ChangeSet 1.1276.1.67, 2003/09/02 10:47:33-07:00, LAVARRE@iomega.com [PATCH] USB: storage: cbw/csw trace in order Via this patch ... We change only when CONFIG_USB_STORAGE_DEBUG=y. To /proc/kmsg etc. we now trace the fields of the cbw as we order those fields in ram and as we order those fields in time on the bus, to avoid disorientating those of us who view those canonical orders often. Also we no longer print "S" or "Sig" to "Signature", instead we always print "S". We chose "S" over "Sig" because it is the "T" signature (aka "Tag") that actually makes each cbw/csw pair distinct, whereas the so-called Signatures only distinguish cbw from csw by flipping one bit. Also in the trace we uppercase a 'C' and an 'S' to keep cbw from csw typographically distinct. For example, what was: <7>usb-storage: Command INQUIRY (6 bytes) <7>usb-storage: 12 00 00 00 24 00 <7>usb-storage: Bulk command S 0x43425355 T 0x1f13 Trg 0 LUN 0 L 36 F 128 CL 6 ... <7>usb-storage: Bulk status Sig 0x53425355 T 0x1f13 R 0 Stat 0x0 becomes: <7>usb-storage: Command INQUIRY (6 bytes) <7>usb-storage: 12 00 00 00 24 00 <7>usb-storage: Bulk Command S 0x43425355 T 0x1f3b L 36 F 128 Trg 0 LUN 0 CL 6 ... <7>usb-storage: Bulk Status S 0x53425355 T 0x1f3b R 0 Stat 0x0 drivers/usb/storage/transport.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c --- a/drivers/usb/storage/transport.c Tue Sep 2 12:42:22 2003 +++ b/drivers/usb/storage/transport.c Tue Sep 2 12:42:22 2003 @@ -942,11 +942,11 @@ memcpy(bcb->CDB, srb->cmnd, bcb->Length); /* send it to out endpoint */ - US_DEBUGP("Bulk command S 0x%x T 0x%x Trg %d LUN %d L %d F %d CL %d\n", + US_DEBUGP("Bulk Command S 0x%x T 0x%x L %d F %d Trg %d LUN %d CL %d\n", le32_to_cpu(bcb->Signature), bcb->Tag, + le32_to_cpu(bcb->DataTransferLength), bcb->Flags, (bcb->Lun >> 4), (bcb->Lun & 0x0F), - le32_to_cpu(bcb->DataTransferLength), - bcb->Flags, bcb->Length); + bcb->Length); result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, US_BULK_CB_WRAP_LEN, NULL); US_DEBUGP("Bulk command transfer result=%d\n", result); @@ -999,7 +999,7 @@ return USB_STOR_TRANSPORT_ERROR; /* check bulk status */ - US_DEBUGP("Bulk status Sig 0x%x T 0x%x R %d Stat 0x%x\n", + US_DEBUGP("Bulk Status S 0x%x T 0x%x R %d Stat 0x%x\n", le32_to_cpu(bcs->Signature), bcs->Tag, bcs->Residue, bcs->Status); if ((bcs->Signature != cpu_to_le32(US_BULK_CS_SIGN) &&