From owner-svn-src-all@freebsd.org Mon May 16 18:11:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FC31B3D3EB; Mon, 16 May 2016 18:11:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E86F411F3; Mon, 16 May 2016 18:11:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GIBsni081630; Mon, 16 May 2016 18:11:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GIBrib081627; Mon, 16 May 2016 18:11:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605161811.u4GIBrib081627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 May 2016 18:11:53 +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: r299961 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:11:55 -0000 Author: asomers Date: Mon May 16 18:11:53 2016 New Revision: 299961 URL: https://svnweb.freebsd.org/changeset/base/299961 Log: MFC 298212 Add the ability to read a SAS device's Target Port NAA designator sys/cam/scsi/scsi_all.h sys/cam/scsi/scsi_all.c Add the scsi_devid_is_port_naa helper function Modified: stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.c Mon May 16 18:11:53 2016 (r299961) @@ -5626,6 +5626,19 @@ scsi_devid_is_lun_name(uint8_t *bufp) return 1; } +int +scsi_devid_is_port_naa(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_PORT) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + return 1; +} + struct scsi_vpd_id_descriptor * scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len, scsi_devid_checkfn_t ck_fn) Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.h Mon May 16 18:11:53 2016 (r299961) @@ -3659,6 +3659,7 @@ int scsi_devid_is_lun_eui64(uint8_t *bu int scsi_devid_is_lun_naa(uint8_t *bufp); int scsi_devid_is_lun_name(uint8_t *bufp); int scsi_devid_is_lun_t10(uint8_t *bufp); +int scsi_devid_is_port_naa(uint8_t *bufp); struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, scsi_devid_checkfn_t ck_fn);