[OpenBIOS] [PATCH] ESP : Fix SCSI READ command length
Blue Swirl
blauwirbel at gmail.com
Fri Jan 28 22:47:42 CET 2011
On Fri, Jan 28, 2011 at 10:24 AM, Mark Cave-Ayland
<mark.cave-ayland at siriusit.co.uk> wrote:
> On 27/01/11 19:05, Olivier DANET wrote:
>
>> Signed-off-by: Olivier Danet<odanet at caramail.com>
>> ---
>> diff -rup a/drivers/esp.c b/drivers/esp.c
>> --- a/drivers/esp.c 2011-01-27 15:11:52.000000000 +0100
>> +++ b/drivers/esp.c 2011-01-27 15:13:34.000000000 +0100
>> @@ -147,7 +147,7 @@ ob_sd_read_sector(esp_private_t *esp, sd
>> sd->id, offset);
>>
>> // Setup command = Read(10)
>> - memset(esp->buffer, 0, 10);
>> + memset(esp->buffer, 0, 11);
>> esp->buffer[0] = 0x80;
>> esp->buffer[1] = READ_10;
>>
>> @@ -159,7 +159,7 @@ ob_sd_read_sector(esp_private_t *esp, sd
>> esp->buffer[8] = 0;
>> esp->buffer[9] = 1;
>>
>> - if (do_command(esp, sd, 10, sd->bs))
>> + if (do_command(esp, sd, 11, sd->bs))
>> return 0;
>>
>> return 0;
>
> Hi Olivier,
>
> While on the surface the patch looks sensible, it's quite difficult to
> review this (and your associated QEMU patches) in their current form.
>
> Could you re-submit with an extra description, describing briefly i) what
> symptoms did you see without the patch, ii) what does this fix with the
> patch applied, and iii) a document reference which verifies the command
> length should be 11 instead of 10.
For iii): SCSI-3 Block Commands (SBC), 6.1.5 READ(10): the number of
bytes is 10 for the command itself. Before the command there is one
byte for IDENTIFY (0x80), defined by SCSI Parallel Interface. Thus 11,
like READ_CAPACITY below. INQUIRY is 6+1, defined in SCSI Primary
Commands.
More information about the OpenBIOS
mailing list