| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The end year is legally and functionally redundant, and more importantly
causes cherry-pick conflicts when trying to maintain old branches.
|
|
|
|
| |
The primary purpose for this is to test the hotplug codepaths.
|
|
|
|
|
| |
Also, reduce the number of idle sources by batching them up as much as
possible.
|
| |
|
| |
|
|
|
|
| |
Somehow this worked when we unref'd the context but did not ref it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On FreeBSD, symbols 'environ' and ' __progname' are defined in crt1.o
and referenced by libc.so. This makes it different from platforms which
define 'environ' in libc.so. GNU BFD linker fails to link an executable
if these two symbols are not put into the global section of the version
script because a shared library should not reference a local symbol
defined in a different object file. GNU gold and LLVM LLD don't have
the problem.
This means the current check for --version-script fails on FreeBSD when
GNU BFD linker is used. The failure can be avoided by linking a shared
library instead of an executable, but meson doesn't support passing
additional arguments to the compiler in its 'has_link_argument' method.
Instead of adding these two unused symbols to the real version script,
use a smaller version script specifically made for the test.
|
|
|
|
|
| |
Instead of keeping a list of OS in the build file, it should be better
to run a check to determine if it is supported by the linker.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Initial device enumeration may happen in a random order. This causes
issues if someone calls g_usb_device_get_parent from the "device-added"
signal handler. The problem is. that this will cause an infinite
recursion as GUsb tries to enumerate again, which results in the device
to be added. Also, the order of devices is random and resolving the
parent requires the full list of devices. As such, we should delay
emission until the internal array has been filled.
To fix this, emit the signals from g_usb_context_enumerate.
Also, while changing this, it became obvious that libusb hotplug callback
is updating priv->devices from the libusb thread, only pushing it to an
idle handler when the signal is emitted. Doing this is unsafe if hotplug
events arrive during enumeration. Push libusb event into the mainloop
immediately in order to process it.
Doing means that any libusb hotplug events arriving during
g_usb_context_enumerate will be handled after the function has returned.
Making all possible corner cases behave correctly.
|
|
|
|
|
|
|
| |
Some devices won't answer to a request with a 128-byte data buffer, this
allows the user to specify the size of the request data
buffer. g_usb_device_get_string_descriptor_bytes still uses the default
buffer size (128 bytes).
|
|
|
|
|
|
|
| |
Fixes:
DEPRECATION: Library was passed to the libraries keyword argument of a
previous call to generate() method instead of first positional argument.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
FreeBSD is not a supported platform of libusb. The native USB access library
on FreeBSD is libusb20, which provides both the non-portable FreeBSD-specific
API and wrapper functions that are mostly compatible eith libusb 1.0 API.
It is an integral part of FreeBSD and the version included in the oldest
supported FreeBSD release reports 1.0.9 in its libusb-1.0.pc.
Based on a patch by Ting-Wei Lan <lantw@src.gnome.org>, many thanks.
|
|
|
|
|
|
| |
Root hubs on FreeBSD have vid and pid set to zero.
Based on a patch by Ting-Wei Lan <lantw@src.gnome.org>
|
|
|
|
|
|
|
|
|
| |
We used to reference a device during the initable init vfunc, however
it's better to do it when the device is actually set as an object
property.
In this way, the device is always unreffed when the object is disposed,
without having to care about the ordering.
|
|
|
|
|
|
|
|
|
|
|
| |
Currently gusb-device adds two references to an internal libusb device,
causing a memory leak on destruction.
In fact, we add a reference when the device is constructed and when the
device is inited.
To avoid this and ensure that libusb will cleanup all the devices on
context destruction, only reference on device initialization.
|
|
|
|
| |
This is requried for the GD32VF103 device.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
libusb can only handle cancellation if the transfer is already
in-flight. However, g_cancellable_connect will immediately call the
callback and then libusb_cancel_transfer when the cancellable is already
cancelled at the time the transfer is submitted.
Move the cancellation registration to after transfer submission to avoid
ordering issues. Also avoid even submitting the transfer if the
cancellable is already cancelled to begin with.
|
| |
|
| |
|
|
|
|
|
| |
Adds a getter for a gusb_device to get the string index for the active
configuration's description.
|
|
|
|
| |
Fixes https://github.com/fwupd/fwupd/issues/2178
|
|
|
|
|
|
| |
Python can be installed in different directories on different operating
systems, so we can't hard-code the path of it. Instead, use meson to
find it to avoid 'no such file or directory' error on the bad path.
|
|
|
|
| |
Fixes: #34
|
|
|
|
|
|
|
| |
This resulted in losing g_usb_source_set_callback@LIBGUSB_0.1.0 from
the ABI in version 0.3.4.
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
|
|
|
| |
This is the same script used by fwupd, and would have caught both recent issues
with the exported symbol versions being incorrect.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The existing logic here was unsound; the recursion only checked the string for
length 0 after it had gone up the tree to the parent, and so would never match.
This meant if you had identical devices with the same port hierarchy on
different USB busses they had the *same* physical ID. This really upsets
projects like fwupd which use the physical ID to stay the same on device replug
(which worked fine), but also dedupe devices with the same physical ID, which
is what broke here.
|
|
|
|
| |
Fixes the last point in https://github.com/hughsie/libgusb/issues/27
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
We depend on a libusb to always define this.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In 985b9e4ec39ac521e7398a8e3017c96f2c4d75ec I mistakenly thought this was the
timeout for the added/removed context checking, which was Windows-specific.
It actually was the main context event thread, which is running all the time.
Switch the poll timeout to be 2s, (still down from the default 60s!) which is a
better compromise between battery life and context shutdown performance.
Fixes https://github.com/hughsie/libgusb/issues/24
|
|
|
|
| |
Fixes https://github.com/hughsie/libgusb/issues/11
|