Lines Matching refs:host

86 #define HOSTDATA(host) ((struct aha1740_hostdata *) &host->hostdata)  argument
88 static inline struct ecb *ecb_dma_to_cpu (struct Scsi_Host *host, in ecb_dma_to_cpu() argument
91 struct aha1740_hostdata *hdata = HOSTDATA (host); in ecb_dma_to_cpu()
99 static inline dma_addr_t ecb_cpu_to_dma (struct Scsi_Host *host, void *cpu) in ecb_cpu_to_dma() argument
101 struct aha1740_hostdata *hdata = HOSTDATA (host); in ecb_cpu_to_dma()
111 struct aha1740_hostdata *host = HOSTDATA(shpnt); in aha1740_show_info() local
114 shpnt->io_port, shpnt->irq, host->edev->slot, in aha1740_show_info()
115 host->translation ? "en" : "dis"); in aha1740_show_info()
209 struct Scsi_Host *host = (struct Scsi_Host *) dev_id; in aha1740_intr_handle() local
221 if (!host) in aha1740_intr_handle()
223 spin_lock_irqsave(host->host_lock, flags); in aha1740_intr_handle()
224 base = host->io_port; in aha1740_intr_handle()
226 edev = HOSTDATA(host)->edev; in aha1740_intr_handle()
232 ecbptr = ecb_dma_to_cpu (host, inl(MBOXIN0(base))); in aha1740_intr_handle()
310 spin_unlock_irqrestore(host->host_lock, flags); in aha1740_intr_handle()
319 struct aha1740_hostdata *host = HOSTDATA(SCpnt->device->host); in aha1740_queuecommand_lck() local
347 spin_lock_irqsave(SCpnt->device->host->host_lock, flags); in aha1740_queuecommand_lck()
348 ecbno = host->last_ecb_used + 1; /* An optimization */ in aha1740_queuecommand_lck()
352 if (!host->ecb[ecbno].cmdw) in aha1740_queuecommand_lck()
357 } while (ecbno != host->last_ecb_used); in aha1740_queuecommand_lck()
359 if (host->ecb[ecbno].cmdw) in aha1740_queuecommand_lck()
362 host->ecb[ecbno].cmdw = AHA1740CMD_INIT; /* SCSI Initiator Command in aha1740_queuecommand_lck()
365 host->last_ecb_used = ecbno; in aha1740_queuecommand_lck()
366 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); in aha1740_queuecommand_lck()
372 host->ecb[ecbno].cdblen = SCpnt->cmd_len; /* SCSI Command in aha1740_queuecommand_lck()
382 memcpy(host->ecb[ecbno].cdb, cmd, SCpnt->cmd_len); in aha1740_queuecommand_lck()
384 SCpnt->host_scribble = dma_alloc_coherent (&host->edev->dev, in aha1740_queuecommand_lck()
402 host->ecb[ecbno].sg = 1; /* SCSI Initiator Command in aha1740_queuecommand_lck()
409 host->ecb[ecbno].datalen = nseg * sizeof(struct aha1740_chain); in aha1740_queuecommand_lck()
410 host->ecb[ecbno].dataptr = sg_dma; in aha1740_queuecommand_lck()
417 host->ecb[ecbno].datalen = 0; in aha1740_queuecommand_lck()
418 host->ecb[ecbno].dataptr = 0; in aha1740_queuecommand_lck()
420 host->ecb[ecbno].lun = SCpnt->device->lun; in aha1740_queuecommand_lck()
421 host->ecb[ecbno].ses = 1; /* Suppress underrun errors */ in aha1740_queuecommand_lck()
422 host->ecb[ecbno].dir = direction; in aha1740_queuecommand_lck()
423 host->ecb[ecbno].ars = 1; /* Yes, get the sense on an error */ in aha1740_queuecommand_lck()
424 host->ecb[ecbno].senselen = 12; in aha1740_queuecommand_lck()
425 host->ecb[ecbno].senseptr = ecb_cpu_to_dma (SCpnt->device->host, in aha1740_queuecommand_lck()
426 host->ecb[ecbno].sense); in aha1740_queuecommand_lck()
427 host->ecb[ecbno].statusptr = ecb_cpu_to_dma (SCpnt->device->host, in aha1740_queuecommand_lck()
428 host->ecb[ecbno].status); in aha1740_queuecommand_lck()
429 host->ecb[ecbno].done = done; in aha1740_queuecommand_lck()
430 host->ecb[ecbno].SCpnt = SCpnt; in aha1740_queuecommand_lck()
435 for (i = 0; i < sizeof(host->ecb[ecbno]) - 10; i++) in aha1740_queuecommand_lck()
436 printk("%02x ", ((unchar *)&host->ecb[ecbno])[i]); in aha1740_queuecommand_lck()
456 unsigned int base = SCpnt->device->host->io_port; in aha1740_queuecommand_lck()
459 spin_lock_irqsave(SCpnt->device->host->host_lock, flags); in aha1740_queuecommand_lck()
468 outl (ecb_cpu_to_dma (SCpnt->device->host, host->ecb + ecbno), in aha1740_queuecommand_lck()
479 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); in aha1740_queuecommand_lck()
508 int extended = HOSTDATA(sdev->host)->translation; in aha1740_biosparam()
556 struct aha1740_hostdata *host; in aha1740_probe() local
587 host = HOSTDATA(shpnt); in aha1740_probe()
588 host->edev = edev; in aha1740_probe()
589 host->translation = translation; in aha1740_probe()
590 host->ecb_dma_addr = dma_map_single (&edev->dev, host->ecb, in aha1740_probe()
591 sizeof (host->ecb), in aha1740_probe()
593 if (!host->ecb_dma_addr) { in aha1740_probe()
619 dma_unmap_single (&edev->dev, host->ecb_dma_addr, in aha1740_probe()
620 sizeof (host->ecb), DMA_BIDIRECTIONAL); in aha1740_probe()
632 struct aha1740_hostdata *host = HOSTDATA (shpnt); in aha1740_remove() local
637 dma_unmap_single (dev, host->ecb_dma_addr, in aha1740_remove()
638 sizeof (host->ecb), DMA_BIDIRECTIONAL); in aha1740_remove()