Lines Matching refs:sh

552 static struct Scsi_Host *sh[MAX_BOARDS + 1];  variable
572 #define HD(board) ((struct hostdata *) &sh[board]->hostdata)
687 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in board_inquiry()
695 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in board_inquiry()
698 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in board_inquiry()
701 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in board_inquiry()
821 sh[j] = scsi_register(tpnt, sizeof(struct hostdata)); in port_detect()
823 if (sh[j] == NULL) { in port_detect()
834 sh[j]->io_port = port_base; in port_detect()
835 sh[j]->unique_id = port_base; in port_detect()
836 sh[j]->n_io_port = REGION_SIZE; in port_detect()
837 sh[j]->base = bios_segment_table[config_1.bios_segment]; in port_detect()
838 sh[j]->irq = irq; in port_detect()
839 sh[j]->sg_tablesize = MAX_SGLIST; in port_detect()
840 sh[j]->this_id = config_2.ha_scsi_id; in port_detect()
841 sh[j]->can_queue = MAX_MAILBOXES; in port_detect()
842 sh[j]->cmd_per_lun = MAX_CMD_PER_LUN; in port_detect()
843 sh[j]->select_queue_depths = select_queue_depths; in port_detect()
849 sys_mask = inb(sh[j]->io_port + REG_SYS_MASK); in port_detect()
850 lcl_mask = inb(sh[j]->io_port + REG_LCL_MASK); in port_detect()
856 if (sh[j]->this_id == 0) sh[j]->this_id = -1; in port_detect()
859 if (sh[j]->base == 0) outb(CMD_ENA_INTR, sh[j]->io_port + REG_SYS_MASK); in port_detect()
868 if (have_old_firmware) sh[j]->sg_tablesize = MAX_SAFE_SGLIST; in port_detect()
871 sh[j]->unchecked_isa_dma = FALSE; in port_detect()
872 sh[j]->dma_channel = NO_DMA; in port_detect()
878 scsi_register_blocked_host(sh[j]); in port_detect()
879 sh[j]->unchecked_isa_dma = TRUE; in port_detect()
888 sh[j]->dma_channel = dma_channel; in port_detect()
893 sh[j]->max_channel = MAX_CHANNEL - 1; in port_detect()
894 sh[j]->max_id = MAX_TARGET; in port_detect()
895 sh[j]->max_lun = MAX_LUN; in port_detect()
904 sh[j]->hostt->use_clustering = DISABLE_CLUSTERING; in port_detect()
905 sh[j]->sg_tablesize = MAX_SAFE_SGLIST; in port_detect()
912 for (i = 0; i < sh[j]->can_queue; i++) in port_detect()
916 for (i = 0; i < sh[j]->can_queue; i++) in port_detect()
918 sh[j]->sg_tablesize * sizeof(struct sg_list), in port_detect()
919 (sh[j]->unchecked_isa_dma ? GFP_DMA : 0) | GFP_ATOMIC))) { in port_detect()
921 u14_34f_release(sh[j]); in port_detect()
938 BN(j), bus_type, (unsigned long)sh[j]->io_port, (int)sh[j]->base, in port_detect()
939 sh[j]->irq, dma_name, sh[j]->sg_tablesize, sh[j]->can_queue); in port_detect()
941 if (sh[j]->max_id > 8 || sh[j]->max_lun > 8) in port_detect()
943 BN(j), sh[j]->max_id, sh[j]->max_lun); in port_detect()
945 for (i = 0; i <= sh[j]->max_channel; i++) in port_detect()
947 BN(j), i, sh[j]->this_id); in port_detect()
1016 for (k = 0; k < MAX_BOARDS + 1; k++) sh[k] = NULL; in u14_34f_detect()
1187 for (k = 0; k < sh[j]->can_queue; k++, i++) { in do_qcomm()
1189 if (i >= sh[j]->can_queue) i = 0; in do_qcomm()
1197 if (k == sh[j]->can_queue) { in do_qcomm()
1235 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in do_qcomm()
1244 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in do_qcomm()
1247 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in do_qcomm()
1275 if (i >= sh[j]->can_queue) in do_abort()
1278 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in do_abort()
1295 if (inb(sh[j]->io_port + REG_SYS_INTR) & IRQ_ASSERTED) in do_abort()
1356 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in do_reset()
1363 for (c = 0; c <= sh[j]->max_channel; c++) in do_reset()
1364 for (k = 0; k < sh[j]->max_id; k++) { in do_reset()
1369 for (i = 0; i < sh[j]->can_queue; i++) { in do_reset()
1406 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in do_reset()
1411 outb(CMD_RESET, sh[j]->io_port + REG_LCL_INTR); in do_reset()
1427 for (i = 0; i < sh[j]->can_queue; i++) { in do_reset()
1628 for (k = 0; k < sh[j]->can_queue; k++) { in flush_dev()
1646 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { in flush_dev()
1654 outl(H2DEV(cpp->cp_dma_addr), sh[j]->io_port + REG_OGM); in flush_dev()
1655 outb(CMD_OGM_INTR, sh[j]->io_port + REG_LCL_INTR); in flush_dev()
1666 if (sh[j]->irq != irq) in ihdlr()
1667 panic("%s: ihdlr, irq %d, sh[j]->irq %d.\n", BN(j), irq, sh[j]->irq); in ihdlr()
1670 if (!((reg = inb(sh[j]->io_port + REG_SYS_INTR)) & IRQ_ASSERTED)) return; in ihdlr()
1678 if (wait_on_busy(sh[j]->io_port, 20 * MAXLOOP)) { in ihdlr()
1679 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in ihdlr()
1685 ret = inl(sh[j]->io_port + REG_ICM); in ihdlr()
1688 outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR); in ihdlr()
1691 for (i = 0; i < sh[j]->can_queue; i++) in ihdlr()
1694 if (i >= sh[j]->can_queue) in ihdlr()
1807 for (c = 0; c <= sh[j]->max_channel; c++) in ihdlr()
1808 for (k = 0; k < sh[j]->max_id; k++) in ihdlr()
1886 for (j = 0; sh[j] != NULL && sh[j] != shpnt; j++); in u14_34f_release()
1888 if (sh[j] == NULL) panic("%s: release, invalid Scsi_Host pointer.\n", in u14_34f_release()
1891 if(sh[j]->unchecked_isa_dma) scsi_deregister_blocked_host(sh[j]); in u14_34f_release()
1893 for (i = 0; i < sh[j]->can_queue; i++) in u14_34f_release()
1896 for (i = 0; i < sh[j]->can_queue; i++) in u14_34f_release()
1900 free_irq(sh[j]->irq, &sha[j]); in u14_34f_release()
1902 if (sh[j]->dma_channel != NO_DMA) free_dma(sh[j]->dma_channel); in u14_34f_release()
1904 release_region(sh[j]->io_port, sh[j]->n_io_port); in u14_34f_release()
1905 scsi_unregister(sh[j]); in u14_34f_release()