diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-12-28 16:19:16 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-12-28 16:19:16 +0000 |
commit | 72cfb58a94217ff9e2a3702e5d361663d7c66a37 (patch) | |
tree | f8501c3b4aef719d977927138508ddb07640d7c8 /sys/dev | |
parent | 2683a16fffbaaaef1dc9a8e971607aa7adcc165d (diff) |
massage the way vpds are defined. rename the page used for the devices
serial number and split the vpd header out for use in other places. while
here define the device identification page bits too.
ok krw@ marco@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/atascsi.c | 16 | ||||
-rw-r--r-- | sys/dev/ata/atascsi.h | 3 | ||||
-rw-r--r-- | sys/dev/ic/ami.c | 14 |
3 files changed, 17 insertions, 16 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 45a4c5c089c..1fe99ac16ad 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.54 2007/12/09 01:30:59 dlg Exp $ */ +/* $OpenBSD: atascsi.c,v 1.55 2007/12/28 16:19:14 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -553,17 +553,17 @@ atascsi_disk_serial(struct scsi_xfer *xs) struct scsi_link *link = xs->sc_link; struct atascsi *as = link->adapter_softc; struct ata_port *ap = as->as_ports[link->target]; - struct scsi_inquiry_vpd vpd; + struct scsi_vpd_serial pg; - bzero(&vpd, sizeof(vpd)); + bzero(&pg, sizeof(pg)); - vpd.device = T_DIRECT; - vpd.page_code = SI_PG_SERIAL; - vpd.page_length = sizeof(ap->ap_identify.serial); - bcopy(ap->ap_identify.serial, vpd.serial, + pg.hdr.device = T_DIRECT; + pg.hdr.page_code = SI_PG_SERIAL; + pg.hdr.page_length = sizeof(ap->ap_identify.serial); + bcopy(ap->ap_identify.serial, pg.serial, sizeof(ap->ap_identify.serial)); - bcopy(&vpd, xs->data, MIN(sizeof(vpd), xs->datalen)); + bcopy(&pg, xs->data, MIN(sizeof(pg), xs->datalen)); return (atascsi_done(xs, XS_NOERROR)); } diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h index 58de6156786..39472937452 100644 --- a/sys/dev/ata/atascsi.h +++ b/sys/dev/ata/atascsi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.h,v 1.30 2007/12/06 12:19:01 jsg Exp $ */ +/* $OpenBSD: atascsi.h,v 1.31 2007/12/28 16:19:14 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -93,6 +93,7 @@ struct ata_identify { u_int16_t features85; /* 85 */ u_int16_t features86; /* 86 */ u_int16_t features87; /* 87 */ +#define ATA_ID_F87_WWN (1<<8) u_int16_t ultradma; /* 88 */ u_int16_t erasetime; /* 89 */ u_int16_t erasetimex; /* 90 */ diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 8f5669e4dd3..f1858af47cc 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.185 2007/09/27 08:45:19 chl Exp $ */ +/* $OpenBSD: ami.c,v 1.186 2007/12/28 16:19:14 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -2013,7 +2013,7 @@ ami_disk(struct ami_softc *sc, struct bioc_disk *bd, struct ami_big_diskarray *p) { struct scsi_inquiry_data inqbuf; - struct scsi_inquiry_vpd vpdbuf; + struct scsi_vpd_serial vpdbuf; char *plist; int i, s, t, off; int ld = p->ada_nld, error = EINVAL; @@ -2073,8 +2073,8 @@ ami_disk(struct ami_softc *sc, struct bioc_disk *bd, bcopy(vpdbuf.serial, ser, sizeof ser - 1); ser[sizeof ser - 1] = '\0'; - if (vpdbuf.page_length < sizeof ser) - ser[vpdbuf.page_length] = '\0'; + if (vpdbuf.hdr.page_length < sizeof ser) + ser[vpdbuf.hdr.page_length] = '\0'; strlcpy(bd->bd_serial, ser, sizeof(bd->bd_serial)); } @@ -2233,7 +2233,7 @@ int ami_ioctl_disk(struct ami_softc *sc, struct bioc_disk *bd) { struct scsi_inquiry_data inqbuf; - struct scsi_inquiry_vpd vpdbuf; + struct scsi_vpd_serial vpdbuf; struct ami_big_diskarray *p; /* struct too large for stack */ int i, s, t, d; int off; @@ -2313,8 +2313,8 @@ ami_ioctl_disk(struct ami_softc *sc, struct bioc_disk *bd) bcopy(vpdbuf.serial, ser, sizeof ser - 1); ser[sizeof ser - 1] = '\0'; - if (vpdbuf.page_length < sizeof ser) - ser[vpdbuf.page_length] = '\0'; + if (vpdbuf.hdr.page_length < sizeof ser) + ser[vpdbuf.hdr.page_length] = '\0'; strlcpy(bd->bd_serial, ser, sizeof(bd->bd_serial)); } |