Lines Matching defs:adp
102 siop_setuptables(struct siop_adapter *adp, struct siop_xfer *xfer,
108 htoc32((adp->clock_div << 24) | (xs->target << 16));
130 siop_ma(struct siop_adapter *adp, struct scsi_xfer *xs)
141 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
146 dbc = readl(adp->addr + SIOP_DBC) & 0x00ffffff;
151 siop_clearfifo(struct siop_adapter *adp)
154 uint8_t ctest3 = readb(adp->addr + SIOP_CTEST3);
157 writeb(adp->addr + SIOP_CTEST3, ctest3 | CTEST3_CLF);
158 while ((readb(adp->addr + SIOP_CTEST3) & CTEST3_CLF) != 0) {
162 writeb(adp->addr + SIOP_CTEST3,
163 readb(adp->addr + SIOP_CTEST3) & ~CTEST3_CLF);
170 siop_sdp(struct siop_adapter *adp, struct siop_xfer *xfer, struct scsi_xfer *xs,
194 siop_update_resid(adp, xfer, xs, offset);
224 siop_update_resid(struct siop_adapter *adp, struct siop_xfer *xfer,
253 #define CALL_SCRIPT(ent) writel(adp->addr + SIOP_DSP, scriptaddr + ent);
256 siop_intr(struct siop_adapter *adp)
260 u_long scriptaddr = local_to_PCI((u_long)adp->script);
266 istat = readb(adp->addr + SIOP_ISTAT);
271 writeb(adp->addr + SIOP_ISTAT, ISTAT_INTF);
276 writeb(adp->addr + SIOP_ISTAT, 0);
278 dsa = readl(adp->addr + SIOP_DSA);
279 if (dsa >= local_to_PCI((u_long)adp->xfer) &&
280 dsa < local_to_PCI((u_long)adp->xfer) + SIOP_TABLE_SIZE) {
281 dsa -= local_to_PCI((u_long)adp->xfer);
282 siop_xfer = adp->xfer;
285 xs = adp->xs;
289 dstat = readb(adp->addr + SIOP_DSTAT);
297 sist = readw(adp->addr + SIOP_SIST0);
298 sstat1 = readb(adp->addr + SIOP_SSTAT1);
304 dstat = readb(adp->addr + SIOP_DSTAT);
309 writel(adp->addr + SIOP_DSA,
311 scratcha0 = readb(adp->addr + SIOP_SCRATCHA);
322 siop_ma(adp, xs);
324 siop_clearfifo(adp);
334 siop_ma(adp, xs);
336 siop_clearfifo(adp);
337 writeb(adp->addr + SIOP_SCRATCHA,
361 readl(adp->addr + SIOP_DSP) - scriptaddr);
376 irqcode = readl(adp->addr + SIOP_DSPS);
392 readl(adp->addr + SIOP_DSP) - scriptaddr);
403 target = readb(adp->addr + SIOP_SCRATCHA) & 0xf;
404 lun = readb(adp->addr + SIOP_SCRATCHA + 1);
405 tag = readb(adp->addr + SIOP_SCRATCHA + 2);
406 if (target != adp->xs->target ||
407 lun != adp->xs->lun ||
414 siop_xfer = adp->xfer;
416 writel(adp->addr + SIOP_DSP,
425 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
426 siop_sdp(adp, siop_xfer, xs, offset);
440 local_to_PCI((u_long)adp->xfer));
444 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
456 siop_update_resid(adp, siop_xfer, xs, offset);
481 writel(adp->addr + SIOP_DSP, scriptaddr + Ent_script_sched);
484 siop_scsicmd_end(adp, xs);
486 writel(adp->addr + SIOP_DSP, scriptaddr + Ent_script_sched);
492 siop_scsicmd_end(struct siop_adapter *adp, struct scsi_xfer *xs)
527 siop_scsi_request(struct siop_adapter *adp, struct scsi_xfer *xs)
529 void *xfer = adp->xfer;
532 if (adp->sel_t != xs->target) {
535 void *scriptaddr = (void *)local_to_PCI((u_long)adp->script);
537 if (adp->sel_t != -1)
538 adp->script[Ent_resel_targ0 / 4 + adp->sel_t * 2] =
542 adp->script[free_lo + i] = htoc32(lun_switch[i]);
543 adp->script[free_lo + E_abs_lunsw_return_Used[0]] =
546 siop_add_reselsw(adp, xs->target, free_lo);
548 adp->sel_t = xs->target;
553 siop_setuptables(adp, xfer, xs);
561 siop_start(adp, xs);
563 adp->xs = xs;
567 siop_intr(adp);
577 scsi_request_sense(adp, xs);
582 error = scsi_interpret_sense(adp, xs);
624 siop_start(struct siop_adapter *adp, struct scsi_xfer *xs)
626 struct siop_xfer *siop_xfer = adp->xfer;
627 uint32_t dsa, *script = adp->script;
643 slot = adp->currschedslot;
651 slot = adp->currschedslot = 0;
690 adp->currschedslot = slot;
695 writeb(adp->addr + SIOP_ISTAT, ISTAT_SIGP);
743 siop_add_reselsw(struct siop_adapter *adp, int target, int lunsw_off)
745 uint32_t *script = adp->script;
747 void *scriptaddr = (void *)local_to_PCI((u_long)adp->script);
764 siop_update_scntl3(adp, target, lunsw_off);
769 siop_update_scntl3(struct siop_adapter *adp, int target, int lunsw_off)
771 uint32_t *script = adp->script;
775 htoc32(0x78030000 | ((adp->clock_div >> 16) & 0x0000ff00));
788 _scsi_inquire(struct siop_adapter *adp, int t, int l, int buflen, char *buf)
790 struct scsipi_inquiry *cmd = (struct scsipi_inquiry *)adp->cmd;
792 (struct scsipi_inquiry_data *)adp->data;
813 error = siop_scsi_request(adp, &xs);
822 scsi_request_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
824 struct scsi_request_sense *cmd = adp->sense;
825 struct scsi_sense_data *data = (struct scsi_sense_data *)adp->data;
846 error = siop_scsi_request(adp, &sense);
884 scsi_interpret_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
930 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
931 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
966 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
967 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
982 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
983 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
984 if (!(adp->sd->sc_flags & FLAGS_REMOVABLE))
1052 scsi_probe(struct siop_adapter *adp)
1062 if (t == adp->id)
1065 if (_scsi_inquire(adp, t, l, sizeof(buf), buf) != 0)
1089 struct siop_adapter *adp;
1096 adp = &adapt;
1098 adp->sd = sd;
1099 error = _scsi_inquire(adp, sd->sc_target, sd->sc_lun, buflen, buf);
1100 adp->sd = NULL;
1129 struct siop_adapter *adp;
1137 adp = &adapt;
1139 memcpy(adp->cmd, cmd, cmdlen);
1140 adp->sd = sd;
1146 xs.cmd = adp->cmd;
1148 xs.data = adp->data;
1154 error = siop_scsi_request(adp, &xs);
1155 adp->sd = NULL;
1160 memcpy(data, adp->data, datalen);