summaryrefslogtreecommitdiffstats
path: root/sys/cam/ata
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/ata')
-rw-r--r--sys/cam/ata/ata_da.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 8e93302..f1a9433 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -812,6 +812,25 @@ adasysctlinit(void *context, int pending)
cam_periph_release(periph);
}
+static int
+adagetattr(struct bio *bp)
+{
+ int ret = -1;
+ struct cam_periph *periph;
+
+ if (bp->bio_disk == NULL || bp->bio_disk->d_drv1)
+ return ENXIO;
+ periph = (struct cam_periph *)bp->bio_disk->d_drv1;
+ if (periph->path == NULL)
+ return ENXIO;
+
+ ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
+ periph->path);
+ if (ret == 0)
+ bp->bio_completed = bp->bio_length;
+ return ret;
+}
+
static cam_status
adaregister(struct cam_periph *periph, void *arg)
{
@@ -917,6 +936,7 @@ adaregister(struct cam_periph *periph, void *arg)
softc->disk->d_open = adaopen;
softc->disk->d_close = adaclose;
softc->disk->d_strategy = adastrategy;
+ softc->disk->d_getattr = adagetattr;
softc->disk->d_dump = adadump;
softc->disk->d_name = "ada";
softc->disk->d_drv1 = periph;
@@ -938,8 +958,6 @@ adaregister(struct cam_periph *periph, void *arg)
((softc->flags & ADA_FLAG_CAN_CFA) &&
!(softc->flags & ADA_FLAG_CAN_48BIT)))
softc->disk->d_flags |= DISKFLAG_CANDELETE;
- strlcpy(softc->disk->d_ident, cgd->serial_num,
- MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1));
strlcpy(softc->disk->d_descr, cgd->ident_data.model,
MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model)));
softc->disk->d_hba_vendor = cpi.hba_vendor;
OpenPOWER on IntegriCloud