From c21e78cebbe081b1bbfc346bc9279ba918c67158 Mon Sep 17 00:00:00 2001
From: haiqu <judd@ob-wan.com>
Date: Mon, 4 May 2015 01:30:56 +1000
Subject: [PATCH] Add new Huawei modems to usb_modeswitch and enable
---
build/jam/packages/Haiku | 2 +-
build/jam/packages/HaikuBootstrap | 2 +-
src/add-ons/kernel/drivers/common/usb_modeswitch.cpp | 12 +++++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/build/jam/packages/Haiku b/build/jam/packages/Haiku
index 704b5ce..055c730 100644
a
|
b
|
AddNewDriversToPackage power : $(SYSTEM_ADD_ONS_DRIVERS_POWER) ;
|
68 | 68 | #AddNewDriversToPackage display : display_adapter@x86 ; |
69 | 69 | |
70 | 70 | # legacy drivers |
71 | | AddDriversToPackage : console dprintf null <driver>tty zero ; |
| 71 | AddDriversToPackage : console dprintf null <driver>tty usb_modeswitch zero ; |
72 | 72 | AddDriversToPackage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ; |
73 | 73 | AddDriversToPackage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ; |
74 | 74 | AddDriversToPackage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ; |
diff --git a/build/jam/packages/HaikuBootstrap b/build/jam/packages/HaikuBootstrap
index 0d6f674..bb23583 100644
a
|
b
|
AddNewDriversToPackage power : acpi_battery@x86 ;
|
68 | 68 | |
69 | 69 | # legacy drivers |
70 | 70 | AddDriversToPackage : console dprintf null random <driver>tty |
71 | | zero ; |
| 71 | usb_modeswitch zero ; |
72 | 72 | AddDriversToPackage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ; |
73 | 73 | AddDriversToPackage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ; |
74 | 74 | AddDriversToPackage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ; |
diff --git a/src/add-ons/kernel/drivers/common/usb_modeswitch.cpp b/src/add-ons/kernel/drivers/common/usb_modeswitch.cpp
index f1e3c85..be4498c 100644
a
|
b
|
enum msgType {
|
36 | 36 | MSG_HUAWEI_1 = 0, |
37 | 37 | MSG_HUAWEI_2, |
38 | 38 | MSG_HUAWEI_3, |
| 39 | MSG_HUAWEI_4, |
39 | 40 | MSG_NOKIA_1, |
40 | 41 | MSG_OLIVETTI_1, |
41 | 42 | MSG_OLIVETTI_2, |
… |
… |
unsigned char kDevicesMsg[][31] = {
|
67 | 68 | 0x06, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, |
68 | 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
69 | 70 | }, |
| 71 | { /* MSG_HUAWEI_4 */ |
| 72 | |
| 73 | 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, |
| 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x11, |
| 75 | 0x06, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, |
| 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 77 | }, |
70 | 78 | { /* MSG_NOKIA_1 */ |
71 | 79 | 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, |
72 | 80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1b, |
… |
… |
unsigned char kDevicesMsg[][31] = {
|
122 | 130 | #define NOKIA_VENDOR 0x0421 |
123 | 131 | #define NOVATEL_VENDOR 0x1410 |
124 | 132 | #define ZYDAS_VENDOR 0x0ace |
125 | | #define ZTE_VENDOR 0x19d2 |
| 133 | #define ZTE_VENDOR 0x19d2 |
126 | 134 | #define OLIVETTI_VENDOR 0x0b3c |
127 | 135 | #define OPTION_VENDOR 0x0af0 |
128 | 136 | #define ATHEROS_VENDOR 0x0cf3 |
… |
… |
static const struct {
|
160 | 168 | {{ 0, 0, 0, HUAWEI_VENDOR, 0x1030}, MSG_HUAWEI_2}, |
161 | 169 | {{ 0, 0, 0, HUAWEI_VENDOR, 0x1031}, MSG_HUAWEI_2}, |
162 | 170 | {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f01}, MSG_HUAWEI_3}, |
| 171 | {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f02}, MSG_HUAWEI_3}, |
| 172 | {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f03}, MSG_HUAWEI_4}, |
163 | 173 | {{ 0, 0, 0, NOKIA_VENDOR, 0x060c}, MSG_NOKIA_1}, |
164 | 174 | {{ 0, 0, 0, NOKIA_VENDOR, 0x0610}, MSG_NOKIA_1}, |
165 | 175 | {{ 0, 0, 0, NOKIA_VENDOR, 0x061d}, MSG_NOKIA_1}, |