$(INSTALL_DATA) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g
$(INSTALL_DIR) $(1)/lib/netifd/proto
$(INSTALL_BIN) ./files/3g.sh $(1)/lib/netifd/proto/3g.sh
+ $(INSTALL_BIN) ./files/directip.sh $(1)/lib/netifd/proto/directip.sh
+ $(INSTALL_DIR) $(1)/lib/network/wwan/
+ $(INSTALL_DATA) ./files/data/* $(1)/lib/network/wwan/
endef
define Package/comgt-directip/install
#!/bin/sh
-INCLUDE_ONLY=1
-. ../netifd-proto.sh
-. ./ppp.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+ NOT_INCLUDED=1
+ INCLUDE_ONLY=1
+
+ . ../netifd-proto.sh
+ . ./ppp.sh
+ init_proto "$@"
+}
proto_3g_init_config() {
no_device=1
json_get_var pincode pincode
json_get_var dialnumber dialnumber
+ [ -n "$dat_device" ] && device=$dat_device
[ -e "$device" ] || {
proto_set_available "$interface" 0
return 1
proto_kill_command "$interface"
}
-add_protocol 3g
+[ -z "NOT_INCLUDED" ] || add_protocol 3g
--- /dev/null
+{
+ "desc": "Nokia C5-00 Mobile phone",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-10",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-10",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-15/CS-18",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-12",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-11",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-17",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-18",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-19",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia CS-19",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Nokia 21M-02",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "iBall 3.5G Connect",
+ "control": 2,
+ "data": 2
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Leoxsys LN-72V",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Axesstel MV241",
+ "control": 2,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Siemens SG75",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Generic Qualcomm",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-152",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-156",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-156",
+ "control": 1,
+ "data": 2
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Option GIO711",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Option GI0201",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Option GTM380",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Option GTM681W",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Option GTM671WFS",
+ "control": 2,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 100",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 120",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 140",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 145",
+ "control": 0,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 155",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 200",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 160",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Olivetti Olicard 500",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Ericsson F3507g",
+ "control": 4,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Ericsson F3507g",
+ "control": 4,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Ericsson F3307",
+ "control": 4,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Ericsson F5521gw",
+ "control": 4,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Ericsson F5521gw",
+ "control": 4,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Kyocera KPC650",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Kyocera KPC680",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra MC7700",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Sierra Wireless AC313U/320U/330U Direct IP",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "LG L-05A",
+ "control": 0,
+ "data": 2
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "LG LUU-2100TI",
+ "control": 0,
+ "data": 2
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "LG LUU-2110TI",
+ "control": 0,
+ "data": 2
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "LG L-02C",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "PANTECH UM-150",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "PANTECH UM-175",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "PANTECH UM-175AL",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "PANTECH UM-190",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "PANTECH UM-185C/UM185E",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "PANTECH UML-290 4G Modem",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "PANTECH P4200 4G Modem",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Sierra EM5625",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5720",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC595U",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5725",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC597E",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra EM5725",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC597",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5727 CDMA",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC598",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra T11",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC402",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5728",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra CDMA 1xEVDO PC Card, AC580",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC595U",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5720",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5725",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC5727",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC250U",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8755",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8765",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8755",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8765",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8755",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8755",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8775",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8775",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8775",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra AC875",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Sierra AC875U",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC875E",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8781",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8780",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8781",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8780",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8781",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8785",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra MC8785 Composite",
+ "control": 3,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Sierra AC880",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC 881",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC880E",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC881E",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC880U",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra ATT USB Connect 881",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC885E",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra AC885E",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Sierra C885",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "Sierra C888",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "Sierra C22 and C33",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "Sierra Compass HSPA",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "Sierra C889",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "Sierra MC7710",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Sierra AC320U/AC330U Direct IP",
+ "control": 3,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "HUAWEI U8110",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI UMG1831",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "HUAWEI/Option newer modems",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option EC1260 Wireless Data Modem HSD USB Card",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option newer modems",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "HUAWEI/Option EC168",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option newer modems",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option E1756C",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option E1800",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option E352-R1",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei K3806",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Huawei K4505",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei K3765",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei R201",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "HUAWEI/Option newer modems",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K3806",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Huawei K4605",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K5005",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K3770",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K3771",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K4510",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei K4511",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei K3772",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173/E177",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei E367/E398",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E398",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei E367",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei E367",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei E392u-12",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Huawei E3131",
+ "control": 3,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E3276",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei K4201 composite",
+ "type": "mbim"
+}
--- /dev/null
+{
+ "desc": "Huawei K4202 composite",
+ "type": "mbim"
+}
--- /dev/null
+{
+ "desc": "Huawei K4606 composite",
+ "type": "mbim"
+}
--- /dev/null
+{
+ "desc": "Huawei E8278",
+ "type": "ncm"
+}
--- /dev/null
+{
+ "desc": "Huawei E173s",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E188",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173s",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E173",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Huawei E586",
+ "type": "ncm"
+}
--- /dev/null
+{
+ "desc": "Huawei E587",
+ "type": "ncm"
+}
--- /dev/null
+{
+ "desc": "Huawei E173",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Huawei K5150 composite",
+ "mode": "mbim"
+}
--- /dev/null
+{
+ "desc": "Novatel U730",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel U740",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel U870",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel XU870",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel X950D",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel EV620",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel ES720",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel E725",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel ES620",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel EU730",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel EU740",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel EU870D",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel MC727/U727",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel Ovation MC930D/MC950D",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel USB760",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel USB760",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel USB760 3G",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel MC780",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel MiFi 2372",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel MiFi 2372",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel USB998",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel USB679",
+ "control": 0,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Novatel MF3470",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel Ovation MC545/MC547",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Novatel E371",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Novatel MC551/USB551L",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "UBIQUAM U-100/105/200/300/520",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "AnyData ADU-620UW",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "AnyData ADU-300A",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "AnyData ADU-500A",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "AnyData ADU-890WH",
+ "control": 0,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "AnyData ADU-890WH",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CNU-510",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CNU-550",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CNU-550",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CDU-550",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Franklin U300",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Cmotech CGU-628",
+ "control": 0,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Cmotech CHE-628S",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Franklin U301",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Cmotech CDU-650",
+ "control": 2,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CCU-650U",
+ "control": 2,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CCU-650",
+ "control": 2,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CNM-650",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CNU-650",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Cmotech CDU-680",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE ET502HS/MT505UP/MF632",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ONDA MF110/ZTE",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ONDA MSA110UP/ZTE",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ONDA MT689DC/ZTE",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K2525",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ONDA MT503HSA",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE MF628",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF110/MF112/MF626",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF636",
+ "control": 1,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "control": 2,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF100",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF190",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "AIKO 83D",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE K3565-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF627",
+ "control": 0,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF626",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "ZTE A580",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE A353",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF668/MF190",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF645",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF636",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "ZTE AC581",
+ "control": 3,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE K4505-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ONDA MT505UP/ZTE",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "ZTE MF651",
+ "control": 1,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF112",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "ZTE MF637",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF110",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF651",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "ZTE MF665C",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF190B",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE AC583",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE MF683",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF820D",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE A371",
+ "control": 0,
+ "data": 1
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF820S",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF821",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Onda MT8205/ZTE",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF880",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF821D",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K3805-Z",
+ "control": 1,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K3570-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K3571-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K3806-Z",
+ "control": 1,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K5006-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K4510-Z",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K4510-Z",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K3770-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE K3770-Z",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K3772-Z",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF691",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF195",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF195",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF190",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF669",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF190",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF190",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF667",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF60",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF60",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF91D",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MFxxx",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF192",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF652",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF591",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF196",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF190J",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF190J",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE MF190J",
+ "control": 0,
+ "data": 0
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "ZTE K3765-Z",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "ZTE MF180",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "ZTE AC682",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE AC3781",
+ "control": 1,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "ZTE AC2738",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE generic",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE MG880",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE MG880",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE MG880",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE AC8700",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "ZTE AC8710",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-100/C-120",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-100/C-120",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-270",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-170/C-180",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-320",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-508",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Bandrich C-33x",
+ "control": 0,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Alcatel X060S/X070S/X080S/X200",
+ "control": 2,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "Alcatel X085C",
+ "control": 2,
+ "data": 2
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Alcatel X220L",
+ "control": 4,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Alcatel X220L",
+ "control": 4,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Alcatel X600",
+ "control": 0,
+ "data": 4
+}}
--- /dev/null
+{
+ "desc": "Alcatel X080C",
+ "control": 0,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Alcatel L100V,",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Alcatel L800Z,",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Alcatel X020 & X030",
+ "control": 2,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Alcatel X020 & X030",
+ "control": 2,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "4G Systems XS Stick W14",
+ "control": 0,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "4G Systems XS Stick W14",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "4G Systems XS Stick W14",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "4G Systems XS Stick W14",
+ "control": 1,
+ "data": 3
+}}
--- /dev/null
+{
+ "desc": "4G Systems XS Stick W21",
+ "control": 2,
+ "data": 1
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "Softbank C02LC",
+ "control": 1,
+ "data": 2
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "PROLink PHS300, A-Link 3GU",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU",
+ "control": 1,
+ "data": 2
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-162-U5, Micromax MMX 300c",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-162-U5, Micromax MMX 300c",
+ "control": 1,
+ "data": 2
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "D-Link DWM-156 A6",
+ "control": 1,
+ "data": 0
+} "generic": 1
+}
--- /dev/null
+{
+ "desc": "D-Link DWM-156 A7",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-156 A7",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "D-Link DWM-156 A7",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Celot K-3000/CT-650/CT-680",
+ "control": 2,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "TP-Link MA180",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "TP-Link MA180",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "TP-Link MA180",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "TP-Link MA260",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Dell 5700",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5500",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5505",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5700",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5510",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5700",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5700",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5720",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5720",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5720",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5520",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5520",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5520",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5530",
+ "control": 0,
+ "data": 1
+} "acm": 1
+}
--- /dev/null
+{
+ "desc": "Dell 5730",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5730",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5730",
+ "control": 1,
+ "data": 0
+}}
--- /dev/null
+{
+ "desc": "Dell 5620",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Dell 5630",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Dell 5800",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Dell 5800v2",
+ "type": "qmi"
+}
--- /dev/null
+{
+ "desc": "Dell 5804",
+ "control": 1,
+ "data": 0
+}}
#!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
proto_directip_init_config() {
available=1
local device apn pincode ifname auth username password
json_get_vars device apn pincode auth username password
+ [ -n "$ctl_device" ] && device=$ctl_device
+
[ -e "$device" ] || {
proto_notify_error "$interface" NO_DEVICE
proto_set_available "$interface" 0
local device
json_get_vars device
+ [ -n "$ctl_device" ] && device=$ctl_device
+
gcom -d "$device" -s /etc/gcom/directip-stop.gcom || proto_notify_error "$interface" CONNECT_FAILED
proto_init_update "*" 0
proto_send_update "$interface"
}
-add_protocol directip
+[ -n "$INCLUDE_ONLY" ] || {
+ add_protocol directip
+}
#!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
-
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
#DBG=-v
proto_mbim_init_config() {
local device apn pincode delay
json_get_vars device apn pincode delay auth username password
+ [ -n "$ctl_device" ] && device=$ctl_device
+
[ -n "$device" ] || {
echo "mbim[$$]" "No control device specified"
proto_notify_error "$interface" NO_DEVICE
json_get_vars device
local tid=$(uci_get_state network $interface tid)
+ [ -n "$ctl_device" ] && device=$ctl_device
+
echo "mbim[$$]" "Stopping network"
[ -n "$tid" ] && {
umbim $DBG -t$tid -d "$device" disconnect
proto_send_update "$interface"
}
-add_protocol mbim
+[ -n "$INCLUDE_ONLY" ] || add_protocol mbim
#!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
proto_qmi_init_config() {
available=1
local device apn auth username password pincode delay modes cid pdh
json_get_vars device apn auth username password pincode delay modes
+ [ -n "$ctl_device" ] && device=$ctl_device
+
[ -n "$device" ] || {
echo "No control device specified"
proto_notify_error "$interface" NO_DEVICE
local device
json_get_vars device
+
+ [ -n "$ctl_device" ] && device=$ctl_device
+
local cid=$(uci_get_state network $interface cid)
echo "Stopping network"
proto_send_update "$interface"
}
-add_protocol qmi
-
+[ -n "$INCLUDE_ONLY" ] || {
+ add_protocol qmi
+}
--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wwan
+PKG_VERSION:=2014-07-17
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/wwan
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Generic OpenWrt 3G/4G proto handler
+endef
+
+define Build/Compile
+ true
+endef
+
+define Package/wwan/install
+ $(INSTALL_DIR) $(1)/lib/netifd/proto/
+ $(CP) ./files/wwan.sh $(1)/lib/netifd/proto/
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+ $(INSTALL_BIN) ./files/wwan.usb $(1)/etc/hotplug.d/usb/00_wwan.sh
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/usbmisc
+ $(INSTALL_BIN) ./files/wwan.usbmisc $(1)/etc/hotplug.d/usbmisc/00_wwan.sh
+endef
+
+$(eval $(call BuildPackage,wwan))
--- /dev/null
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+INCLUDE_ONLY=1
+
+ctl_device=""
+dat_device=""
+
+proto_mbim_setup() { echo "wwan[$$] mbim proto is missing"; }
+proto_qmi_setup() { echo "wwan[$$] qmi proto is missing"; }
+proto_ncm_setup() { echo "wwan[$$] ncm proto is missing"; }
+proto_3g_setup() { echo "wwan[$$] 3g proto is missing"; }
+proto_directip_setup() { echo "wwan[$$] directip proto is missing"; }
+
+[ -f ./mbim.sh ] && . ./mbim.sh
+[ -f ./ncm.sh ] && . ./ncm.sh
+[ -f ./qmi.sh ] && . ./qmi.sh
+[ -f ./3g.sh ] && { . ./ppp.sh; . ./3g.sh; }
+[ -f ./directip.sh ] && . ./directip.sh
+
+proto_wwan_init_config() {
+ available=1
+ no_device=1
+
+ proto_config_add_string apn
+ proto_config_add_string auth
+ proto_config_add_string username
+ proto_config_add_string password
+ proto_config_add_string pincode
+ proto_config_add_string delay
+ proto_config_add_string modes
+}
+
+proto_wwan_setup() {
+ local driver usb devicename desc
+
+ for a in `ls /sys/bus/usb/devices`; do
+ local vendor product
+ [ -z "$usb" -a -f /sys/bus/usb/devices/$a/idVendor -a -f /sys/bus/usb/devices/$a/idProduct ] || continue
+ vendor=$(cat /sys/bus/usb/devices/$a/idVendor)
+ product=$(cat /sys/bus/usb/devices/$a/idProduct)
+ [ -f /lib/network/wwan/$vendor:$product ] && {
+ usb=/lib/network/wwan/$vendor:$product
+ devicename=$a
+ }
+ done
+
+ [ -n "$usb" ] && {
+ local old_cb control data
+
+ json_set_namespace wwan old_cb
+ json_init
+ json_load "$(cat $usb)"
+ json_select
+ json_get_vars desc control data
+ json_set_namespace $old_cb
+
+ [ -n "$control" -a -n "$data" ] && {
+ ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty* | sed "s/.*\///g" | tr "\n" " ")
+ ctl_device=/dev/$(echo $ttys | cut -d" " -f $((control + 1)))
+ dat_device=/dev/$(echo $ttys | cut -d" " -f $((data + 1)))
+ driver=comgt
+ }
+ }
+
+ [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep wwan); do
+ [ -z "$ctl_device" ] || continue
+ driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2)
+ case "$driver" in
+ qmi_wwan|cdc_mbim)
+ ctl_device=/dev/$(ls /sys/class/net/$net/device/usbmisc)
+ ;;
+ sierra_net|*cdc_ncm)
+ ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs basename | head -n1)
+ ;;
+ *) continue;;
+ esac
+ echo "wwan[$$]" "Using proto:$proto device:$ctl_device iface:$net desc:$desc"
+ done
+
+ [ -n "$ctl_device" ] || {
+ echo "wwan[$$]" "No valid device was found"
+ proto_notify_error "$interface" NO_DEVICE
+ proto_block_restart "$interface"
+ return 1
+ }
+
+ uci_set_state network $interface driver "$driver"
+ uci_set_state network $interface ctl_device "$ctl_device"
+ uci_set_state network $interface dat_device "$dat_device"
+
+ case $driver in
+ qmi_wwan) proto_qmi_setup $@ ;;
+ cdc_mbim) proto_mbim_setup $@ ;;
+ sierra_net) proto_directip_setup $@ ;;
+ comgt) proto_3g_setup $@ ;;
+ *cdc_ncm) proto_ncm_setup $@ ;;
+ esac
+}
+
+proto_wwan_teardown() {
+ local interface=$1
+ local driver=$(uci_get_state network $interface driver)
+ ctl_device=$(uci_get_state network $interface ctl_device)
+ dat_device=$(uci_get_state network $interface dat_device)
+
+ case $driver in
+ qmi_wwan) proto_qmi_teardown $@ ;;
+ cdc_mbim) proto_mbim_teardown $@ ;;
+ sierra_net) proto_mbim_teardown $@ ;;
+ comgt) proto_3g_teardown $@ ;;
+ *cdc_ncm) proto_ncm_teardown $@ ;;
+ esac
+}
+
+add_protocol wwan
--- /dev/null
+[ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0
+
+vid=$(cat /sys$DEVPATH/idVendor)
+pid=$(cat /sys$DEVPATH/idProduct)
+[ -f "/lib/network/wwan/$vid:$pid" ] || exit 0
+
+find_wwan_iface() {
+ local cfg="$1"
+ local proto
+ config_get proto "$cfg" proto
+ [ "$proto" = wwan ] || return 0
+ proto_set_available "$cfg" 1
+ ifup $cfg
+ exit 0
+}
+
+config_load network
+config_foreach find_wwan_iface interface
--- /dev/null
+#!/bin/sh
+
+[ "$ACTION" = add ] || exit 0
+[ "${DEVNAME/[0-9]/}" = cdc-wdm ] || exit 0
+
+. /lib/functions.sh
+. /lib/netifd/netifd-proto.sh
+
+find_wwan_iface() {
+ local cfg="$1"
+
+ local proto device
+ config_get proto "$cfg" proto
+ config_get device "$cfg" device
+
+ [ "$proto" = wwan ] || [ "$proto" = mbim ] || [ "$proto" = qmi ] || return 0
+ [ -z "$device" -a "$proto" = wwan ] || [ "$device" = "/dev/$DEVNAME" ] || return 0
+
+ proto_set_available "$cfg" 1
+ ifup "$cfg"
+ exit 0
+}
+
+config_load network
+config_foreach find_wwan_iface interface