summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-08-16 17:47:39 +0000
committermjacob <mjacob@FreeBSD.org>1999-08-16 17:47:39 +0000
commitc54c63dd0357cd5abea4bf9b2b2b5aa9d0502313 (patch)
tree1a16771c02d530db5ee1d4602fe8ceb9e51f89c2 /sys/cam/cam_xpt.c
parent42550e4713c89422791e5e28aafd74044b6b9b20 (diff)
downloadFreeBSD-src-c54c63dd0357cd5abea4bf9b2b2b5aa9d0502313.zip
FreeBSD-src-c54c63dd0357cd5abea4bf9b2b2b5aa9d0502313.tar.gz
Put in a limit (8) for lun width- do not exceed probing this unless a device
is quirked for allowing it. This will allow SCSI cards to specify their true correct lun width (32 for Qlogic SCSI, 16 or 65536 for Qlogic Fibre Channel) without crippling the system because of f/w breakage of a lot of drives. Reviewed by: gibbs@freebsd.org
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index a0a4346..b56c50f 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_xpt.c,v 1.64 1999/06/20 18:19:44 mjacob Exp $
+ * $Id: cam_xpt.c,v 1.65 1999/07/11 06:10:47 jmg Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -194,9 +194,11 @@ struct xpt_quirk_entry {
u_int8_t quirks;
#define CAM_QUIRK_NOLUNS 0x01
#define CAM_QUIRK_NOSERIAL 0x02
+#define CAM_QUIRK_HILUNS 0x04
u_int mintags;
u_int maxtags;
};
+#define CAM_SCSI2_MAXLUN 8
typedef enum {
XPT_FLAG_OPEN = 0x01
@@ -4840,7 +4842,9 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
if ((lun_id != 0) || (device != NULL)) {
/* Try the next lun */
- lun_id++;
+ if (lun_id < (CAM_SCSI2_MAXLUN-1) ||
+ (device->quirk->quirks & CAM_QUIRK_HILUNS))
+ lun_id++;
}
} else {
struct cam_ed *device;
@@ -4849,7 +4853,9 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
if ((device->quirk->quirks & CAM_QUIRK_NOLUNS) == 0) {
/* Try the next lun */
- lun_id++;
+ if (lun_id < (CAM_SCSI2_MAXLUN-1) ||
+ (device->quirk->quirks & CAM_QUIRK_HILUNS))
+ lun_id++;
}
}
OpenPOWER on IntegriCloud