Lines Matching refs:xs

99 		 struct scsi_xfer *xs)
104 htoc32((adp->clock_div << 24) | (xs->target << 16));
107 if (xs->cmd->opcode == SCSI_REQUEST_SENSE)
108 xfer->siop_tables.msg_out[0] = MSG_IDENTIFY(xs->lun, 0);
110 xfer->siop_tables.msg_out[0] = MSG_IDENTIFY(xs->lun, 1);
116 xfer->siop_tables.cmd.count = htoc32(xs->cmdlen);
117 xfer->siop_tables.cmd.addr = htoc32(local_to_PCI((u_long)xs->cmd));
118 if (xs->datalen != 0) {
119 xfer->siop_tables.data[0].count = htoc32(xs->datalen);
121 htoc32(local_to_PCI((u_long)xs->data));
126 siop_ma(struct siop_adapter *adp, struct scsi_xfer *xs)
134 if (xs->datalen == 0)
143 xs->resid = dbc;
147 siop_sdp(struct siop_adapter *adp, struct siop_xfer *xfer, struct scsi_xfer *xs,
151 if (xs->datalen == 0)
171 siop_update_resid(adp, xfer, xs, offset);
202 struct scsi_xfer *xs, int offset)
206 if (xs->datalen == 0)
214 xs->resid -= ctoh32(xfer->siop_tables.data[i].count);
224 xs->resid -= ctoh32(table->count) - xs->resid;
236 struct scsi_xfer *xs = NULL;
262 xs = adp->xs;
299 siop_ma(adp, xs);
312 siop_ma(adp, xs);
330 xs->error = XS_SELTIMEOUT;
342 xs->error = XS_SELTIMEOUT;
372 if (xs) {
373 xs->error = XS_SELTIMEOUT;
385 if (target != adp->xs->target ||
386 lun != adp->xs->lun ||
405 siop_sdp(adp, siop_xfer, xs, offset);
417 if (xs == NULL) {
435 siop_update_resid(adp, siop_xfer, xs, offset);
439 if (xs) {
440 xs->error = XS_SELTIMEOUT;
458 xs->status = ctoh32(siop_xfer->siop_tables.status);
459 if (xs->status == SCSI_OK)
463 siop_scsicmd_end(adp, xs);
471 siop_scsicmd_end(struct siop_adapter *adp, struct scsi_xfer *xs)
474 switch(xs->status) {
476 xs->error = XS_NOERROR;
481 xs->error = XS_BUSY;
485 * don't check status, xs->error is already valid
493 xs->error = XS_SELTIMEOUT;
496 printf("invalid status code %d\n", xs->status);
497 xs->error = XS_DRIVER_STUFFUP;
499 _inv((u_long)xs->cmd, xs->cmdlen);
500 if (xs->datalen != 0)
501 _inv((u_long)xs->data, xs->datalen);
502 xs->xs_status = XS_STS_DONE;
506 siop_scsi_request(struct siop_adapter *adp, struct scsi_xfer *xs)
511 if (adp->sel_t != xs->target) {
525 siop_add_reselsw(adp, xs->target, free_lo);
527 adp->sel_t = xs->target;
532 siop_setuptables(adp, xfer, xs);
535 if (xs->datalen != 0)
536 _inv((u_long)xs->data, xs->datalen);
537 _wbinv((u_long)xs->cmd, xs->cmdlen);
540 siop_start(adp, xs);
542 adp->xs = xs;
544 while (!(xs->xs_status & XS_STS_DONE)) {
554 if (xs->error != XS_NOERROR) {
555 if (xs->error == XS_BUSY || xs->status == SCSI_CHECK)
556 scsi_request_sense(adp, xs);
558 switch (xs->error) {
561 error = scsi_interpret_sense(adp, xs);
587 xs->error);
592 xs->error = XS_NOERROR;
593 xs->status = SCSI_OK;
594 xs->xs_status &= ~XS_STS_DONE;
603 siop_start(struct siop_adapter *adp, struct scsi_xfer *xs)
772 struct scsi_xfer xs;
780 memset(&xs, 0, sizeof(xs));
781 xs.target = t;
782 xs.lun = l;
783 xs.cmdlen = sizeof(*cmd);
784 xs.cmd = (void *)cmd;
785 xs.datalen = SCSIPI_INQUIRY_LENGTH_SCSI2;
786 xs.data = (void *)inqbuf;
788 xs.error = XS_NOERROR;
789 xs.resid = xs.datalen;
790 xs.status = SCSI_OK;
792 error = siop_scsi_request(adp, &xs);
801 scsi_request_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
814 sense.target = xs->target;
815 sense.lun = xs->lun;
829 xs->error = XS_SENSE;
833 xs->error = XS_RESET;
841 xs->error = XS_DRIVER_STUFFUP;
845 xs->error = XS_DRIVER_STUFFUP;
863 scsi_interpret_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
880 sense = (struct scsi_sense_data *)xs->data;
919 if (xs->resid == xs->datalen && xs->datalen) {
923 xs->resid = 0; /* not short read */
980 xs->cmd->opcode, info);
1092 struct scsi_xfer xs;
1104 memset(&xs, 0, sizeof(xs));
1105 xs.target = sd->sc_target;
1106 xs.lun = sd->sc_lun;
1107 xs.cmdlen = cmdlen;
1108 xs.cmd = adp->cmd;
1109 xs.datalen = datalen;
1110 xs.data = adp->data;
1112 xs.error = XS_NOERROR;
1113 xs.resid = datalen;
1114 xs.status = SCSI_OK;
1116 error = siop_scsi_request(adp, &xs);