Lines Matching defs:host
23 * The 700 chip has no host bus interface logic of its own. However,
160 STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
161 STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
265 (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
300 struct Scsi_Host *host;
327 /* Fill in the missing routines from the host template */
344 host = scsi_host_alloc(tpnt, 4);
345 if (!host)
379 host->max_id = 8;
380 host->max_lun = NCR_700_MAX_LUNS;
382 host->transportt = NCR_700_transport_template;
383 host->unique_id = (unsigned long)hostdata->base;
385 host->hostdata[0] = (unsigned long)hostdata;
387 NCR_700_writeb(0xff, host, CTEST9_REG);
389 hostdata->rev = (NCR_700_readb(host, CTEST8_REG)>>4) & 0x0f;
391 hostdata->rev = (NCR_700_readb(host, CTEST7_REG)>>4) & 0x0f;
392 hostdata->fast = (NCR_700_readb(host, CTEST9_REG) == 0);
397 printk(KERN_NOTICE "scsi%d: %s rev %d %s\n", host->host_no,
403 NCR_700_chip_reset(host);
405 if (scsi_add_host(host, dev)) {
407 scsi_host_put(host);
411 spi_signalling(host) = hostdata->differential ? SPI_SIGNAL_HVD :
414 return host;
418 NCR_700_release(struct Scsi_Host *host)
421 (struct NCR_700_Host_Parameters *)host->hostdata[0];
442 * Function : static int data_residual (Scsi_Host *host)
450 * Inputs : host - SCSI host */
452 NCR_700_data_residual (struct Scsi_Host *host) {
454 (struct NCR_700_Host_Parameters *)host->hostdata[0];
459 count = ((NCR_700_readb(host, DFIFO_REG) & 0x7f) -
460 (NCR_700_readl(host, DBC_REG) & 0x7f)) & 0x7f;
462 count = ((NCR_700_readb(host, DFIFO_REG) & 0x3f) -
463 (NCR_700_readl(host, DBC_REG) & 0x3f)) & 0x3f;
467 synchronous = NCR_700_readb(host, SXFER_REG) & 0x0f;
470 ddir = NCR_700_readb(host, CTEST0_REG) & 0x01;
475 count += (NCR_700_readb(host, SSTAT2_REG) & 0xf0) >> 4;
477 if (NCR_700_readb(host, SSTAT1_REG) & SIDL_REG_FULL)
481 __u8 sstat = NCR_700_readb(host, SSTAT1_REG);
646 NCR_700_internal_bus_reset(struct Scsi_Host *host)
649 NCR_700_writeb(ASSERT_RST, host, SCNTL1_REG);
651 NCR_700_writeb(0, host, SCNTL1_REG);
656 NCR_700_chip_setup(struct Scsi_Host *host)
659 (struct NCR_700_Host_Parameters *)host->hostdata[0];
686 NCR_700_writeb(hostdata->dcntl_extra, host, DCNTL_REG);
688 host, DMODE_710_REG);
691 host, CTEST7_REG);
692 NCR_700_writeb(BTB_TIMER_DISABLE, host, CTEST0_REG);
694 | AUTO_ATN, host, SCNTL0_REG);
697 host, DMODE_700_REG);
699 DIFF : 0, host, CTEST7_REG);
703 | GENERATE_RECEIVE_PARITY, host,
707 | PARITY | AUTO_ATN, host, SCNTL0_REG);
711 NCR_700_writeb(1 << host->this_id, host, SCID_REG);
712 NCR_700_writeb(0, host, SBCL_REG);
713 NCR_700_writeb(ASYNC_OPERATION, host, SXFER_REG);
716 | RST_INT | PAR_ERR_INT | SELECT_INT, host, SIEN_REG);
718 NCR_700_writeb(ABORT_INT | INT_INST_INT | ILGL_INST_INT, host, DIEN_REG);
719 NCR_700_writeb(ENABLE_SELECT, host, SCNTL1_REG);
725 NCR_700_writeb(SYNC_DIV_2_0, host, SBCL_REG);
726 NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
731 NCR_700_writeb(SYNC_DIV_1_5, host, SBCL_REG);
732 NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
739 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
740 NCR_700_writeb(ASYNC_DIV_2_0 | hostdata->dcntl_extra, host, DCNTL_REG);
745 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
746 NCR_700_writeb(ASYNC_DIV_1_5 | hostdata->dcntl_extra, host, DCNTL_REG);
750 NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
751 NCR_700_writeb(ASYNC_DIV_1_0 | hostdata->dcntl_extra, host, DCNTL_REG);
766 NCR_700_chip_reset(struct Scsi_Host *host)
769 (struct NCR_700_Host_Parameters *)host->hostdata[0];
771 NCR_700_writeb(SOFTWARE_RESET_710, host, ISTAT_REG);
774 NCR_700_writeb(0, host, ISTAT_REG);
776 NCR_700_writeb(SOFTWARE_RESET, host, DCNTL_REG);
779 NCR_700_writeb(0, host, DCNTL_REG);
784 NCR_700_chip_setup(host);
794 process_extended_message(struct Scsi_Host *host,
830 host, SXFER_REG);
834 shost_printk(KERN_WARNING, host,
848 host->host_no, pun, lun);
858 host->host_no, pun, lun,
870 NCR_700_writel(temp, host, TEMP_REG);
875 process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata,
888 printk("scsi%d (%d:%d): message %s: ", host->host_no, pun, lun,
897 resume_offset = process_extended_message(host, hostdata, SCp,
918 scsi_change_queue_depth(SCp->device, host->cmd_per_lun);
920 shost_printk(KERN_WARNING, host,
929 printk(KERN_ERR "scsi%d (%d:%d) Parity Error!\n", host->host_no,
931 NCR_700_internal_bus_reset(host);
934 printk(KERN_INFO "scsi%d (%d:%d) SIMPLE TAG %d %s\n", host->host_no,
941 host->host_no, pun, lun,
956 NCR_700_writel(temp, host, TEMP_REG);
964 struct Scsi_Host *host,
1076 sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
1081 NCR_700_internal_bus_reset(host);
1086 host->host_no, pun, lun, NCR_700_fatal_messages[i]);
1091 NCR_700_internal_bus_reset(host);
1097 host->host_no, pun, lun,
1112 host->host_no, reselection_id, lun));
1114 SDp = __scsi_device_lookup(host, 0, reselection_id, lun);
1117 host->host_no, reselection_id, lun);
1123 SCp = scsi_host_find_tag(SDp->host, hostdata->msgin[2]);
1126 host->host_no, reselection_id, lun, hostdata->msgin[2]);
1148 host->host_no, reselection_id, lun,
1153 printk(KERN_ERR "scsi%d: FATAL, host not busy during valid reselection!\n",
1154 host->host_no);
1173 host, SXFER_REG);
1195 __u8 reselection_id = NCR_700_readb(host, SFBR_REG);
1199 reselection_id &= ~(1<<host->this_id);
1204 host->host_no, reselection_id, lun, dsp, dsp - hostdata->pScript, hostdata->state, hostdata->command_slot_count);
1229 printk(KERN_ERR "scsi%d: Invalid reselection during selection!!\n", host->host_no);
1233 host->host_no);
1256 resume_offset = process_message(host, hostdata, SCp,
1261 host->host_no, pun, lun, NCR_700_condition[i],
1271 NCR_700_internal_bus_reset(host);
1274 host->host_no, pun, lun, dsps & 0xfff, dsp, dsp - hostdata->pScript);
1278 host->host_no, pun, lun, dsps, dsp - hostdata->pScript);
1279 NCR_700_internal_bus_reset(host);
1292 process_selection(struct Scsi_Host *host, __u32 dsp)
1298 (struct NCR_700_Host_Parameters *)host->hostdata[0];
1303 id = NCR_700_readb(host, hostdata->chip710 ?
1307 id &= ~(1<<host->this_id);
1312 sbcl = NCR_700_readb(host, SBCL_REG);
1320 host->host_no, id));
1346 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata);
1372 NCR_700_clear_fifo(struct Scsi_Host *host) {
1374 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
1376 NCR_700_writeb(CLR_FIFO_710, host, CTEST8_REG);
1378 NCR_700_writeb(CLR_FIFO, host, DFIFO_REG);
1383 NCR_700_flush_fifo(struct Scsi_Host *host) {
1385 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
1387 NCR_700_writeb(FLUSH_DMA_FIFO_710, host, CTEST8_REG);
1389 NCR_700_writeb(0, host, CTEST8_REG);
1391 NCR_700_writeb(FLUSH_DMA_FIFO, host, DFIFO_REG);
1393 NCR_700_writeb(0, host, DFIFO_REG);
1406 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1416 DEBUG(("scsi%d: host busy, queueing command %p, slot %p\n",
1417 SCp->device->host->host_no, slot->cmnd, slot));
1466 NCR_700_clear_fifo(SCp->device->host);
1478 SCp->device->host, SXFER_REG);
1479 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG);
1480 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG);
1488 struct Scsi_Host *host = (struct Scsi_Host *)dev_id;
1490 (struct NCR_700_Host_Parameters *)host->hostdata[0];
1497 /* Use the host lock to serialise access to the 53c700
1500 * need to ensure that for this driver, the host lock and the
1502 spin_lock_irqsave(host->host_lock, flags);
1503 if((istat = NCR_700_readb(host, ISTAT_REG))
1516 sstat0 = NCR_700_readb(host, SSTAT0_REG);
1522 dstat = NCR_700_readb(host, DSTAT_REG);
1525 dsps = NCR_700_readl(host, DSPS_REG);
1526 dsp = NCR_700_readl(host, DSP_REG);
1529 host->host_no, istat, sstat0, dstat,
1545 host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript);
1547 scsi_report_bus_reset(host, 0);
1550 __shost_for_each_device(SDp, host)
1578 NCR_700_chip_setup(host);
1588 host->host_no, pun, lun));
1598 __u32 temp = NCR_700_readl(host, TEMP_REG);
1599 int count = (hostdata->script[Ent_SendMessage/4] & 0xffffff) - ((NCR_700_readl(host, DBC_REG) & 0xffffff) + NCR_700_data_residual(host));
1600 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)));
1605 int data_transfer = NCR_700_readl(host, DBC_REG) & 0xffffff;
1607 int residual = NCR_700_data_residual(host);
1610 __u32 naddr = NCR_700_readl(host, DNAD_REG);
1613 host->host_no, pun, lun,
1618 host->host_no, pun, lun,
1638 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);
1653 NCR_700_flush_fifo(host);
1655 __u8 sbcl = NCR_700_readb(host, SBCL_REG);
1657 host->host_no, pun, lun, dsp - hostdata->pScript, sbcl_to_string(sbcl));
1658 NCR_700_internal_bus_reset(host);
1663 host->host_no, pun, lun);
1667 host->host_no, pun, lun);
1671 host->host_no, pun, lun));
1672 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata);
1676 host->host_no, pun, lun,
1681 host->host_no, pun, lun, dstat);
1707 resume_offset = process_selection(host, dsp);
1715 printk(KERN_ERR "scsi%d: Driver error: resume at 0x%08x [0x%04x] with non busy host!\n",
1716 host->host_no, resume_offset, resume_offset - hostdata->pScript);
1721 NCR_700_clear_fifo(host);
1722 NCR_700_writel(resume_offset, host, DSP_REG);
1742 host->host_no, &hostdata->slots[j],
1751 spin_unlock_irqrestore(host->host_lock, flags);
1759 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1766 printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_no);
1802 printk("53c700: scsi%d, command ", SCp->device->host->host_no);
1935 NCR_700_internal_bus_reset(SCp->device->host);
1947 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
1956 spin_lock_irq(SCp->device->host->host_lock);
1958 spin_unlock_irq(SCp->device->host->host_lock);
1960 spin_lock_irq(SCp->device->host->host_lock);
1964 NCR_700_internal_bus_reset(SCp->device->host);
1965 NCR_700_chip_reset(SCp->device->host);
1967 spin_unlock_irq(SCp->device->host->host_lock);
1969 spin_lock_irq(SCp->device->host->host_lock);
1976 spin_unlock_irq(SCp->device->host->host_lock);
2041 (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];