All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 6/24][RFC] gdth: Use of scsi_eh API and sense accessors
Date: Mon, 04 Feb 2008 11:11:27 -0500	[thread overview]
Message-ID: <47A7392F.2050606@garzik.org> (raw)
In-Reply-To: <1202141236-4722-1-git-send-email-bharrosh@panasas.com>

Boaz Harrosh wrote:
>   Use of new scsi_eh API for setting sense information into
>   the scsi command.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  drivers/scsi/gdth.c |   47 ++++++++++++++++++++++++++---------------------
>  drivers/scsi/gdth.h |    1 +
>  2 files changed, 27 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
> index c825239..9fdd5ef 100644
> --- a/drivers/scsi/gdth.c
> +++ b/drivers/scsi/gdth.c
> @@ -2098,6 +2098,16 @@ static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar priority)
>  #endif
>  }
>  
> +static void gdth_set_4byte_sense(struct scsi_cmnd *scp, u8 sense_code)
> +{
> +	u8 sense[4];
> +
> +	memset(sense, 0, sizeof(sense));
> +	sense[0] = 0x70;
> +	sense[2] = sense_code;
> +	scsi_eh_cpy_sense(scp, sense, sizeof(sense));
> +}

IMO, setting 0x70 and 0x72 is highly common, and worthy of some simple 
helper functions.  See ata_scsi_set_sense() in libata-scsi.c or 
stex_set_sense() in stex.c, which is a copy of the former.

	Jeff





  reply	other threads:[~2008-02-04 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 16:07 [PATCH 6/24][RFC] gdth: Use of scsi_eh API and sense accessors Boaz Harrosh
2008-02-04 16:11 ` Jeff Garzik [this message]
2008-02-04 16:22   ` Boaz Harrosh

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=47A7392F.2050606@garzik.org \
    --to=jeff@garzik.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hch@infradead.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.