Ticket #12051: 0001-Update-Huawei-in-usb_modeswitch.patch
File 0001-Update-Huawei-in-usb_modeswitch.patch, 7.3 KB (added by , 10 years ago) |
---|
-
build/jam/packages/Haiku
From 74edf8f7c13054dd90c8045488680ebcfa097d7a Mon Sep 17 00:00:00 2001 From: haiqu <judd@ob-wan.com> Date: Sat, 9 May 2015 17:45:18 +1000 Subject: [PATCH] Update Huawei in usb_modeswitch --- build/jam/packages/Haiku | 2 +- build/jam/packages/HaikuBootstrap | 2 +- .../kernel/drivers/common/usb_modeswitch.cpp | 80 ++++++++++++++-------- 3 files changed, 52 insertions(+), 32 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) ; -
build/jam/packages/HaikuBootstrap
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) ; -
src/add-ons/kernel/drivers/common/usb_modeswitch.cpp
diff --git a/src/add-ons/kernel/drivers/common/usb_modeswitch.cpp b/src/add-ons/kernel/drivers/common/usb_modeswitch.cpp index f1e3c85..e82f968 100644
a b 8 8 9 9 /* 10 10 Devices and messages reference: usb-modeswitch-data-20100826 11 Huawei devices updated to usb-modeswitch-data-20150115 11 12 */ 12 13 13 14 #include <ByteOrder.h> … … unsigned char kDevicesMsg[][31] = { 64 65 { /* MSG_HUAWEI_3 */ 65 66 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, 66 67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 67 0x06, 0x20, 0x00, 0x00, 0x0 0, 0x00, 0x00, 0x01,68 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 68 69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 69 70 }, 70 71 { /* MSG_NOKIA_1 */ … … unsigned char kDevicesMsg[][31] = { 122 123 #define NOKIA_VENDOR 0x0421 123 124 #define NOVATEL_VENDOR 0x1410 124 125 #define ZYDAS_VENDOR 0x0ace 125 #define ZTE_VENDOR 0x19d2126 #define ZTE_VENDOR 0x19d2 126 127 #define OLIVETTI_VENDOR 0x0b3c 127 128 #define OPTION_VENDOR 0x0af0 128 129 #define ATHEROS_VENDOR 0x0cf3 … … static const struct { 133 134 msgType type, type2, type3; 134 135 } kDevices[] = { 135 136 {{ 0, 0, 0, HUAWEI_VENDOR, 0x101e}, MSG_HUAWEI_1}, 136 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1446}, MSG_HUAWEI_1},137 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1449}, MSG_HUAWEI_1},138 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14ad}, MSG_HUAWEI_1},139 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14b5}, MSG_HUAWEI_1},140 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14b7}, MSG_HUAWEI_1},141 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14ba}, MSG_HUAWEI_1},142 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c1}, MSG_HUAWEI_1},143 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c3}, MSG_HUAWEI_1},144 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c4}, MSG_HUAWEI_1},145 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c5}, MSG_HUAWEI_1},146 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14d1}, MSG_HUAWEI_1},147 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14fe}, MSG_HUAWEI_1},148 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1505}, MSG_HUAWEI_1},149 {{ 0, 0, 0, HUAWEI_VENDOR, 0x151a}, MSG_HUAWEI_1},150 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1520}, MSG_HUAWEI_1},151 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1521}, MSG_HUAWEI_1},152 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1523}, MSG_HUAWEI_1},153 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1526}, MSG_HUAWEI_1},154 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1553}, MSG_HUAWEI_1},155 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1557}, MSG_HUAWEI_1},156 {{ 0, 0, 0, HUAWEI_VENDOR, 0x155b}, MSG_HUAWEI_1},157 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1c0b}, MSG_HUAWEI_1},158 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1c24}, MSG_HUAWEI_1},159 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f11}, MSG_HUAWEI_1},160 137 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1030}, MSG_HUAWEI_2}, 161 138 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1031}, MSG_HUAWEI_2}, 139 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1446}, MSG_HUAWEI_3}, 140 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1449}, MSG_HUAWEI_3}, 141 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14ad}, MSG_HUAWEI_3}, 142 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14b5}, MSG_HUAWEI_3}, 143 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14b7}, MSG_HUAWEI_3}, 144 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14ba}, MSG_HUAWEI_3}, 145 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c1}, MSG_HUAWEI_3}, 146 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c3}, MSG_HUAWEI_3}, 147 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c4}, MSG_HUAWEI_3}, 148 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14c5}, MSG_HUAWEI_3}, 149 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14d1}, MSG_HUAWEI_3}, 150 {{ 0, 0, 0, HUAWEI_VENDOR, 0x14fe}, MSG_HUAWEI_3}, 151 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1505}, MSG_HUAWEI_3}, 152 {{ 0, 0, 0, HUAWEI_VENDOR, 0x151a}, MSG_HUAWEI_3}, 153 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1520}, MSG_HUAWEI_3}, 154 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1521}, MSG_HUAWEI_3}, 155 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1523}, MSG_HUAWEI_3}, 156 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1526}, MSG_HUAWEI_3}, 157 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1553}, MSG_HUAWEI_3}, 158 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1557}, MSG_HUAWEI_3}, 159 {{ 0, 0, 0, HUAWEI_VENDOR, 0x155b}, MSG_HUAWEI_3}, 160 {{ 0, 0, 0, HUAWEI_VENDOR, 0x156a}, MSG_HUAWEI_3}, 161 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1576}, MSG_HUAWEI_3}, 162 {{ 0, 0, 0, HUAWEI_VENDOR, 0x157d}, MSG_HUAWEI_3}, 163 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1583}, MSG_HUAWEI_3}, 164 {{ 0, 0, 0, HUAWEI_VENDOR, 0x15ca}, MSG_HUAWEI_3}, 165 {{ 0, 0, 0, HUAWEI_VENDOR, 0x15e7}, MSG_HUAWEI_3}, 166 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1c0b}, MSG_HUAWEI_3}, 167 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1c1b}, MSG_HUAWEI_3}, 168 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1c24}, MSG_HUAWEI_3}, 169 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1da1}, MSG_HUAWEI_3}, 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_3}, 173 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f11}, MSG_HUAWEI_3}, 174 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f15}, MSG_HUAWEI_3}, 175 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f16}, MSG_HUAWEI_3}, 176 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f17}, MSG_HUAWEI_3}, 177 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f18}, MSG_HUAWEI_3}, 178 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f19}, MSG_HUAWEI_3}, 179 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f1b}, MSG_HUAWEI_3}, 180 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f1c}, MSG_HUAWEI_3}, 181 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f1d}, MSG_HUAWEI_3}, 182 {{ 0, 0, 0, HUAWEI_VENDOR, 0x1f1e}, MSG_HUAWEI_3}, 163 183 {{ 0, 0, 0, NOKIA_VENDOR, 0x060c}, MSG_NOKIA_1}, 164 184 {{ 0, 0, 0, NOKIA_VENDOR, 0x0610}, MSG_NOKIA_1}, 165 185 {{ 0, 0, 0, NOKIA_VENDOR, 0x061d}, MSG_NOKIA_1}, … … my_get_msg_type(const usb_device_descriptor *desc, int index) 388 408 case 2: 389 409 return kDevices[i].type3; 390 410 } 391 411 392 412 } 393 413 394 414 return MSG_NONE; … … my_modeswitch(my_device* device) 412 432 TRACE_ALWAYS("send message %d failed\n", i + 1); 413 433 return err; 414 434 } 415 435 416 436 TRACE("device switched: %p\n", device); 417 437 418 438 char data[36]; … … my_modeswitch(my_device* device) 422 442 i + 1, device->status); 423 443 return err; 424 444 } 425 TRACE("device switched (response length %ld)\n", device->actual_length); 445 TRACE("device switched (response length %ld)\n", device->actual_length); 426 446 } 427 447 428 448 TRACE("device switched: %p\n", device); 429 449 430 450 return B_OK;