summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2011-02-26 14:58:54 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2011-02-26 14:58:54 +0000
commit3fa7ecd6134abe348569c648a52df0da771219ae (patch)
tree44bde4d5f256ba7cfb26815701cdc05607d77274 /sys/cam/scsi
parent34864eccf3e5ec4e2a15c089a5f21e4496eaeb4d (diff)
downloadFreeBSD-src-3fa7ecd6134abe348569c648a52df0da771219ae.zip
FreeBSD-src-3fa7ecd6134abe348569c648a52df0da771219ae.tar.gz
Add the disk ident and a human-meaningful description (here, the disk model
string) to the geom_disk config XML so that they are easily accessible from userland. MFC after: 1 week
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_cd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 6a73efb..4c49e2d3 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -724,6 +724,12 @@ cdregister(struct cam_periph *periph, void *arg)
softc->disk->d_strategy = cdstrategy;
softc->disk->d_ioctl = cdioctl;
softc->disk->d_name = "cd";
+ cam_strvis(softc->disk->d_descr, cgd->inq_data.vendor,
+ sizeof(cgd->inq_data.vendor), sizeof(softc->disk->d_descr));
+ strlcat(softc->disk->d_descr, " ", sizeof(softc->disk->d_descr));
+ cam_strvis(&softc->disk->d_descr[strlen(softc->disk->d_descr)],
+ cgd->inq_data.product, sizeof(cgd->inq_data.product),
+ sizeof(softc->disk->d_descr) - strlen(softc->disk->d_descr));
softc->disk->d_unit = periph->unit_number;
softc->disk->d_drv1 = periph;
if (cpi.maxio == 0)
OpenPOWER on IntegriCloud