diff --git a/fibocom-dial/Makefile b/fibocom-dial/Makefile index 411cf9c..a454549 100644 --- a/fibocom-dial/Makefile +++ b/fibocom-dial/Makefile @@ -6,20 +6,21 @@ PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/fibocom-dial - SECTION:=utils - CATEGORY:=Utilities - TITLE:=Fibocom Dial + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Fibocom Dial endef -define Package/fibocom-dial/description - Fibocom Dial (Prints a snarky message) +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/fibocom-dial/install - $(INSTALL_DIR) $(1)/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/fibocom-dial $(1)/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/fibo_qmimsg_server $(1)/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/multi-pdn-manager $(1)/bin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fibocom-dial $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fibo_qmimsg_server $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/multi-pdn-manager $(1)/usr/bin endef $(eval $(call BuildPackage,fibocom-dial)) diff --git a/fibocom_QMI_WWAN/src/qmi_wwan_f.c b/fibocom_QMI_WWAN/src/qmi_wwan_f.c index 165a38c..8995e83 100644 --- a/fibocom_QMI_WWAN/src/qmi_wwan_f.c +++ b/fibocom_QMI_WWAN/src/qmi_wwan_f.c @@ -281,8 +281,11 @@ static int bridge_arp_reply(struct net_device *net, struct sk_buff *skb, uint br __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 1; } @@ -650,8 +653,13 @@ 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 net->stats.rx_packets += rx_packets; @@ -666,8 +674,13 @@ 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 net->stats.tx_packets += tx_packets; @@ -700,10 +713,17 @@ 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; @@ -1857,8 +1877,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/luci-app-gobinetmodem/Makefile b/luci-app-gobinetmodem/Makefile index 08676a3..634cff7 100644 --- a/luci-app-gobinetmodem/Makefile +++ b/luci-app-gobinetmodem/Makefile @@ -8,12 +8,9 @@ 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 +LUCI_DEPENDS:=+luci-compat +quectel-CM-5G +kmod-gobinet \ + +kmod-usb-net-cdc-ether +kmod-usb-net-qmi-wwan \ + +kmod-usb-net-rndis +kmod-usb-serial-option include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-usbmodem/Makefile b/luci-app-usbmodem/Makefile index 5411c43..447ca3c 100644 --- a/luci-app-usbmodem/Makefile +++ b/luci-app-usbmodem/Makefile @@ -8,12 +8,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 +LUCI_DEPENDS:=+luci-compat +quectel-CM-5G +kmod-usb-acm \ + +kmod-usb-net-cdc-ether +kmod-usb-net-cdc-mbim \ + +kmod-usb-net-qmi-wwan +kmod-usb-net-rndis \ + +kmod-usb-serial-option +kmod-usb-wdm \ + +kmod-qmi_wwan_f +kmod-qmi_wwan_q include $(TOPDIR)/feeds/luci/luci.mk diff --git a/quectel_cm_5G/Makefile b/quectel_cm_5G/Makefile index 06aafdc..5eff117 100644 --- a/quectel_cm_5G/Makefile +++ b/quectel_cm_5G/Makefile @@ -1,39 +1,39 @@ include $(TOPDIR)/rules.mk PKG_NAME:= quectel-CM-5G -PKG_RELEASE:=2 -PKG_VERSION:=1.0 +PKG_VERSION:=1.6.4 +PKG_RELEASE:=1 -include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/quectel-CM-5G SECTION:=utils CATEGORY:=Utilities - TITLE:=quectel-CM-5G app building test + TITLE:=quectel-CM-5G app endef -define Package/quectel-CM-5G/description - quectel-CM-5G app building test +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Compile $(MAKE) -C "$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ ARCH="$(LINUX_KARCH)" \ - SUBDIRS="$(PKG_BUILD_DIR)" \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + M="$(PKG_BUILD_DIR)" \ 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_DIR) $(1)/usr/bin $(1)/lib/netifd/proto + $(INSTALL_BIN) $(PKG_BUILD_DIR)/quectel-CM $(1)/usr/bin + $(INSTALL_BIN) ./files/rmnet_init.sh $(1)/lib/netifd + $(INSTALL_BIN) ./files/rmnet.script $(1)/lib/netifd $(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)) diff --git a/quectel_cm_5G/files/rmnet.script b/quectel_cm_5G/files/rmnet.script index 93d2cf0..5bafb90 100644 --- a/quectel_cm_5G/files/rmnet.script +++ b/quectel_cm_5G/files/rmnet.script @@ -10,6 +10,7 @@ . /lib/functions.sh . /lib/functions/network.sh . /lib/netifd/netifd-proto.sh + setup_interface() { INTERFACE=$1 CONFIG=/tmp/rmnet_$2_ipv4config diff --git a/quectel_cm_5G/files/rmnet.sh b/quectel_cm_5G/files/rmnet.sh index f783561..101ee60 100644 --- a/quectel_cm_5G/files/rmnet.sh +++ b/quectel_cm_5G/files/rmnet.sh @@ -6,6 +6,7 @@ . /lib/functions.sh . /lib/functions/network.sh . ../netifd-proto.sh + init_proto "$@" proto_rmnet_setup() { diff --git a/quectel_cm_5G/files/rmnet6.script b/quectel_cm_5G/files/rmnet6.script index d252c2c..bbe05b2 100644 --- a/quectel_cm_5G/files/rmnet6.script +++ b/quectel_cm_5G/files/rmnet6.script @@ -10,6 +10,7 @@ . /lib/functions.sh . /lib/functions/network.sh . /lib/netifd/netifd-proto.sh + setup_interface() { INTERFACE=$1 CONFIG=/tmp/rmnet_$2_ipv6config @@ -45,7 +46,7 @@ setup_interface() { done #proto_add_data - [ -n "$ZONE" ] && json_add_string zone "$ZONE" + [ -n "$ZONE" ] && json_add_string zone "$ZONE" proto_close_data proto_send_update "$INTERFACE" diff --git a/quectel_cm_5G/files/rmnet6.sh b/quectel_cm_5G/files/rmnet6.sh index 94a9598..57a5495 100644 --- a/quectel_cm_5G/files/rmnet6.sh +++ b/quectel_cm_5G/files/rmnet6.sh @@ -6,6 +6,7 @@ . /lib/functions.sh . /lib/functions/network.sh . ../netifd-proto.sh + init_proto "$@" proto_rmnet6_setup() {