[SeaBIOS] [PATCH] USB-MSC: Support multiple LUN devices

Paolo Bonzini pbonzini at redhat.com
Fri Nov 18 09:05:28 CET 2011


On 10/16/2011 12:45 PM, Sven Schnelle wrote:
> +    /* some SCSI commands have the LUN in CDB */
> +    if (data[0] == 0x08 || // READ(6)
> +	data[0] == 0x12 || // INQUIRY
> +	data[0] == 0x15 || // MODE SELECT(6)
> +	data[0] == 0x55 || // MODE SELECT(10)
> +	data[0] == 0x1A || // MODE SENSE(6)
> +	data[0] == 0x28 || // READ(10)
> +	data[0] == 0x1B || // START STOP UNIT(6)
> +	data[0] == 0x25 || // READ CAPACITY
> +	data[0] == 0x03 // REQUEST SENSE
> +	) {

In old versions of the SCSI standard all commands had the LUN in the 
CDB.  In recent versions, no commands have the LUN in the CDB, but it 
doesn't surprise me that some devices make it a requirement.  Where did 
you take the list from?  It would make sense (also for simplicity and 
code size) to just include the LUN always.

> +	data[1]&= ~0x10;

Why should data[1] bit 4 be cleared?

Paolo



More information about the SeaBIOS mailing list