summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2017-12-18 12:16:17 +0100
committerBjørn Mork <bjorn@mork.no>2017-12-18 12:16:17 +0100
commit9702dfe99e88b3fcebd4a1f4d0a4467ea62ae29a (patch)
tree9988209247f614e22a5c9d03e534f90342dcf430
parent453da8e540b1c53d357b897d6c70372cd4633390 (diff)
fix support for Option modems
USB_ModeSwitch version 2.3.0 introduced "OptionMode". Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rwxr-xr-xconvert-modeswitch.pl1
-rw-r--r--switch.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl
index 6930e5f..71c2b79 100755
--- a/convert-modeswitch.pl
+++ b/convert-modeswitch.pl
@@ -62,6 +62,7 @@ my %options = (
MBIM => $mode_option,
HuaweiMode => $mode_option,
HuaweiNewMode => $mode_option,
+ OptionMode => $mode_option,
SierraMode => $mode_option,
SonyMode => $mode_option,
QisdaMode => $mode_option,
diff --git a/switch.c b/switch.c
index 587a2af..b3f62fa 100644
--- a/switch.c
+++ b/switch.c
@@ -152,6 +152,20 @@ static void handle_huaweinew(struct usbdev_data *data, struct blob_attr **tb)
send_messages(data, msgs, ARRAY_SIZE(msgs));
}
+static void handle_option(struct usbdev_data *data, struct blob_attr **tb)
+{
+ static struct msg_entry msgs[] = {
+ {
+ "\x55\x53\x42\x43\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x06\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 31
+ }
+ };
+
+ detach_driver(data);
+ data->need_response = false;
+ send_messages(data, msgs, ARRAY_SIZE(msgs));
+}
+
static void handle_standardeject(struct usbdev_data *data, struct blob_attr **tb)
{
static struct msg_entry msgs[] = {
@@ -384,6 +398,7 @@ enum {
MODE_MOBILE_ACTION,
MODE_CISCO,
MODE_MBIM,
+ MODE_OPTION,
__MODE_MAX
};
@@ -404,6 +419,7 @@ static const struct {
[MODE_MOBILE_ACTION] = { "MobileAction", handle_mobile_action },
[MODE_CISCO] = { "Cisco", handle_cisco },
[MODE_MBIM] = { "MBIM", handle_mbim },
+ [MODE_OPTION] = { "Option", handle_option },
};
void handle_switch(struct usbdev_data *data)