FreeBSD Bugzilla – Attachment 206624 Details for
Bug 239916
Add detach_kernel_driver to usbconfig(8)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Add-detach_kernel_driver-to-usbconfig-8.patch (text/plain), 2.71 KB, created by
Kevin Zheng
on 2019-08-16 19:28:42 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kevin Zheng
Created:
2019-08-16 19:28:42 UTC
Size:
2.71 KB
patch
obsolete
>From a63660b735fcee6df0471c583570f506191a8531 Mon Sep 17 00:00:00 2001 >From: Kevin Zheng <kevinz5000@gmail.com> >Date: Fri, 16 Aug 2019 12:26:33 -0700 >Subject: [PATCH] Add detach_kernel_driver to usbconfig(8) > >--- > usr.sbin/usbconfig/usbconfig.8 | 2 ++ > usr.sbin/usbconfig/usbconfig.c | 16 ++++++++++++++++ > 2 files changed, 18 insertions(+) > >diff --git a/usr.sbin/usbconfig/usbconfig.8 b/usr.sbin/usbconfig/usbconfig.8 >index e6cefc38ccf..e02ddf2c2c9 100644 >--- a/usr.sbin/usbconfig/usbconfig.8 >+++ b/usr.sbin/usbconfig/usbconfig.8 >@@ -119,6 +119,8 @@ Display the list of interface drivers (such as > or > .Xr u3g 4 ) > currently attached to the device. >+.It Cm detach_kernel_driver >+Try to detach the kernel driver for the given interface > .It Cm suspend > Force the device to suspend. > .It Cm resume >diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c >index 2fd45c50086..3d9cc219991 100644 >--- a/usr.sbin/usbconfig/usbconfig.c >+++ b/usr.sbin/usbconfig/usbconfig.c >@@ -89,6 +89,7 @@ struct options { > uint8_t got_add_quirk:1; > uint8_t got_dump_string:1; > uint8_t got_do_request:1; >+ uint8_t got_detach_kernel_driver:1; > }; > > struct token { >@@ -111,6 +112,7 @@ enum { > T_ADD_QUIRK, > T_REMOVE_QUIRK, > T_SHOW_IFACE_DRIVER, >+ T_DETACH_KERNEL_DRIVER, > T_DUMP_QUIRK_NAMES, > T_DUMP_DEVICE_QUIRKS, > T_DUMP_ALL_DESC, >@@ -144,6 +146,7 @@ static const struct token token[] = { > {"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, > {"add_quirk", T_ADD_QUIRK, 1}, > {"remove_quirk", T_REMOVE_QUIRK, 1}, >+ {"detach_kernel_driver", T_DETACH_KERNEL_DRIVER, 0}, > {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, > {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, > {"dump_all_desc", T_DUMP_ALL_DESC, 0}, >@@ -284,6 +287,7 @@ usage(void) > " remove_dev_quirk_vplh <vid> <pid> <lo_rev> <hi_rev> <quirk>" "\n" > " add_quirk <quirk>" "\n" > " remove_quirk <quirk>" "\n" >+ " detach_kernel_driver" "\n" > " dump_quirk_names" "\n" > " dump_device_quirks" "\n" > " dump_all_desc" "\n" >@@ -492,6 +496,11 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) > err(1, "could not set power ON"); > } > } >+ if (opt->got_detach_kernel_driver) { >+ if (libusb20_dev_detach_kernel_driver(pdev, opt->iface)) { >+ err(1, "could not detach kernel driver"); >+ } >+ } > dump_any = > (opt->got_dump_all_desc || > opt->got_dump_device_desc || >@@ -611,6 +620,13 @@ main(int argc, char **argv) > opt->got_any++; > break; > >+ case T_DETACH_KERNEL_DRIVER: >+ if (opt->got_detach_kernel_driver) >+ duplicate_option(argv[n]); >+ opt->got_detach_kernel_driver = 1; >+ opt->got_any++; >+ break; >+ > case T_DUMP_QUIRK_NAMES: > if (opt->got_dump_quirk_names) > duplicate_option(argv[n]); >-- >2.22.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239916
: 206624