Ticket #12051: 0001-Add-new-Huawei-modems-to-usb_modeswitch-and-enable.patch

File 0001-Add-new-Huawei-modems-to-usb_modeswitch-and-enable.patch, 3.3 KB (added by haiqu, 10 years ago)
  • build/jam/packages/Haiku

    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) ;  
    6868#AddNewDriversToPackage display     : display_adapter@x86 ;
    6969
    7070# legacy drivers
    71 AddDriversToPackage                 : console dprintf null <driver>tty zero ;
     71AddDriversToPackage                 : console dprintf null <driver>tty usb_modeswitch zero ;
    7272AddDriversToPackage audio hmulti    : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
    7373AddDriversToPackage audio old       : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
    7474AddDriversToPackage 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 ;  
    6868
    6969# legacy drivers
    7070AddDriversToPackage                 : console dprintf null random <driver>tty
    71                                         zero ;
     71                                        usb_modeswitch zero ;
    7272AddDriversToPackage audio hmulti    : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
    7373AddDriversToPackage audio old       : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
    7474AddDriversToPackage 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..be4498c 100644
    a b enum msgType {  
    3636    MSG_HUAWEI_1 = 0,
    3737    MSG_HUAWEI_2,
    3838    MSG_HUAWEI_3,
     39    MSG_HUAWEI_4,
    3940    MSG_NOKIA_1,
    4041    MSG_OLIVETTI_1,
    4142    MSG_OLIVETTI_2,
    unsigned char kDevicesMsg[][31] = {  
    6768        0x06, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
    6869        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    6970    },
     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    },
    7078    {   /* MSG_NOKIA_1 */
    7179        0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78,
    7280        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1b,
    unsigned char kDevicesMsg[][31] = {  
    122130#define NOKIA_VENDOR    0x0421
    123131#define NOVATEL_VENDOR  0x1410
    124132#define ZYDAS_VENDOR    0x0ace
    125 #define ZTE_VENDOR  0x19d2
     133#define ZTE_VENDOR      0x19d2
    126134#define OLIVETTI_VENDOR 0x0b3c
    127135#define OPTION_VENDOR   0x0af0
    128136#define ATHEROS_VENDOR  0x0cf3
    static const struct {  
    160168    {{ 0, 0, 0, HUAWEI_VENDOR, 0x1030}, MSG_HUAWEI_2},
    161169    {{ 0, 0, 0, HUAWEI_VENDOR, 0x1031}, MSG_HUAWEI_2},
    162170    {{ 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},
    163173    {{ 0, 0, 0, NOKIA_VENDOR, 0x060c}, MSG_NOKIA_1},
    164174    {{ 0, 0, 0, NOKIA_VENDOR, 0x0610}, MSG_NOKIA_1},
    165175    {{ 0, 0, 0, NOKIA_VENDOR, 0x061d}, MSG_NOKIA_1},