Skip to contentSkip to conversation

USB: Remove LUN number from CDB

PATCH New Abraham 3 participants 4 messages Oct 28, 2008 – Feb 10, 2009

lore
Share & tools
lore

Abraham

#0 lore raw

PATCH 1/1 USB: Remove LUN number from CDB

The LUN number is not part of the Command Descriptor Block (CDB) for scsi inquiry, request sense, test unit ready, read capacity and read10 commands. This patch removes the LUN number information from the CDB.

common/usb_storage.c 2008-10-28 17:09:12.000000000 +0530 renamed from common/usb_storage.c.orig 2008-10-28 17:08:45.000000000 +0530 +0 -5
@@ -827,7 +827,6 @@ static int usb_inquiry(ccb *srb,struct u
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_INQUIRY;
-               srb->cmd[1]=srb->lun<<5;
                srb->cmd[4]=36;
                srb->datalen=36;
                srb->cmdlen=12;
@@ -851,7 +850,6 @@ static int usb_request_sense(ccb *srb,st
        ptr=(char *)srb->pdata;
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_REQ_SENSE;
-       srb->cmd[1]=srb->lun<<5;
        srb->cmd[4]=18;
        srb->datalen=18;
        srb->pdata = &srb->sense_buf[0];
@@ -869,7 +867,6 @@ static int usb_test_unit_ready(ccb *srb,
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_TST_U_RDY;
-               srb->cmd[1]=srb->lun<<5;
                srb->datalen=0;
                srb->cmdlen=12;
                if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {
@@ -889,7 +886,6 @@ static int usb_read_capacity(ccb *srb,st
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_RD_CAPAC;
-               srb->cmd[1]=srb->lun<<5;
                srb->datalen=8;
                srb->cmdlen=12;
                if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {
@@ -904,7 +900,6 @@ static int usb_read_10(ccb *srb,struct u
 {
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_READ10;
-       srb->cmd[1]=srb->lun<<5;
        srb->cmd[2]=((unsigned char) (start>>24))&0xff;
        srb->cmd[3]=((unsigned char) (start>>16))&0xff;
        srb->cmd[4]=((unsigned char) (start>>8))&0xff;
#1 lore raw

PATCH 1/1 USB: Remove LUN number from CDB

Dear Remy,

In message <[email protected]>

Quoted 40 lines · Thomas

The LUN number is not part of the Command Descriptor Block (CDB) for scsi inquiry, request sense, test unit ready, read capacity and read10 commands. This patch removes the LUN number information from the CDB.

common/usb_storage.c 2008-10-28 17:09:12.000000000 +0530 renamed from common/usb_storage.c.orig 2008-10-28 17:08:45.000000000 +0530 +0 -4
@@ -827,7 +827,6 @@ static int usb_inquiry(ccb *srb,struct u
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_INQUIRY;
-               srb->cmd[1]=srb->lun<<5;
                srb->cmd[4]=36;
                srb->datalen=36;
                srb->cmdlen=12;
@@ -851,7 +850,6 @@ static int usb_request_sense(ccb *srb,st
        ptr=(char *)srb->pdata;
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_REQ_SENSE;
-       srb->cmd[1]=srb->lun<<5;
        srb->cmd[4]=18;
        srb->datalen=18;
        srb->pdata = &srb->sense_buf[0];
@@ -869,7 +867,6 @@ static int usb_test_unit_ready(ccb *srb,
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_TST_U_RDY;
-               srb->cmd[1]=srb->lun<<5;
                srb->datalen=0;
                srb->cmdlen=12;
                if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {
@@ -889,7 +886,6 @@ static int usb_read_capacity(ccb *srb,st
        do {
                memset(&srb->cmd[0],0,12);
                srb->cmd[0]=SCSI_RD_CAPAC;
-               srb->cmd[1]=srb->lun<<5;
                srb->datalen=8;
                srb->cmdlen=12;
                if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {

common/usb_storage.c 2008-10-28 17:09:12.000000000 +0530 static int usb_read_10(ccb *srb,struct u · line 905

Quoted 7 lines
common/usb_storage.c 2008-10-28 17:09:12.000000000 +0530 renamed from common/usb_storage.c.orig 2008-10-28 17:08:45.000000000 +0530 +0 -1
@@ -904,7 +900,6 @@ static int usb_read_10(ccb *srb,struct u
 {
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_READ10;
-       srb->cmd[1]=srb->lun<<5;
        srb->cmd[2]=((unsigned char) (start>>24))&0xff;
        srb->cmd[3]=((unsigned char) (start>>16))&0xff;
        srb->cmd[4]=((unsigned char) (start>>8))&0xff;

Is this patch still in some of your queues?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The day-to-day travails of the IBM programmer are so amusing to  most
of us who are fortunate enough never to have been one - like watching
Charlie Chaplin trying to cook a shoe.
#2 lore raw

PATCH 1/1 USB: Remove LUN number from CDB

Hello Wolfgang,

Quoted 8 lines

In message <[email protected]>

Quoted 4 lines · Thomas

The LUN number is not part of the Command Descriptor Block (CDB) for scsi inquiry, request sense, test unit ready, read capacity and read10 commands. This patch removes the LUN number information from the CDB.

Is this patch still in some of your queues?

It seems to be a patch that was posted around the time I started with the custodianship, and apparently I missed it back then.
I will look at in detail later today.

Kind Regards,

#3 lore raw

PATCH 1/1 USB: Remove LUN number from CDB

Hello Thomas,

2009/2/10 Remy Bohmer <[email protected]>:

Quoted 11 lines

Hello Wolfgang,

Quoted 8 lines

In message <[email protected]>

Quoted 4 lines · Thomas

The LUN number is not part of the Command Descriptor Block (CDB) for scsi inquiry, request sense, test unit ready, read capacity and read10 commands. This patch removes the LUN number information from the CDB.

Is this patch still in some of your queues?

Applied to the U-boot-usb tree
Thanks.

Remy