On Wed, 3 Mar 2004, Max Zaitsev wrote:
> > Well, if you're up for it, here's something that might prove very helpful.
> >
> > There's a debugging package for USB devices that runs under Windows 2000
> > called USB Snoopy...
> >
> Ok, I did it. Actually, while running in the logging mode, the system's
> performance was way less then any good. It took good 5 minutes for windows to
> recognise the devise and scan for partitions. This resulted in a logfile of
> 64Mb. Then I've started a new log and tried to read from the device. The
> system load was that high that by the time I've realised that the log file is
> growing as crazy and canceled the transfer it was already 30Mb large. Then
> I've tried to write a large file to the device. This time the rate of log
> file growth was not that high and I've canceled the transfer when it was 6Mb.
> As I don't possess a know how on how to sensibly trim those files I've tried
> to zip them to an archive, which turns out to be still around 25Mb.
I had a quick look at your USB Snoopy log files. Two things stand out
immediately. First, Windows 2000 definitely uses the equivalent of
max_sectors = 128, so you should be okay with that. Second, (lapsing into
jargon for a moment) it uses a maxpacket-size buffer for the CSW transfer.
I don't know if that's important, but below is a patch that does the same
thing for the usb-storage driver. I've seen vaguely related issues with
Genesys devices, so who knows? Maybe this will help.
Alan Stern
===== drivers/usb/storage/transport.c 1.125 vs edited =====
--- 1.125/drivers/usb/storage/transport.c Fri Feb 27 13:13:48 2004
+++ edited/drivers/usb/storage/transport.c Fri Mar 5 12:57:12 2004
@@ -987,7 +987,7 @@
/* get CSW for device status */
US_DEBUGP("Attempting to get CSW...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
- bcs, US_BULK_CS_WRAP_LEN, &cswlen);
+ bcs, US_IOBUF_SIZE, &cswlen);
/* Some broken devices add unnecessary zero-length packets to the
* end of their data transfers. Such packets show up as 0-length
@@ -996,7 +996,7 @@
if (result == USB_STOR_XFER_SHORT && cswlen == 0) {
US_DEBUGP("Received 0-length CSW; retrying...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
- bcs, US_BULK_CS_WRAP_LEN, &cswlen);
+ bcs, US_IOBUF_SIZE, &cswlen);
}
/* did the attempt to read the CSW fail? */
@@ -1005,12 +1005,12 @@
/* get the status again */
US_DEBUGP("Attempting to get CSW (2nd try)...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
- bcs, US_BULK_CS_WRAP_LEN, NULL);
+ bcs, US_IOBUF_SIZE, &cswlen);
}
/* if we still have a failure at this point, we're in trouble */
US_DEBUGP("Bulk status result = %d\n", result);
- if (result != USB_STOR_XFER_GOOD)
+ if (result != USB_STOR_XFER_SHORT || cswlen != US_BULK_CS_WRAP_LEN)
return USB_STOR_TRANSPORT_ERROR;
/* check bulk status */
===== drivers/usb/storage/usb.h 1.50 vs edited =====
--- 1.50/drivers/usb/storage/usb.h Sat Feb 21 19:21:42 2004
+++ edited/drivers/usb/storage/usb.h Fri Mar 5 12:44:28 2004
@@ -98,7 +98,7 @@
* size we'll allocate.
*/
-#define US_IOBUF_SIZE 64 /* Size of the DMA-mapped I/O buffer */
+#define US_IOBUF_SIZE 512 /* Size of the DMA-mapped I/O buffer */
typedef int (*trans_cmnd)(Scsi_Cmnd*, struct us_data*);
typedef int (*trans_reset)(struct us_data*);
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel