|
From: Tim R. <ti...@pr...> - 2007-03-06 19:19:26
|
Del Merritt wrote: > mohammed abuhijle wrote: >> Alright then, thanks for the explanation. I was using 512 because I >> thought I had to abide by the maxPacketsize of the endpoint I am using. >> >> Now the second problem is that I get a zero as a return value from >> usb_bulk_write. It is still the same code but with changing the size >> value of usb_bulk_write to 1 MB instead of 512. > > Well, in theory you can say, "here's 1MB; gopher it". But in practice > you probably don't want to do that. First, it's possible Linux has a > limit on the size of what it buffers. More likely the device won't > like something that big, since it too will have to deal with it. No, it won't. The device will never be asked to transfer more than its maximum packet size, which for a bulk pipe is no more than 512 bytes. The chopping and reconstructing is all done in the host. Even if the device only transmits 64 bytes at a time, I can still ask for a megabyte. It might take a while for it to accumulate, but the USB driver will handle it. > It's much like any other packet-driven system: the bigger the packet, > the better the possible throughput, but the worse the error recovery - > particularly if you can or have to retransmit the data. For a bulk pipe, retransmission is automatic, on a packet by packet basis. The buffer size is irrelevant to that process. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |