Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openwrt 23.05 #104

Merged
merged 10 commits into from
Nov 13, 2023
1 change: 1 addition & 0 deletions package/boot/uboot-envtools/files/ramips
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ alfa-network,tube-e4g|\
engenius,epg600|\
engenius,esr600h|\
linksys,re7000|\
meig,slt866|\
sitecom,wlr-4100-v1-002|\
zyxel,keenetic-lite-iii-a)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
Expand Down
2 changes: 1 addition & 1 deletion package/network/utils/iptables/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=iptables
PKG_VERSION:=1.8.8
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From da5b32fb4656ab69fe1156eb7e36c7c961839e8a Mon Sep 17 00:00:00 2001
From: Phil Sutter <[email protected]>
Date: Wed, 8 Jun 2022 13:45:13 +0200
Subject: [PATCH] extensions: string: Review parse_string() function

* Compare against sizeof(info->pattern) which is more clear than having
to know that this buffer is of size XT_STRING_MAX_PATTERN_SIZE

* Invert the check and error early to reduce indenting

* Pass info->patlen to memcpy() to avoid reading past end of 's'

Signed-off-by: Phil Sutter <[email protected]>
---
extensions/libxt_string.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

--- a/extensions/libxt_string.c
+++ b/extensions/libxt_string.c
@@ -78,14 +78,13 @@ static void string_init(struct xt_entry_

static void
parse_string(const char *s, struct xt_string_info *info)
-{
+{
/* xt_string does not need \0 at the end of the pattern */
- if (strlen(s) <= XT_STRING_MAX_PATTERN_SIZE) {
- memcpy(info->pattern, s, XT_STRING_MAX_PATTERN_SIZE);
- info->patlen = strnlen(s, XT_STRING_MAX_PATTERN_SIZE);
- return;
- }
- xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
+ if (strlen(s) > sizeof(info->pattern))
+ xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
+
+ info->patlen = strnlen(s, sizeof(info->pattern));
+ memcpy(info->pattern, s, info->patlen);
}

static void
2 changes: 1 addition & 1 deletion scripts/getver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try_git() {
r*)
GET_REV="$(echo $GET_REV | tr -d 'r')"
BASE_REV="$(git rev-list ${REBOOT}..HEAD 2>/dev/null | wc -l | awk '{print $1}')"
REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
[ $((BASE_REV - GET_REV)) -ge 0 ] && REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
;;
*)
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,52 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support

--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1086,6 +1086,7 @@ static const struct usb_device_id produc
@@ -1080,12 +1080,18 @@ static const struct usb_device_id produc
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
.driver_info = (unsigned long)&qmi_wwan_info,
},
+ { /* Meiglink SGM828 */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, USB_CLASS_VENDOR_SPEC, 0x10, 0x05),
+ .driver_info = (unsigned long)&qmi_wwan_info,
+ },
+
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */
+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */
+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */

/* 3. Combined interface devices matching on interface number */
{QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -247,6 +247,8 @@ static void option_instat_callback(struc
@@ -247,6 +247,11 @@ static void option_instat_callback(struc
#define UBLOX_PRODUCT_R410M 0x90b2
/* These Yuga products use Qualcomm's vendor ID */
#define YUGA_PRODUCT_CLM920_NC5 0x9625
+/* These MeigLink products use Qualcomm's vendor ID */
+#define MEIGLINK_PRODUCT_SLM750 0xf601
+
+#define MEIGLINK_VENDOR_ID 0x2dee
+#define MEIGLINK_PRODUCT_SLM828 0x4d49

#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
@@ -1185,6 +1187,11 @@ static const struct usb_device_id option
@@ -1144,6 +1149,11 @@ static const struct usb_device_id option
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
.driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
+ /* MeiG */
+ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x01) },
+ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x02) },
+ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x03) },
+ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x04) },
/* Quectel products using Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
@@ -1185,6 +1195,11 @@ static const struct usb_device_id option
.driver_info = ZLP },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },
Expand Down
56 changes: 56 additions & 0 deletions target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -630,6 +630,16 @@ static const struct driver_info zte_rndi
.tx_fixup = rndis_tx_fixup,
};

+static const struct driver_info asr_rndis_info = {
+ .description = "Asr RNDIS device",
+ .flags = FLAG_WWAN | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT | FLAG_NOARP,
+ .bind = rndis_bind,
+ .unbind = rndis_unbind,
+ .status = rndis_status,
+ .rx_fixup = rndis_rx_fixup,
+ .tx_fixup = rndis_tx_fixup,
+};
+
/*-------------------------------------------------------------------------*/

static const struct usb_device_id products [] = {
@@ -666,6 +676,36 @@ static const struct usb_device_id produc
USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
.driver_info = (unsigned long) &rndis_info,
}, {
+ /* Quectel EG060V rndis device */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6004,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
+ /* Quectel EC200A rndis device */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6005,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
+ /* Quectel EC200T rndis device */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6026,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
+ /* Simcom A7906E rndis device */
+ USB_DEVICE_AND_INTERFACE_INFO(0x1e0e, 0x9011,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
+ /* Meig SLM770A */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d57,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
+ /* Meig SLM828 */
+ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49,
+ USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+ .driver_info = (unsigned long) &asr_rndis_info,
+}, {
/* Novatel Verizon USB730L */
USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1),
.driver_info = (unsigned long) &rndis_info,
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ string.

--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -7,9 +7,11 @@
@@ -7,9 +7,12 @@
*/

#include <linux/device.h>
+#include <linux/ctype.h>
+#include <linux/etherdevice.h>
#include <linux/export.h>
#include <linux/fs.h>
Expand All @@ -32,7 +33,7 @@ string.
#include <linux/init.h>
#include <linux/kref.h>
#include <linux/module.h>
@@ -696,6 +698,37 @@ static int nvmem_validate_keepouts(struc
@@ -696,6 +699,62 @@ static int nvmem_validate_keepouts(struc
return 0;
}

Expand Down Expand Up @@ -66,25 +67,55 @@ string.
+
+ return 0;
+}
+
+static int nvmem_mac_base_hex_read(void *context, const char *id, int index, unsigned int offset,
+ void *buf, size_t bytes)
+{
+ u8 mac[ETH_ALEN], *hexstr;
+ int i;
+
+ if (WARN_ON(bytes != 2 * ETH_ALEN))
+ return -EINVAL;
+
+ hexstr = (u8 *)buf;
+ for (i = 0; i < ETH_ALEN; i++) {
+ if (!isxdigit(hexstr[i * 2]) || !isxdigit(hexstr[i * 2 + 1]))
+ return -EINVAL;
+
+ mac[i] = (hex_to_bin(hexstr[i * 2]) << 4) | hex_to_bin(hexstr[i * 2 + 1]);
+ }
+
+ if (index)
+ eth_addr_add(mac, index);
+
+ ether_addr_copy(buf, mac);
+
+ return 0;
+}
+
static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
{
struct nvmem_layout *layout = nvmem->layout;
@@ -731,6 +764,20 @@ static int nvmem_add_cells_from_dt(struc
@@ -731,6 +790,25 @@ static int nvmem_add_cells_from_dt(struc
if (layout && layout->fixup_cell_info)
layout->fixup_cell_info(nvmem, layout, &info);

+ if (of_device_is_compatible(np, "fixed-layout")) {
+ if (of_device_is_compatible(child, "mac-base")) {
+ if (info.bytes == 6) {
+ if (info.bytes == ETH_ALEN) {
+ info.raw_len = info.bytes;
+ info.bytes = ETH_ALEN;
+ info.read_post_process = nvmem_mac_base_raw_read;
+ } else if (info.bytes == 2 * ETH_ALEN) {
+ info.raw_len = info.bytes;
+ info.bytes = ETH_ALEN;
+ info.read_post_process = nvmem_mac_base_hex_read;
+ } else if (info.bytes == 3 * ETH_ALEN - 1) {
+ info.raw_len = info.bytes;
+ info.bytes = ETH_ALEN;
+ info.read_post_process = nvmem_mac_base_ascii_read;
+ }
+
+ }
+ }
+
Expand Down
135 changes: 135 additions & 0 deletions target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
compatible = "comfast,cf-e390ax", "mediatek,mt7621-soc";
model = "COMFAST CF-E390AX";

chosen {
bootargs = "console=ttyS0,115200";
};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};

leds {
compatible = "gpio-leds";

led_status_green: status_green {
label = "green:status";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};

led_status_blue: status_blue {
label = "blue:status";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};

led_status_red: status_red {
label = "red:status";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
};

aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_red;
};
};

&pcie {
status = "okay";
};

&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};

&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <14000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "bootloader";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "config";
reg = <0x30000 0x10000>;
read-only;
};

factory: partition@50000 {
label = "factory";
reg = <0x50000 0x10000>;
read-only;
};

partition@90000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x90000 0xf70000>;
};
};
};
};

&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_e000: macaddr@e000 {
reg = <0xe000 0x6>;
};
};

&gmac0 {
nvmem-cells = <&macaddr_factory_e000>;
nvmem-cell-names = "mac-address";
};

&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_factory_e000>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};

port@4 {
status = "okay";
label = "lan";
};
};
};

Loading
Loading