public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi_debug support for rotation speed
Date: Thu, 19 Jun 2008 18:07:37 +0200	[thread overview]
Message-ID: <485A8449.8020008@torque.net> (raw)
In-Reply-To: <20080619160258.GI4392@parisc-linux.org>

Matthew Wilcox wrote:
> 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>

Looks fine.

Signed-off-by: Douglas Gilbert <dougg@torque.net>


> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index f6600bf..91d7e05 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -646,6 +646,14 @@ static int inquiry_evpd_b0(unsigned char * arr)
>  	return sizeof(vpdb0_data);
>  }
>  
> +static int inquiry_evpd_b1(unsigned char *arr)
> +{
> +	memset(arr, 0, 0x3c);
> +	arr[0] = 0;
> +	arr[1] = 1;
> +
> +	return 0x3c;
> +}
>  
>  #define SDEBUG_LONG_INQ_SZ 96
>  #define SDEBUG_MAX_INQ_ARR_SZ 584
> @@ -701,6 +709,7 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
>  			arr[n++] = 0x88;  /* SCSI ports */
>  			arr[n++] = 0x89;  /* ATA information */
>  			arr[n++] = 0xb0;  /* Block limits (SBC) */
> +			arr[n++] = 0xb1;  /* Block characteristics (SBC) */
>  			arr[3] = n - 4;	  /* number of supported VPD pages */
>  		} else if (0x80 == cmd[2]) { /* unit serial number */
>  			arr[1] = cmd[2];	/*sanity */
> @@ -740,6 +749,9 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
>  		} else if (0xb0 == cmd[2]) { /* Block limits (SBC) */
>  			arr[1] = cmd[2];        /*sanity */
>  			arr[3] = inquiry_evpd_b0(&arr[4]);
> +		} else if (0xb1 == cmd[2]) { /* Block characteristics (SBC) */
> +			arr[1] = cmd[2];        /*sanity */
> +			arr[3] = inquiry_evpd_b1(&arr[4]);
>  		} else {
>  			/* Illegal request, invalid field in cdb */
>  			mk_sense_buffer(devip, ILLEGAL_REQUEST,


      reply	other threads:[~2008-06-19 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 16:02 [PATCH] scsi_debug support for rotation speed Matthew Wilcox
2008-06-19 16:07 ` Douglas Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485A8449.8020008@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox