Age | Commit message (Collapse) | Author | Files | Lines |
|
Before this patch we kept track of if we actually detached the kernel
driver, and would only then re-attach the kernel driver.
But if an app is using auto-redirection there is a chance that we
claim the interface before the kernel driver got a chance to attach, this
esp. happens when the module first needs to be loaded by udev. This scenario
would leave people with USB-devices without devices attached which is very
rarely what people want! So this patch changes our behavior to instead always
re-attach the kernel drivers on device cleanup.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
The direct trigger for making this change is the fact that the 0.4 release
is broken due to a return without a value in a non void function. Somehow
this happened to always do the right thing in my testing, but not for others.
This is something which should have been caught by a compiler warning, but
I always build from git, and then no -Wall (let alone -Werror) gets passed
to the compiler, which allowed this to slip through. So to avoid future
embarrassment this patch changes the configure script to add various
compiler options to CFLAGS by default, which should catch most detectable
mistakes.
Note that this change modifies CFLAGS directly, so if you're somehow specifying
your own CFLAGS nothing will change (this is intentional). Also all added flags
are checked, so if you've a compiler which is not gcc nothing will change.
This patch also fixes the few warnings actually present in the code, so as to
not have a state in the commit tree where the code does not compile.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Now that we only re-parse the interface and not the entire config when changing
the alt setting, we must first clear the ep-info of the endpoints currently
belonging to the interface as a different alt setting may have less endpoints!
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Also fix a nasty bug where we would try to cancel the head rather
then the first transfer in the list!
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
See the description of the new usbredirhost_set_device() function in
usbredirhost/usbredirhost.h
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Also remove the never implemented usbredirparser_get_peer_caps function
from the public header file.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Make this conditional on the same cap as device_reject, rename
the cap to usb_redir_cap_filter. Rename device_reject to filter_reject to
reflect that it is filtering related and that the the cap and packet names
are consistent with each other. Also cleanup some related comments / docs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
So that it can do some sanity checks on the data too.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Remove the wrong comment and move the free outside the locked part
of the function.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Before this patch the code would cancel the iso stream, but keep the transfers,
and then on a successfull clear of the stall re-submit the same transfers.
This means however that the transfers would get resubmitted before their
completion callback from the cancel got to run. And re-submitting an
uncompleted transfer will fail.
So instead cancel and free the stream (getting rid of the single user
of cancel_iso_stream which did not want it to also free the urbs) and
when the stall is successfully cleared, alloc a new stream and, if it is
an input stream, submit its transfers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
When an input interrupt urb failed with an error of LIBUSB_TRANSFER_NO_DEVICE,
we do not resubmit it (which is correct), but we did not set endpoint.interrupt
in_transfer to NULL either, so later on we would try to cancel the non
submitted urb.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Add an usb_redir_device_reject packet to allow notifying the usb-host when
an usb-guest rejects a device because of usb-guest side device filtering.
Also bump the version to 0.3.4 so that apps can check if libusbredirparser /
libusbredirhost knows about usb_redir_device_reject by checking the version
number.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Fix accidental mention of Library / Lesser in the disclaimer, these 2
test / example programs are meant to be under the GPL not the LGPL.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
When changing the active configuration we must first release all interfaces,
this is done by the usbredirhost_release() helper function, but before
this patch that function also re-attached the in kernel driver, making
the interfaces busy again and causing the set_config call to fail.
This patch fixes this by not doing the kernel driver re-attach when
releasing the interfaces for a set_config call.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
This change allows the data from an usb_redir_interface_info_header
struct to be directly passed to usbredirfilter_check().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Add usbredirfilter code, to help apps exclude certain devices from
redirection. See the new usbredirfilter.h for details.
This commit also bumps the reported version to 0.3.3, so that apps using
libusbredirparser can check for this version to check the presence of the
new usbredirfilter functions.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
-Distribute the protocol doc and README.multi-thread
-Don't distribute the .pc files, they are generated by configure
-Update the TODO file
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
This will get called after receiving the hello packet from the other side.
This can be used to determine when the caps from the other side have been
received and it thus is safe to call usbredirparser_send_device_connect.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
This new field is only send / received if both sides have the (new)
usb_redir_cap_connect_device_version capability.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
If our buffer gets completely drained, wait for it to refill before
submitting more packets. If our buffers overflows, drop not just the package
causing the overflow, but drop half the buffer size packets, so that it
should be at its target size of being half-filled again.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
If a control packet is a clear stall, we need to do an actual clear stall,
rather then just forward the control packet, so that the usbhost usbstack
knows the stall is cleared.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
@libdir@ is expanded to ${exec_prefix}/lib on my machine so we
need exec_prefix to be defined in the .pc file.
Thanks to Marc-André Lureau for reporting this.
|
|
Oops.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Having separate set_locking_funcs functions causes the locking functions
to be available potentially too late. And it just is not very pretty.
This commit changes the API (in a way which is backward compat with 0.3.1), so
that locking functions can be specified at creation time, just like all the
other callbacks.
This commit also bumps the reported version to 0.3.2, so that apps using
libusbredirhost can check for this version to check the presence of the new
usbredirhost_open_full function.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
0.3.1 was released a while ago, and some post release changes were
added to the ChangeLog entries for 0.3.1, oops.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Replace the current build system with an autotools based one.
HdG, 3 small changes:
1) LIBUSBREDIRPARSER_SO_VERSION 1:0:0 should be 0:0:0, so that the soname
does not change by going from Makefiles to autofoo
2) Drop LIBGPOD_SO_VERSION from configure.ac
3) Make libusb pkgconfig check require version >= 1.0.9
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
usbredirhost_cancel_iso_stream should call
usbredirhost_cancel_iso_stream_unlocked instead of calling itself. This fixes
usbredirhost_cancel_iso_stream going into an endless recursion loop.
Thanks to coolper chen <lixin.chen@saicocch.com> for reporting this!
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|