49 Commits

Author SHA1 Message Date
Anil Nair
5ffcedfbca Updated TODO link
Closes #198

Signed-off-by: Nathan Hjelm <hjelmn@me.com>
2016-07-24 20:02:31 -06:00
hjelmn@cs.unm.edu
1eff220474 Misc: Revert all references to libusb/libusb.info 2014-01-08 23:51:01 +00:00
Pete Batard
7430e7dd33 Misc: Update copyrights, TODO and libusb_version.describe
* Changes suggested by Chuck Cook & Xiaofan Chen
2012-09-18 21:35:23 +01:00
Daniel Drake
fbad9a5426 Linux: Compatibility with new sysfs descriptors file
As of 2.6.26, the descriptors file now includes all descriptors, not
just the active one.
2008-06-28 21:18:41 -05:00
Daniel Drake
1df713d622 Introduce contexts to the API
Suggested by David Zeuthen. This allows multiple libraries in the same
process to independently use libusb without interfering.
2008-06-26 22:42:59 -05:00
Daniel Drake
d5f82893fa Overflow handling 2008-06-20 23:05:09 -05:00
Daniel Drake
e7a7a49d03 docs update
Add a THANKS file, make copyright notices easily accessible, update TODO
2008-06-15 15:30:02 -05:00
Daniel Drake
7c525480ab Implement serialization of event handlers
Now offers a mechanism to wait for events while another thread is
doing the event handling. Complicates things for MT async apps, but
then again it's a bit of a tricky combination to start with.
2008-05-25 22:51:34 +01:00
Daniel Drake
eb25630f52 More informative libusb_open() return code
Hopefully one of the last API tweaks...
2008-05-16 23:50:20 +01:00
Daniel Drake
1298c51f51 Backend documentation for porting efforts
Hopefully comprehensive enough for people to get started.
2008-05-13 23:47:55 +01:00
Daniel Drake
fec7c84163 Handle hot-unplugging
This involved moving from select() to poll() because there is no way to
distinguish usbfs's POLLERR condition with select().
2008-05-11 20:47:27 +01:00
Daniel Drake
aeb905fa5d Documentation work 2008-05-11 16:10:45 +01:00
Daniel Drake
ba5d9a45c0 Endianness of control setup packets
Document behaviour where host-endian and bus-endian (little) should be
used respectively.

Also remove packed attribute from libusb_control_setup as all fields
are naturally aligned.
2008-05-11 15:39:41 +01:00
Daniel Drake
7bedc3b268 Document that releasing interface causes SET_INTERFACE control request 2008-05-11 15:11:59 +01:00
Daniel Drake
f2ede9876c Support unconfigured devices 2008-05-10 21:45:42 +01:00
Daniel Drake
8ebb4ccdfa Linux: fix caching of active configuration for non-sysfs 2008-05-10 20:56:44 +01:00
Daniel Drake
fe4adcc99e Rework configuration handling
libusb no longer caches descriptors in libusb_device but backends are
intended to be able to provide copies from memory. In the common linux
case we can use sysfs.
2008-05-09 19:33:33 +01:00
Daniel Drake
10d4e427cc Documentation work
Partially based on some libusb-devel discussions
2008-05-08 23:04:52 +01:00
Daniel Drake
885c2a5de6 documentation touchups 2008-05-05 21:36:59 +01:00
Daniel Drake
7da521954b Linux: fix logical URB allocation
We were allocating the wrong number of URBs for transfers of size
multiples of 16k.
2008-05-05 01:00:31 +01:00
Daniel Drake
5384bbf300 Linux: better EACCES handling 2008-05-03 14:34:54 +01:00
Daniel Drake
e2f822b4f1 Linux: use read-only access to enumerate devices and descriptors
Write access is not needed until later.
Also fix handling of open() error code.
2008-05-03 14:24:40 +01:00
Daniel Drake
e20f8281fb Allow multiple interfaces to be claimed 2008-05-02 17:33:52 +01:00
Daniel Drake
2012898ffc standardised error codes 2008-04-29 15:26:46 +01:00
Daniel Drake
e12618c79d add threaded example program 2008-04-19 16:24:21 +01:00
Daniel Drake
d2ff2b14a1 lock flying_transfers during transfer removal 2008-04-18 23:25:48 +01:00
Daniel Drake
ad6e2b712c Linux: fire multiple URBs at once for split transfers
This results in a significant performance increase for bulk transfers
larger than 16kb, and fixes a bug where data would be spliced and mixed
between two simultaneously submitted transfers to the same endpoint.

It also allows isochronous transfers larger than 16kb to be submitted.

This commit also improves cancellation - the library now understands
what is going on.
2008-04-11 21:42:29 +01:00
Daniel Drake
d9b2ce2894 Constify some return data
Make it clear that apps should not mess with these structures
2008-04-01 23:30:49 +01:00
Daniel Drake
8d809854e2 Rename libusb_poll() to libusb_handle_events() 2008-03-30 22:19:00 +01:00
Daniel Drake
211f80c9f2 Isochronous endpoint I/O
Due to variable-sized structures, this involved changing allocation
mechanism. All transfers must now be allocated and freed through
libusb.

A synchronous function is missing, and I could do with writing a few
more helper functions to simplify things.
2008-03-30 22:17:34 +01:00
Daniel Drake
0499e9f418 it's called bmRequestType 2008-03-20 21:19:48 +00:00
Daniel Drake
88884ae4bb Save transfer flags before invoking callback
The callback may free the transfer, in which case we can't read the flags
after it has returned.
2008-03-20 21:19:48 +00:00
Daniel Drake
ead09cde68 API documentation
Hopefully mostly complete. Some constants were renamed and move into
enums.
2008-03-20 21:19:45 +00:00
Daniel Drake
c0c9432d38 Beginnings of cross-platform abstraction
This also includes a libusb_get_pollfds API change
2008-03-13 12:46:08 +00:00
Daniel Drake
de4c5341d1 Add transfer flags 2008-03-10 18:38:15 +00:00
Daniel Drake
9e89d1aa82 Rename descriptor-getting functions
Based on feedback from Tim Roberts
2008-03-09 16:27:42 +00:00
Daniel Drake
ebad1c7968 Rename libusb_dev_handle to libusb_device_handle 2008-03-09 16:12:08 +00:00
Daniel Drake
66348c90ea Separate transfer allocation and submission
Leads to some hefty API changes. Now we're much more similar to the
Linux kernel model.

Problems with dealing with asynchronous control transfers are passed
on to the user, basically you must allocate a buffer, start with the
setup, and put the data after. This won't make much sense until
documented (soon...)
2008-03-09 00:58:09 +00:00
Daniel Drake
d21ebe47ce Rework URB API naming
Now refer to everything as "transfers" as consistent with the USB spec
libusb_transfer is now a kind of transfer handle. To reduce confusion
with libusb_bulk_transfer and libusb_control_transfer, those have been
renamed to libusb_{control,bulk}_transfer_request.
2008-03-08 12:58:32 +00:00
Daniel Drake
fd6fb3cc09 Add fallback on /proc/bus/usb
/dev/bus/usb is a relatively new thing probably not present on every
system
2008-03-08 12:58:32 +00:00
Daniel Drake
f3fdf44791 Persistent libusb_device storage
Devices are now assigned a session ID (currently busnum:devaddr) which
is used to distinguish unique devices.

Now multiple callers of libusb_get_device_list will get the same
libusb_device structure instances.
2008-03-08 12:58:29 +00:00
Daniel Drake
9cfdb494fc Rework device discovery API
libusb_find_devices and libusb_get_devices are no more

libusb_get_device_list obtains a list of libusb_device structures for all
known devices in the system.

Each libusb_device now has a reference count, defaulting to 1 on
instantiation. The reference count of 1 refers to the fact that it is
present in the list in this scenario.

Opening a device adds a pointer to the libusb_device structure in the
handle, so that also adds a reference. Closing the device removes that
reference.

The function to free the device list can optionally unref all the devices
inside.

In future we will make the libusb_device instances all "global" so that if
the app calls get_device_list twice it actually gets the same libusb_device
structure references back. This way we can start to track disconnects, and
we can investigate adding a unique "session ID" to each libusb_device, an
identifier guaranteed to be unique to that device until reboot.
2008-03-06 23:25:20 +00:00
Daniel Drake
b873521a6f Notifications for changes to the fd set
Applications can now be notified when they should start and stop polling
new file descriptors.
2008-02-26 22:39:28 +00:00
Daniel Drake
e583100a40 TODO update 2008-01-30 13:24:54 +00:00
Daniel Drake
637a8d7ff8 Remove timers and signalfd
Instead of timers, add a mechanism for informing the parent app when the
next timeout is due to happen, so that it can call us at that time.

As we no longer use signals, signalfd has also been removed.
2008-01-30 13:19:10 +00:00
Daniel Drake
8c56abe2e1 Poll usbfs descriptors directly
We don't need to use signalfd for this functionality because we can poll
the file descriptors for write events.
2008-01-26 18:19:04 +00:00
Daniel Drake
dcd5e0075f TODO update
Start listing the things I want to discuss/reconsider before 1.0 API
is final.
2008-01-04 01:20:29 +00:00
Daniel Drake
a8d2881eb7 Add functionality to access device descriptors 2007-12-03 23:29:22 +00:00
Daniel Drake
852bba4754 Initial commit
Basic library structure which supports enumerating detected USB devices
2007-12-02 22:54:59 +00:00