Hi all.
 
I'm fairly new to RedHat Linux and I am trying to sort out how to 
use the USB filesystem properly with my USB device.

I've been using libusb with some success.  However I am 
experiencing a problem issuing a bulk write while I have a bulk 
read pending.

In one case I use the same handle to do the bulk read and bulk 
write.  I fork() after opening the handle and the parent is 
looping and issuing bulk reads and processing the data.  The 
timeout is 3*1000 (which should translate to 3 secs.).  The child 
periodically issues a bulk write, but when this happens I loose a 
bulk read frame on the parent.
 
It so happens that the bulk in and out endpoints have the same 
number (2 in this case).  Could this be the problem or limitation 
on Linux?  BTW, the device works like a charm on Windows so I 
know my USB firmware is good.
 
I thought that maybe I should open up unique handles to the usb 
device in both the parent and child process instead.  But when I 
do this the child gets 'Device or resource busy' when it trys to 
do the bulk write.  The parent process is having no problems with 
the bulk reads and is likely to have a bulk read pending timeout 
when this occurs.

Incidentally, the bulk read/write functions in libusb use 
ioctl(fd, IOCTL_USB_BULK, &bulk) where bulk is of type 'struct 
usb_bulktransfer' just in case you are not familiar.  usblib 
appears to open the handle using open(filename, O_RDWR). 

I would appreciate any insight on what I might be doing wrong.  I 
haven't been able to find any useful examples of how to use the 
USB filesystem properly.  The test code that comes with libusb 
doesn't show how to do transfers of any kind.  USB robot is not 
helpful either.

Where can I find the source for the Linux USB filesystem?
 
I also notice that when the bulk read fails because of a timeout 
the hard drive is getting written to.  I notice this every 3 
sec's and wonder why there is any drive activity when this happens.
 
Is there a way to put a larger value into the timeout and cause 
the ioctl() to terminate before the timeout when I want to exit 
the program or do I just have to live with waiting for the timeout?
 
Thanks,
Andrew



-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology! 
Open Source & Linux Developers, register now for the AMD Developer 
Symposium. Code: EX8664 http://www.developwithamd.com/developerlab
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to