aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2008-06-19 12:02:58 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:30 -0400
commiteac6e8e449647cbb9efee53977c8bfee0aa7d69e (patch)
treefa6ffb7b45f8b99fd139a9993629f9e43119d00f /drivers/scsi/scsi_debug.c
parentf80f868ec463b0463b332cdb704fe5438f013f98 (diff)
[SCSI] scsi_debug: add support for rotation speed
Add support for VPD page b1 to scsi_debug SCSI VPD page b1 reports the nominal rotation speed of the device. Since scsi_debug is ram-based, claim to be a non-rotating medium. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 3901125455c9..01d11a01ffbf 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -643,6 +643,14 @@ static int inquiry_evpd_b0(unsigned char * arr)
643 return sizeof(vpdb0_data); 643 return sizeof(vpdb0_data);
644} 644}
645 645
646static int inquiry_evpd_b1(unsigned char *arr)
647{
648 memset(arr, 0, 0x3c);
649 arr[0] = 0;
650 arr[1] = 1;
651
652 return 0x3c;
653}
646 654
647#define SDEBUG_LONG_INQ_SZ 96 655#define SDEBUG_LONG_INQ_SZ 96
648#define SDEBUG_MAX_INQ_ARR_SZ 584 656#define SDEBUG_MAX_INQ_ARR_SZ 584
@@ -698,6 +706,7 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
698 arr[n++] = 0x88; /* SCSI ports */ 706 arr[n++] = 0x88; /* SCSI ports */
699 arr[n++] = 0x89; /* ATA information */ 707 arr[n++] = 0x89; /* ATA information */
700 arr[n++] = 0xb0; /* Block limits (SBC) */ 708 arr[n++] = 0xb0; /* Block limits (SBC) */
709 arr[n++] = 0xb1; /* Block characteristics (SBC) */
701 arr[3] = n - 4; /* number of supported VPD pages */ 710 arr[3] = n - 4; /* number of supported VPD pages */
702 } else if (0x80 == cmd[2]) { /* unit serial number */ 711 } else if (0x80 == cmd[2]) { /* unit serial number */
703 arr[1] = cmd[2]; /*sanity */ 712 arr[1] = cmd[2]; /*sanity */
@@ -737,6 +746,9 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
737 } else if (0xb0 == cmd[2]) { /* Block limits (SBC) */ 746 } else if (0xb0 == cmd[2]) { /* Block limits (SBC) */
738 arr[1] = cmd[2]; /*sanity */ 747 arr[1] = cmd[2]; /*sanity */
739 arr[3] = inquiry_evpd_b0(&arr[4]); 748 arr[3] = inquiry_evpd_b0(&arr[4]);
749 } else if (0xb1 == cmd[2]) { /* Block characteristics (SBC) */
750 arr[1] = cmd[2]; /*sanity */
751 arr[3] = inquiry_evpd_b1(&arr[4]);
740 } else { 752 } else {
741 /* Illegal request, invalid field in cdb */ 753 /* Illegal request, invalid field in cdb */
742 mk_sense_buffer(devip, ILLEGAL_REQUEST, 754 mk_sense_buffer(devip, ILLEGAL_REQUEST,