usbconfig.c (49366f62991ba8e723c0fcadd60007afe4d3b0a5) usbconfig.c (fa6d8b65d3956f69cde9043a3c5e77fb57788904)
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2008-2009 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 68 unchanged lines hidden (view full) ---

77 uint8_t got_power_on:1;
78 uint8_t got_dump_device_quirks:1;
79 uint8_t got_dump_quirk_names:1;
80 uint8_t got_dump_all_desc:1;
81 uint8_t got_dump_device_desc:1;
82 uint8_t got_dump_curr_config:1;
83 uint8_t got_dump_all_config:1;
84 uint8_t got_dump_info:1;
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 *
5 * Copyright (c) 2008-2009 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 68 unchanged lines hidden (view full) ---

77 uint8_t got_power_on:1;
78 uint8_t got_dump_device_quirks:1;
79 uint8_t got_dump_quirk_names:1;
80 uint8_t got_dump_all_desc:1;
81 uint8_t got_dump_device_desc:1;
82 uint8_t got_dump_curr_config:1;
83 uint8_t got_dump_all_config:1;
84 uint8_t got_dump_info:1;
85 uint8_t got_dump_stats:1;
85 uint8_t got_show_iface_driver:1;
86 uint8_t got_remove_device_quirk:1;
87 uint8_t got_add_device_quirk:1;
88 uint8_t got_remove_quirk:1;
89 uint8_t got_add_quirk:1;
90 uint8_t got_dump_string:1;
91 uint8_t got_do_request:1;
92 uint8_t got_detach_kernel_driver:1;

--- 23 unchanged lines hidden (view full) ---

116 T_DUMP_QUIRK_NAMES,
117 T_DUMP_DEVICE_QUIRKS,
118 T_DUMP_ALL_DESC,
119 T_DUMP_DEVICE_DESC,
120 T_DUMP_CURR_CONFIG_DESC,
121 T_DUMP_ALL_CONFIG_DESC,
122 T_DUMP_STRING,
123 T_DUMP_INFO,
86 uint8_t got_show_iface_driver:1;
87 uint8_t got_remove_device_quirk:1;
88 uint8_t got_add_device_quirk:1;
89 uint8_t got_remove_quirk:1;
90 uint8_t got_add_quirk:1;
91 uint8_t got_dump_string:1;
92 uint8_t got_do_request:1;
93 uint8_t got_detach_kernel_driver:1;

--- 23 unchanged lines hidden (view full) ---

117 T_DUMP_QUIRK_NAMES,
118 T_DUMP_DEVICE_QUIRKS,
119 T_DUMP_ALL_DESC,
120 T_DUMP_DEVICE_DESC,
121 T_DUMP_CURR_CONFIG_DESC,
122 T_DUMP_ALL_CONFIG_DESC,
123 T_DUMP_STRING,
124 T_DUMP_INFO,
125 T_DUMP_STATS,
124 T_SUSPEND,
125 T_RESUME,
126 T_POWER_OFF,
127 T_POWER_SAVE,
128 T_POWER_ON,
129 T_RESET,
130 T_LIST,
131 T_DO_REQUEST,

--- 18 unchanged lines hidden (view full) ---

150 {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0},
151 {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0},
152 {"dump_all_desc", T_DUMP_ALL_DESC, 0},
153 {"dump_device_desc", T_DUMP_DEVICE_DESC, 0},
154 {"dump_curr_config_desc", T_DUMP_CURR_CONFIG_DESC, 0},
155 {"dump_all_config_desc", T_DUMP_ALL_CONFIG_DESC, 0},
156 {"dump_string", T_DUMP_STRING, 1},
157 {"dump_info", T_DUMP_INFO, 0},
126 T_SUSPEND,
127 T_RESUME,
128 T_POWER_OFF,
129 T_POWER_SAVE,
130 T_POWER_ON,
131 T_RESET,
132 T_LIST,
133 T_DO_REQUEST,

--- 18 unchanged lines hidden (view full) ---

152 {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0},
153 {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0},
154 {"dump_all_desc", T_DUMP_ALL_DESC, 0},
155 {"dump_device_desc", T_DUMP_DEVICE_DESC, 0},
156 {"dump_curr_config_desc", T_DUMP_CURR_CONFIG_DESC, 0},
157 {"dump_all_config_desc", T_DUMP_ALL_CONFIG_DESC, 0},
158 {"dump_string", T_DUMP_STRING, 1},
159 {"dump_info", T_DUMP_INFO, 0},
160 {"dump_stats", T_DUMP_STATS, 0},
158 {"show_ifdrv", T_SHOW_IFACE_DRIVER, 0},
159 {"suspend", T_SUSPEND, 0},
160 {"resume", T_RESUME, 0},
161 {"power_off", T_POWER_OFF, 0},
162 {"power_save", T_POWER_SAVE, 0},
163 {"power_on", T_POWER_ON, 0},
164 {"reset", T_RESET, 0},
165 {"list", T_LIST, 0},

--- 125 unchanged lines hidden (view full) ---

291 " dump_quirk_names" "\n"
292 " dump_device_quirks" "\n"
293 " dump_all_desc" "\n"
294 " dump_device_desc" "\n"
295 " dump_curr_config_desc" "\n"
296 " dump_all_config_desc" "\n"
297 " dump_string <index>" "\n"
298 " dump_info" "\n"
161 {"show_ifdrv", T_SHOW_IFACE_DRIVER, 0},
162 {"suspend", T_SUSPEND, 0},
163 {"resume", T_RESUME, 0},
164 {"power_off", T_POWER_OFF, 0},
165 {"power_save", T_POWER_SAVE, 0},
166 {"power_on", T_POWER_ON, 0},
167 {"reset", T_RESET, 0},
168 {"list", T_LIST, 0},

--- 125 unchanged lines hidden (view full) ---

294 " dump_quirk_names" "\n"
295 " dump_device_quirks" "\n"
296 " dump_all_desc" "\n"
297 " dump_device_desc" "\n"
298 " dump_curr_config_desc" "\n"
299 " dump_all_config_desc" "\n"
300 " dump_string <index>" "\n"
301 " dump_info" "\n"
302 " dump_stats" "\n"
299 " show_ifdrv" "\n"
300 " suspend" "\n"
301 " resume" "\n"
302 " power_off" "\n"
303 " power_save" "\n"
304 " power_on" "\n"
305 " reset" "\n"
306 " list" "\n"

--- 194 unchanged lines hidden (view full) ---

501 err(1, "could not detach kernel driver");
502 }
503 }
504 dump_any =
505 (opt->got_dump_all_desc ||
506 opt->got_dump_device_desc ||
507 opt->got_dump_curr_config ||
508 opt->got_dump_all_config ||
303 " show_ifdrv" "\n"
304 " suspend" "\n"
305 " resume" "\n"
306 " power_off" "\n"
307 " power_save" "\n"
308 " power_on" "\n"
309 " reset" "\n"
310 " list" "\n"

--- 194 unchanged lines hidden (view full) ---

505 err(1, "could not detach kernel driver");
506 }
507 }
508 dump_any =
509 (opt->got_dump_all_desc ||
510 opt->got_dump_device_desc ||
511 opt->got_dump_curr_config ||
512 opt->got_dump_all_config ||
509 opt->got_dump_info);
513 opt->got_dump_info ||
514 opt->got_dump_stats);
510
511 if (opt->got_list || dump_any) {
512 dump_device_info(pdev,
513 opt->got_show_iface_driver);
514 }
515 if (opt->got_dump_device_desc) {
516 printf("\n");
517 dump_device_desc(pdev);

--- 4 unchanged lines hidden (view full) ---

522 } else if (opt->got_dump_curr_config) {
523 printf("\n");
524 dump_config(pdev, 0);
525 } else if (opt->got_dump_all_desc) {
526 printf("\n");
527 dump_device_desc(pdev);
528 dump_config(pdev, 1);
529 }
515
516 if (opt->got_list || dump_any) {
517 dump_device_info(pdev,
518 opt->got_show_iface_driver);
519 }
520 if (opt->got_dump_device_desc) {
521 printf("\n");
522 dump_device_desc(pdev);

--- 4 unchanged lines hidden (view full) ---

527 } else if (opt->got_dump_curr_config) {
528 printf("\n");
529 dump_config(pdev, 0);
530 } else if (opt->got_dump_all_desc) {
531 printf("\n");
532 dump_device_desc(pdev);
533 dump_config(pdev, 1);
534 }
535 if (opt->got_dump_stats) {
536 printf("\n");
537 dump_device_stats(pdev);
538 }
530 if (dump_any) {
531 printf("\n");
532 }
533 if (libusb20_dev_close(pdev)) {
534 err(1, "could not close device");
535 }
536 }
537

--- 208 unchanged lines hidden (view full) ---

746 opt->got_any++;
747 break;
748 case T_DUMP_INFO:
749 if (opt->got_dump_info)
750 duplicate_option(argv[n]);
751 opt->got_dump_info = 1;
752 opt->got_any++;
753 break;
539 if (dump_any) {
540 printf("\n");
541 }
542 if (libusb20_dev_close(pdev)) {
543 err(1, "could not close device");
544 }
545 }
546

--- 208 unchanged lines hidden (view full) ---

755 opt->got_any++;
756 break;
757 case T_DUMP_INFO:
758 if (opt->got_dump_info)
759 duplicate_option(argv[n]);
760 opt->got_dump_info = 1;
761 opt->got_any++;
762 break;
763 case T_DUMP_STATS:
764 if (opt->got_dump_stats)
765 duplicate_option(argv[n]);
766 opt->got_dump_stats = 1;
767 opt->got_any++;
768 break;
754 case T_DUMP_STRING:
755 if (opt->got_dump_string)
756 duplicate_option(argv[n]);
757 opt->string_index = num_id(argv[n + 1], "str_index");
758 opt->got_dump_string = 1;
759 opt->got_any++;
760 n++;
761 break;

--- 118 unchanged lines hidden ---
769 case T_DUMP_STRING:
770 if (opt->got_dump_string)
771 duplicate_option(argv[n]);
772 opt->string_index = num_id(argv[n + 1], "str_index");
773 opt->got_dump_string = 1;
774 opt->got_any++;
775 n++;
776 break;

--- 118 unchanged lines hidden ---