MessageContent3 => $msg_option,
WaitBefore => [ ],
DetachStorageOnly => [ ],
+ MBIM => $mode_option,
HuaweiMode => $mode_option,
HuaweiNewMode => $mode_option,
SierraMode => $mode_option,
if (libusb_open(usbdevs[i], &data.devh))
continue;
+ data.dev = usbdevs[i];
+
libusb_get_string_descriptor_ascii(
data.devh, data.desc.iManufacturer,
(void *) data.mfg, sizeof(data.mfg));
send_messages(data, msgs, ARRAY_SIZE(msgs));
}
+static void handle_mbim(struct usbdev_data *data, struct blob_attr **tb)
+{
+ int j;
+
+ if (data->desc.bNumConfigurations < 2)
+ return;
+
+ for (j = 0; j < data->desc.bNumConfigurations; j++) {
+ struct libusb_config_descriptor *config;
+ int i;
+
+ libusb_get_config_descriptor(data->dev, j, &config);
+
+ for (i = 0; i < config->bNumInterfaces; i++) {
+ if (config->interface[i].altsetting[0].bInterfaceClass == 2) {
+ if (config->interface[i].altsetting[0].bInterfaceSubClass == 0x0e) {
+ struct libusb_config_descriptor *active;
+ int count = 5;
+
+ libusb_get_active_config_descriptor(data->dev, &active);
+ if (active->bConfigurationValue == config->bConfigurationValue)
+ return;
+ while ((libusb_set_configuration(data->devh, config->bConfigurationValue) < 0) && --count)
+ libusb_detach_kernel_driver(data->devh, active->interface[0].altsetting[0].bInterfaceNumber);
+
+ libusb_free_config_descriptor(config);
+ return;
+ }
+ }
+ }
+
+ libusb_free_config_descriptor(config);
+ }
+}
+
static void set_alt_setting(struct usbdev_data *data, int setting)
{
if (libusb_claim_interface(data->devh, data->interface))
MODE_SEQUANS,
MODE_MOBILE_ACTION,
MODE_CISCO,
+ MODE_MBIM,
__MODE_MAX
};
[MODE_SEQUANS] = { "Sequans", handle_sequans },
[MODE_MOBILE_ACTION] = { "MobileAction", handle_mobile_action },
[MODE_CISCO] = { "Cisco", handle_cisco },
+ [MODE_MBIM] = { "MBIM", handle_mbim },
};
void handle_switch(struct usbdev_data *data)