From owner-p4-projects@FreeBSD.ORG Sat Feb 19 03:53:01 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F22716A4D0; Sat, 19 Feb 2005 03:53:01 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30FE316A4CE for ; Sat, 19 Feb 2005 03:53:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1152843D5D for ; Sat, 19 Feb 2005 03:53:01 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j1J3r0uL075201 for ; Sat, 19 Feb 2005 03:53:00 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1J3r0TG075198 for perforce@freebsd.org; Sat, 19 Feb 2005 03:53:00 GMT (envelope-from scottl@freebsd.org) Date: Sat, 19 Feb 2005 03:53:00 GMT Message-Id: <200502190353.j1J3r0TG075198@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Subject: PERFORCE change 71284 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2005 03:53:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=71284 Change 71284 by scottl@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 -__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 #include @@ -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++; } }