[LEDE-DEV] [PATCH 2/3] support Quanta and Blackberry modes

Bjørn Mork bjorn at mork.no
Mon Dec 18 06:00:55 PST 2017


Quanta mode was introduced in usb_modeswitch 1.2.6 and Blackberry
mode in usb_modeswitch 1.2.7

Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 convert-modeswitch.pl |  2 ++
 switch.c              | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl
index 71c2b7950cb5..48d0fd43bfce 100755
--- a/convert-modeswitch.pl
+++ b/convert-modeswitch.pl
@@ -62,6 +62,8 @@ my %options = (
 	MBIM => $mode_option,
 	HuaweiMode => $mode_option,
 	HuaweiNewMode => $mode_option,
+	QuantaMode => $mode_option,
+	BlackberryMode => $mode_option,
 	OptionMode => $mode_option,
 	SierraMode => $mode_option,
 	SonyMode => $mode_option,
diff --git a/switch.c b/switch.c
index b3f62fa0da29..fe25e800dc33 100644
--- a/switch.c
+++ b/switch.c
@@ -375,6 +375,23 @@ static void handle_mbim(struct usbdev_data *data, struct blob_attr **tb)
 	}
 }
 
+static void handle_quanta(struct usbdev_data *data, struct blob_attr **tb)
+{
+	int type = LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN;
+
+	detach_driver(data);
+	send_control_packet(data, type, 0xff, 0, 0, 8);
+}
+
+static void handle_blackberry(struct usbdev_data *data, struct blob_attr **tb)
+{
+	int type = LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN;
+
+	detach_driver(data);
+	send_control_packet(data, type, 0xb1, 0x0000, 0, 8);
+	send_control_packet(data, type, 0xa9, 0x000e, 0, 8);
+}
+
 static void set_alt_setting(struct usbdev_data *data, int setting)
 {
 	if (libusb_claim_interface(data->devh, data->interface))
@@ -399,6 +416,8 @@ enum {
 	MODE_CISCO,
 	MODE_MBIM,
 	MODE_OPTION,
+	MODE_QUANTA,
+	MODE_BLACKBERRY,
 	__MODE_MAX
 };
 
@@ -420,6 +439,8 @@ static const struct {
 	[MODE_CISCO] = { "Cisco", handle_cisco },
 	[MODE_MBIM] = { "MBIM", handle_mbim },
 	[MODE_OPTION] = { "Option", handle_option },
+	[MODE_QUANTA] = { "Quanta", handle_quanta },
+	[MODE_BLACKBERRY] = { "Blackberry", handle_blackberry },
 };
 
 void handle_switch(struct usbdev_data *data)
-- 
2.11.0




More information about the Lede-dev mailing list