diff options
author | Matthew Wilcox <matthew@wil.cx> | 2008-06-19 15:13:38 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-14 15:59:33 -0400 |
commit | 1e9dbc9291738149577cc488fd441f061815e02e (patch) | |
tree | 34d8cf8a8f339d0fad6c7741aa3bee2d033bac70 | |
parent | 6ad67403da47e833d9e418caf7f28295c9472e11 (diff) |
[libata] Add support for VPD page b1
SCSI VPD page b1 reports the nominal rotation speed and physical size
of the device. Devices that conform to ATA-8 can return this information
in words 217 and 168 of the identify data.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/libata-scsi.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index b578b11caa7b..479c29e2e25c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1857,7 +1857,9 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf) | |||
1857 | const u8 pages[] = { | 1857 | const u8 pages[] = { |
1858 | 0x00, /* page 0x00, this page */ | 1858 | 0x00, /* page 0x00, this page */ |
1859 | 0x80, /* page 0x80, unit serial no page */ | 1859 | 0x80, /* page 0x80, unit serial no page */ |
1860 | 0x83 /* page 0x83, device ident page */ | 1860 | 0x83, /* page 0x83, device ident page */ |
1861 | 0x89, /* page 0x89, ata info page */ | ||
1862 | 0xb1, /* page 0xb1, block device characteristics page */ | ||
1861 | }; | 1863 | }; |
1862 | 1864 | ||
1863 | rbuf[3] = sizeof(pages); /* number of supported VPD pages */ | 1865 | rbuf[3] = sizeof(pages); /* number of supported VPD pages */ |
@@ -1978,6 +1980,19 @@ static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf) | |||
1978 | return 0; | 1980 | return 0; |
1979 | } | 1981 | } |
1980 | 1982 | ||
1983 | static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf) | ||
1984 | { | ||
1985 | rbuf[1] = 0xb1; | ||
1986 | rbuf[3] = 0x3c; | ||
1987 | if (ata_id_major_version(args->id) > 7) { | ||
1988 | rbuf[4] = args->id[217] >> 8; | ||
1989 | rbuf[5] = args->id[217]; | ||
1990 | rbuf[7] = args->id[168] & 0xf; | ||
1991 | } | ||
1992 | |||
1993 | return 0; | ||
1994 | } | ||
1995 | |||
1981 | /** | 1996 | /** |
1982 | * ata_scsiop_noop - Command handler that simply returns success. | 1997 | * ata_scsiop_noop - Command handler that simply returns success. |
1983 | * @args: device IDENTIFY data / SCSI command of interest. | 1998 | * @args: device IDENTIFY data / SCSI command of interest. |
@@ -2999,6 +3014,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | |||
2999 | case 0x89: | 3014 | case 0x89: |
3000 | ata_scsi_rbuf_fill(&args, ata_scsiop_inq_89); | 3015 | ata_scsi_rbuf_fill(&args, ata_scsiop_inq_89); |
3001 | break; | 3016 | break; |
3017 | case 0xb1: | ||
3018 | ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1); | ||
3019 | break; | ||
3002 | default: | 3020 | default: |
3003 | ata_scsi_invalid_field(cmd, done); | 3021 | ata_scsi_invalid_field(cmd, done); |
3004 | break; | 3022 | break; |