|
Lines 89-94
struct options {
Link Here
|
| 89 |
uint8_t got_add_quirk:1; |
89 |
uint8_t got_add_quirk:1; |
| 90 |
uint8_t got_dump_string:1; |
90 |
uint8_t got_dump_string:1; |
| 91 |
uint8_t got_do_request:1; |
91 |
uint8_t got_do_request:1; |
|
|
92 |
uint8_t got_detach_kernel_driver:1; |
| 92 |
}; |
93 |
}; |
| 93 |
|
94 |
|
| 94 |
struct token { |
95 |
struct token { |
|
Lines 111-116
enum {
Link Here
|
| 111 |
T_ADD_QUIRK, |
112 |
T_ADD_QUIRK, |
| 112 |
T_REMOVE_QUIRK, |
113 |
T_REMOVE_QUIRK, |
| 113 |
T_SHOW_IFACE_DRIVER, |
114 |
T_SHOW_IFACE_DRIVER, |
|
|
115 |
T_DETACH_KERNEL_DRIVER, |
| 114 |
T_DUMP_QUIRK_NAMES, |
116 |
T_DUMP_QUIRK_NAMES, |
| 115 |
T_DUMP_DEVICE_QUIRKS, |
117 |
T_DUMP_DEVICE_QUIRKS, |
| 116 |
T_DUMP_ALL_DESC, |
118 |
T_DUMP_ALL_DESC, |
|
Lines 144-149
static const struct token token[] = {
Link Here
|
| 144 |
{"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, |
146 |
{"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, |
| 145 |
{"add_quirk", T_ADD_QUIRK, 1}, |
147 |
{"add_quirk", T_ADD_QUIRK, 1}, |
| 146 |
{"remove_quirk", T_REMOVE_QUIRK, 1}, |
148 |
{"remove_quirk", T_REMOVE_QUIRK, 1}, |
|
|
149 |
{"detach_kernel_driver", T_DETACH_KERNEL_DRIVER, 0}, |
| 147 |
{"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, |
150 |
{"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, |
| 148 |
{"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, |
151 |
{"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, |
| 149 |
{"dump_all_desc", T_DUMP_ALL_DESC, 0}, |
152 |
{"dump_all_desc", T_DUMP_ALL_DESC, 0}, |
|
Lines 284-289
usage(void)
Link Here
|
| 284 |
" remove_dev_quirk_vplh <vid> <pid> <lo_rev> <hi_rev> <quirk>" "\n" |
287 |
" remove_dev_quirk_vplh <vid> <pid> <lo_rev> <hi_rev> <quirk>" "\n" |
| 285 |
" add_quirk <quirk>" "\n" |
288 |
" add_quirk <quirk>" "\n" |
| 286 |
" remove_quirk <quirk>" "\n" |
289 |
" remove_quirk <quirk>" "\n" |
|
|
290 |
" detach_kernel_driver" "\n" |
| 287 |
" dump_quirk_names" "\n" |
291 |
" dump_quirk_names" "\n" |
| 288 |
" dump_device_quirks" "\n" |
292 |
" dump_device_quirks" "\n" |
| 289 |
" dump_all_desc" "\n" |
293 |
" dump_all_desc" "\n" |
|
Lines 492-497
flush_command(struct libusb20_backend *pbe, struct options *opt)
Link Here
|
| 492 |
err(1, "could not set power ON"); |
496 |
err(1, "could not set power ON"); |
| 493 |
} |
497 |
} |
| 494 |
} |
498 |
} |
|
|
499 |
if (opt->got_detach_kernel_driver) { |
| 500 |
if (libusb20_dev_detach_kernel_driver(pdev, opt->iface)) { |
| 501 |
err(1, "could not detach kernel driver"); |
| 502 |
} |
| 503 |
} |
| 495 |
dump_any = |
504 |
dump_any = |
| 496 |
(opt->got_dump_all_desc || |
505 |
(opt->got_dump_all_desc || |
| 497 |
opt->got_dump_device_desc || |
506 |
opt->got_dump_device_desc || |
|
Lines 611-616
main(int argc, char **argv)
Link Here
|
| 611 |
opt->got_any++; |
620 |
opt->got_any++; |
| 612 |
break; |
621 |
break; |
| 613 |
|
622 |
|
|
|
623 |
case T_DETACH_KERNEL_DRIVER: |
| 624 |
if (opt->got_detach_kernel_driver) |
| 625 |
duplicate_option(argv[n]); |
| 626 |
opt->got_detach_kernel_driver = 1; |
| 627 |
opt->got_any++; |
| 628 |
break; |
| 629 |
|
| 614 |
case T_DUMP_QUIRK_NAMES: |
630 |
case T_DUMP_QUIRK_NAMES: |
| 615 |
if (opt->got_dump_quirk_names) |
631 |
if (opt->got_dump_quirk_names) |
| 616 |
duplicate_option(argv[n]); |
632 |
duplicate_option(argv[n]); |
| 617 |
- |
|
|