diff options
author | Daniel Drake <dsd@gentoo.org> | 2008-05-05 16:22:33 +0100 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2008-05-05 16:45:11 +0100 |
commit | a304eca71f22c6df7d70a901483b30f1b8e93378 (patch) | |
tree | 1ca25c3ec1db242980523f3ef47cc6dcf9f166c1 /libusb/sync.c | |
parent | 7da521954ba661d3f537440c31a84b66e974d56b (diff) | |
download | libusb-a304eca71f22c6df7d70a901483b30f1b8e93378.tar.gz |
Detect endpoint halts and unsupported control requests
Diffstat (limited to 'libusb/sync.c')
-rw-r--r-- | libusb/sync.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libusb/sync.c b/libusb/sync.c index 77d01db..6f1f07b 100644 --- a/libusb/sync.c +++ b/libusb/sync.c @@ -60,6 +60,8 @@ static void ctrl_transfer_cb(struct libusb_transfer *transfer) * value 0. * \returns 0 on success * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out + * \returns LIBUSB_ERROR_PIPE if the control request was not supported by the + * device * \returns another LIBUSB_ERROR code on other failures */ API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle, @@ -116,6 +118,9 @@ API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle, case LIBUSB_TRANSFER_TIMED_OUT: r = LIBUSB_ERROR_TIMEOUT; break; + case LIBUSB_TRANSFER_STALL: + r = LIBUSB_ERROR_PIPE; + break; default: usbi_warn("unrecognised status code %d", transfer->status); r = LIBUSB_ERROR_OTHER; @@ -174,6 +179,9 @@ static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, case LIBUSB_TRANSFER_TIMED_OUT: r = LIBUSB_ERROR_TIMEOUT; break; + case LIBUSB_TRANSFER_STALL: + r = LIBUSB_ERROR_PIPE; + break; default: usbi_warn("unrecognised status code %d", transfer->status); r = LIBUSB_ERROR_OTHER; @@ -217,6 +225,7 @@ static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, * \returns 0 on success (and populates <tt>transferred</tt>) * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates * <tt>transferred</tt>) + * \returns LIBUSB_ERROR_PIPE if the endpoint halted * \returns another LIBUSB_ERROR code on other failures */ API_EXPORTED int libusb_bulk_transfer(struct libusb_device_handle *dev_handle, @@ -262,6 +271,7 @@ API_EXPORTED int libusb_bulk_transfer(struct libusb_device_handle *dev_handle, * * \returns 0 on success (and populates <tt>transferred</tt>) * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out + * \returns LIBUSB_ERROR_PIPE if the endpoint halted * \returns another LIBUSB_ERROR code on other error */ API_EXPORTED int libusb_interrupt_transfer( |