On Mon, Feb 04 2008 at 18:11 +0200, Jeff Garzik <[EMAIL PROTECTED]> wrote:
> Boaz Harrosh wrote:
>> Use of new scsi_eh API for setting sense information into
>> the scsi command.
>>
>> Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
>> ---
>> 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
>
Thanks, Yes I was thinking of a more general sense-formating helper but
I'm not yet sure of it's API. If you also thinks so, it motivates me
to define one and use it in a lot of places that do such formating.
Boaz
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html