aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/scsi/scsi_da.c
diff options
context:
space:
mode:
authorNate Lawson <njl@FreeBSD.org>2003-07-28 06:15:59 +0000
committerNate Lawson <njl@FreeBSD.org>2003-07-28 06:15:59 +0000
commit1deac5817994a27fd4b6d4342b69e6773f7a934a (patch)
treeaef0e23332a02e65463a1a419cc6fd6e2df931de /sys/cam/scsi/scsi_da.c
parent234c7726c87700e8658f1620c8e98ea095be831e (diff)
downloadsrc-1deac5817994a27fd4b6d4342b69e6773f7a934a.tar.gz
src-1deac5817994a27fd4b6d4342b69e6773f7a934a.zip
Add a PATH_INQ flag, PIM_NO_6_BYTE, which indicates the SIM never wishes to
receive 6 byte commands. Add a check for this flag to da(4) and cd(4) so that they honor it. This is a quick workaround for many devices (especially USB) that require da(4) quirks to operate. The more complete approach is to finish the new transport code which will be aware of the SCSI version a transport implements. MFC after: 1 day
Notes
Notes: svn path=/head/; revision=118105
Diffstat (limited to 'sys/cam/scsi/scsi_da.c')
-rw-r--r--sys/cam/scsi/scsi_da.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 2d7fb8356633..07651ea59e61 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1087,6 +1087,7 @@ daregister(struct cam_periph *periph, void *arg)
int s;
struct da_softc *softc;
struct ccb_setasync csa;
+ struct ccb_pathinq cpi;
struct ccb_getdev *cgd;
char tmpstr[80], tmpstr2[80];
caddr_t match;
@@ -1134,6 +1135,13 @@ daregister(struct cam_periph *periph, void *arg)
else
softc->quirks = DA_Q_NONE;
+ /* Check if the SIM does not want 6 byte commands */
+ xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+ cpi.ccb_h.func_code = XPT_PATH_INQ;
+ xpt_action((union ccb *)&cpi);
+ if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE))
+ softc->quirks |= DA_Q_NO_6_BYTE;
+
snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number);
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
sysctl_ctx_init(&softc->sysctl_ctx);