Lines Matching refs:host

631 static inline u_short isp_inw(struct Scsi_Host *host, long offset)  in isp_inw()  argument
633 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata; in isp_inw()
637 return inw(host->io_port + offset); in isp_inw()
640 static inline void isp_outw(u_short val, struct Scsi_Host *host, long offset) in isp_outw() argument
642 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata; in isp_outw()
646 outw(val, host->io_port + offset); in isp_outw()
649 static inline void isp1020_enable_irqs(struct Scsi_Host *host) in isp1020_enable_irqs() argument
651 isp_outw(ISP_EN_INT|ISP_EN_RISC, host, PCI_INTF_CTL); in isp1020_enable_irqs()
655 static inline void isp1020_disable_irqs(struct Scsi_Host *host) in isp1020_disable_irqs() argument
657 isp_outw(0x0, host, PCI_INTF_CTL); in isp1020_disable_irqs()
664 struct Scsi_Host *host; in isp1020_detect() local
682 host = scsi_register(tmpt, sizeof(struct isp1020_hostdata)); in isp1020_detect()
683 if (!host) in isp1020_detect()
686 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_detect()
691 scsi_set_pci_device(host, pdev); in isp1020_detect()
693 if (isp1020_init(host)) in isp1020_detect()
696 if (isp1020_reset_hardware(host) in isp1020_detect()
698 || isp1020_get_defaults(host) in isp1020_detect()
700 || isp1020_set_defaults(host) in isp1020_detect()
702 || isp1020_load_parameters(host)) { in isp1020_detect()
706 host->this_id = hostdata->host_param.initiator_scsi_id; in isp1020_detect()
707 host->max_sectors = 64; in isp1020_detect()
709 if (request_irq(host->irq, do_isp1020_intr_handler, SA_INTERRUPT | SA_SHIRQ, in isp1020_detect()
710 "qlogicisp", host)) in isp1020_detect()
713 host->irq); in isp1020_detect()
717 isp_outw(0x0, host, PCI_SEMAPHORE); in isp1020_detect()
718 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR); in isp1020_detect()
719 isp1020_enable_irqs(host); in isp1020_detect()
726 if (host->io_port) release_region(host->io_port, 0xff); in isp1020_detect()
738 scsi_unregister(host); in isp1020_detect()
747 int isp1020_release(struct Scsi_Host *host) in isp1020_release() argument
753 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_release()
755 isp_outw(0x0, host, PCI_INTF_CTL); in isp1020_release()
756 free_irq(host->irq, host); in isp1020_release()
760 if (host->io_port) release_region(host->io_port, 0xff); in isp1020_release()
768 const char *isp1020_info(struct Scsi_Host *host) in isp1020_info() argument
775 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_info()
778 hostdata->pci_dev->bus->number, hostdata->pci_dev->devfn, host->irq, in isp1020_info()
780 (hostdata->memaddr ? hostdata->memaddr : host->io_port)); in isp1020_info()
802 struct Scsi_Host *host; in isp1020_queuecommand() local
808 host = Cmnd->host; in isp1020_queuecommand()
809 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_queuecommand()
814 out_ptr = isp_inw(host, + MBOX4); in isp1020_queuecommand()
843 isp_outw(in_ptr, host, MBOX4); in isp1020_queuecommand()
956 isp_outw(in_ptr, host, MBOX4); in isp1020_queuecommand()
960 host->can_queue = host->host_busy + num_free; in isp1020_queuecommand()
961 host->sg_tablesize = QLOGICISP_MAX_SG(num_free); in isp1020_queuecommand()
984 struct Scsi_Host *host = dev_id; in isp1020_intr_handler() local
991 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_intr_handler()
995 if (!(isp_inw(host, PCI_INTF_STS) & 0x04)) { in isp1020_intr_handler()
1000 in_ptr = isp_inw(host, MBOX5); in isp1020_intr_handler()
1001 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR); in isp1020_intr_handler()
1003 if ((isp_inw(host, PCI_SEMAPHORE) & ASYNC_EVENT_INTERRUPT)) { in isp1020_intr_handler()
1004 status = isp_inw(host, MBOX0); in isp1020_intr_handler()
1021 isp_outw(0x0, host, PCI_SEMAPHORE); in isp1020_intr_handler()
1072 isp_outw(out_ptr, host, MBOX5); in isp1020_intr_handler()
1172 struct Scsi_Host *host; in isp1020_abort() local
1180 host = Cmnd->host; in isp1020_abort()
1181 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_abort()
1188 isp1020_disable_irqs(host); in isp1020_abort()
1195 isp1020_mbox_command(host, param); in isp1020_abort()
1202 isp1020_enable_irqs(host); in isp1020_abort()
1213 struct Scsi_Host *host; in isp1020_reset() local
1219 host = Cmnd->host; in isp1020_reset()
1220 hostdata = (struct isp1020_hostdata *) host->hostdata; in isp1020_reset()
1225 isp1020_disable_irqs(host); in isp1020_reset()
1227 isp1020_mbox_command(host, param); in isp1020_reset()
1234 isp1020_enable_irqs(host); in isp1020_reset()
1267 static int isp1020_reset_hardware(struct Scsi_Host *host) in isp1020_reset_hardware() argument
1274 isp_outw(ISP_RESET, host, PCI_INTF_CTL); in isp1020_reset_hardware()
1276 isp_outw(HCCR_RESET, host, HOST_HCCR); in isp1020_reset_hardware()
1278 isp_outw(HCCR_RELEASE, host, HOST_HCCR); in isp1020_reset_hardware()
1279 isp_outw(HCCR_BIOS_DISABLE, host, HOST_HCCR); in isp1020_reset_hardware()
1282 while (--loop_count && isp_inw(host, HOST_HCCR) == RISC_BUSY) { in isp1020_reset_hardware()
1289 isp_outw(0, host, ISP_CFG1); in isp1020_reset_hardware()
1292 printk("qlogicisp : mbox 0 0x%04x \n", isp_inw(host, MBOX0)); in isp1020_reset_hardware()
1293 printk("qlogicisp : mbox 1 0x%04x \n", isp_inw(host, MBOX1)); in isp1020_reset_hardware()
1294 printk("qlogicisp : mbox 2 0x%04x \n", isp_inw(host, MBOX2)); in isp1020_reset_hardware()
1295 printk("qlogicisp : mbox 3 0x%04x \n", isp_inw(host, MBOX3)); in isp1020_reset_hardware()
1296 printk("qlogicisp : mbox 4 0x%04x \n", isp_inw(host, MBOX4)); in isp1020_reset_hardware()
1297 printk("qlogicisp : mbox 5 0x%04x \n", isp_inw(host, MBOX5)); in isp1020_reset_hardware()
1301 isp1020_mbox_command(host, param); in isp1020_reset_hardware()
1314 isp1020_mbox_command(host, param); in isp1020_reset_hardware()
1328 isp1020_mbox_command(host, param); in isp1020_reset_hardware()
1340 isp1020_mbox_command(host, param); in isp1020_reset_hardware()
1344 isp1020_mbox_command(host, param); in isp1020_reset_hardware()
1489 static int isp1020_get_defaults(struct Scsi_Host *host) in isp1020_get_defaults() argument
1494 (struct isp1020_hostdata *) host->hostdata; in isp1020_get_defaults()
1498 if (!isp1020_verify_nvram(host)) { in isp1020_get_defaults()
1501 return isp1020_set_defaults(host); in isp1020_get_defaults()
1504 value = isp1020_read_nvram_word(host, 2); in isp1020_get_defaults()
1509 value = isp1020_read_nvram_word(host, 3); in isp1020_get_defaults()
1513 value = isp1020_read_nvram_word(host, 4); in isp1020_get_defaults()
1521 value = isp1020_read_nvram_word(host, 5); in isp1020_get_defaults()
1524 value = isp1020_read_nvram_word(host, 6); in isp1020_get_defaults()
1527 value = isp1020_read_nvram_word(host, 7); in isp1020_get_defaults()
1561 value = isp1020_read_nvram_word(host, 14 + i * 3); in isp1020_get_defaults()
1565 value = isp1020_read_nvram_word(host, 15 + i * 3); in isp1020_get_defaults()
1595 static int isp1020_verify_nvram(struct Scsi_Host *host) in isp1020_verify_nvram() argument
1602 value = isp1020_read_nvram_word(host, i); in isp1020_verify_nvram()
1625 u_short isp1020_read_nvram_word(struct Scsi_Host *host, u_short byte) in isp1020_read_nvram_word() argument
1634 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1635 isp_outw(output | 0x3, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1636 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1641 isp_outw(0x3, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1642 input = isp_inw(host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1643 isp_outw(0x2, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1647 isp_outw(0x0, host, PCI_NVRAM); NVRAM_DELAY(); in isp1020_read_nvram_word()
1655 static int isp1020_set_defaults(struct Scsi_Host *host) in isp1020_set_defaults() argument
1658 (struct isp1020_hostdata *) host->hostdata; in isp1020_set_defaults()
1692 static int isp1020_load_parameters(struct Scsi_Host *host) in isp1020_load_parameters() argument
1705 (struct isp1020_hostdata *) host->hostdata; in isp1020_load_parameters()
1712 hwrev = isp_inw(host, ISP_CFG0) & ISP_CFG0_HWMSK; in isp1020_load_parameters()
1719 isp_outw(isp_inw(host, ISP_CFG1) | isp_cfg1, host, ISP_CFG1); in isp1020_load_parameters()
1720 isp_outw(isp_inw(host, CDMA_CONF) | DMA_CONF_BENAB, host, CDMA_CONF); in isp1020_load_parameters()
1721 isp_outw(isp_inw(host, DDMA_CONF) | DMA_CONF_BENAB, host, DDMA_CONF); in isp1020_load_parameters()
1726 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1738 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1749 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1761 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1773 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1784 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1795 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1814 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1829 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1856 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1881 isp1020_mbox_command(host, param); in isp1020_load_parameters()
1901 static int isp1020_mbox_command(struct Scsi_Host *host, u_short param[]) in isp1020_mbox_command() argument
1909 while (--loop_count && isp_inw(host, HOST_HCCR) & 0x0080) { in isp1020_mbox_command()
1917 case 8: isp_outw(param[7], host, MBOX7); in isp1020_mbox_command()
1918 case 7: isp_outw(param[6], host, MBOX6); in isp1020_mbox_command()
1919 case 6: isp_outw(param[5], host, MBOX5); in isp1020_mbox_command()
1920 case 5: isp_outw(param[4], host, MBOX4); in isp1020_mbox_command()
1921 case 4: isp_outw(param[3], host, MBOX3); in isp1020_mbox_command()
1922 case 3: isp_outw(param[2], host, MBOX2); in isp1020_mbox_command()
1923 case 2: isp_outw(param[1], host, MBOX1); in isp1020_mbox_command()
1924 case 1: isp_outw(param[0], host, MBOX0); in isp1020_mbox_command()
1927 isp_outw(0x0, host, PCI_SEMAPHORE); in isp1020_mbox_command()
1928 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR); in isp1020_mbox_command()
1929 isp_outw(HCCR_SET_HOST_INTR, host, HOST_HCCR); in isp1020_mbox_command()
1932 while (--loop_count && !(isp_inw(host, PCI_INTF_STS) & 0x04)) { in isp1020_mbox_command()
1940 while (--loop_count && isp_inw(host, MBOX0) == 0x04) { in isp1020_mbox_command()
1948 case 8: param[7] = isp_inw(host, MBOX7); in isp1020_mbox_command()
1949 case 7: param[6] = isp_inw(host, MBOX6); in isp1020_mbox_command()
1950 case 6: param[5] = isp_inw(host, MBOX5); in isp1020_mbox_command()
1951 case 5: param[4] = isp_inw(host, MBOX4); in isp1020_mbox_command()
1952 case 4: param[3] = isp_inw(host, MBOX3); in isp1020_mbox_command()
1953 case 3: param[2] = isp_inw(host, MBOX2); in isp1020_mbox_command()
1954 case 2: param[1] = isp_inw(host, MBOX1); in isp1020_mbox_command()
1955 case 1: param[0] = isp_inw(host, MBOX0); in isp1020_mbox_command()
1958 isp_outw(0x0, host, PCI_SEMAPHORE); in isp1020_mbox_command()
1959 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR); in isp1020_mbox_command()