summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2016-04-18 15:01:59 +0000
committerasomers <asomers@FreeBSD.org>2016-04-18 15:01:59 +0000
commit36e5827be63d285980dba97e9acfd56db9da4c27 (patch)
tree35ae92365124b4aaf20c2782310934f4d2ff8f4a /sys/cam
parentae9a652080bc3b428fd4d797c6329b05e1018366 (diff)
downloadFreeBSD-src-36e5827be63d285980dba97e9acfd56db9da4c27.zip
FreeBSD-src-36e5827be63d285980dba97e9acfd56db9da4c27.tar.gz
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 Reviewed by: ken MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5975
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_all.c13
-rw-r--r--sys/cam/scsi/scsi_all.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index 3a073ee..12be402 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -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)
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index e5b492f..6e97a27 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -3661,6 +3661,7 @@ int scsi_devid_is_lun_eui64(uint8_t *bufp);
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);
OpenPOWER on IntegriCloud