diff options
author | se <se@FreeBSD.org> | 1995-03-22 19:45:22 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1995-03-22 19:45:22 +0000 |
commit | 2a7c96b4c3420692d5f5452784f5e934d2b9f5f5 (patch) | |
tree | 370b15234b36d39de3e3709fe9a9427376f10cc4 /sys/pci | |
parent | 35f792f27c10aa60d00383ec58be9cb9a59ec3fc (diff) | |
download | FreeBSD-src-2a7c96b4c3420692d5f5452784f5e934d2b9f5f5.zip FreeBSD-src-2a7c96b4c3420692d5f5452784f5e934d2b9f5f5.tar.gz |
Set request sense data size from xp->req_sense_length if != 0.
Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/ncr.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index ab453d6..146c548 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: ncr.c,v 1.33 1995/03/21 22:14:27 se Exp $ +** $Id: ncr.c,v 1.34 1995/03/22 11:00:23 se Exp $ ** ** Device driver for the NCR 53C810 PCI-SCSI-Controller. ** @@ -788,6 +788,7 @@ struct dsb { struct scr_tblmove smsg ; struct scr_tblmove smsg2 ; struct scr_tblmove cmd ; + struct scr_tblmove scmd ; struct scr_tblmove sense ; struct scr_tblmove data [MAX_SCATTER]; }; @@ -897,6 +898,12 @@ struct ccb { ccb_p next_ccb; /* + ** Sense command + */ + + u_char sensecmd[6]; + + /* ** Tag for this transfer. ** It's patched into jump_ccb. ** If it's not zero, a SIMPLE_TAG @@ -1217,7 +1224,7 @@ static void ncr_attach (pcici_t tag, int unit); static char ident[] = - "\n$Id: ncr.c,v 1.33 1995/03/21 22:14:27 se Exp $\n"; + "\n$Id: ncr.c,v 1.34 1995/03/22 11:00:23 se Exp $\n"; u_long ncr_version = NCR_VERSION + (u_long) sizeof (struct ncb) @@ -1236,13 +1243,6 @@ static int ncr_debug = SCSI_DEBUG_FLAGS; int ncr_cache; /* to be alligned _NOT_ static */ -/* -** SCSI cmd to get the SCSI sense data -*/ - -static u_char rs_cmd [6] = - { 0x03, 0, 0, 0, sizeof (struct scsi_sense_data), 0 }; - /*========================================================== ** ** @@ -1782,8 +1782,8 @@ static struct script script0 = { /* ** Send the GETCC command */ -/*>>>*/ SCR_MOVE_ABS (6) ^ SCR_COMMAND, - (ncrcmd) &rs_cmd, +/*>>>*/ SCR_MOVE_TBL ^ SCR_COMMAND, + offsetof (struct dsb, scmd), SCR_JUMP, PADDR (dispatch), @@ -3826,6 +3826,18 @@ static INT32 ncr_start (struct scsi_xfer * xp) cp->phys.cmd.addr = vtophys (cmd); cp->phys.cmd.size = xp->cmdlen; /* + ** sense command + */ + cp->phys.scmd.addr = vtophys (&cp->sensecmd); + cp->phys.scmd.size = 6; + /* + ** patch requested size into sense command + */ + cp->sensecmd[0] = 0x03; + cp->sensecmd[4] = sizeof(struct scsi_sense_data); + if (xp->req_sense_length) + cp->sensecmd[4] = xp->req_sense_length; + /* ** sense data */ cp->phys.sense.addr = vtophys (&cp->xfer->sense); @@ -4014,14 +4026,10 @@ void ncr_complete (ncb_p np, ccb_p cp) ** Check for extended errors. */ - if (cp->xerr_status != XE_OK && !(cp->scsi_status & S_SENSE)) { + if (cp->xerr_status != XE_OK) { PRINT_ADDR(xp); switch (cp->xerr_status) { case XE_EXTRA_DATA: - if (cp->scsi_status & S_SENSE) { - cp->xerr_status = XE_OK; - break; - }; printf ("extraneous data discarded.\n"); break; case XE_BAD_PHASE: |