svn commit: r203524 - head/sys/dev/ciss

Alexander Motin mav at FreeBSD.org
Fri Feb 5 12:40:18 UTC 2010


Author: mav
Date: Fri Feb  5 12:40:18 2010
New Revision: 203524
URL: http://svn.freebsd.org/changeset/base/203524

Log:
  When hacking INQUIRY result, make sure that it is right INQUIRY and there
  is enough of result to hack.

Modified:
  head/sys/dev/ciss/ciss.c

Modified: head/sys/dev/ciss/ciss.c
==============================================================================
--- head/sys/dev/ciss/ciss.c	Fri Feb  5 12:17:14 2010	(r203523)
+++ head/sys/dev/ciss/ciss.c	Fri Feb  5 12:40:18 2010	(r203524)
@@ -3286,10 +3286,15 @@ ciss_cam_complete_fixup(struct ciss_soft
 {
     struct scsi_inquiry_data	*inq;
     struct ciss_ldrive		*cl;
+    uint8_t			*cdb;
     int				bus, target;
 
-    if (((csio->ccb_h.flags & CAM_CDB_POINTER) ?
-	 *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == INQUIRY) {
+    cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ?
+	 (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes;
+    if (cdb[0] == INQUIRY && 
+	(cdb[1] & SI_EVPD) == 0 &&
+	(csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN &&
+	csio->dxfer_len >= SHORT_INQUIRY_LENGTH) {
 
 	inq = (struct scsi_inquiry_data *)csio->data_ptr;
 	target = csio->ccb_h.target_id;


More information about the svn-src-head mailing list