Lines Matching refs:j

687    int j, tqd, utqd;  in u14_34f_slave_configure()  local
691 j = ((struct hostdata *) host->hostdata)->board_number; in u14_34f_slave_configure()
744 static int board_inquiry(unsigned int j) { in board_inquiry() argument
750 id_dma_addr = pci_map_single(HD(j)->pdev, HD(j)->board_id, in board_inquiry()
751 sizeof(HD(j)->board_id), PCI_DMA_BIDIRECTIONAL); in board_inquiry()
752 cpp = &HD(j)->cp[0]; in board_inquiry()
753 cpp->cp_dma_addr = pci_map_single(HD(j)->pdev, cpp, sizeof(struct mscp), in board_inquiry()
759 cpp->data_len = H2DEV(sizeof(HD(j)->board_id)); in board_inquiry()
763 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in board_inquiry()
764 printk("%s: board_inquiry, adapter busy.\n", BN(j)); in board_inquiry()
768 HD(j)->cp_stat[0] = IGNORE; in board_inquiry()
771 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in board_inquiry()
774 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in board_inquiry()
777 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in board_inquiry()
784 if (cpp->adapter_status || HD(j)->cp_stat[0] != FREE) { in board_inquiry()
785 HD(j)->cp_stat[0] = FREE; in board_inquiry()
786 printk("%s: board_inquiry, err 0x%x.\n", BN(j), cpp->adapter_status); in board_inquiry()
790 pci_unmap_single(HD(j)->pdev, cpp->cp_dma_addr, sizeof(struct mscp), in board_inquiry()
792 pci_unmap_single(HD(j)->pdev, id_dma_addr, sizeof(HD(j)->board_id), in board_inquiry()
798 (unsigned long port_base, unsigned int j, struct scsi_host_template *tpnt) { in port_detect() argument
850 sprintf(name, "%s%d", driver_name, j); in port_detect()
877 driver_name, (void *) &sha[j])) { in port_detect()
891 sh[j] = scsi_register(tpnt, sizeof(struct hostdata)); in port_detect()
894 if (sh[j] == NULL) { in port_detect()
899 sh[j]->io_port = port_base; in port_detect()
900 sh[j]->unique_id = port_base; in port_detect()
901 sh[j]->n_io_port = REGION_SIZE; in port_detect()
902 sh[j]->base = bios_segment_table[config_1.bios_segment]; in port_detect()
903 sh[j]->irq = irq; in port_detect()
904 sh[j]->sg_tablesize = MAX_SGLIST; in port_detect()
905 sh[j]->this_id = config_2.ha_scsi_id; in port_detect()
906 sh[j]->can_queue = MAX_MAILBOXES; in port_detect()
907 sh[j]->cmd_per_lun = MAX_CMD_PER_LUN; in port_detect()
913 sys_mask = inb(sh[j]->io_port + REG_SYS_MASK); in port_detect()
914 lcl_mask = inb(sh[j]->io_port + REG_LCL_MASK); in port_detect()
920 if (sh[j]->this_id == 0) sh[j]->this_id = -1; in port_detect()
923 if (sh[j]->base == 0) outb(CMD_ENA_INTR, sh[j]->io_port + REG_SYS_MASK); in port_detect()
925 memset(HD(j), 0, sizeof(struct hostdata)); in port_detect()
926 HD(j)->heads = mapping_table[config_2.mapping_mode].heads; in port_detect()
927 HD(j)->sectors = mapping_table[config_2.mapping_mode].sectors; in port_detect()
928 HD(j)->subversion = subversion; in port_detect()
929 HD(j)->pdev = NULL; in port_detect()
930 HD(j)->board_number = j; in port_detect()
932 if (have_old_firmware) sh[j]->sg_tablesize = MAX_SAFE_SGLIST; in port_detect()
934 if (HD(j)->subversion == ESA) { in port_detect()
935 sh[j]->unchecked_isa_dma = FALSE; in port_detect()
936 sh[j]->dma_channel = NO_DMA; in port_detect()
937 sprintf(BN(j), "U34F%d", j); in port_detect()
942 sh[j]->unchecked_isa_dma = TRUE; in port_detect()
951 sh[j]->dma_channel = dma_channel; in port_detect()
952 sprintf(BN(j), "U14F%d", j); in port_detect()
956 sh[j]->max_channel = MAX_CHANNEL - 1; in port_detect()
957 sh[j]->max_id = MAX_TARGET; in port_detect()
958 sh[j]->max_lun = MAX_LUN; in port_detect()
960 if (HD(j)->subversion == ISA && !board_inquiry(j)) { in port_detect()
961 HD(j)->board_id[40] = 0; in port_detect()
963 if (strcmp(&HD(j)->board_id[32], "06000600")) { in port_detect()
964 printk("%s: %s.\n", BN(j), &HD(j)->board_id[8]); in port_detect()
966 BN(j), &HD(j)->board_id[32]); in port_detect()
967 sh[j]->hostt->use_clustering = DISABLE_CLUSTERING; in port_detect()
968 sh[j]->sg_tablesize = MAX_SAFE_SGLIST; in port_detect()
977 for (i = 0; i < sh[j]->can_queue; i++) in port_detect()
978 HD(j)->cp[i].cp_dma_addr = pci_map_single(HD(j)->pdev, in port_detect()
979 &HD(j)->cp[i], sizeof(struct mscp), PCI_DMA_BIDIRECTIONAL); in port_detect()
981 for (i = 0; i < sh[j]->can_queue; i++) in port_detect()
982 if (! ((&HD(j)->cp[i])->sglist = kmalloc( in port_detect()
983 sh[j]->sg_tablesize * sizeof(struct sg_list), in port_detect()
984 (sh[j]->unchecked_isa_dma ? GFP_DMA : 0) | GFP_ATOMIC))) { in port_detect()
985 printk("%s: kmalloc SGlist failed, mbox %d, detaching.\n", BN(j), i); in port_detect()
997 if (j == 0) { in port_detect()
1005 BN(j), bus_type, (unsigned long)sh[j]->io_port, (int)sh[j]->base, in port_detect()
1006 sh[j]->irq, dma_name, sh[j]->sg_tablesize, sh[j]->can_queue); in port_detect()
1008 if (sh[j]->max_id > 8 || sh[j]->max_lun > 8) in port_detect()
1010 BN(j), sh[j]->max_id, sh[j]->max_lun); in port_detect()
1012 for (i = 0; i <= sh[j]->max_channel; i++) in port_detect()
1014 BN(j), i, sh[j]->this_id); in port_detect()
1021 free_irq(irq, &sha[j]); in port_detect()
1029 u14_34f_release(sh[j]); in port_detect()
1085 unsigned int j = 0, k; in u14_34f_detect() local
1105 if (j < MAX_BOARDS && port_detect(io_port[k], j, tpnt)) j++; in u14_34f_detect()
1108 num_boards = j; in u14_34f_detect()
1109 return j; in u14_34f_detect()
1112 static void map_dma(unsigned int i, unsigned int j) { in map_dma() argument
1120 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; in map_dma()
1124 cpp->sense_addr = H2DEV(pci_map_single(HD(j)->pdev, SCpnt->sense_buffer, in map_dma()
1142 H2DEV(pci_map_single(HD(j)->pdev, cpp->sglist, in map_dma()
1153 static void unmap_dma(unsigned int i, unsigned int j) { in unmap_dma() argument
1158 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; in unmap_dma()
1162 pci_unmap_single(HD(j)->pdev, DEV2H(cpp->sense_addr), in unmap_dma()
1170 pci_unmap_single(HD(j)->pdev, DEV2H(cpp->data_address), in unmap_dma()
1174 static void sync_dma(unsigned int i, unsigned int j) { in sync_dma() argument
1179 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; in sync_dma()
1183 pci_dma_sync_single_for_cpu(HD(j)->pdev, DEV2H(cpp->sense_addr), in sync_dma()
1187 pci_dma_sync_sg_for_cpu(HD(j)->pdev, scsi_sglist(SCpnt), in sync_dma()
1193 pci_dma_sync_single_for_cpu(HD(j)->pdev, DEV2H(cpp->data_address), in sync_dma()
1197 static void scsi_to_dev_dir(unsigned int i, unsigned int j) { in scsi_to_dev_dir() argument
1215 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt; in scsi_to_dev_dir()
1231 panic("%s: qcomm, invalid SCpnt->sc_data_direction.\n", BN(j)); in scsi_to_dev_dir()
1251 unsigned int i, j, k; in u14_34f_queuecommand_lck() local
1255 j = ((struct hostdata *) SCpnt->device->host->hostdata)->board_number; in u14_34f_queuecommand_lck()
1259 BN(j), SCpnt); in u14_34f_queuecommand_lck()
1263 i = HD(j)->last_cp_used + 1; in u14_34f_queuecommand_lck()
1265 for (k = 0; k < sh[j]->can_queue; k++, i++) { in u14_34f_queuecommand_lck()
1267 if (i >= sh[j]->can_queue) i = 0; in u14_34f_queuecommand_lck()
1269 if (HD(j)->cp_stat[i] == FREE) { in u14_34f_queuecommand_lck()
1270 HD(j)->last_cp_used = i; in u14_34f_queuecommand_lck()
1275 if (k == sh[j]->can_queue) { in u14_34f_queuecommand_lck()
1276 printk("%s: qcomm, no free mailbox.\n", BN(j)); in u14_34f_queuecommand_lck()
1281 cpp = &HD(j)->cp[i]; in u14_34f_queuecommand_lck()
1289 BN(j), i, SCpnt->device->channel, SCpnt->device->id, in u14_34f_queuecommand_lck()
1301 scsi_to_dev_dir(i, j); in u14_34f_queuecommand_lck()
1304 map_dma(i, j); in u14_34f_queuecommand_lck()
1308 HD(j)->cp_stat[i] = READY; in u14_34f_queuecommand_lck()
1309 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, FALSE); in u14_34f_queuecommand_lck()
1313 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in u14_34f_queuecommand_lck()
1314 unmap_dma(i, j); in u14_34f_queuecommand_lck()
1322 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in u14_34f_queuecommand_lck()
1325 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in u14_34f_queuecommand_lck()
1327 HD(j)->cp_stat[i] = IN_USE; in u14_34f_queuecommand_lck()
1334 unsigned int i, j; in DEF_SCSI_QCMD() local
1336 j = ((struct hostdata *) SCarg->device->host->hostdata)->board_number; in DEF_SCSI_QCMD()
1346 if (i >= sh[j]->can_queue) in DEF_SCSI_QCMD()
1347 panic("%s: abort, invalid SCarg->host_scribble.\n", BN(j)); in DEF_SCSI_QCMD()
1349 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in DEF_SCSI_QCMD()
1350 printk("%s: abort, timeout error.\n", BN(j)); in DEF_SCSI_QCMD()
1354 if (HD(j)->cp_stat[i] == FREE) { in DEF_SCSI_QCMD()
1355 printk("%s: abort, mbox %d is free.\n", BN(j), i); in DEF_SCSI_QCMD()
1359 if (HD(j)->cp_stat[i] == IN_USE) { in DEF_SCSI_QCMD()
1360 printk("%s: abort, mbox %d is in use.\n", BN(j), i); in DEF_SCSI_QCMD()
1362 if (SCarg != HD(j)->cp[i].SCpnt) in DEF_SCSI_QCMD()
1364 BN(j), i, SCarg, HD(j)->cp[i].SCpnt); in DEF_SCSI_QCMD()
1366 if (inb(sh[j]->io_port + REG_SYS_INTR) & IRQ_ASSERTED) in DEF_SCSI_QCMD()
1367 printk("%s: abort, mbox %d, interrupt pending.\n", BN(j), i); in DEF_SCSI_QCMD()
1372 if (HD(j)->cp_stat[i] == IN_RESET) { in DEF_SCSI_QCMD()
1373 printk("%s: abort, mbox %d is in reset.\n", BN(j), i); in DEF_SCSI_QCMD()
1377 if (HD(j)->cp_stat[i] == LOCKED) { in DEF_SCSI_QCMD()
1378 printk("%s: abort, mbox %d is locked.\n", BN(j), i); in DEF_SCSI_QCMD()
1382 if (HD(j)->cp_stat[i] == READY || HD(j)->cp_stat[i] == ABORTING) { in DEF_SCSI_QCMD()
1383 unmap_dma(i, j); in DEF_SCSI_QCMD()
1386 HD(j)->cp_stat[i] = FREE; in DEF_SCSI_QCMD()
1387 printk("%s, abort, mbox %d ready, DID_ABORT, done.\n", BN(j), i); in DEF_SCSI_QCMD()
1392 panic("%s: abort, mbox %d, invalid cp_stat.\n", BN(j), i); in DEF_SCSI_QCMD()
1396 unsigned int i, j, k, c, limit = 0; in u14_34f_eh_host_reset() local
1401 j = ((struct hostdata *) SCarg->device->host->hostdata)->board_number; in u14_34f_eh_host_reset()
1404 spin_lock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1407 printk("%s: reset, inactive.\n", BN(j)); in u14_34f_eh_host_reset()
1409 if (HD(j)->in_reset) { in u14_34f_eh_host_reset()
1410 printk("%s: reset, exit, already in reset.\n", BN(j)); in u14_34f_eh_host_reset()
1411 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1415 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in u14_34f_eh_host_reset()
1416 printk("%s: reset, exit, timeout error.\n", BN(j)); in u14_34f_eh_host_reset()
1417 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1421 HD(j)->retries = 0; in u14_34f_eh_host_reset()
1423 for (c = 0; c <= sh[j]->max_channel; c++) in u14_34f_eh_host_reset()
1424 for (k = 0; k < sh[j]->max_id; k++) { in u14_34f_eh_host_reset()
1425 HD(j)->target_redo[k][c] = TRUE; in u14_34f_eh_host_reset()
1426 HD(j)->target_to[k][c] = 0; in u14_34f_eh_host_reset()
1429 for (i = 0; i < sh[j]->can_queue; i++) { in u14_34f_eh_host_reset()
1431 if (HD(j)->cp_stat[i] == FREE) continue; in u14_34f_eh_host_reset()
1433 if (HD(j)->cp_stat[i] == LOCKED) { in u14_34f_eh_host_reset()
1434 HD(j)->cp_stat[i] = FREE; in u14_34f_eh_host_reset()
1435 printk("%s: reset, locked mbox %d forced free.\n", BN(j), i); in u14_34f_eh_host_reset()
1439 if (!(SCpnt = HD(j)->cp[i].SCpnt)) in u14_34f_eh_host_reset()
1440 panic("%s: reset, mbox %d, SCpnt == NULL.\n", BN(j), i); in u14_34f_eh_host_reset()
1442 if (HD(j)->cp_stat[i] == READY || HD(j)->cp_stat[i] == ABORTING) { in u14_34f_eh_host_reset()
1443 HD(j)->cp_stat[i] = ABORTING; in u14_34f_eh_host_reset()
1444 printk("%s: reset, mbox %d aborting.\n", BN(j), i); in u14_34f_eh_host_reset()
1448 HD(j)->cp_stat[i] = IN_RESET; in u14_34f_eh_host_reset()
1449 printk("%s: reset, mbox %d in reset.\n", BN(j), i); in u14_34f_eh_host_reset()
1453 panic("%s: reset, mbox %d, garbled SCpnt.\n", BN(j), i); in u14_34f_eh_host_reset()
1456 panic("%s: reset, mbox %d, index mismatch.\n", BN(j), i); in u14_34f_eh_host_reset()
1459 panic("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n", BN(j), i); in u14_34f_eh_host_reset()
1464 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in u14_34f_eh_host_reset()
1465 printk("%s: reset, cannot reset, timeout error.\n", BN(j)); in u14_34f_eh_host_reset()
1466 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1470 outb(CMD_RESET, sh[j]->io_port + REG_LCL_INTR); in u14_34f_eh_host_reset()
1471 printk("%s: reset, board reset done, enabling interrupts.\n", BN(j)); in u14_34f_eh_host_reset()
1477 HD(j)->in_reset = TRUE; in u14_34f_eh_host_reset()
1479 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1482 spin_lock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1484 printk("%s: reset, interrupts disabled, loops %d.\n", BN(j), limit); in u14_34f_eh_host_reset()
1486 for (i = 0; i < sh[j]->can_queue; i++) { in u14_34f_eh_host_reset()
1488 if (HD(j)->cp_stat[i] == IN_RESET) { in u14_34f_eh_host_reset()
1489 SCpnt = HD(j)->cp[i].SCpnt; in u14_34f_eh_host_reset()
1490 unmap_dma(i, j); in u14_34f_eh_host_reset()
1495 HD(j)->cp_stat[i] = LOCKED; in u14_34f_eh_host_reset()
1497 printk("%s, reset, mbox %d locked, DID_RESET, done.\n", BN(j), i); in u14_34f_eh_host_reset()
1500 else if (HD(j)->cp_stat[i] == ABORTING) { in u14_34f_eh_host_reset()
1501 SCpnt = HD(j)->cp[i].SCpnt; in u14_34f_eh_host_reset()
1502 unmap_dma(i, j); in u14_34f_eh_host_reset()
1507 HD(j)->cp_stat[i] = FREE; in u14_34f_eh_host_reset()
1509 printk("%s, reset, mbox %d aborting, DID_RESET, done.\n", BN(j), i); in u14_34f_eh_host_reset()
1520 HD(j)->in_reset = FALSE; in u14_34f_eh_host_reset()
1523 if (arg_done) printk("%s: reset, exit, done.\n", BN(j)); in u14_34f_eh_host_reset()
1524 else printk("%s: reset, exit.\n", BN(j)); in u14_34f_eh_host_reset()
1526 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1532 unsigned int j = 0; in u14_34f_bios_param() local
1535 dkinfo[0] = HD(j)->heads; in u14_34f_bios_param()
1536 dkinfo[1] = HD(j)->sectors; in u14_34f_bios_param()
1537 dkinfo[2] = size / (HD(j)->heads * HD(j)->sectors); in u14_34f_bios_param()
1555 unsigned int i, j, k, y; in sort() local
1561 for (j = k + 1; j < n; j++) in sort()
1563 if (sk[j] > sk[k]) k = j; in sort()
1566 if (sk[j] < sk[k]) k = j; in sort()
1578 static int reorder(unsigned int j, unsigned long cursec, in reorder() argument
1604 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; in reorder()
1641 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; in reorder()
1665 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; in reorder()
1678 static void flush_dev(struct scsi_device *dev, unsigned long cursec, unsigned int j, in flush_dev() argument
1684 for (k = 0; k < sh[j]->can_queue; k++) { in flush_dev()
1686 if (HD(j)->cp_stat[k] != READY && HD(j)->cp_stat[k] != IN_USE) continue; in flush_dev()
1688 cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; in flush_dev()
1692 if (HD(j)->cp_stat[k] == IN_USE) return; in flush_dev()
1697 if (reorder(j, cursec, ihdlr, il, n_ready)) n_ready = 1; in flush_dev()
1700 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; in flush_dev()
1702 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in flush_dev()
1707 HD(j)->cp_stat[k] = ABORTING; in flush_dev()
1711 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in flush_dev()
1712 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in flush_dev()
1713 HD(j)->cp_stat[k] = IN_USE; in flush_dev()
1718 static irqreturn_t ihdlr(unsigned int j) in ihdlr() argument
1723 int irq = sh[j]->irq; in ihdlr()
1726 if (!((reg = inb(sh[j]->io_port + REG_SYS_INTR)) & IRQ_ASSERTED)) goto none; in ihdlr()
1728 HD(j)->iocount++; in ihdlr()
1730 if (do_trace) printk("%s: ihdlr, enter, irq %d, count %d.\n", BN(j), irq, in ihdlr()
1731 HD(j)->iocount); in ihdlr()
1734 if (wait_on_busy(sh[j]->io_port, 20 * MAXLOOP)) { in ihdlr()
1735 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in ihdlr()
1737 BN(j), irq, reg, HD(j)->iocount); in ihdlr()
1741 ret = inl(sh[j]->io_port + REG_ICM); in ihdlr()
1744 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in ihdlr()
1747 for (i = 0; i < sh[j]->can_queue; i++) in ihdlr()
1748 if (H2DEV(HD(j)->cp[i].cp_dma_addr) == ret) break; in ihdlr()
1750 if (i >= sh[j]->can_queue) in ihdlr()
1751 panic("%s: ihdlr, invalid mscp bus address %p, cp0 %p.\n", BN(j), in ihdlr()
1752 (void *)ret, (void *)H2DEV(HD(j)->cp[0].cp_dma_addr)); in ihdlr()
1754 cpp = &(HD(j)->cp[i]); in ihdlr()
1758 if ((HD(j)->iocount > 500) && ((HD(j)->iocount % 500) < 3)) goto handled; in ihdlr()
1761 if (HD(j)->cp_stat[i] == IGNORE) { in ihdlr()
1762 HD(j)->cp_stat[i] = FREE; in ihdlr()
1765 else if (HD(j)->cp_stat[i] == LOCKED) { in ihdlr()
1766 HD(j)->cp_stat[i] = FREE; in ihdlr()
1767 printk("%s: ihdlr, mbox %d unlocked, count %d.\n", BN(j), i, in ihdlr()
1768 HD(j)->iocount); in ihdlr()
1771 else if (HD(j)->cp_stat[i] == FREE) { in ihdlr()
1772 printk("%s: ihdlr, mbox %d is free, count %d.\n", BN(j), i, in ihdlr()
1773 HD(j)->iocount); in ihdlr()
1776 else if (HD(j)->cp_stat[i] == IN_RESET) in ihdlr()
1777 printk("%s: ihdlr, mbox %d is in reset.\n", BN(j), i); in ihdlr()
1778 else if (HD(j)->cp_stat[i] != IN_USE) in ihdlr()
1780 BN(j), i, HD(j)->cp_stat[i]); in ihdlr()
1782 HD(j)->cp_stat[i] = FREE; in ihdlr()
1785 if (SCpnt == NULL) panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", BN(j), i); in ihdlr()
1788 panic("%s: ihdlr, mbox %d, SCpnt %p garbled.\n", BN(j), i, in ihdlr()
1793 BN(j), i, *(unsigned int *)SCpnt->host_scribble); in ihdlr()
1795 sync_dma(i, j); in ihdlr()
1799 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, TRUE); in ihdlr()
1804 if ((HD(j)->iocount > 500) && ((HD(j)->iocount % 200) < 2)) in ihdlr()
1817 && HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)]) in ihdlr()
1830 HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE; in ihdlr()
1833 (!(tstatus == CHECK_CONDITION && HD(j)->iocount <= 1000 && in ihdlr()
1840 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0; in ihdlr()
1842 if (HD(j)->last_retried_pid == SCpnt->serial_number) HD(j)->retries = 0; in ihdlr()
1847 if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1) in ihdlr()
1851 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++; in ihdlr()
1862 for (c = 0; c <= sh[j]->max_channel; c++) in ihdlr()
1863 for (k = 0; k < sh[j]->max_id; k++) in ihdlr()
1864 HD(j)->target_redo[k][c] = TRUE; in ihdlr()
1870 && HD(j)->retries < MAX_INTERNAL_RETRIES) { in ihdlr()
1878 HD(j)->retries++; in ihdlr()
1879 HD(j)->last_retried_pid = SCpnt->serial_number; in ihdlr()
1902 if ((spp->adapter_status != ASOK && HD(j)->iocount > 1000) || in ihdlr()
1904 spp->adapter_status != ASST && HD(j)->iocount <= 1000) || in ihdlr()
1910 reg, HD(j)->iocount); in ihdlr()
1912 unmap_dma(i, j); in ihdlr()
1919 if (do_trace) printk("%s: ihdlr, exit, irq %d, count %d.\n", BN(j), irq, in ihdlr()
1920 HD(j)->iocount); in ihdlr()
1929 unsigned int j; in do_interrupt_handler() local
1934 if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) return IRQ_NONE; in do_interrupt_handler()
1936 spin_lock_irqsave(sh[j]->host_lock, spin_flags); in do_interrupt_handler()
1937 ret = ihdlr(j); in do_interrupt_handler()
1938 spin_unlock_irqrestore(sh[j]->host_lock, spin_flags); in do_interrupt_handler()
1943 unsigned int i, j; in u14_34f_release() local
1945 for (j = 0; sh[j] != NULL && sh[j] != shpnt; j++); in u14_34f_release()
1947 if (sh[j] == NULL) in u14_34f_release()
1950 for (i = 0; i < sh[j]->can_queue; i++) in u14_34f_release()
1951 kfree((&HD(j)->cp[i])->sglist); in u14_34f_release()
1953 for (i = 0; i < sh[j]->can_queue; i++) in u14_34f_release()
1954 pci_unmap_single(HD(j)->pdev, HD(j)->cp[i].cp_dma_addr, in u14_34f_release()
1957 free_irq(sh[j]->irq, &sha[j]); in u14_34f_release()
1959 if (sh[j]->dma_channel != NO_DMA) in u14_34f_release()
1960 free_dma(sh[j]->dma_channel); in u14_34f_release()
1962 release_region(sh[j]->io_port, sh[j]->n_io_port); in u14_34f_release()
1963 scsi_unregister(sh[j]); in u14_34f_release()