[sane-devel] USB speed
pierre at pirsoft.dnsalias.org
Sat May 6 16:50:46 UTC 2006
i am trying to make the scanning speed of my scanner depend on the usb
speed available. I first attempted to use the detection from the cs3200f
backend, but found that it only detects if the device is high speed
capable, not if it is currently communicating with high speed.
On further investigation i found that there are two ways to determine
the used speed on linux:
* The first one involves an ioctl, which needs an file descriptor of the
device. I cannot see any way to get the fd from libusb.
* The second one is looking at /proc/bus/usb/devices, parsing the
T-lines. This only needs the device number and the bus number, which can
be obtained from libusb.
The attached patch adds a function to sanei_usb which adds a function
determining the usb speed. Currently, it only reports speeds when using
libusb on Linux. I tested this on Linux 2.6.16.
Any objections to this approach?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4686 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20060506/7705d805/usb-speed.bin
More information about the sane-devel