The attached patch for the 2.6.0-test series re-orders some debug output messages; the new order matches the order in which the fields are actually transferred over the wire. This is to make life easier for those developers who are accustomed to working with bus-analyizers.
Greg, please apply.
Matt
----- Forwarded message from Pat LaVarre <[EMAIL PROTECTED]> -----
Date: Tue, 19 Aug 2003 15:47:43 -0600
From: "Pat LaVarre" <[EMAIL PROTECTED]>
Subject: [usb-storage] [PATCH] (pel1) cbw/csw trace in order
To: <[EMAIL PROTECTED]>
List-Id: Linux USB Mass Storage Driver Developers List <usb-storage.one-eyed-alien.net>
X-Spam-Status: No, hits=2.3 required=5.0 tests=ORDER_STATUS,RCVD_IN_ORBZ version=2.11
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
Pat LaVarre
diff -Nur linux-2.6.0-test3/drivers/usb/storage/transport.c
linux/drivers/usb/storage/transport.c
--- linux-2.6.0-test3/drivers/usb/storage/transport.c 2003-08-08 22:34:48.000000000
-0600
+++ linux/drivers/usb/storage/transport.c 2003-08-19 15:34:50.302252256 -0600
@@ -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) &&
----- End forwarded message -----
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
SP: I sell software for Microsoft. Can you set me free?
DP: Natural Selection says I shouldn't.
-- MS Salesman and Dust Puppy
User Friendly, 4/2/1998
pgp00000.pgp
Description: PGP signature
