From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 2 17:30:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F3A5B74B; Sun, 2 Nov 2014 17:30:31 +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 C507ACCB; Sun, 2 Nov 2014 17:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HUVIg028992; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HUV30028990; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021730.sA2HUV30028990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273980 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:30:32 -0000 Author: mav Date: Sun Nov 2 17:30:30 2014 New Revision: 273980 URL: https://svnweb.freebsd.org/changeset/base/273980 Log: MFC r273687: Add "rpm" and "formfactor" LUN options to match istgt functionality. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:30:30 2014 (r273980) @@ -10209,6 +10209,8 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * { struct scsi_vpd_block_device_characteristics *bdc_ptr; struct ctl_lun *lun; + const char *value; + u_int i; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10241,7 +10243,18 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; bdc_ptr->page_code = SVPD_BDC; scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length); - scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) + i = strtol(value, NULL, 0); + else + i = SVPD_NON_ROTATING; + scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) + i = strtol(value, NULL, 0); + else + i = 0; + bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; ctsio->scsi_status = SCSI_STATUS_OK; Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:30:30 2014 (r273980) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 12, 2014 +.Dd October 26, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,12 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va rpm +Specifies medium rotation rate of the device: 0 -- not reported, +1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. +.It Va formfactor +Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", +2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. .It Va writecache