summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 184d43e..3cf307a 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1096,7 +1096,7 @@ xpt_denounce_periph(struct cam_periph *periph)
int
xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
{
- int ret = -1, l;
+ int ret = -1, l, o;
struct ccb_dev_advinfo cdai;
struct scsi_vpd_id_descriptor *idd;
@@ -1136,6 +1136,12 @@ xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
if (idd == NULL)
idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
cdai.provsiz, scsi_devid_is_lun_eui64);
+ if (idd == NULL)
+ idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
+ cdai.provsiz, scsi_devid_is_lun_uuid);
+ if (idd == NULL)
+ idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf,
+ cdai.provsiz, scsi_devid_is_lun_md5);
} else
idd = NULL;
if (idd == NULL)
@@ -1162,6 +1168,17 @@ xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
buf[l] = 0;
} else
ret = EFAULT;
+ } else if ((idd->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_UUID
+ && idd->identifier[0] == 0x10) {
+ if ((idd->length - 2) * 2 + 4 < len) {
+ for (l = 2, o = 0; l < idd->length; l++) {
+ if (l == 6 || l == 8 || l == 10 || l == 12)
+ o += sprintf(buf + o, "-");
+ o += sprintf(buf + o, "%02x",
+ idd->identifier[l]);
+ }
+ } else
+ ret = EFAULT;
} else {
if (idd->length * 2 < len) {
for (l = 0; l < idd->length; l++)
OpenPOWER on IntegriCloud