• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/linux/linux/drivers/scsi/

Lines Matching refs:host

14  *  Rewritten to support multiple host adapters.
74 * visible to the host CPU is defined effectively by the Z80's
77 * on-board BIOS is of no interest whatsoever.) The host CPU has
177 * more commands, while ICMBs are used by the host adapter per command.
390 * - mb and scbs are required for interfacing with the host adapter.
395 * - An icb is for host-only (non-SCSI) commands. ICBs are 16 bytes each;
438 Adapter *host; /* host adapter */
443 * This driver is written to allow host-only commands to be executed.
564 * The SCBs declared here are shared by all host adapters; hence, this
749 static inline void wd7000_enable_intr (Adapter *host)
751 host->control |= INT_EN;
752 outb (host->control, host->iobase + ASC_CONTROL);
756 static inline void wd7000_enable_dma (Adapter *host)
759 host->control |= DMA_EN;
760 outb (host->control, host->iobase + ASC_CONTROL);
763 set_dma_mode (host->dma, DMA_MODE_CASCADE);
764 enable_dma (host->dma);
796 static inline int command_out (Adapter * host, unchar * cmd, int len)
798 if (!WAIT (host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0)) {
801 outb (*cmd, host->iobase + ASC_COMMAND);
802 WAIT (host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0);
803 } while (inb (host->iobase + ASC_STAT) & CMD_REJ);
918 static int mail_out (Adapter *host, Scb *scbptr)
926 Mailbox *ogmbs = host->mb.ogmb;
927 int *next_ogmb = &(host->next_ogmb);
972 wd7000_enable_intr (host);
975 command_out (host, &start_ogmb, 1);
1007 case 6: /* Unexpected Command Received w/ host as target */
1026 printk ("\nSCSI command error: SCSI 0x%02x host 0x%04x return %d\n",
1043 #define wd7000_intr_ack(host) outb (0, host->iobase + ASC_INTR_ACK)
1050 register IcbAny *icb; /* for host commands */
1052 Adapter *host = (Adapter *) wd7000_host[irq - IRQ_MIN]->hostdata; /* This MUST be set!!! */
1053 Mailbox *icmbs = host->mb.icmb;
1055 host->int_counter++;
1058 printk ("wd7000_intr_handle: irq = %d, host = 0x%06lx\n", irq, (long) host);
1061 flag = inb (host->iobase + ASC_INTR_STAT);
1067 if (!(inb (host->iobase + ASC_STAT) & INT_IM)) {
1071 * comes out as 7 from the 8259, which is 15 to the host. Thus, it
1079 wd7000_intr_ack (host);
1094 wd7000_intr_ack (host);
1106 wd7000_intr_ack (host);
1133 wd7000_intr_ack (host);
1157 Adapter *host = (Adapter *) SCpnt->host->hostdata;
1170 scb->host = host;
1176 if (SCpnt->host->sg_tablesize == SG_NONE) {
1199 while (!mail_out (host, scb)); /* keep trying */
1216 int wd7000_diagnostics (Adapter *host, int code)
1231 mail_out (host, (struct scb *) &icb);
1250 int wd7000_init (Adapter *host)
1256 host->bus_on,
1257 host->bus_off,
1269 outb (ASC_RES, host->iobase + ASC_CONTROL);
1271 outb (0, host->iobase + ASC_CONTROL);
1272 host->control = 0; /* this must always shadow ASC_CONTROL */
1274 if (WAIT (host->iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0)) {
1279 if ((diag = inb (host->iobase + ASC_INTR_STAT)) != 1) {
1301 memset (&(host->mb), 0, sizeof (host->mb));
1304 any2scsi ((unchar *) & (init_cmd.mailboxes), (int) &(host->mb));
1305 if (!command_out (host, (unchar *) &init_cmd, sizeof (init_cmd))) {
1310 if (WAIT (host->iobase + ASC_STAT, ASC_STATMASK, ASC_INIT, 0)) {
1315 if (request_irq (host->irq, do_wd7000_intr_handle, SA_INTERRUPT, "wd7000", NULL)) {
1316 printk ("wd7000_init: can't get IRQ %d.\n", host->irq);
1319 if (request_dma (host->dma, "wd7000")) {
1320 printk ("wd7000_init: can't get DMA channel %d.\n", host->dma);
1321 free_irq (host->irq, NULL);
1324 wd7000_enable_dma (host);
1325 wd7000_enable_intr (host);
1327 if (!wd7000_diagnostics (host, ICB_DIAG_FULL)) {
1328 free_dma (host->dma);
1329 free_irq (host->irq, NULL);
1337 void wd7000_revision (Adapter *host)
1349 mail_out (host, (struct scb *) &icb);
1352 host->rev1 = icb.primary;
1353 host->rev2 = icb.secondary;
1360 int wd7000_set_info (char *buffer, int length, struct Scsi_Host *host)
1384 struct Scsi_Host *host = NULL;
1397 * Find the specified host board.
1401 host = wd7000_host[i];
1409 if (! host)
1416 return (wd7000_set_info (buffer, length, host));
1418 adapter = (Adapter *) host->hostdata;
1465 scd = host->host_queue;
1470 if (scd->host->host_no == hostno) {
1518 Adapter *host = NULL;
1618 * which we'll use as the Adapter structure (host) for
1627 host = (Adapter *) sh->hostdata;
1630 printk ("wd7000_detect: adapter allocated at 0x%x\n", (int) host);
1633 memset (host, 0, sizeof (Adapter));
1635 host->irq = configs[pass].irq;
1636 host->dma = configs[pass].dma;
1637 host->iobase = iobase;
1638 host->int_counter = 0;
1639 host->bus_on = configs[pass].bus_on;
1640 host->bus_off = configs[pass].bus_off;
1641 host->sh = wd7000_host[host->irq - IRQ_MIN] = sh;
1646 host->iobase, host->irq, host->dma);
1649 if (!wd7000_init (host)) /* Initialization failed */
1655 wd7000_revision (host); /* important for scatter/gather */
1660 if (host->rev1 < 6)
1669 host->rev1, host->rev2);
1671 host->iobase, host->irq, host->dma);
1673 host->bus_on * 125, host->bus_off * 125);
1703 Adapter *host = (Adapter *) SCpnt->host->hostdata;
1705 if (inb (host->iobase + ASC_STAT) & INT_IM) {
1707 wd7000_intr_handle (host->irq, NULL, NULL);