Home | History | Annotate | Download | only in boot

Lines Matching refs:xs

103 		 struct scsi_xfer *xs)
108 htoc32((adp->clock_div << 24) | (xs->target << 16));
111 if (xs->cmd->opcode == SCSI_REQUEST_SENSE)
112 xfer->siop_tables.msg_out[0] = MSG_IDENTIFY(xs->lun, 0);
114 xfer->siop_tables.msg_out[0] = MSG_IDENTIFY(xs->lun, 1);
120 xfer->siop_tables.cmd.count = htoc32(xs->cmdlen);
121 xfer->siop_tables.cmd.addr = htoc32(local_to_PCI((u_long)xs->cmd));
122 if (xs->datalen != 0) {
123 xfer->siop_tables.data[0].count = htoc32(xs->datalen);
125 htoc32(local_to_PCI((u_long)xs->data));
130 siop_ma(struct siop_adapter *adp, struct scsi_xfer *xs)
138 if (xs->datalen == 0)
147 xs->resid = dbc;
170 siop_sdp(struct siop_adapter *adp, struct siop_xfer *xfer, struct scsi_xfer *xs,
174 if (xs->datalen == 0)
194 siop_update_resid(adp, xfer, xs, offset);
225 struct scsi_xfer *xs, int offset)
229 if (xs->datalen == 0)
237 xs->resid -= ctoh32(xfer->siop_tables.data[i].count);
247 xs->resid -= ctoh32(table->count) - xs->resid;
259 struct scsi_xfer *xs = NULL;
285 xs = adp->xs;
322 siop_ma(adp, xs);
334 siop_ma(adp, xs);
351 xs->error = XS_SELTIMEOUT;
363 xs->error = XS_SELTIMEOUT;
393 if (xs) {
394 xs->error = XS_SELTIMEOUT;
406 if (target != adp->xs->target ||
407 lun != adp->xs->lun ||
426 siop_sdp(adp, siop_xfer, xs, offset);
438 if (xs == NULL) {
456 siop_update_resid(adp, siop_xfer, xs, offset);
460 if (xs) {
461 xs->error = XS_SELTIMEOUT;
479 xs->status = ctoh32(siop_xfer->siop_tables.status);
480 if (xs->status == SCSI_OK)
484 siop_scsicmd_end(adp, xs);
492 siop_scsicmd_end(struct siop_adapter *adp, struct scsi_xfer *xs)
495 switch(xs->status) {
497 xs->error = XS_NOERROR;
502 xs->error = XS_BUSY;
506 * don't check status, xs->error is already valid
514 xs->error = XS_SELTIMEOUT;
517 printf("invalid status code %d\n", xs->status);
518 xs->error = XS_DRIVER_STUFFUP;
520 _inv((u_long)xs->cmd, xs->cmdlen);
521 if (xs->datalen != 0)
522 _inv((u_long)xs->data, xs->datalen);
523 xs->xs_status = XS_STS_DONE;
527 siop_scsi_request(struct siop_adapter *adp, struct scsi_xfer *xs)
532 if (adp->sel_t != xs->target) {
546 siop_add_reselsw(adp, xs->target, free_lo);
548 adp->sel_t = xs->target;
553 siop_setuptables(adp, xfer, xs);
556 if (xs->datalen != 0)
557 _inv((u_long)xs->data, xs->datalen);
558 _wbinv((u_long)xs->cmd, xs->cmdlen);
561 siop_start(adp, xs);
563 adp->xs = xs;
565 while (!(xs->xs_status & XS_STS_DONE)) {
575 if (xs->error != XS_NOERROR) {
576 if (xs->error == XS_BUSY || xs->status == SCSI_CHECK)
577 scsi_request_sense(adp, xs);
579 switch (xs->error) {
582 error = scsi_interpret_sense(adp, xs);
608 xs->error);
613 xs->error = XS_NOERROR;
614 xs->status = SCSI_OK;
615 xs->xs_status &= ~XS_STS_DONE;
624 siop_start(struct siop_adapter *adp, struct scsi_xfer *xs)
793 struct scsi_xfer xs;
801 memset(&xs, 0, sizeof(xs));
802 xs.target = t;
803 xs.lun = l;
804 xs.cmdlen = sizeof(*cmd);
805 xs.cmd = (void *)cmd;
806 xs.datalen = SCSIPI_INQUIRY_LENGTH_SCSI2;
807 xs.data = (void *)inqbuf;
809 xs.error = XS_NOERROR;
810 xs.resid = xs.datalen;
811 xs.status = SCSI_OK;
813 error = siop_scsi_request(adp, &xs);
822 scsi_request_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
835 sense.target = xs->target;
836 sense.lun = xs->lun;
850 xs->error = XS_SENSE;
854 xs->error = XS_RESET;
862 xs->error = XS_DRIVER_STUFFUP;
866 xs->error = XS_DRIVER_STUFFUP;
884 scsi_interpret_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
901 sense = (struct scsi_sense_data *)xs->data;
957 if (xs->resid == xs->datalen && xs->datalen) {
961 xs->resid = 0; /* not short read */
1019 xs->cmd->opcode, info);
1130 struct scsi_xfer xs;
1142 memset(&xs, 0, sizeof(xs));
1143 xs.target = sd->sc_target;
1144 xs.lun = sd->sc_lun;
1145 xs.cmdlen = cmdlen;
1146 xs.cmd = adp->cmd;
1147 xs.datalen = datalen;
1148 xs.data = adp->data;
1150 xs.error = XS_NOERROR;
1151 xs.resid = datalen;
1152 xs.status = SCSI_OK;
1154 error = siop_scsi_request(adp, &xs);