> From: Sven Duscha <[EMAIL PROTECTED]>
> Date: Thu, 1 Sep 2005 17:18:29 +0200
> 
> I got the device to work with the usbcore-driver and am now
> experimenting with bulk transfers. The easiest approach seemed to use
> functions provided in libusb-0.1.10a (http://libusb.sourceforge.net/)
> to do bulk transfers with usb_bulk_read and usb_bulk_write.

So you synchronously write N bytes, wait T for that to complete so your
task can be rescheduled and return to userspace, and then repeat.

The problem with that model is that the time to write N bytes
is probably going to be a LOT less than T.

There are two basic fixes:  (a) make N big enough to dwarf T, or
(b) stop waiting after every write, and use asynchronous APIs.
(I don't know if libusb has async APIs, but usbfs certainly does,
and libusb uses usbfs.)

If you look inside the kernel you'll see a usb_sg_wait() routine that
basically lets drivers write N1, N2, N3, N4, etc all at once and then
just wait a single time.  The "usbnet" driver framework does much the
same kind of thing, but without waiting:  queued asynchronous writes.

Back when I first did that stuff, I sustained transfer rates of about
36 MByte/sec with an FX2, using bulk transfers.  That's without any
data copying to userspace.


> The problem is that in doing so I only get a maximum transfer rate of
> ca. 3000k/sec. ...
> 
> My only guess is that going through generic usbcore-support could be
> the bottle neck. But I'm a bit reluctant to delve into development of
> a device driver for the Cypress FX2LP module.

You mean, do that in kernel mode?  You're already doing it
in user mode...


> On the other hand there is hardly any information on the linux support
> for the FX2LP available on the net, even the less from Cypress
> itself. Most drivers and sample applications are for the
> FX-USB1.1-version only.

Well there's "fxload" which has handled the FX2 (and presumably FX2LP)
for some time now.   Anything else would necessarily be specific to
the 8051 firmware you write for that chip.

- Dave



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to