Lines Matching defs:host

22  * The 700 chip has no host bus interface logic of its own.  However,
159 STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
160 STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
264 (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
299 struct Scsi_Host *host;
326 /* Fill in the missing routines from the host template */
343 host = scsi_host_alloc(tpnt, 4);
344 if (!host)
378 host->max_id = 8;
379 host->max_lun = NCR_700_MAX_LUNS;
381 host->transportt = NCR_700_transport_template;
382 host->unique_id = (unsigned long)hostdata->base;
384 host->hostdata[0] = (unsigned long)hostdata;
386 NCR_700_writeb(0xff, host, CTEST9_REG);
388 hostdata->rev = (NCR_700_readb(host, CTEST8_REG)>>4) & 0x0f;
390 hostdata->rev = (NCR_700_readb(host, CTEST7_REG)>>4) & 0x0f;
391 hostdata->fast = (NCR_700_readb(host, CTEST9_REG) == 0);
396 printk(KERN_NOTICE "scsi%d: %s rev %d %s\n", host->host_no,
402 NCR_700_chip_reset(host);
404 if (scsi_add_host(host, dev)) {
406 scsi_host_put(host);
410 spi_signalling(host) = hostdata->differential ? SPI_SIGNAL_HVD :
413 return host;
417 NCR_700_release(struct Scsi_Host *host)
420 (struct NCR_700_Host_Parameters *)host->hostdata[0];
441 * Function : static int data_residual (Scsi_Host *host)
449 * Inputs : host - SCSI host */
451 NCR_700_data_residual (struct Scsi_Host *host) {
453 (struct NCR_700_Host_Parameters *)host->hostdata[0];
458 count = ((NCR_700_readb(host, DFIFO_REG) & 0x7f) -
459 (NCR_700_readl(host, DBC_REG) & 0x7f)) & 0x7f;
461 count = ((NCR_700_readb(host, DFIFO_REG) & 0x3f) -
462 (NCR_700_readl(host, DBC_REG) & 0x3f)) & 0x3f;
466 synchronous = NCR_700_readb(host, SXFER_REG) & 0x0f;
469 ddir = NCR_700_readb(host, CTEST0_REG) & 0x01;
474 count += (NCR_700_readb(host, SSTAT2_REG) & 0xf0) >> 4;
476 if (NCR_700_readb(host, SSTAT1_REG) & SIDL_REG_FULL)
480 __u8 sstat = NCR_700_readb(host, SSTAT1_REG);
645 NCR_700_internal_bus_reset(struct Scsi_Host *host)
648 NCR_700_writeb(ASSERT_RST, host, SCNTL1_REG);
650 NCR_700_writeb(0, host, SCNTL1_REG);
655 NCR_700_chip_setup(struct Scsi_Host *host)
658 (struct NCR_700_Host_Parameters *)host->hostdata[0];
685 NCR_700_writeb(hostdata->dcntl_extra, host, DCNTL_REG);
687 host, DMODE_710_REG);
690 host, CTEST7_REG);
691 NCR_700_writeb(BTB_TIMER_DISABLE, host, CTEST0_REG);
693 | AUTO_ATN, host, SCNTL0_REG);
696 host, DMODE_700_REG);
698 DIFF : 0, host, CTEST7_REG);
702 | GENERATE_RECEIVE_PARITY, host,
706 | PARITY | AUTO_ATN, host, SCNTL0_REG);
710 NCR_700_writeb(1 << host->this_id, host, SCID_REG);
711 NCR_700_writeb(0, host, SBCL_REG);
712 NCR_700_writeb(ASYNC_OPERATION, host, SXFER_REG);
715 | RST_INT | PAR_ERR_INT | SELECT_INT, host, SIEN_REG);
717 NCR_700_writeb(ABORT_INT | INT_INST_INT | ILGL_INST_INT, host, DIEN_REG);
718 NCR_700_writeb(ENABLE_SELECT, host, SCNTL1_REG);
724 NCR_700_writeb(SYNC_DIV_2_0, host, SBCL_REG);
725 NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
730 NCR_700_writeb(SYNC_DIV_1_5, host, SBCL_REG);
731 NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
738 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
739 NCR_700_writeb(ASYNC_DIV_2_0 | hostdata->dcntl_extra, host, DCNTL_REG);
744 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
745 NCR_700_writeb(ASYNC_DIV_1_5 | hostdata->dcntl_extra, host, DCNTL_REG);
749 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
750 NCR_700_writeb(ASYNC_DIV_1_0 | hostdata->dcntl_extra, host, DCNTL_REG);
765 NCR_700_chip_reset(struct Scsi_Host *host)
768 (struct NCR_700_Host_Parameters *)host->hostdata[0];
770 NCR_700_writeb(SOFTWARE_RESET_710, host, ISTAT_REG);
773 NCR_700_writeb(0, host, ISTAT_REG);
775 NCR_700_writeb(SOFTWARE_RESET, host, DCNTL_REG);
778 NCR_700_writeb(0, host, DCNTL_REG);
783 NCR_700_chip_setup(host);
793 process_extended_message(struct Scsi_Host *host,
829 host, SXFER_REG);
833 shost_printk(KERN_WARNING, host,
847 host->host_no, pun, lun);
857 host->host_no, pun, lun,
869 NCR_700_writel(temp, host, TEMP_REG);
874 process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata,
887 printk("scsi%d (%d:%d): message %s: ", host->host_no, pun, lun,
896 resume_offset = process_extended_message(host, hostdata, SCp,
917 scsi_change_queue_depth(SCp->device, host->cmd_per_lun);
919 shost_printk(KERN_WARNING, host,
928 printk(KERN_ERR "scsi%d (%d:%d) Parity Error!\n", host->host_no,
930 NCR_700_internal_bus_reset(host);
933 printk(KERN_INFO "scsi%d (%d:%d) SIMPLE TAG %d %s\n", host->host_no,
940 host->host_no, pun, lun,
955 NCR_700_writel(temp, host, TEMP_REG);
963 struct Scsi_Host *host,
1075 sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
1080 NCR_700_internal_bus_reset(host);
1085 host->host_no, pun, lun, NCR_700_fatal_messages[i]);
1090 NCR_700_internal_bus_reset(host);
1096 host->host_no, pun, lun,
1111 host->host_no, reselection_id, lun));
1113 SDp = __scsi_device_lookup(host, 0, reselection_id, lun);
1116 host->host_no, reselection_id, lun);
1122 SCp = scsi_host_find_tag(SDp->host, hostdata->msgin[2]);
1125 host->host_no, reselection_id, lun, hostdata->msgin[2]);
1147 host->host_no, reselection_id, lun,
1152 printk(KERN_ERR "scsi%d: FATAL, host not busy during valid reselection!\n",
1153 host->host_no);
1172 host, SXFER_REG);
1194 __u8 reselection_id = NCR_700_readb(host, SFBR_REG);
1198 reselection_id &= ~(1<<host->this_id);
1203 host->host_no, reselection_id, lun, dsp, dsp - hostdata->pScript, hostdata->state, hostdata->command_slot_count);
1228 printk(KERN_ERR "scsi%d: Invalid reselection during selection!!\n", host->host_no);
1232 host->host_no);
1255 resume_offset = process_message(host, hostdata, SCp,
1260 host->host_no, pun, lun, NCR_700_condition[i],
1270 NCR_700_internal_bus_reset(host);
1273 host->host_no, pun, lun, dsps & 0xfff, dsp, dsp - hostdata->pScript);
1277 host->host_no, pun, lun, dsps, dsp - hostdata->pScript);
1278 NCR_700_internal_bus_reset(host);
1291 process_selection(struct Scsi_Host *host, __u32 dsp)
1297 (struct NCR_700_Host_Parameters *)host->hostdata[0];
1302 id = NCR_700_readb(host, hostdata->chip710 ?
1306 id &= ~(1<<host->this_id);
1311 sbcl = NCR_700_readb(host, SBCL_REG);
1319 host->host_no, id));
1345 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata);
1371 NCR_700_clear_fifo(struct Scsi_Host *host) {
1373 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
1375 NCR_700_writeb(CLR_FIFO_710, host, CTEST8_REG);
1377 NCR_700_writeb(CLR_FIFO, host, DFIFO_REG);
1382 NCR_700_flush_fifo(struct Scsi_Host *host) {
1384 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
1386 NCR_700_writeb(FLUSH_DMA_FIFO_710, host, CTEST8_REG);
1388 NCR_700_writeb(0, host, CTEST8_REG);
1390 NCR_700_writeb(FLUSH_DMA_FIFO, host, DFIFO_REG);
1392 NCR_700_writeb(0, host, DFIFO_REG);
1405 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1415 DEBUG(("scsi%d: host busy, queueing command %p, slot %p\n",
1416 SCp->device->host->host_no, slot->cmnd, slot));
1465 NCR_700_clear_fifo(SCp->device->host);
1477 SCp->device->host, SXFER_REG);
1478 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG);
1479 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG);
1487 struct Scsi_Host *host = (struct Scsi_Host *)dev_id;
1489 (struct NCR_700_Host_Parameters *)host->hostdata[0];
1496 /* Use the host lock to serialise access to the 53c700
1499 * need to ensure that for this driver, the host lock and the
1501 spin_lock_irqsave(host->host_lock, flags);
1502 if((istat = NCR_700_readb(host, ISTAT_REG))
1514 sstat0 = NCR_700_readb(host, SSTAT0_REG);
1520 dstat = NCR_700_readb(host, DSTAT_REG);
1523 dsps = NCR_700_readl(host, DSPS_REG);
1524 dsp = NCR_700_readl(host, DSP_REG);
1527 host->host_no, istat, sstat0, dstat,
1543 host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript);
1545 scsi_report_bus_reset(host, 0);
1548 __shost_for_each_device(SDp, host)
1576 NCR_700_chip_setup(host);
1586 host->host_no, pun, lun));
1596 __u32 temp = NCR_700_readl(host, TEMP_REG);
1597 int count = (hostdata->script[Ent_SendMessage/4] & 0xffffff) - ((NCR_700_readl(host, DBC_REG) & 0xffffff) + NCR_700_data_residual(host));
1598 printk("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE %d remain, return %p[%04x], phase %s\n", host->host_no, pun, lun, count, (void *)temp, temp - hostdata->pScript, sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
1603 int data_transfer = NCR_700_readl(host, DBC_REG) & 0xffffff;
1605 int residual = NCR_700_data_residual(host);
1608 __u32 naddr = NCR_700_readl(host, DNAD_REG);
1611 host->host_no, pun, lun,
1616 host->host_no, pun, lun,
1636 printk("scsi%d (%d:%d) transfer mismatch pAddr=%lx, naddr=%lx, data_transfer=%d, residual=%d\n", host->host_no, pun, lun, (unsigned long)pAddr, (unsigned long)naddr, data_transfer, residual);
1651 NCR_700_flush_fifo(host);
1653 __u8 sbcl = NCR_700_readb(host, SBCL_REG);
1655 host->host_no, pun, lun, dsp - hostdata->pScript, sbcl_to_string(sbcl));
1656 NCR_700_internal_bus_reset(host);
1661 host->host_no, pun, lun);
1665 host->host_no, pun, lun);
1669 host->host_no, pun, lun));
1670 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata);
1674 host->host_no, pun, lun,
1679 host->host_no, pun, lun, dstat);
1705 resume_offset = process_selection(host, dsp);
1713 printk(KERN_ERR "scsi%d: Driver error: resume at 0x%08x [0x%04x] with non busy host!\n",
1714 host->host_no, resume_offset, resume_offset - hostdata->pScript);
1719 NCR_700_clear_fifo(host);
1720 NCR_700_writel(resume_offset, host, DSP_REG);
1740 host->host_no, &hostdata->slots[j],
1749 spin_unlock_irqrestore(host->host_lock, flags);
1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1763 printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_no);
1796 printk("53c700: scsi%d, command ", SCp->device->host->host_no);
1929 NCR_700_internal_bus_reset(SCp->device->host);
1941 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1950 spin_lock_irq(SCp->device->host->host_lock);
1952 spin_unlock_irq(SCp->device->host->host_lock);
1954 spin_lock_irq(SCp->device->host->host_lock);
1958 NCR_700_internal_bus_reset(SCp->device->host);
1959 NCR_700_chip_reset(SCp->device->host);
1961 spin_unlock_irq(SCp->device->host->host_lock);
1963 spin_lock_irq(SCp->device->host->host_lock);
1970 spin_unlock_irq(SCp->device->host->host_lock);
2035 (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];