PERFORCE change 71284 for review

Scott Long scottl at FreeBSD.org
Fri Feb 18 19:53:02 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=71284

Change 71284 by scottl at scottl-junior on 2005/02/19 03:52:53

	IFC: partial merge of cam_xpt.c rev 1.147

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#10 integrate

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#10 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.146 2005/01/05 22:34:34 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.147 2005/01/22 22:46:45 mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -76,6 +76,16 @@
 /* number of high powered commands that can go through right now */
 static int num_highpower = CAM_MAX_HIGHPOWER;
 
+/*
+ * If we're not quirked to search <= the first 8 luns
+ * and we are either quirked to search above lun 8,
+ * or we're > SCSI-2, we can look for luns above lun 8.
+ */
+#define	CAN_SRCH_HI(dv)					\
+  (((dv->quirk->quirks & CAM_QUIRK_NOHILUNS) == 0) 	\
+  && ((dv->quirk->quirks & CAM_QUIRK_HILUNS)		\
+  || SID_ANSI_REV(&dv->inq_data) > SCSI_REV_2))
+
 typedef enum {
 	XPT_FLAG_OPEN		= 0x01
 } xpt_flags;
@@ -5135,7 +5145,7 @@
 			s = splcam();
 			device = TAILQ_FIRST(&target->ed_entries);
 			if (device != NULL) {
-				phl = device->quirk->quirks & CAM_QUIRK_HILUNS;
+				phl = CAN_SRCH_HI(device);
 				if (device->lun_id == 0)
 					device = TAILQ_NEXT(device, links);
 			}
@@ -5151,8 +5161,8 @@
 
 			if ((device->quirk->quirks & CAM_QUIRK_NOLUNS) == 0) {
 				/* Try the next lun */
-				if (lun_id < (CAM_SCSI2_MAXLUN-1) ||
-				    (device->quirk->quirks & CAM_QUIRK_HILUNS))
+				if (lun_id < (CAM_SCSI2_MAXLUN-1)
+				  || CAN_SRCH_HI(device))
 					lun_id++;
 			}
 		}


More information about the p4-projects mailing list