Lines Matching refs:sh
609 static struct Scsi_Host *sh[MAX_BOARDS + 1]; variable
630 #define HD(board) ((struct hostdata *) &sh[board]->hostdata)
763 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 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()
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()
932 if (have_old_firmware) sh[j]->sg_tablesize = MAX_SAFE_SGLIST; in port_detect()
935 sh[j]->unchecked_isa_dma = FALSE; in port_detect()
936 sh[j]->dma_channel = NO_DMA; in port_detect()
942 sh[j]->unchecked_isa_dma = TRUE; in port_detect()
951 sh[j]->dma_channel = dma_channel; 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()
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()
981 for (i = 0; i < sh[j]->can_queue; i++) 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()
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()
1029 u14_34f_release(sh[j]); in port_detect()
1099 for (k = 0; k < MAX_BOARDS + 1; k++) sh[k] = NULL; in u14_34f_detect()
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()
1275 if (k == sh[j]->can_queue) { in u14_34f_queuecommand_lck()
1313 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 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()
1346 if (i >= sh[j]->can_queue) in DEF_SCSI_QCMD()
1349 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in DEF_SCSI_QCMD()
1366 if (inb(sh[j]->io_port + REG_SYS_INTR) & IRQ_ASSERTED) in DEF_SCSI_QCMD()
1404 spin_lock_irq(sh[j]->host_lock); 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()
1417 spin_unlock_irq(sh[j]->host_lock); 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()
1429 for (i = 0; i < sh[j]->can_queue; i++) { in u14_34f_eh_host_reset()
1464 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 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()
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()
1486 for (i = 0; i < sh[j]->can_queue; i++) { in u14_34f_eh_host_reset()
1526 spin_unlock_irq(sh[j]->host_lock); in u14_34f_eh_host_reset()
1684 for (k = 0; k < sh[j]->can_queue; k++) { in flush_dev()
1702 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 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()
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()
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()
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()
1750 if (i >= sh[j]->can_queue) 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()
1936 spin_lock_irqsave(sh[j]->host_lock, spin_flags); in do_interrupt_handler()
1938 spin_unlock_irqrestore(sh[j]->host_lock, spin_flags); in do_interrupt_handler()
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()
1953 for (i = 0; i < sh[j]->can_queue; i++) 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()