diff --git a/luci-app-gobinetmodem/Makefile b/luci-app-gobinetmodem/Makefile index f12f31a..08676a3 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 2a761d6..5b6de85 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 a117d7b..784130f 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") -mp=Map("gobinetmodem",translate("gobinet Modem Server")) -mp.description=translate("Modem Server For OpenWrt") - -s=mp:section(TypedSection,"service", "Base Setting") +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 -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") +password = s:option(Value, "password", translate("PAP/CHAP password")) +password.rmempty = true -tool=s:option(Value,"tool",translate("Tools")) -tool:value("quectel-CM","quectel-CM") -tool.rmempty=true +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 return mp - diff --git a/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po b/luci-app-gobinetmodem/po/zh-cn/usbmodem.po similarity index 100% rename from luci-app-gobinetmodem/po/zh_Hans/usbmodem.po rename to luci-app-gobinetmodem/po/zh-cn/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 6eb5a09..b4b7674 100644 --- a/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem +++ b/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem @@ -9,4 +9,3 @@ 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 e1630c5..e1d3daf 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 591ba4b..258ce66 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") -mp=Map("pcimodem",translate("PCI Modem Server")) -mp.description=translate("Modem Server For OpenWrt") - -s=mp:section(TypedSection,"service", "Base Setting") +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 -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") +password = s:option(Value, "password", translate("PAP/CHAP password")) +password.rmempty = true -tool=s:option(Value,"tool",translate("Tools")) -tool:value("quectel-CM","quectel-CM") -tool.rmempty=true +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 return mp - diff --git a/luci-app-pcimodem/po/zh_Hans/pcimodem.po b/luci-app-pcimodem/po/zh-cn/pcimodem.po similarity index 100% rename from luci-app-pcimodem/po/zh_Hans/pcimodem.po rename to luci-app-pcimodem/po/zh-cn/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 213c62c..10f5ab8 100644 --- a/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem +++ b/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem @@ -9,4 +9,3 @@ EOF rm -f /tmp/luci-indexcache exit 0 - diff --git a/luci-app-spdmodem/Makefile b/luci-app-spdmodem/Makefile index 252ec31..988ee1c 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_DEPENDS:=+luci-compat +kmod-sprd_pcie 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 81e8ad9..c0164bb 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 3456c37..c6bade4 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") -mp=Map("spdmodem",translate("SPD Modem Server")) -mp.description=translate("Modem Server For OpenWrt") - -s=mp:section(TypedSection,"service", "Base Setting") +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 -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") +password = s:option(Value, "password", translate("PAP/CHAP password")) +password.rmempty = true -tool=s:option(Value,"tool",translate("Tools")) -tool:value("quectel-CM","quectel-CM") -tool.rmempty=true +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 return mp - diff --git a/luci-app-spdmodem/po/zh_Hans/spdmodem.po b/luci-app-spdmodem/po/zh-cn/spdmodem.po similarity index 100% rename from luci-app-spdmodem/po/zh_Hans/spdmodem.po rename to luci-app-spdmodem/po/zh-cn/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 1bfe6e4..faa1d1e 100644 --- a/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem +++ b/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem @@ -9,4 +9,3 @@ EOF rm -f /tmp/luci-indexcache exit 0 - diff --git a/luci-app-usbmodem/Makefile b/luci-app-usbmodem/Makefile index 3349019..2214f0c 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 9021a61..6cf943c 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 11e4df9..97af802 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") -mp=Map("usbmodem",translate("USB Modem Server")) -mp.description=translate("Modem Server For OpenWrt") - -s=mp:section(TypedSection,"service", "Base Setting") +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 -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") +password = s:option(Value, "password", translate("PAP/CHAP password")) +password.rmempty = true -tool=s:option(Value,"tool",translate("Tools")) -tool:value("quectel-CM","quectel-CM") -tool.rmempty=true +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 return mp - diff --git a/luci-app-usbmodem/po/zh_Hans/usbmodem.po b/luci-app-usbmodem/po/zh-cn/usbmodem.po similarity index 100% rename from luci-app-usbmodem/po/zh_Hans/usbmodem.po rename to luci-app-usbmodem/po/zh-cn/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 ebc3b75..1b2ba06 100644 --- a/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem +++ b/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem @@ -9,4 +9,3 @@ EOF rm -f /tmp/luci-indexcache exit 0 - diff --git a/quectel_Gobinet/Makefile b/quectel_Gobinet/Makefile index 5457008..abdba44 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:=Gobinet Support + SUBMENU:=WWAN 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 bf6f718..24dec5e 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:=PCIE Support + SUBMENU:=WWAN 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 74e9d1c..b27dfad 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:=1 +PKG_RELEASE:=2 include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/qmi_wwan_q - SUBMENU:=qmiwwan Support + SUBMENU:=WWAN 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 5b9c9ac..99a9e9f 100644 --- a/quectel_QMI_WWAN/src/qmi_wwan_q.c +++ b/quectel_QMI_WWAN/src/qmi_wwan_q.c @@ -319,7 +319,11 @@ 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; } @@ -383,7 +387,11 @@ 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 @@ -753,12 +761,22 @@ 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 } @@ -769,12 +787,22 @@ 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 } @@ -801,16 +829,25 @@ 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; @@ -1258,7 +1295,11 @@ 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)); @@ -2025,8 +2066,16 @@ 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 6397c23..7e0f6b5 100644 --- a/quectel_SRPD_PCIE/Makefile +++ b/quectel_SRPD_PCIE/Makefile @@ -15,9 +15,8 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define KernelPackage/sprd_pcie - SUBMENU:=PCIE Support + SUBMENU:=WWAN 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 deleted file mode 100644 index f12f31a..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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 deleted file mode 100644 index 2a761d6..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/controller/gobinetmodem.lua +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index a117d7b..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/luasrc/model/cbi/gobinetmodem.lua +++ /dev/null @@ -1,39 +0,0 @@ --- 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 deleted file mode 100644 index df1f6df..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/po/zh_Hans/usbmodem.po +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 05fad9b..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/config/gobinetmodem +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 953ee96..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/init.d/gobinetmodem +++ /dev/null @@ -1,80 +0,0 @@ -#!/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 deleted file mode 100644 index 6eb5a09..0000000 --- a/quectel_SRPD_PCIE/luci-app-gobinetmodem/root/etc/uci-defaults/luci-gobinetmodem +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 deleted file mode 100644 index 1bcb748..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# 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 deleted file mode 100644 index e1630c5..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/controller/pcimodem.lua +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 591ba4b..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/luasrc/model/cbi/pcimodem.lua +++ /dev/null @@ -1,39 +0,0 @@ --- 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 deleted file mode 100644 index fea348d..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/po/zh_Hans/pcimodem.po +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 05fad9b..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/config/pcimodem +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index f60124f..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/init.d/pcimodem +++ /dev/null @@ -1,75 +0,0 @@ -#!/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 deleted file mode 100644 index 213c62c..0000000 --- a/quectel_SRPD_PCIE/luci-app-pcimodem/root/etc/uci-defaults/luci-pcimodem +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 deleted file mode 100644 index 252ec31..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# 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 deleted file mode 100644 index 81e8ad9..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/controller/spdmodem.lua +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 3456c37..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/luasrc/model/cbi/spdmodem.lua +++ /dev/null @@ -1,39 +0,0 @@ --- 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 deleted file mode 100644 index b10da0f..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/po/zh_Hans/spdmodem.po +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 05fad9b..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/config/spdmodem +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index eece321..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/init.d/spdmodem +++ /dev/null @@ -1,75 +0,0 @@ -#!/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 deleted file mode 100644 index 1bfe6e4..0000000 --- a/quectel_SRPD_PCIE/luci-app-spdmodem/root/etc/uci-defaults/luci-spdmodem +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 deleted file mode 100644 index 3349019..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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 deleted file mode 100644 index 9021a61..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/controller/usbmodem.lua +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 11e4df9..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/luasrc/model/cbi/usbmodem.lua +++ /dev/null @@ -1,51 +0,0 @@ --- 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 deleted file mode 100644 index 6459a00..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/po/zh_Hans/usbmodem.po +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 8d7627b..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/config/usbmodem +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index e5f1081..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/init.d/usbmodem +++ /dev/null @@ -1,80 +0,0 @@ -#!/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 deleted file mode 100644 index ebc3b75..0000000 --- a/quectel_SRPD_PCIE/luci-app-usbmodem/root/etc/uci-defaults/luci-usbmodem +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 623cda9..06aafdc 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:=1 +PKG_RELEASE:=2 PKG_VERSION:=1.0 +include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/quectel-CM-5G @@ -17,29 +17,23 @@ 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_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 + $(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 endef $(eval $(call BuildPackage,quectel-CM-5G))