Lines Matching refs:host
467 Adapter *host; /* host adapter */ member
738 static inline void wd7000_enable_intr(Adapter * host) in wd7000_enable_intr() argument
740 host->control |= INT_EN; in wd7000_enable_intr()
741 outb(host->control, host->iobase + ASC_CONTROL); in wd7000_enable_intr()
745 static inline void wd7000_enable_dma(Adapter * host) in wd7000_enable_dma() argument
748 host->control |= DMA_EN; in wd7000_enable_dma()
749 outb(host->control, host->iobase + ASC_CONTROL); in wd7000_enable_dma()
752 set_dma_mode(host->dma, DMA_MODE_CASCADE); in wd7000_enable_dma()
753 enable_dma(host->dma); in wd7000_enable_dma()
777 static inline int command_out(Adapter * host, unchar * cmd, int len) in command_out() argument
779 if (!WAIT(host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0)) { in command_out()
782 outb(*cmd, host->iobase + ASC_COMMAND); in command_out()
783 WAIT(host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0); in command_out()
784 } while (inb(host->iobase + ASC_STAT) & CMD_REJ); in command_out()
808 static inline Scb *alloc_scbs(struct Scsi_Host *host, int needed) in alloc_scbs() argument
819 spin_unlock_irq(host->host_lock); in alloc_scbs()
856 spin_lock_irq(host->host_lock); in alloc_scbs()
895 static int mail_out(Adapter * host, Scb * scbptr) in mail_out() argument
903 Mailbox *ogmbs = host->mb.ogmb; in mail_out()
904 int *next_ogmb = &(host->next_ogmb); in mail_out()
909 spin_lock_irqsave(host->sh->host_lock, flags); in mail_out()
922 spin_unlock_irqrestore(host->sh->host_lock, flags); in mail_out()
939 wd7000_enable_intr(host); in mail_out()
942 command_out(host, &start_ogmb, 1); in mail_out()
996 #define wd7000_intr_ack(host) outb (0, host->iobase + ASC_INTR_ACK) argument
1001 Adapter *host = (Adapter *) dev_id; in wd7000_intr() local
1007 Mailbox *icmbs = host->mb.icmb; in wd7000_intr()
1010 spin_lock_irqsave(host->sh->host_lock, flags); in wd7000_intr()
1011 host->int_counter++; in wd7000_intr()
1013 dprintk("wd7000_intr: irq = %d, host = 0x%06lx\n", irq, (long) host); in wd7000_intr()
1015 flag = inb(host->iobase + ASC_INTR_STAT); in wd7000_intr()
1019 if (!(inb(host->iobase + ASC_STAT) & INT_IM)) { in wd7000_intr()
1078 wd7000_intr_ack(host); in wd7000_intr()
1080 spin_unlock_irqrestore(host->sh->host_lock, flags); in wd7000_intr()
1093 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; in wd7000_queuecommand_lck() local
1099 scb = alloc_scbs(SCpnt->device->host, 1); in wd7000_queuecommand_lck()
1106 scb->host = host; in wd7000_queuecommand_lck()
1135 while (!mail_out(host, scb)) in wd7000_queuecommand_lck()
1143 static int wd7000_diagnostics(Adapter * host, int code) in DEF_SCSI_QCMD()
1158 mail_out(host, (struct scb *) &icb); in DEF_SCSI_QCMD()
1178 static int wd7000_adapter_reset(Adapter * host) in wd7000_adapter_reset() argument
1183 host->bus_on, in wd7000_adapter_reset()
1184 host->bus_off, in wd7000_adapter_reset()
1195 outb(ASC_RES, host->iobase + ASC_CONTROL); in wd7000_adapter_reset()
1197 outb(0, host->iobase + ASC_CONTROL); in wd7000_adapter_reset()
1198 host->control = 0; /* this must always shadow ASC_CONTROL */ in wd7000_adapter_reset()
1200 if (WAIT(host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0)) { in wd7000_adapter_reset()
1205 if ((diag = inb(host->iobase + ASC_INTR_STAT)) != 1) { in wd7000_adapter_reset()
1233 memset(&(host->mb), 0, sizeof(host->mb)); in wd7000_adapter_reset()
1236 any2scsi((unchar *) & (init_cmd.mailboxes), (int) &(host->mb)); in wd7000_adapter_reset()
1237 if (!command_out(host, (unchar *) & init_cmd, sizeof(init_cmd))) { in wd7000_adapter_reset()
1242 if (WAIT(host->iobase + ASC_STAT, ASC_STATMASK, ASC_INIT, 0)) { in wd7000_adapter_reset()
1249 static int wd7000_init(Adapter * host) in wd7000_init() argument
1251 if (wd7000_adapter_reset(host) == -1) in wd7000_init()
1255 if (request_irq(host->irq, wd7000_intr, 0, "wd7000", host)) { in wd7000_init()
1256 printk("wd7000_init: can't get IRQ %d.\n", host->irq); in wd7000_init()
1259 if (request_dma(host->dma, "wd7000")) { in wd7000_init()
1260 printk("wd7000_init: can't get DMA channel %d.\n", host->dma); in wd7000_init()
1261 free_irq(host->irq, host); in wd7000_init()
1264 wd7000_enable_dma(host); in wd7000_init()
1265 wd7000_enable_intr(host); in wd7000_init()
1267 if (!wd7000_diagnostics(host, ICB_DIAG_FULL)) { in wd7000_init()
1268 free_dma(host->dma); in wd7000_init()
1269 free_irq(host->irq, NULL); in wd7000_init()
1277 static void wd7000_revision(Adapter * host) in wd7000_revision() argument
1288 mail_out(host, (struct scb *) &icb); in wd7000_revision()
1293 host->rev1 = icb.primary; in wd7000_revision()
1294 host->rev2 = icb.secondary; in wd7000_revision()
1298 static int wd7000_set_info(struct Scsi_Host *host, char *buffer, int length) in wd7000_set_info() argument
1310 static int wd7000_show_info(struct seq_file *m, struct Scsi_Host *host) in wd7000_show_info() argument
1312 Adapter *adapter = (Adapter *)host->hostdata; in wd7000_show_info()
1319 spin_lock_irqsave(host->host_lock, flags); in wd7000_show_info()
1320 …seq_printf(m, "Host scsi%d: Western Digital WD-7000 (rev %d.%d)\n", host->host_no, adapter->rev1, … in wd7000_show_info()
1359 spin_unlock_irqrestore(host->host_lock, flags); in wd7000_show_info()
1381 Adapter *host = NULL; in wd7000_detect() local
1480 host = (Adapter *) sh->hostdata; in wd7000_detect()
1482 dprintk("wd7000_detect: adapter allocated at 0x%x\n", (int) host); in wd7000_detect()
1483 memset(host, 0, sizeof(Adapter)); in wd7000_detect()
1485 host->irq = configs[pass].irq; in wd7000_detect()
1486 host->dma = configs[pass].dma; in wd7000_detect()
1487 host->iobase = iobase; in wd7000_detect()
1488 host->int_counter = 0; in wd7000_detect()
1489 host->bus_on = configs[pass].bus_on; in wd7000_detect()
1490 host->bus_off = configs[pass].bus_off; in wd7000_detect()
1491 host->sh = wd7000_host[unit] = sh; in wd7000_detect()
1494 … Trying init WD-7000 card at IO " "0x%x, IRQ %d, DMA %d...\n", host->iobase, host->irq, host->dma); in wd7000_detect()
1496 if (!wd7000_init(host)) /* Initialization failed */ in wd7000_detect()
1502 wd7000_revision(host); /* important for scatter/gather */ in wd7000_detect()
1507 if (host->rev1 < 6) in wd7000_detect()
1515 printk(KERN_INFO "Western Digital WD-7000 (rev %d.%d) ", host->rev1, host->rev2); in wd7000_detect()
1516 printk("using IO 0x%x, IRQ %d, DMA %d.\n", host->iobase, host->irq, host->dma); in wd7000_detect()
1517 printk(" BUS_ON time: %dns, BUS_OFF time: %dns\n", host->bus_on * 125, host->bus_off * 125); in wd7000_detect()
1553 Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
1555 if (inb(host->iobase + ASC_STAT) & INT_IM) {
1557 wd7000_intr_handle(host->irq, NULL, NULL);
1570 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; in wd7000_host_reset() local
1572 spin_lock_irq(SCpnt->device->host->host_lock); in wd7000_host_reset()
1574 if (wd7000_adapter_reset(host) < 0) { in wd7000_host_reset()
1575 spin_unlock_irq(SCpnt->device->host->host_lock); in wd7000_host_reset()
1579 wd7000_enable_intr(host); in wd7000_host_reset()
1581 spin_unlock_irq(SCpnt->device->host->host_lock); in wd7000_host_reset()