aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>1999-08-16 17:47:39 +0000
committerMatt Jacob <mjacob@FreeBSD.org>1999-08-16 17:47:39 +0000
commit48f6456d827dec0556c2cb55d64470152b84abaf (patch)
treec9fafcac9d266f8eaf9a4b713684d458e705fbd1 /sys/cam
parenta0c6c4d6ce7ef3499acdd248e50cead6dee6e1f2 (diff)
downloadsrc-48f6456d827dec0556c2cb55d64470152b84abaf.tar.gz
src-48f6456d827dec0556c2cb55d64470152b84abaf.zip
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
Notes
Notes: svn path=/head/; revision=49897
Diffstat (limited to 'sys/cam')
-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 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 <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++;
}
}