Age | Commit message (Collapse) | Author | Files | Lines |
|
* libusb has been added to Coverity at https://scan.coverity.com/projects/2180
* Use "// coverity[keyword]" to silence the issues we don't care about
* All other issues from the Windows build have been fixed, apart from the closing of the DLLs.
|
|
This implementation makes use of the IOKitWaitQuiet which waits until
all IOKit processing is complete. The performance won't necessarily be
great but it should help codes that have not yet or cannot move to the
libusb hotplug API.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
* void function call was returning a value
* introduced in 6d8dfe0aee41a3c7dd862c3de488df3ce452d86e
* also fix whitespaces
|
|
The backend was incorrectly calculating the addresses of endpoints
with directions other than kUSBIn and kUSBOut. This primarily affects
devices with multiple control endpoints. This commit should correct
the issue by only setting the direction bit when the direction is
kUSBIn.
Thanks to Jean-Etienne for identifying the issue.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
Clean up some code in the darwin backend.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
This commit adds support for bulk streams to the darwin backend. I
have not had a chance to fully test this code as I have no access
to any devices that use this interface.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
In the Xcode project, set:
LD_DYLIB_INSTALL_NAME = @rpath
Such that the built dylib's install name uses rpath, which is
generally what one wants.
|
|
The parameters already match the function declaration; no need to cast.
|
|
Being able to allocate bulk-streams is not really useful if the user cannot
specify the stream ids when submitting transfers.
The actual stream id gets added to our private itransfer struct, and a setter +
getter are added to get to it. Unfortunately this is the only way to add
support for stream ids without breaking ABI. So this is another item to fix
when we do break ABI in libusb-2.0.
Bulk streams also use a separate transer type, to allow backends to determine
if a transfer is a bulk stream transfer or an ordinary bulk transfer. This is
added because there is no other reliable way to determine if a transfer is
a stream as the stream_id is part of the private itransfer struct so apps
re-using a transfer may not set it to 0. Adding a separate transfer-type
for this was suggested (and coded) by Nathan Hjelm.
Most users will likely use the new libusb_fill_bulk_stream_transfer()
though, and will never know the difference.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
DEVNUM but do have a DEVICE parameter.
These netlink events are now parsed:
>>>>>>>>>>>>>>>>>
add@/devices/platform/brcm-ohci-0.0/usb3/3-2/3-2:1.0
ACTION=add
DEVPATH=/devices/platform/brcm-ohci-0.0/usb3/3-2/3-2:1.0
SUBSYSTEM=usb
SEQNUM=290
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/003/003
PRODUCT=45e/28e/114
TYPE=255/255/255
INTERFACE=255/93/1
<<<<<<<<<<<<<<<<<
Also added a retry when opening the device file to work around a race condition with the kernel
|
|
* Closes #3
|
|
|
|
|
|
|
|
|
|
I also updated the documentation on the backend get_config_descriptor
function. The documentation incorrectly stated that this function returns
0 on success when it really returns the length of the descriptor.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
* Make it the same as the one used on the website and elsewhere
|
|
Using an atexit function to cleanup the state could cause weird interactions
with other atexit functions. Ensure the darwin cleanup function is called
last by making it a destructor function instead.
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
* The driver has to be updated to version 1.0.0.66 (2011-10-25) or later
* Older versions can fail with the following warning:
could not get node connection information for device [..]: [87] The parameter is incorrect.
* Also Remove duplicated "API" string in debug output
* Closes #1
|
|
* add a missing call to libusb_handle_events_completed()
* add a missing argument to libusb_hotplug_deregister_callback()
|
|
* Has VID:PID 8086:1111
|
|
|
|
|
|
|
|
|
|
|
|
* Some MinGW platforms may not have FACILITY_SETUPAPI defined
* Issue introduced with 8b46e1c088167eb86b1712765896e2f17d70d148
|
|
* The sessionID value is 64-bit, so print it as such.
* Closes #153
|
|
* GetPipeProperties() may fail when the device is unplugged if DeviceVersion is not greater than 320.
* In this case maxPacketSize will be zero and the integer division will throw a EXC_ARITHMETIC signal.
* Closes #136
|
|
* Closes #117
|
|
* http://msdn.microsoft.com/en-us/library/windows/hardware/ff545011.aspx
states that SetupAPI errors must be be converted before passing it to FormatMessage().
* Use our own implementation of HRESULT_FROM_SETUPAPI to avoid defining a new function call.
* Issue and original fix suggested by Matthias Bolte
* Closes #166
|
|
* Closes #157
|
|
* Closes #154
|
|
* Don't limit support to ARM only (adds MIPS support)
* Also add a workaround for a MIPS NDK linker bug
* Also add a gitignore entry required to run bootstrap.sh on OS X
* Closes #134
|
|
* Also update gitignore
* Closes #162
|
|
libusbx/libusb/libusb.h:153: warning: no matching file member found for
libusb_cpu_to_le16()Possible candidates:
static uint16_t libusb_cpu_to_le16(const uint16_t x)
Thanks to Serhat Sevki Dincer for the bug report
http://sourceforge.net/mailarchive/message.php?msg_id=31719691
|
|
* Issue reported by Surmakyynis
* Closes #160
|
|
libusb_exit sets usbi_default_context to NULL, modify usbi_log_v so that
it still honors the LIBUSB_DEBUG environment variable in this case.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Closes #150
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Before this patch if ie multiple hot-plug events were pending, multiple
handle_events calls would be necessary to handle them all, this patch
changes handle_events so that the poll is re-done to check for more events
if there was activity on any of the special fds.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
* These controllers identify themselves as VUSB3HUB
* Closes #152
|
|
Problem detected by the Coverity tool
CID 1042546 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)3.
negative_returns: "initial_pos" is passed to a parameter that cannot be
negative.
fseek(3) can't be called with a negative offset with SEEK_SET
|
|
The default case in windows_transfer_callback() calls windows_error_str(0)
which will convert the error code returned by GetLastError() to a string.
This currently works because windows_transfer_callback() is either called
with io_result set to NO_ERROR or io_result set to GetLastError().
If windows_transfer_callback() will ever be called with io_result set
differently then the default case might report the wrong error message.
Call windows_error_str(io_result) instead to avoid this.
Closes #151
|
|
* Add option 'w' to force the use of a Device Request rather than an
Interface Request when querying the WCID OS Extended Properties descriptor.
* This is due to a WinUSB limitation where all Interface Requests have the
wIndex set to the interface number.
* This assumes that the WCID firmware answers both Device and Interface requests
equally.
|
|
ezusb.c: In function 'ezusb_load_ram':
ezusb.c:719:6: warning: 'ret' may be used uninitialized in this function
[-Wmaybe-uninitialized]
int ret;
|
|
If fdopen(3) fails then ctx->output_file is NULL and should not be used
in cleanup_test_output() called next.
Problem detected by the Coverity tool
CID 1042543 (#1 of 1): Dereference after null check (FORWARD_NULL)9.
var_deref_model: Passing "ctx" to function
"cleanup_test_output(libusbx_testlib_ctx *)", which dereferences null
"ctx->output_file".
|
|
Problem detected by the Coverity tool
CID 1042540 (#1 of 1): Unchecked return value (CHECKED_RETURN)1.
check_return: Calling function "libusb_bulk_transfer(struct
libusb_device_handle *, unsigned char, unsigned char *, int, int *,
unsigned int)" without checking return value (as is done elsewhere 4 out
of 5 times).
|
|
Problem detected by the Coverity tool
CID 1042539 (#1 of 1): Unchecked return value (CHECKED_RETURN)8.
check_return: Calling function "libusb_handle_events(libusb_context *)"
without checking return value (as is done elsewhere 6 out of 7 times).
|
|
Problem detected by the Coverity tool
CID 1042538 (#1 of 1): Unchecked return value (CHECKED_RETURN)4.
check_return: Calling function "libusb_init(libusb_context **)" without
checking return value (as is done elsewhere 11 out of 12 times).
|