From owner-svn-src-head@FreeBSD.ORG Sun Oct 26 20:13:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB015868; Sun, 26 Oct 2014 20:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E0211B; Sun, 26 Oct 2014 20:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9QKDkeX096075; Sun, 26 Oct 2014 20:13:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QKDkLl096074; Sun, 26 Oct 2014 20:13:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410262013.s9QKDkLl096074@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Oct 2014 20:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273708 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 20:13:46 -0000 Author: mav Date: Sun Oct 26 20:13:46 2014 New Revision: 273708 URL: https://svnweb.freebsd.org/changeset/base/273708 Log: Fix support for LUN flat space addressing. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Oct 26 19:42:44 2014 (r273707) +++ head/sys/cam/ctl/ctl.c Sun Oct 26 20:13:46 2014 (r273708) @@ -9403,17 +9403,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio * Flat addressing method. */ lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | - (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK); -#ifdef OLDCTLHEADERS - (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) | - (targ_lun_id & SRLD_BUS_LUN_MASK); -#endif + RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); lun_data->luns[num_filled].lundata[1] = -#ifdef OLDCTLHEADERS - targ_lun_id >> SRLD_BUS_LUN_BITS; -#endif - targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS; + (targ_lun_id & 0xff); + num_filled++; + } else if (targ_lun_id <= 0xffffff) { + /* + * Extended flat addressing method. + */ + lun_data->luns[num_filled].lundata[0] = + RPL_LUNDATA_ATYP_EXTLUN | 0x12; + scsi_ulto3b(targ_lun_id, + &lun_data->luns[num_filled].lundata[1]); num_filled++; } else { printf("ctl_report_luns: bogus LUN number %jd, "