Age | Commit message (Collapse) | Author |
|
|
|
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update external/libusb
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I7d00a9849a85bffe05ae89030db1c59424059fea
|
|
Except for the Windows, Emscripten, and Haiku backends we use C-style
comments markers and not double-slash. Get rid of a few inconsistent
// instances.
Note the doxygen code examples have // comments because they are inside
proper /* */ comments.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Ideally it should be a warning only for composite devices but it is
difficult to discern that case. The message is too invasive and
confusing for the non-composite case, so make it debug instead.
Follow-up of commit f9ae36b
Closes #1394
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
- Fix typos.
- Use SuperSpeedPlus naming consistently.
- Remove C++ style comment in favor of C style.
Fixup of commit f00f06e9
References #1499
Closes #1502
|
|
The "Binary device Object Store" (BOS) descriptor was introduced with
bcdUSB revision 0x0201.
References #1492
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
The type mismatch was caught by building with -Wconversion.
References #1497
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
The second argument to open() is an int carrying flags (including
"access modes"). A third, optional argument has type mode_t, carrying
"file mode bits" for file permissions.
Also rename the variable to access_mode to make it more clear.
The type mismatch was caught by building with -Wconversion.
References #1497
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Fixup of commit f00f06e9
Closes #1499
|
|
|
|
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update external/libusb
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I52801e891e1a773c5963d80eeda6673f144557e6
|
|
Previously when getting the device list, a malformed device GUID would
be explicitly ignored and skipped, allowing the operation to complete. A
recent change to winusb_get_device_list() in commit fdab67b accidentally
changed this behaviour, so this scenario instead caused an early exit
with error code LIBUSB_ERROR_NO_MEM.
Closes #1475
|
|
Implement detection on darwin and linux_usbfs, and report it in xusb.
Closes #1477
|
|
See specs in USB 3.1 specs in section:
9.6.2.5 SuperSpeedPlus USB Device Capability
Closes #1428
Fixes #1429
|
|
No real change.
- rearrange elements to be initialized in the same order as they appear
in the struct declaration
- explicitly set values to NULL so that global searches for things like
`wrap_sys_device` easily reveal that the function is NULL on Darwin
Closes #1439
|
|
This function has different implementations on every OS, but for some,
like macOS, it was truncating from 64 to 32 bit by casting to int. So
increase its size from int to long.
(The function is currently only used for debug output.)
Closes #1423
|
|
Fixes #1387
Closes #1482
|
|
The clang static analyzer doesn't see that the pointer will always be
non-NULL if the return value is success. Just assert this fact so that
it can see this, and then it won't warn:
Access to field 'can_enumerate' results in a dereference of a null
pointer (loaded from variable 'cached_device')
References #1414
|
|
Reformulate the loop in a way that the variable is read.
References #1414
|
|
These don't generate any warnings anymore (with Xcode 15).
References #1414
|
|
Found thanks to a warning about implicit sign conversion.
The return value is the new reference count, not an IOReturn error code.
I'm not sure if this is copy paste, and the new ref count is
unimportant, so I just preserved the existing behaviour (but adjusted
the log message). The change only impacts debug logs anyway.
References #1414
|
|
- Sometimes just change a type to match where it's coming from
- Sometimes add an explicit cast (but only if it's guaranteed correct,
like a previous check that a signed value is positive before casting to
unsigned)
- For libusb_bulk_transfer() add an assert to be certain that the signed
return value is never negative.
Update API documentation to underline this fact.
Add similar assert in usbi_handle_transfer_completion().
- darwin: For parsing OS version, change scanf to use %u instead of %i
- xusb: Add additional range checks before casting
- xusb: Reverse some backwards count and size arguments to calloc, not
that it really matters
Closes #1414
|
|
References #1414
|
|
This is a common capability, not per backend.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
This prevents concurrent access to the list by the event background
thread, which could still be processing a previous hotplug event and
having to modify the list.
Fixes #1366
Fixes #1445
Closes #1452
References #1406
|
|
|
|
Test: NA
Bug: NA
Change-Id: Idb99926a50e262a6cfdf19637827ff17f81b8ef5
|
|
Remove all parents with a single child remaining in parent tree.
This ensures that no parents of the direct parent of the device being
considered are left in the list, when appearing before their child(ren)
in the processing order of the context device list cleaning.
References #1452
References #1406
|
|
All checks are enabled except for those that cause any warning.
This is a starting point, some of the currently-suppressed warnings can
be fixed hereafter.
Closes #1434
|
|
Fixup of commit 66e63d6
Fixes #1465
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libusb/+/2954501
Change-Id: I2b079c8109b34320d54c36a52f2eef69359455da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
|
|
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update libusb
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Test: TreeHugger
Change-Id: Ifb65673bd9d1a8653475e1396110447114685d4a
|
|
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Programs using the previous version may use the new version as drop-in
replacement, but programs using the new version may use APIs not present
in the previous one.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
References #1425
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
umockdev relies on the per-context log callbacks to do its checks
properly, and these are not called if ENABLE_DEBUG_LOGGING is defined
(configure --enable-debug-log).
Fixes #1449
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
When setting LIBUSB_OPTION_LOG_CB before the first libusb_init(),
the global callback is set.
However, after the first libusb_init() there is a default context, and
setting LIBUSB_OPTION_LOG_CB would only set this default context, and
not the global callback. There would be no way to set the global
callback through libusb_set_option().
Change this so that the global log callback is set in addition to the
default context (when libusb_set_option is called with NULL context).
Closes #1397
|
|
But set it only on option LIBUSB_OPTION_LOG_CB.
Otherwise the following second call resets the callback to the
default one:
libusb_set_option(NULL, LIBUSB_OPTION_LOG_CB, cb_func);
libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_DEBUG);
References #1397
|
|
- Replace some uses of the soft-deprecated libusb_init() and
libusb_set_debug() with their updates.
- Updated various comments to favour use of the new functions.
- Notably remove \deprecated doxygen statement, since it causes
-Wdocumentation compiler warnings.
- Notably update the xusb example to pass debug options to
libusb_init_context() instead of setting environment variable.
- Also improve comments related to LIBUSB_API_VERSION and
LIBUSBX_API_VERSION.
Closes #1408
[Tormod: Fix Doxygen formatting and references]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
They aren't included in any target, so they are never compiled.
But having them in the project allows doing global searches that also
look in these files.
Closes #1421
|
|
project.pbxproj is not so human-readable, and xcconfig files are
preferable because you can add comments about the build settings.
References #1421
|
|
In one case, renamed a variable from `larg` which codespell thought was
a typo for `large`.
Closes #1411
|
|
Also zero-initialize locationID since otherwise it could be used
uninitialized.
Also change the return variable to bool, matching what the function
actually returns.
Fortunately, this only affected log messages.
Closes #1412
[Tormod: Use PRIx32 for printing the 32-bit locationID]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
The libusb.info website, like most sites these days, auto-redirects to
the https version anyway.
Also replaced a couple of other http links to https, after verifying
that they autoredirect to https.
Note this changes the "describe" field in the version info returned by
libusb_get_version(). This field is only there for ABI compatibility and
contains the website URL.
Closes #1407
|
|
Closes #1410
|
|
In 2013, commit 858b794c added a comment saying "This function gets
called with the flying_transfers_lock locked".
That appears to have changed with 138b661f. Commit 88778414 improved
some stale comments, but missed these.
It is clear in the code that the comment is no longer true. The function
is *not* called with flying_transfers_lock locked, but it does lock
itransfer->lock.
References #1410
|
|
This is now symmetric with add_to_flying_list(), which was already
requiring that *callers* lock flying_transfers_lock. Updated the only
2 callers.
This also makes the code correspond better to the big comment about
locking made in 138b661f.
Also documented at the top of several functions when they require that
flying_transfers_lock already be held. Verified by code review that it's
actually the case.
This should not change any behaviour at all.
References #1410
|