From 48f6456d827dec0556c2cb55d64470152b84abaf Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Mon, 16 Aug 1999 17:47:39 +0000 Subject: 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 --- sys/cam/cam_xpt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sys/cam') diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index a0a434668ef9..b56c50f15425 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 #include @@ -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++; } } -- cgit v1.2.3