Lines Matching refs:h
147 static cmdlist_t * cmd_alloc(ctlr_info_t *h, int get_from_pool);
148 static void cmd_free(ctlr_info_t *h, cmdlist_t *c, int got_from_pool);
166 static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io);
169 static void start_io(ctlr_info_t *h);
233 ctlr_info_t *h = (ctlr_info_t*)m->private; in ida_proc_show() local
240 ctlr = h->ctlr; in ida_proc_show()
252 h->devname, in ida_proc_show()
253 h->product_name, in ida_proc_show()
254 (unsigned long)h->board_id, in ida_proc_show()
255 h->firm_rev[0], h->firm_rev[1], h->firm_rev[2], h->firm_rev[3], in ida_proc_show()
256 (unsigned long)h->ctlr_sig, (unsigned long)h->vaddr, in ida_proc_show()
257 (unsigned int) h->io_mem_addr, (unsigned int)h->intr, in ida_proc_show()
258 h->log_drives, h->phys_drives, in ida_proc_show()
259 h->Qdepth, h->maxQsinceinit); in ida_proc_show()
263 for(i=0; i<h->log_drives; i++) { in ida_proc_show()
264 drv = &h->drv[i]; in ida_proc_show()
270 spin_lock_irqsave(IDA_LOCK(h->ctlr), flags); in ida_proc_show()
273 c = h->reqQ; in ida_proc_show()
276 while(c && c != h->reqQ) { in ida_proc_show()
281 c = h->cmpQ; in ida_proc_show()
284 while(c && c != h->cmpQ) { in ida_proc_show()
290 spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); in ida_proc_show()
293 h->nr_allocs, h->nr_frees); in ida_proc_show()
906 ctlr_info_t *h = q->queuedata; in do_ida_request() local
919 if ((c = cmd_alloc(h,1)) == NULL) in do_ida_request()
924 c->ctlr = h->ctlr; in do_ida_request()
925 c->hdr.unit = (drv_info_t *)(creq->rq_disk->private_data) - h->drv; in do_ida_request()
946 c->req.sg[i].addr = (__u32) pci_map_page(h->pci_dev, in do_ida_request()
958 addQ(&h->reqQ, c); in do_ida_request()
959 h->Qdepth++; in do_ida_request()
960 if (h->Qdepth > h->maxQsinceinit) in do_ida_request()
961 h->maxQsinceinit = h->Qdepth; in do_ida_request()
966 start_io(h); in do_ida_request()
975 static void start_io(ctlr_info_t *h) in start_io() argument
979 while((c = h->reqQ) != NULL) { in start_io()
981 if (h->access.fifo_full(h) == 0) in start_io()
985 removeQ(&h->reqQ, c); in start_io()
986 h->Qdepth--; in start_io()
989 h->access.submit_command(h, c); in start_io()
992 addQ(&h->cmpQ, c); in start_io()
1045 ctlr_info_t *h = dev_id; in do_ida_intr() local
1051 istat = h->access.intr_pending(h); in do_ida_intr()
1060 spin_lock_irqsave(IDA_LOCK(h->ctlr), flags); in do_ida_intr()
1062 while((a = h->access.command_completed(h))) { in do_ida_intr()
1064 if ((c = h->cmpQ) == NULL) in do_ida_intr()
1071 if (c == h->cmpQ) in do_ida_intr()
1079 removeQ(&h->cmpQ, c); in do_ida_intr()
1091 cmd_free(h, c, 1); in do_ida_intr()
1103 do_ida_request(h->queue); in do_ida_intr()
1104 spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); in do_ida_intr()
1116 ctlr_info_t *h = (ctlr_info_t*)tdata; in ida_timer() local
1118 h->timer.expires = jiffies + IDA_TIMER; in ida_timer()
1119 add_timer(&h->timer); in ida_timer()
1120 h->misc_tflags = 0; in ida_timer()
1234 static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io) in ida_ctlr_ioctl() argument
1236 int ctlr = h->ctlr; in ida_ctlr_ioctl()
1242 if ((c = cmd_alloc(h, 0)) == NULL) in ida_ctlr_ioctl()
1260 cmd_free(h, c, 0); in ida_ctlr_ioctl()
1263 c->req.hdr.blk = pci_map_single(h->pci_dev, &(io->c), in ida_ctlr_ioctl()
1267 c->req.sg[0].addr = pci_map_single(h->pci_dev, p, in ida_ctlr_ioctl()
1278 cmd_free(h, c, 0); in ida_ctlr_ioctl()
1283 c->req.sg[0].addr = pci_map_single(h->pci_dev, p, in ida_ctlr_ioctl()
1295 cmd_free(h, c, 0); in ida_ctlr_ioctl()
1299 c->req.sg[0].addr = pci_map_single(h->pci_dev, p, in ida_ctlr_ioctl()
1305 c->req.sg[0].addr = pci_map_single(h->pci_dev,&io->c, in ida_ctlr_ioctl()
1312 addQ(&h->reqQ, c); in ida_ctlr_ioctl()
1313 h->Qdepth++; in ida_ctlr_ioctl()
1314 start_io(h); in ida_ctlr_ioctl()
1322 pci_unmap_single(h->pci_dev, c->req.sg[0].addr, c->req.sg[0].size, in ida_ctlr_ioctl()
1327 pci_unmap_single(h->pci_dev, c->req.hdr.blk, in ida_ctlr_ioctl()
1350 cmd_free(h, c, 0); in ida_ctlr_ioctl()
1360 static cmdlist_t * cmd_alloc(ctlr_info_t *h, int get_from_pool) in cmd_alloc() argument
1367 c = (cmdlist_t*)pci_alloc_consistent(h->pci_dev, in cmd_alloc()
1373 i = find_first_zero_bit(h->cmd_pool_bits, NR_CMDS); in cmd_alloc()
1376 } while(test_and_set_bit(i&(BITS_PER_LONG-1), h->cmd_pool_bits+(i/BITS_PER_LONG)) != 0); in cmd_alloc()
1377 c = h->cmd_pool + i; in cmd_alloc()
1378 cmd_dhandle = h->cmd_pool_dhandle + i*sizeof(cmdlist_t); in cmd_alloc()
1379 h->nr_allocs++; in cmd_alloc()
1387 static void cmd_free(ctlr_info_t *h, cmdlist_t *c, int got_from_pool) in cmd_free() argument
1392 pci_free_consistent(h->pci_dev, sizeof(cmdlist_t), c, in cmd_free()
1395 i = c - h->cmd_pool; in cmd_free()
1396 clear_bit(i&(BITS_PER_LONG-1), h->cmd_pool_bits+(i/BITS_PER_LONG)); in cmd_free()
1397 h->nr_frees++; in cmd_free()