summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2021-01-05 14:38:02 +0100
committerPali Rohár <pali.rohar@gmail.com>2021-01-05 14:38:02 +0100
commite6422cf5a21f9bf578f02cb33d9b0b8e4130369b (patch)
treebd96582aec0ff00a4790c8c33b7e7330140cca32
parenta6effa8f6217a2207d0c57b17d48cb878649e701 (diff)
download0xFFFF-e6422cf5a21f9bf578f02cb33d9b0b8e4130369b.tar.bz2
usb-device: Remove dead usb_set_configuration() code
It is on worng place, must be called prior usb_claim_interface() and currently no device use it.
-rw-r--r--src/usb-device.c38
-rw-r--r--src/usb-device.h1
2 files changed, 14 insertions, 25 deletions
diff --git a/src/usb-device.c b/src/usb-device.c
index 5ff24cb..101d795 100644
--- a/src/usb-device.c
+++ b/src/usb-device.c
@@ -46,19 +46,20 @@
#endif
static struct usb_flash_device usb_devices[] = {
- { 0x0421, 0x0096, -1, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } },
- { 0x0421, 0x0105, 2, 1, -1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_34, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } },
- { 0x0421, 0x0106, 0, -1, -1, FLASH_COLD, { DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } },
- { 0x0421, 0x0189, -1, -1, -1, FLASH_DISK, { DEVICE_RX_48, 0 } },
- { 0x0421, 0x01c7, -1, -1, -1, FLASH_DISK, { DEVICE_RX_51, 0 } },
- { 0x0421, 0x01c8, 1, 1, -1, FLASH_MKII, { DEVICE_RX_51, DEVICE_RM_680, 0 } },
- { 0x0421, 0x03d1, -1, -1, -1, FLASH_DISK, { DEVICE_RM_680, 0 } },
- { 0x0421, 0x03d2, 1, 1, -1, FLASH_MKII, { DEVICE_RM_680, 0 } },
- { 0x0421, 0x0431, -1, -1, -1, FLASH_DISK, { DEVICE_SU_18, DEVICE_RX_34, 0 } },
- { 0x0421, 0x04c3, -1, -1, -1, FLASH_DISK, { DEVICE_RX_34, 0 } },
- { 0x0421, 0x0518, -1, -1, -1, FLASH_DISK, { DEVICE_RM_696, 0 } },
- { 0x0421, 0x0519, -1, -1, -1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* RNDIS/Ethernet mode */
- { 0x0421, 0x051a, 2, 1, -1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* Sync mode (ADL protocol) */
+ /* vend prod i a protocol devices */
+ { 0x0421, 0x0096, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } },
+ { 0x0421, 0x0105, 2, 1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_34, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } },
+ { 0x0421, 0x0106, 0, -1, FLASH_COLD, { DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } },
+ { 0x0421, 0x0189, -1, -1, FLASH_DISK, { DEVICE_RX_48, 0 } },
+ { 0x0421, 0x01c7, -1, -1, FLASH_DISK, { DEVICE_RX_51, 0 } },
+ { 0x0421, 0x01c8, 1, 1, FLASH_MKII, { DEVICE_RX_51, DEVICE_RM_680, 0 } },
+ { 0x0421, 0x03d1, -1, -1, FLASH_DISK, { DEVICE_RM_680, 0 } },
+ { 0x0421, 0x03d2, 1, 1, FLASH_MKII, { DEVICE_RM_680, 0 } },
+ { 0x0421, 0x0431, -1, -1, FLASH_DISK, { DEVICE_SU_18, DEVICE_RX_34, 0 } },
+ { 0x0421, 0x04c3, -1, -1, FLASH_DISK, { DEVICE_RX_34, 0 } },
+ { 0x0421, 0x0518, -1, -1, FLASH_DISK, { DEVICE_RM_696, 0 } },
+ { 0x0421, 0x0519, -1, -1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* RNDIS/Ethernet mode */
+ { 0x0421, 0x051a, 2, 1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* Sync mode (ADL protocol) */
};
static const char * usb_flash_protocols[] = {
@@ -209,17 +210,6 @@ static struct usb_device_info * usb_device_is_valid(struct usb_device * dev) {
}
}
- if ( usb_devices[i].configuration >= 0 ) {
- PRINTF_LINE("Setting USB configuration...");
- if ( usb_set_configuration(udev, usb_devices[i].configuration) < 0 ) {
- PRINTF_ERROR("usb_set_configuration failed");
- fprintf(stderr, "\n");
- usb_reattach_kernel_driver(udev, usb_devices[i].interface);
- usb_close(udev);
- return NULL;
- }
- }
-
ret = calloc(1, sizeof(struct usb_device_info));
if ( ! ret ) {
ALLOC_ERROR();
diff --git a/src/usb-device.h b/src/usb-device.h
index 082bf73..1f3277a 100644
--- a/src/usb-device.h
+++ b/src/usb-device.h
@@ -49,7 +49,6 @@ struct usb_flash_device {
uint16_t product;
int interface;
int alternate;
- int configuration;
enum usb_flash_protocol protocol;
enum device devices[DEVICE_COUNT];
};