From 541ae6e89c3cf8e7142f60058aef5c4b1c0b96b0 Mon Sep 17 00:00:00 2001 From: ling <1042585959@qq.com> Date: Mon, 3 Apr 2023 11:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-gobinetmodem/Makefile | 10 +-- .../luasrc/controller/gobinetmodem.lua | 4 +- .../luasrc/model/cbi/gobinetmodem.lua | 52 ++++++------ .../po/{zh-cn => zh_Hans}/usbmodem.po | 0 .../root/etc/uci-defaults/luci-gobinetmodem | 1 + .../luasrc/controller/pcimodem.lua | 4 +- .../luasrc/model/cbi/pcimodem.lua | 52 ++++++------ .../po/{zh-cn => zh_Hans}/pcimodem.po | 0 .../root/etc/uci-defaults/luci-pcimodem | 1 + luci-app-spdmodem/Makefile | 2 +- .../luasrc/controller/spdmodem.lua | 4 +- .../luasrc/model/cbi/spdmodem.lua | 52 ++++++------ .../po/{zh-cn => zh_Hans}/spdmodem.po | 0 .../root/etc/uci-defaults/luci-spdmodem | 1 + luci-app-usbmodem/Makefile | 10 +-- .../luasrc/controller/usbmodem.lua | 4 +- .../luasrc/model/cbi/usbmodem.lua | 54 ++++++------- .../po/{zh-cn => zh_Hans}/usbmodem.po | 0 .../root/etc/uci-defaults/luci-usbmodem | 1 + quectel_Gobinet/Makefile | 2 +- quectel_MHI/Makefile | 2 +- quectel_QMI_WWAN/Makefile | 6 +- quectel_QMI_WWAN/src/qmi_wwan_q.c | 49 ------------ quectel_SRPD_PCIE/Makefile | 3 +- .../luci-app-gobinetmodem/Makefile | 20 +++++ .../luasrc/controller/gobinetmodem.lua | 9 +++ .../luasrc/model/cbi/gobinetmodem.lua | 39 +++++++++ .../po/zh_Hans/usbmodem.po | 24 ++++++ .../root/etc/config/gobinetmodem | 4 + .../root/etc/init.d/gobinetmodem | 80 +++++++++++++++++++ .../root/etc/uci-defaults/luci-gobinetmodem | 12 +++ quectel_SRPD_PCIE/luci-app-pcimodem/Makefile | 15 ++++ .../luasrc/controller/pcimodem.lua | 9 +++ .../luasrc/model/cbi/pcimodem.lua | 39 +++++++++ .../luci-app-pcimodem/po/zh_Hans/pcimodem.po | 24 ++++++ .../root/etc/config/pcimodem | 4 + .../root/etc/init.d/pcimodem | 75 +++++++++++++++++ .../root/etc/uci-defaults/luci-pcimodem | 12 +++ quectel_SRPD_PCIE/luci-app-spdmodem/Makefile | 15 ++++ .../luasrc/controller/spdmodem.lua | 9 +++ .../luasrc/model/cbi/spdmodem.lua | 39 +++++++++ .../luci-app-spdmodem/po/zh_Hans/spdmodem.po | 24 ++++++ .../root/etc/config/spdmodem | 4 + .../root/etc/init.d/spdmodem | 75 +++++++++++++++++ .../root/etc/uci-defaults/luci-spdmodem | 12 +++ quectel_SRPD_PCIE/luci-app-usbmodem/Makefile | 20 +++++ .../luasrc/controller/usbmodem.lua | 9 +++ .../luasrc/model/cbi/usbmodem.lua | 51 ++++++++++++ .../luci-app-usbmodem/po/zh_Hans/usbmodem.po | 24 ++++++ .../root/etc/config/usbmodem | 5 ++ .../root/etc/init.d/usbmodem | 80 +++++++++++++++++++ .../root/etc/uci-defaults/luci-usbmodem | 12 +++ quectel_cm_5G/Makefile | 26 +++--- 53 files changed, 896 insertions(+), 189 deletions(-) rename luci-app-gobinetmodem/po/{zh-cn => zh_Hans}/usbmodem.po (100%) rename luci-app-pcimodem/po/{zh-cn => zh_Hans}/pcimodem.po (100%) rename luci-app-spdmodem/po/{zh-cn => zh_Hans}/spdmodem.po (100%) rename luci-app-usbmodem/po/{zh-cn => zh_Hans}/usbmodem.po (100%) create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/Makefile create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/config/gobinetmodem create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/init.d/gobinetmodem create mode 100644 quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/Makefile create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/controller/pcimodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/po/zh_Hans/pcimodem.po create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/config/pcimodem create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/init.d/pcimodem create mode 100644 quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/Makefile create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/controller/spdmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/po/zh_Hans/spdmodem.po create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/config/spdmodem create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/init.d/spdmodem create mode 100644 quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/Makefile create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/controller/usbmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/po/zh_Hans/usbmodem.po create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/config/usbmodem create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/init.d/usbmodem create mode 100644 quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem diff --git a/luci-app-gobinetmodem/Makefile b/luci-app-gobinetmodem/Makefile index 08676a3..f12f31a 100644 --- a/luci-app-gobinetmodem/Makefile +++ b/luci-app-gobinetmodem/Makefile @@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Modem Server LUCI_DEPENDS:=+luci-compat +kmod-usb-net +kmod-usb-net-cdc-ether +kmod-usb-acm \ - +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ - +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ - +kmod-usb-serial-option \ - +kmod-usb2 +kmod-usb3 \ - +quectel-CM-5G +kmod-gobinet + +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ + +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ + +kmod-usb-serial-option \ + +kmod-usb2 +kmod-usb3 \ + +quectel-CM-5G +kmod-gobinet include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua b/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua index 5b6de85..2a761d6 100644 --- a/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua +++ b/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua @@ -4,6 +4,6 @@ function index() if not nixio.fs.access("/etc/config/gobinetmodem") then return end - - entry({"admin", "network", "gobinetmodem"}, cbi("gobinetmodem"), _("Gobinet Modem Server"), 80).dependent = false + + entry({"admin", "network", "gobinetmodem"}, cbi("gobinetmodem"), _("Gobinet Modem Server"), 80).dependent=false end diff --git a/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua b/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua index 784130f..a117d7b 100644 --- a/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua +++ b/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua @@ -1,39 +1,39 @@ -- Copyright 2016 David Thornley -- Licensed to the public under the Apache License 2.0. -mp = Map("gobinetmodem") -mp.title = translate("gobinet Modem Server") -mp.description = translate("Modem Server For OpenWrt") -s = mp:section(TypedSection, "service", "Base Setting") +mp=Map("gobinetmodem",translate("gobinet Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") s.anonymous = true -enabled = s:option(Flag, "enabled", translate("Enable")) -enabled.default = 0 -enabled.rmempty = false +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false -apn = s:option(Value, "apn", translate("APN")) -apn.rmempty = true +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true -pincode = s:option(Value, "pincode", translate("PIN")) -pincode.rmempty = true +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true -username = s:option(Value, "username", translate("PAP/CHAP username")) -username.rmempty = true +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true -password = s:option(Value, "password", translate("PAP/CHAP password")) -password.rmempty = true +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") -auth = s:option(Value, "auth", translate("Authentication Type")) -auth.rmempty = true -auth:value("", translate("-- Please choose --")) -auth:value("both", "PAP/CHAP (both)") -auth:value("pap", "PAP") -auth:value("chap", "CHAP") -auth:value("none", "NONE") - -tool = s:option(Value, "tool", translate("Tools")) -tool:value("quectel-CM", "quectel-CM") -tool.rmempty = true +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true return mp + diff --git a/luci-app-gobinetmodem/po/zh-cn/usbmodem.po b/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po similarity index 100% rename from luci-app-gobinetmodem/po/zh-cn/usbmodem.po rename to luci-app-gobinetmodem/po/zh_Hans/usbmodem.po diff --git a/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem b/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem index b4b7674..6eb5a09 100644 --- a/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem +++ b/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem @@ -9,3 +9,4 @@ EOF rm -f /tmp/luci-indexcache exit 0 + diff --git a/luci-app-pcimodem/luasrc/controller/pcimodem.lua b/luci-app-pcimodem/luasrc/controller/pcimodem.lua index e1d3daf..e1630c5 100644 --- a/luci-app-pcimodem/luasrc/controller/pcimodem.lua +++ b/luci-app-pcimodem/luasrc/controller/pcimodem.lua @@ -4,6 +4,6 @@ function index() if not nixio.fs.access("/etc/config/pcimodem") then return end - - entry({"admin", "network", "pcimodem"}, cbi("pcimodem"), _("PCI Modem Server"), 80).dependent = false + + entry({"admin", "network", "pcimodem"}, cbi("pcimodem"), _("PCI Modem Server"), 80).dependent=false end diff --git a/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua b/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua index 258ce66..591ba4b 100644 --- a/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua +++ b/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua @@ -1,39 +1,39 @@ -- Copyright 2016 David Thornley -- Licensed to the public under the Apache License 2.0. -mp = Map("pcimodem") -mp.title = translate("PCI Modem Server") -mp.description = translate("Modem Server For OpenWrt") -s = mp:section(TypedSection, "service", "Base Setting") +mp=Map("pcimodem",translate("PCI Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") s.anonymous = true -enabled = s:option(Flag, "enabled", translate("Enable")) -enabled.default = 0 -enabled.rmempty = false +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false -apn = s:option(Value, "apn", translate("APN")) -apn.rmempty = true +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true -pincode = s:option(Value, "pincode", translate("PIN")) -pincode.rmempty = true +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true -username = s:option(Value, "username", translate("PAP/CHAP username")) -username.rmempty = true +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true -password = s:option(Value, "password", translate("PAP/CHAP password")) -password.rmempty = true +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") -auth = s:option(Value, "auth", translate("Authentication Type")) -auth.rmempty = true -auth:value("", translate("-- Please choose --")) -auth:value("both", "PAP/CHAP (both)") -auth:value("pap", "PAP") -auth:value("chap", "CHAP") -auth:value("none", "NONE") - -tool = s:option(Value, "tool", translate("Tools")) -tool:value("quectel-CM", "quectel-CM") -tool.rmempty = true +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true return mp + diff --git a/luci-app-pcimodem/po/zh-cn/pcimodem.po b/luci-app-pcimodem/po/zh_Hans/pcimodem.po similarity index 100% rename from luci-app-pcimodem/po/zh-cn/pcimodem.po rename to luci-app-pcimodem/po/zh_Hans/pcimodem.po diff --git a/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem b/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem index 10f5ab8..213c62c 100644 --- a/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem +++ b/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem @@ -9,3 +9,4 @@ EOF rm -f /tmp/luci-indexcache exit 0 + diff --git a/luci-app-spdmodem/Makefile b/luci-app-spdmodem/Makefile index 988ee1c..252ec31 100644 --- a/luci-app-spdmodem/Makefile +++ b/luci-app-spdmodem/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=SPD Modem Server -LUCI_DEPENDS:=+luci-compat +kmod-sprd_pcie +LUCI_DEPENDS:= include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-spdmodem/luasrc/controller/spdmodem.lua b/luci-app-spdmodem/luasrc/controller/spdmodem.lua index c0164bb..81e8ad9 100644 --- a/luci-app-spdmodem/luasrc/controller/spdmodem.lua +++ b/luci-app-spdmodem/luasrc/controller/spdmodem.lua @@ -4,6 +4,6 @@ function index() if not nixio.fs.access("/etc/config/spdmodem") then return end - - entry({"admin", "network", "spdmodem"}, cbi("spdmodem"), _("SPD Modem Server"), 80).dependent = false + + entry({"admin", "network", "spdmodem"}, cbi("spdmodem"), _("SPD Modem Server"), 80).dependent=false end diff --git a/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua b/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua index c6bade4..3456c37 100644 --- a/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua +++ b/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua @@ -1,39 +1,39 @@ -- Copyright 2016 David Thornley -- Licensed to the public under the Apache License 2.0. -mp = Map("spdmodem") -mp.title = translate("SPD Modem Server") -mp.description = translate("Modem Server For OpenWrt") -s = mp:section(TypedSection, "service", "Base Setting") +mp=Map("spdmodem",translate("SPD Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") s.anonymous = true -enabled = s:option(Flag, "enabled", translate("Enable")) -enabled.default = 0 -enabled.rmempty = false +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false -apn = s:option(Value, "apn", translate("APN")) -apn.rmempty = true +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true -pincode = s:option(Value, "pincode", translate("PIN")) -pincode.rmempty = true +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true -username = s:option(Value, "username", translate("PAP/CHAP username")) -username.rmempty = true +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true -password = s:option(Value, "password", translate("PAP/CHAP password")) -password.rmempty = true +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") -auth = s:option(Value, "auth", translate("Authentication Type")) -auth.rmempty = true -auth:value("", translate("-- Please choose --")) -auth:value("both", "PAP/CHAP (both)") -auth:value("pap", "PAP") -auth:value("chap", "CHAP") -auth:value("none", "NONE") - -tool = s:option(Value, "tool", translate("Tools")) -tool:value("quectel-CM", "quectel-CM") -tool.rmempty = true +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true return mp + diff --git a/luci-app-spdmodem/po/zh-cn/spdmodem.po b/luci-app-spdmodem/po/zh_Hans/spdmodem.po similarity index 100% rename from luci-app-spdmodem/po/zh-cn/spdmodem.po rename to luci-app-spdmodem/po/zh_Hans/spdmodem.po diff --git a/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem b/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem index faa1d1e..1bfe6e4 100644 --- a/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem +++ b/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem @@ -9,3 +9,4 @@ EOF rm -f /tmp/luci-indexcache exit 0 + diff --git a/luci-app-usbmodem/Makefile b/luci-app-usbmodem/Makefile index 2214f0c..3349019 100644 --- a/luci-app-usbmodem/Makefile +++ b/luci-app-usbmodem/Makefile @@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Modem Server LUCI_DEPENDS:=+luci-compat +kmod-usb-net +kmod-usb-net-cdc-ether +kmod-usb-acm \ - +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ - +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ - +kmod-usb-serial-option +kmod-usb-wdm \ - +kmod-usb2 +kmod-usb3 \ - +quectel-CM-5G +kmod-qmi_wwan_q +kmod-usb-net-cdc-mbim + +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ + +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ + +kmod-usb-serial-option +kmod-usb-wdm \ + +kmod-usb2 +kmod-usb3 \ + +quectel-CM-5G +kmod-qmi_wwan_q +kmod-usb-net-cdc-mbim include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-usbmodem/luasrc/controller/usbmodem.lua b/luci-app-usbmodem/luasrc/controller/usbmodem.lua index 6cf943c..9021a61 100644 --- a/luci-app-usbmodem/luasrc/controller/usbmodem.lua +++ b/luci-app-usbmodem/luasrc/controller/usbmodem.lua @@ -4,6 +4,6 @@ function index() if not nixio.fs.access("/etc/config/usbmodem") then return end - - entry({"admin", "network", "usbmodem"}, cbi("usbmodem"), _("USB Modem Server"), 80).dependent = false + + entry({"admin", "network", "usbmodem"}, cbi("usbmodem"), _("USB Modem Server"), 80).dependent=false end diff --git a/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua b/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua index 97af802..11e4df9 100644 --- a/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua +++ b/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua @@ -1,18 +1,18 @@ -- Copyright 2016 David Thornley -- Licensed to the public under the Apache License 2.0. -mp = Map("usbmodem") -mp.title = translate("USB Modem Server") -mp.description = translate("Modem Server For OpenWrt") -s = mp:section(TypedSection, "service", "Base Setting") +mp=Map("usbmodem",translate("USB Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") s.anonymous = true -enabled = s:option(Flag, "enabled", translate("Enable")) -enabled.default = 0 -enabled.rmempty = false +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false -device = s:option(Value, "device", translate("Modem device")) +device=s:option(Value, "device", translate("Modem device")) device.rmempty = false local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*") @@ -24,28 +24,28 @@ if device_suggestions then end end -apn = s:option(Value, "apn", translate("APN")) -apn.rmempty = true +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true -pincode = s:option(Value, "pincode", translate("PIN")) -pincode.rmempty = true +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true -username = s:option(Value, "username", translate("PAP/CHAP username")) -username.rmempty = true +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true -password = s:option(Value, "password", translate("PAP/CHAP password")) -password.rmempty = true +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") -auth = s:option(Value, "auth", translate("Authentication Type")) -auth.rmempty = true -auth:value("", translate("-- Please choose --")) -auth:value("both", "PAP/CHAP (both)") -auth:value("pap", "PAP") -auth:value("chap", "CHAP") -auth:value("none", "NONE") - -tool = s:option(Value, "tool", translate("Tools")) -tool:value("quectel-CM", "quectel-CM") -tool.rmempty = true +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true return mp + diff --git a/luci-app-usbmodem/po/zh-cn/usbmodem.po b/luci-app-usbmodem/po/zh_Hans/usbmodem.po similarity index 100% rename from luci-app-usbmodem/po/zh-cn/usbmodem.po rename to luci-app-usbmodem/po/zh_Hans/usbmodem.po diff --git a/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem b/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem index 1b2ba06..ebc3b75 100644 --- a/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem +++ b/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem @@ -9,3 +9,4 @@ EOF rm -f /tmp/luci-indexcache exit 0 + diff --git a/quectel_Gobinet/Makefile b/quectel_Gobinet/Makefile index abdba44..5457008 100644 --- a/quectel_Gobinet/Makefile +++ b/quectel_Gobinet/Makefile @@ -15,7 +15,7 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/gobinet - SUBMENU:=WWAN Support + SUBMENU:=Gobinet Support TITLE:=Quectel Linux USB Gobinet Driver DEPENDS:=+kmod-usb-net FILES:=$(PKG_BUILD_DIR)/GobiNet.ko diff --git a/quectel_MHI/Makefile b/quectel_MHI/Makefile index 24dec5e..bf6f718 100644 --- a/quectel_MHI/Makefile +++ b/quectel_MHI/Makefile @@ -15,7 +15,7 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/pcie_mhi - SUBMENU:=WWAN Support + SUBMENU:=PCIE Support TITLE:=Kernel pcie driver for MHI device DEPENDS:=+pciids +pciutils +quectel-CM-5G FILES:=$(PKG_BUILD_DIR)/pcie_mhi.ko diff --git a/quectel_QMI_WWAN/Makefile b/quectel_QMI_WWAN/Makefile index b27dfad..74e9d1c 100644 --- a/quectel_QMI_WWAN/Makefile +++ b/quectel_QMI_WWAN/Makefile @@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qmi_wwan_q PKG_VERSION:=3.0 -PKG_RELEASE:=2 +PKG_RELEASE:=1 include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/qmi_wwan_q - SUBMENU:=WWAN Support + SUBMENU:=qmiwwan Support TITLE:=Quectel Linux USB QMI WWAN Driver - DEPENDS:=+kmod-usb-net +kmod-usb-wdm + DEPENDS:=+kmod-usb-net kmod-usb-wdm FILES:=$(PKG_BUILD_DIR)/qmi_wwan_q.ko AUTOLOAD:=$(call AutoLoad,81,qmi_wwan_q) endef diff --git a/quectel_QMI_WWAN/src/qmi_wwan_q.c b/quectel_QMI_WWAN/src/qmi_wwan_q.c index 99a9e9f..5b9c9ac 100644 --- a/quectel_QMI_WWAN/src/qmi_wwan_q.c +++ b/quectel_QMI_WWAN/src/qmi_wwan_q.c @@ -319,11 +319,7 @@ static int bridge_arp_reply(struct net_device *net, struct sk_buff *skb, uint br reply->ip_summed = CHECKSUM_UNNECESSARY; reply->pkt_type = PACKET_HOST; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) netif_rx_ni(reply); -#else - netif_rx(reply); -#endif } return 1; } @@ -387,11 +383,7 @@ static struct sk_buff *bridge_mode_tx_fixup(struct net_device *net, struct sk_bu __skb_pull(reply, skb_network_offset(reply)); reply->ip_summed = CHECKSUM_UNNECESSARY; reply->pkt_type = PACKET_HOST; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) netif_rx_ni(reply); -#else - netif_rx(reply); -#endif return NULL; } #endif @@ -761,22 +753,12 @@ static void rmnet_vnd_update_rx_stats(struct net_device *net, struct pcpu_sw_netstats *stats64 = this_cpu_ptr(dev->stats64); u64_stats_update_begin(&stats64->syncp); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) stats64->rx_packets += rx_packets; stats64->rx_bytes += rx_bytes; -#else - u64_stats_add(&stats64->rx_packets, rx_packets); - u64_stats_add(&stats64->rx_bytes, rx_bytes); -#endif u64_stats_update_end(&stats64->syncp); #else -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) net->stats.rx_packets += rx_packets; net->stats.rx_bytes += rx_bytes; -#else - u64_stats_add(&net->stats.rx_packets, rx_packets); - u64_stats_add(&net->stats.rx_bytes, rx_bytes); -#endif #endif } @@ -787,22 +769,12 @@ static void rmnet_vnd_update_tx_stats(struct net_device *net, struct pcpu_sw_netstats *stats64 = this_cpu_ptr(dev->stats64); u64_stats_update_begin(&stats64->syncp); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) stats64->tx_packets += tx_packets; stats64->tx_bytes += tx_bytes; -#else - u64_stats_add(&stats64->tx_packets, tx_packets); - u64_stats_add(&stats64->tx_bytes, tx_bytes); -#endif u64_stats_update_end(&stats64->syncp); #else -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) net->stats.tx_packets += tx_packets; net->stats.tx_bytes += tx_bytes; -#else - u64_stats_add(&net->stats.tx_packets, tx_packets); - u64_stats_add(&net->tx_bytes, tx_bytes); -#endif #endif } @@ -829,25 +801,16 @@ static struct rtnl_link_stats64 *_rmnet_vnd_get_stats64(struct net_device *net, do { start = u64_stats_fetch_begin_irq(&stats64->syncp); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) rx_packets = stats64->rx_packets; rx_bytes = stats64->rx_bytes; tx_packets = stats64->tx_packets; tx_bytes = stats64->tx_bytes; -#else - rx_packets = u64_stats_read(&stats64->rx_packets); - rx_bytes = u64_stats_read(&stats64->rx_bytes); - tx_packets = u64_stats_read(&stats64->tx_packets); - tx_bytes = u64_stats_read(&stats64->tx_bytes); -#endif } while (u64_stats_fetch_retry_irq(&stats64->syncp, start)); - stats->rx_packets += rx_packets; stats->rx_bytes += rx_bytes; stats->tx_packets += tx_packets; stats->tx_bytes += tx_bytes; - } return stats; @@ -1295,11 +1258,7 @@ static int qmap_register_device(sQmiWwanQmap * pDev, u8 offset_id) priv->dev = pDev->mpNetDev; priv->qmap_version = pDev->qmap_version; priv->mux_id = QUECTEL_QMAP_MUX_ID + offset_id; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) memcpy (qmap_net->dev_addr, real_dev->dev_addr, ETH_ALEN); -#else - eth_hw_addr_set (real_dev, qmap_net->dev_addr); -#endif #ifdef QUECTEL_BRIDGE_MODE priv->bridge_mode = !!(pDev->bridge_mode & BIT(offset_id)); @@ -2066,16 +2025,8 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) /* make MAC addr easily distinguishable from an IP header */ if (possibly_iphdr(dev->net->dev_addr)) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */ dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */ -#else - u8 addr = dev->net->dev_addr[0]; - - addr |= 0x02; /* set local assignment bit */ - addr &= 0xbf; /* clear "IP" bit */ - dev_addr_mod(dev->net, 0, &addr, 1); -#endif } if (!_usbnet_get_stats64) _usbnet_get_stats64 = dev->net->netdev_ops->ndo_get_stats64; diff --git a/quectel_SRPD_PCIE/Makefile b/quectel_SRPD_PCIE/Makefile index 7e0f6b5..6397c23 100644 --- a/quectel_SRPD_PCIE/Makefile +++ b/quectel_SRPD_PCIE/Makefile @@ -15,8 +15,9 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/sprd_pcie - SUBMENU:=WWAN Support + SUBMENU:=PCIE Support TITLE:=Kernel pcie driver for SPRD device + DEPENDS:= FILES:=$(PKG_BUILD_DIR)/sprd_pcie.ko AUTOLOAD:=$(call AutoLoad,41,sprd_pcie) endef diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/Makefile b/quectel_SRPD_PCIE/luci-app-gobinetmodem/Makefile new file mode 100644 index 0000000..f12f31a --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/Makefile @@ -0,0 +1,20 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Modem Server +LUCI_DEPENDS:=+luci-compat +kmod-usb-net +kmod-usb-net-cdc-ether +kmod-usb-acm \ + +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ + +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ + +kmod-usb-serial-option \ + +kmod-usb2 +kmod-usb3 \ + +quectel-CM-5G +kmod-gobinet + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua b/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua new file mode 100644 index 0000000..2a761d6 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua @@ -0,0 +1,9 @@ +module("luci.controller.gobinetmodem", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/gobinetmodem") then + return + end + + entry({"admin", "network", "gobinetmodem"}, cbi("gobinetmodem"), _("Gobinet Modem Server"), 80).dependent=false +end diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua b/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua new file mode 100644 index 0000000..a117d7b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua @@ -0,0 +1,39 @@ +-- Copyright 2016 David Thornley +-- Licensed to the public under the Apache License 2.0. + + +mp=Map("gobinetmodem",translate("gobinet Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") +s.anonymous = true + +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false + +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true + +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true + +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true + +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") + +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true + +return mp + diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po b/quectel_SRPD_PCIE/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po new file mode 100644 index 0000000..df1f6df --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" +"X-Generator: Poedit 2.3.1\n" + +msgid "Base Setting" +msgstr "基本设置" + +msgid "gobinet Modem Server" +msgstr "gobinet移动网络拨号服务" + +msgid "Modem Server For OpenWrt" +msgstr "OpenWrt移动网络拨号服务" + +msgid "Tools" +msgstr "拨号工具" diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/config/gobinetmodem b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/config/gobinetmodem new file mode 100644 index 0000000..05fad9b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/config/gobinetmodem @@ -0,0 +1,4 @@ +config service + option tool 'quectel-CM' + option enabled '0' + diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/init.d/gobinetmodem b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/init.d/gobinetmodem new file mode 100644 index 0000000..953ee96 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/init.d/gobinetmodem @@ -0,0 +1,80 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2014 OpenWrt.org + +START=99 +STOP=16 +USE_PROCD=1 +#使用procd启动 + +run_4g() +{ + local enabled + config_get_bool enabled $1 enabled + + echo "run 4G" >> /tmp/log4g + + if [ "$enabled" = "1" ]; then + local user + local password + local apn + local auth + local pincode + local device + local tool + + # echo "enable 4G" >> /tmp/log4g + config_get user $1 user + config_get password $1 password + config_get apn $1 apn + config_get auth $1 auth + config_get pincode $1 pincode + config_get device $1 device + config_get tool $1 tool + config_get tty $1 tty + config_get atcmd $1 atcmd + + devname="$(basename "$device")" + devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)" + ifname="$( ls "$devpath"/net )" + + if [ "$tool" = "at" ];then + at_tool "$atcmd" -d $tty + else + procd_open_instance + #创建一个实例, 在procd看来一个应用程序可以多个实\E4\BE? + #ubus call service list 可以查看实例 + procd_set_param command $tool -i $ifname -s $apn + if [ "$password" != "" ];then + procd_append_param command $user $password $auth + fi + if [ "$pincode" != "" ]; then + procd_append_param command -p $pincode + fi + # procd_append_param command -f /tmp/4g.log + procd_set_param respawn + echo "quectel-CM has started." + procd_close_instance + #关闭实例 + fi + + fi +} + + +service_triggers() +{ + procd_add_reload_trigger "gobinetmodem" +} + +start_service() { + config_load gobinetmodem + config_foreach run_4g service +} + +stop_service() +{ + echo "4G stop" >> /tmp/log4g + killall quectel-CM + echo "quectel-CM has stoped." +} + diff --git a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem new file mode 100644 index 0000000..6eb5a09 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem @@ -0,0 +1,12 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@gobinetmodem[-1] + add ucitrack gobinetmodem + set ucitrack.@gobinetmodem[-1].init=gobinetmodem + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/Makefile b/quectel_SRPD_PCIE/luci-app-pcimodem/Makefile new file mode 100644 index 0000000..1bcb748 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=PCI Modem Server +LUCI_DEPENDS:=+kmod-pcie_mhi +pciutils +quectel-CM-5G + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/controller/pcimodem.lua b/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/controller/pcimodem.lua new file mode 100644 index 0000000..e1630c5 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/controller/pcimodem.lua @@ -0,0 +1,9 @@ +module("luci.controller.pcimodem", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/pcimodem") then + return + end + + entry({"admin", "network", "pcimodem"}, cbi("pcimodem"), _("PCI Modem Server"), 80).dependent=false +end diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua b/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua new file mode 100644 index 0000000..591ba4b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua @@ -0,0 +1,39 @@ +-- Copyright 2016 David Thornley +-- Licensed to the public under the Apache License 2.0. + + +mp=Map("pcimodem",translate("PCI Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") +s.anonymous = true + +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false + +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true + +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true + +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true + +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") + +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true + +return mp + diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/po/zh_Hans/pcimodem.po b/quectel_SRPD_PCIE/luci-app-pcimodem/po/zh_Hans/pcimodem.po new file mode 100644 index 0000000..fea348d --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/po/zh_Hans/pcimodem.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" +"X-Generator: Poedit 2.3.1\n" + +msgid "Base Setting" +msgstr "基本设置" + +msgid "PCI Modem Server" +msgstr "PCI移动网络拨号服务" + +msgid "Modem Server For OpenWrt" +msgstr "OpenWrt移动网络拨号服务" + +msgid "Tools" +msgstr "拨号工具" diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/config/pcimodem b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/config/pcimodem new file mode 100644 index 0000000..05fad9b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/config/pcimodem @@ -0,0 +1,4 @@ +config service + option tool 'quectel-CM' + option enabled '0' + diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/init.d/pcimodem b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/init.d/pcimodem new file mode 100644 index 0000000..f60124f --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/init.d/pcimodem @@ -0,0 +1,75 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2014 OpenWrt.org + +START=99 +STOP=16 +USE_PROCD=1 +#使用procd启动 + +run_5g() +{ + local enabled + config_get_bool enabled $1 enabled + + echo "run 4G" >> /tmp/log4g + + if [ "$enabled" = "1" ]; then + local user + local password + local apn + local auth + local pincode + local tool + + # echo "enable 5G" >> /tmp/log5g + config_get user $1 user + config_get password $1 password + config_get apn $1 apn + config_get auth $1 auth + config_get pincode $1 pincode + config_get tool $1 tool + config_get tty $1 tty + config_get atcmd $1 atcmd + + if [ "$tool" = "at" ];then + at_tool "$atcmd" -d $tty + else + procd_open_instance + #创建一个实例, 在procd看来一个应用程序可以多个实\E4\BE? + #ubus call service list 可以查看实例 + procd_set_param command $tool -i rmnet_mhi0 -s $apn + if [ "$password" != "" ];then + procd_append_param command $user $password $auth + fi + if [ "$pincode" != "" ]; then + procd_append_param command -p $pincode + fi + # procd_append_param command -f /tmp/4g.log + procd_set_param respawn + echo "quectel-CM has started." + procd_close_instance + #关闭实例 + fi + + fi +} + + +service_triggers() +{ + procd_add_reload_trigger "pcimodem" +} + +start_service() { + config_load pcimodem + config_foreach run_5g service +} + +stop_service() +{ + echo "5G stop" >> /tmp/log5g + killall quectel-CM + echo "quectel-CM has stoped." +} + + diff --git a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem new file mode 100644 index 0000000..213c62c --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem @@ -0,0 +1,12 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@pcimodem[-1] + add ucitrack pcimodem + set ucitrack.@pcimodem[-1].init=pcimodem + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/Makefile b/quectel_SRPD_PCIE/luci-app-spdmodem/Makefile new file mode 100644 index 0000000..252ec31 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=SPD Modem Server +LUCI_DEPENDS:= + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/controller/spdmodem.lua b/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/controller/spdmodem.lua new file mode 100644 index 0000000..81e8ad9 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/controller/spdmodem.lua @@ -0,0 +1,9 @@ +module("luci.controller.spdmodem", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/spdmodem") then + return + end + + entry({"admin", "network", "spdmodem"}, cbi("spdmodem"), _("SPD Modem Server"), 80).dependent=false +end diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua b/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua new file mode 100644 index 0000000..3456c37 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua @@ -0,0 +1,39 @@ +-- Copyright 2016 David Thornley +-- Licensed to the public under the Apache License 2.0. + + +mp=Map("spdmodem",translate("SPD Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") +s.anonymous = true + +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false + +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true + +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true + +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true + +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") + +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true + +return mp + diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/po/zh_Hans/spdmodem.po b/quectel_SRPD_PCIE/luci-app-spdmodem/po/zh_Hans/spdmodem.po new file mode 100644 index 0000000..b10da0f --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/po/zh_Hans/spdmodem.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" +"X-Generator: Poedit 2.3.1\n" + +msgid "Base Setting" +msgstr "基本设置" + +msgid "SPD Modem Server" +msgstr "SPD移动网络拨号服务" + +msgid "Modem Server For OpenWrt" +msgstr "OpenWrt移动网络拨号服务" + +msgid "Tools" +msgstr "拨号工具" diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/config/spdmodem b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/config/spdmodem new file mode 100644 index 0000000..05fad9b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/config/spdmodem @@ -0,0 +1,4 @@ +config service + option tool 'quectel-CM' + option enabled '0' + diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/init.d/spdmodem b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/init.d/spdmodem new file mode 100644 index 0000000..eece321 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/init.d/spdmodem @@ -0,0 +1,75 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2014 OpenWrt.org + +START=99 +STOP=16 +USE_PROCD=1 +#使用procd启动 + +run_5g() +{ + local enabled + config_get_bool enabled $1 enabled + + echo "run 4G" >> /tmp/log4g + + if [ "$enabled" = "1" ]; then + local user + local password + local apn + local auth + local pincode + local tool + + # echo "enable 5G" >> /tmp/log5g + config_get user $1 user + config_get password $1 password + config_get apn $1 apn + config_get auth $1 auth + config_get pincode $1 pincode + config_get tool $1 tool + config_get tty $1 tty + config_get atcmd $1 atcmd + + if [ "$tool" = "at" ];then + at_tool "$atcmd" -d $tty + else + procd_open_instance + #创建一个实例, 在procd看来一个应用程序可以多个实\E4\BE? + #ubus call service list 可以查看实例 + procd_set_param command $tool -i -s $apn + if [ "$password" != "" ];then + procd_append_param command $user $password $auth + fi + if [ "$pincode" != "" ]; then + procd_append_param command -p $pincode + fi + # procd_append_param command -f /tmp/4g.log + procd_set_param respawn + echo "quectel-CM has started." + procd_close_instance + #关闭实例 + fi + + fi +} + + +service_triggers() +{ + procd_add_reload_trigger "spdmodem" +} + +start_service() { + config_load spdmodem + config_foreach run_5g service +} + +stop_service() +{ + echo "5G stop" >> /tmp/log5g + killall quectel-CM + echo "quectel-CM has stoped." +} + + diff --git a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem new file mode 100644 index 0000000..1bfe6e4 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem @@ -0,0 +1,12 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@spdmodem[-1] + add ucitrack spdmodem + set ucitrack.@spdmodem[-1].init=spdmodem + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/Makefile b/quectel_SRPD_PCIE/luci-app-usbmodem/Makefile new file mode 100644 index 0000000..3349019 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/Makefile @@ -0,0 +1,20 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Modem Server +LUCI_DEPENDS:=+luci-compat +kmod-usb-net +kmod-usb-net-cdc-ether +kmod-usb-acm \ + +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis +kmod-usb-serial-qualcomm \ + +kmod-usb-net-sierrawireless +kmod-usb-ohci +kmod-usb-serial \ + +kmod-usb-serial-option +kmod-usb-wdm \ + +kmod-usb2 +kmod-usb3 \ + +quectel-CM-5G +kmod-qmi_wwan_q +kmod-usb-net-cdc-mbim + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/controller/usbmodem.lua b/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/controller/usbmodem.lua new file mode 100644 index 0000000..9021a61 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/controller/usbmodem.lua @@ -0,0 +1,9 @@ +module("luci.controller.usbmodem", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/usbmodem") then + return + end + + entry({"admin", "network", "usbmodem"}, cbi("usbmodem"), _("USB Modem Server"), 80).dependent=false +end diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua b/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua new file mode 100644 index 0000000..11e4df9 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua @@ -0,0 +1,51 @@ +-- Copyright 2016 David Thornley +-- Licensed to the public under the Apache License 2.0. + + +mp=Map("usbmodem",translate("USB Modem Server")) +mp.description=translate("Modem Server For OpenWrt") + +s=mp:section(TypedSection,"service", "Base Setting") +s.anonymous = true + +enabled=s:option(Flag,"enabled",translate("Enable")) +enabled.default=0 +enabled.rmempty=false + +device=s:option(Value, "device", translate("Modem device")) +device.rmempty = false + +local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*") + +if device_suggestions then + local node + for node in device_suggestions do + device:value(node) + end +end + +apn=s:option(Value,"apn",translate("APN")) +apn.rmempty=true + +pincode=s:option(Value,"pincode",translate("PIN")) +pincode.rmempty=true + +username=s:option(Value,"username",translate("PAP/CHAP username")) +username.rmempty=true + +password=s:option(Value,"password",translate("PAP/CHAP password")) +password.rmempty=true +auth=s:option(Value,"auth",translate("Authentication Type")) +password.rmempty=true +auth:value("",translate("-- Please choose --")) +auth:value("both","PAP/CHAP (both)") +auth:value("pap","PAP") +auth:value("chap","CHAP") +auth:value("none","NONE") + +tool=s:option(Value,"tool",translate("Tools")) +tool:value("quectel-CM","quectel-CM") +tool.rmempty=true + +return mp + diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/po/zh_Hans/usbmodem.po b/quectel_SRPD_PCIE/luci-app-usbmodem/po/zh_Hans/usbmodem.po new file mode 100644 index 0000000..6459a00 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/po/zh_Hans/usbmodem.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: dingpengyu \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" +"X-Generator: Poedit 2.3.1\n" + +msgid "Base Setting" +msgstr "基本设置" + +msgid "USB Modem Server" +msgstr "USB移动网络拨号服务" + +msgid "Modem Server For OpenWrt" +msgstr "OpenWrt移动网络拨号服务" + +msgid "Tools" +msgstr "拨号工具" diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/config/usbmodem b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/config/usbmodem new file mode 100644 index 0000000..8d7627b --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/config/usbmodem @@ -0,0 +1,5 @@ +config service + option tool 'quectel-CM' + option device '/dev/cdc-wdm0' + option enabled '0' + diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/init.d/usbmodem b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/init.d/usbmodem new file mode 100644 index 0000000..e5f1081 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/init.d/usbmodem @@ -0,0 +1,80 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2014 OpenWrt.org + +START=99 +STOP=16 +USE_PROCD=1 +#使用procd启动 + +run_4g() +{ + local enabled + config_get_bool enabled $1 enabled + + echo "run 4G" >> /tmp/log4g + + if [ "$enabled" = "1" ]; then + local user + local password + local apn + local auth + local pincode + local device + local tool + + # echo "enable 4G" >> /tmp/log4g + config_get user $1 user + config_get password $1 password + config_get apn $1 apn + config_get auth $1 auth + config_get pincode $1 pincode + config_get device $1 device + config_get tool $1 tool + config_get tty $1 tty + config_get atcmd $1 atcmd + + devname="$(basename "$device")" + devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)" + ifname="$( ls "$devpath"/net )" + + if [ "$tool" = "at" ];then + at_tool "$atcmd" -d $tty + else + procd_open_instance + #创建一个实例, 在procd看来一个应用程序可以多个实\E4\BE? + #ubus call service list 可以查看实例 + procd_set_param command $tool -i $ifname -s $apn + if [ "$password" != "" ];then + procd_append_param command $user $password $auth + fi + if [ "$pincode" != "" ]; then + procd_append_param command -p $pincode + fi + # procd_append_param command -f /tmp/4g.log + procd_set_param respawn + echo "quectel-CM has started." + procd_close_instance + #关闭实例 + fi + + fi +} + + +service_triggers() +{ + procd_add_reload_trigger "usbmodem" +} + +start_service() { + config_load usbmodem + config_foreach run_4g service +} + +stop_service() +{ + echo "4G stop" >> /tmp/log4g + killall quectel-CM + echo "quectel-CM has stoped." +} + diff --git a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem new file mode 100644 index 0000000..ebc3b75 --- /dev/null +++ b/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem @@ -0,0 +1,12 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@usbmodem[-1] + add ucitrack usbmodem + set ucitrack.@usbmodem[-1].init=usbmodem + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/quectel_cm_5G/Makefile b/quectel_cm_5G/Makefile index 06aafdc..623cda9 100644 --- a/quectel_cm_5G/Makefile +++ b/quectel_cm_5G/Makefile @@ -1,10 +1,10 @@ include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:= quectel-CM-5G -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_VERSION:=1.0 -include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/quectel-CM-5G @@ -17,23 +17,29 @@ define Package/quectel-CM-5G/description quectel-CM-5G app building test endef +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ${TOPDIR}/package/quectel_cm_5G/src/* $(PKG_BUILD_DIR)/ +endef + define Build/Compile $(MAKE) -C "$(PKG_BUILD_DIR)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ ARCH="$(LINUX_KARCH)" \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ - CC="$(TARGET_CC)" + CC="$(TARGET_CC)" \ + endef define Package/quectel-CM-5G/install - $(INSTALL_DIR) $(1)/usr/bin $(1)/lib/netifd/proto $(1)/lib/netifd - $(INSTALL_BIN) $(PKG_BUILD_DIR)/quectel-CM $(1)/usr/bin/quectel-CM - $(INSTALL_BIN) ./files/rmnet.sh $(1)/lib/netifd/proto - $(INSTALL_BIN) ./files/rmnet6.sh $(1)/lib/netifd/proto - $(INSTALL_BIN) ./files/rmnet6.script $(1)/lib/netifd - $(INSTALL_BIN) ./files/rmnet.script $(1)/lib/netifd - $(INSTALL_BIN) ./files/rmnet_init.sh $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/bin $(1)/lib/netifd/proto $(1)/lib/netifd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/quectel-CM $(1)/usr/bin/quectel-CM + $(INSTALL_BIN) ./files/rmnet_init.sh $(1)/usr/bin + $(INSTALL_BIN) ./files/rmnet.sh $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/rmnet.script $(1)/lib/netifd + $(INSTALL_BIN) ./files/rmnet6.sh $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/rmnet6.script $(1)/lib/netifd endef $(eval $(call BuildPackage,quectel-CM-5G))