Skip to content

Commit

Permalink
Merge pull request #130 from openwrtdiy/openwrt-23.05
Browse files Browse the repository at this point in the history
Synchronize official source code
  • Loading branch information
openwrtdiy authored Sep 25, 2024
2 parents 7ae765f + 6e561fe commit 4130d58
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 34 deletions.
2 changes: 1 addition & 1 deletion include/package-defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define Package/Default
PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=$(PKG_MAINTAINER)
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR)))
ifneq ($(PKG_VERSION),)
ifneq ($(PKG_RELEASE),)
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
Expand Down
3 changes: 2 additions & 1 deletion include/toplevel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))

prepare-tmpinfo: FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \
Expand Down
1 change: 1 addition & 0 deletions package/kernel/r8125/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endef

define KernelPackage/r8125-rss
$(call KernelPackage/r8125)
CONFLICTS:=kmod-r8125
TITLE+= (RSS)
VARIANT:=rss
endef
Expand Down
1 change: 1 addition & 0 deletions package/kernel/r8126/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endef

define KernelPackage/r8126-rss
$(call KernelPackage/r8126)
CONFLICTS:=kmod-r8126
TITLE+= (RSS)
VARIANT:=rss
endef
Expand Down
4 changes: 2 additions & 2 deletions target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
i2c {
compatible = "i2c-gpio";

sda-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
scl-gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
sda-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
scl-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
led-failsafe = &flash;
led-running = &power;
led-upgrade = &flash;
label-mac-device = &gmac;
};

soc {
Expand Down
1 change: 0 additions & 1 deletion target/linux/ramips/image/mt7621.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,6 @@ define Device/tplink_er605-v2
KERNEL_IN_UBI := 1
KERNEL_LOADADDR := 0x82000000
KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGES += sysupgrade.tar
IMAGE_SIZE := 127744k
endef
TARGET_DEVICES += tplink_er605-v2
Expand Down
73 changes: 47 additions & 26 deletions target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ static enum dsa_tag_protocol rtl83xx_get_tag_protocol(struct dsa_switch *ds,
return DSA_TAG_PROTO_TRAILER;
}

static void rtl83xx_vlan_set_pvid(struct rtl838x_switch_priv *priv,
int port, int pvid)
{
/* Set both inner and outer PVID of the port */
priv->r->vlan_port_pvid_set(port, PBVLAN_TYPE_INNER, pvid);
priv->r->vlan_port_pvid_set(port, PBVLAN_TYPE_OUTER, pvid);
priv->r->vlan_port_pvidmode_set(port, PBVLAN_TYPE_INNER,
PBVLAN_MODE_UNTAG_AND_PRITAG);
priv->r->vlan_port_pvidmode_set(port, PBVLAN_TYPE_OUTER,
PBVLAN_MODE_UNTAG_AND_PRITAG);

priv->ports[port].pvid = pvid;
}

/* Initialize all VLANS */
static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv)
{
Expand All @@ -132,17 +146,22 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv)
info.l2_tunnel_list_id = -1;
}

/* Initialize all vlans 0-4095 */
for (int i = 0; i < MAX_VLANS; i ++)
/* Initialize normal VLANs 1-4095 */
for (int i = 1; i < MAX_VLANS; i ++)
priv->r->vlan_set_tagged(i, &info);

/* reset PVIDs; defaults to 1 on reset */
for (int i = 0; i <= priv->ds->num_ports; i++) {
priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_INNER, 0);
priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_OUTER, 0);
priv->r->vlan_port_pvidmode_set(i, PBVLAN_TYPE_INNER, PBVLAN_MODE_UNTAG_AND_PRITAG);
priv->r->vlan_port_pvidmode_set(i, PBVLAN_TYPE_OUTER, PBVLAN_MODE_UNTAG_AND_PRITAG);
/*
* Initialize the special VLAN 0 and reset PVIDs. The CPU port PVID
* is applied to packets from the CPU for untagged destinations,
* regardless if the actual ingress VID. Any port with untagged
* egress VLAN(s) must therefore be a member of VLAN 0 to support
* CPU port as ingress when VLAN filtering is enabled.
*/
for (int i = 0; i <= priv->cpu_port; i++) {
rtl83xx_vlan_set_pvid(priv, i, 0);
info.tagged_ports |= BIT_ULL(i);
}
priv->r->vlan_set_tagged(0, &info);

/* Set forwarding action based on inner VLAN tag */
for (int i = 0; i < priv->cpu_port; i++)
Expand Down Expand Up @@ -1405,20 +1424,6 @@ static int rtl83xx_vlan_prepare(struct dsa_switch *ds, int port,
return 0;
}

static void rtl83xx_vlan_set_pvid(struct rtl838x_switch_priv *priv,
int port, int pvid)
{
/* Set both inner and outer PVID of the port */
priv->r->vlan_port_pvid_set(port, PBVLAN_TYPE_INNER, pvid);
priv->r->vlan_port_pvid_set(port, PBVLAN_TYPE_OUTER, pvid);
priv->r->vlan_port_pvidmode_set(port, PBVLAN_TYPE_INNER,
PBVLAN_MODE_UNTAG_AND_PRITAG);
priv->r->vlan_port_pvidmode_set(port, PBVLAN_TYPE_OUTER,
PBVLAN_MODE_UNTAG_AND_PRITAG);

priv->ports[port].pvid = pvid;
}

static int rtl83xx_vlan_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan,
struct netlink_ext_ack *extack)
Expand All @@ -1430,6 +1435,9 @@ static int rtl83xx_vlan_add(struct dsa_switch *ds, int port,
pr_debug("%s port %d, vid %d, flags %x\n",
__func__, port, vlan->vid, vlan->flags);

/* Let no one mess with our special VLAN 0 */
if (!vlan->vid) return 0;

if (vlan->vid > 4095) {
dev_err(priv->dev, "VLAN out of range: %d", vlan->vid);
return -ENOTSUPP;
Expand All @@ -1441,10 +1449,20 @@ static int rtl83xx_vlan_add(struct dsa_switch *ds, int port,

mutex_lock(&priv->reg_mutex);

if (vlan->flags & BRIDGE_VLAN_INFO_PVID)
rtl83xx_vlan_set_pvid(priv, port, vlan->vid);
else if (priv->ports[port].pvid == vlan->vid)
rtl83xx_vlan_set_pvid(priv, port, 0);
/*
* Realtek switches copy frames as-is to/from the CPU. For a proper
* VLAN handling the 12 bit RVID field (= VLAN id) for incoming traffic
* and the 1 bit RVID_SEL field (0 = use inner tag, 1 = use outer tag)
* for outgoing traffic of the CPU tag structure need to be handled. As
* of now no such logic is in place. So for the CPU port keep the fixed
* PVID=0 from initial setup in place and ignore all subsequent settings.
*/
if (port != priv->cpu_port) {
if (vlan->flags & BRIDGE_VLAN_INFO_PVID)
rtl83xx_vlan_set_pvid(priv, port, vlan->vid);
else if (priv->ports[port].pvid == vlan->vid)
rtl83xx_vlan_set_pvid(priv, port, 0);
}

/* Get port memberships of this vlan */
priv->r->vlan_tables_read(vlan->vid, &info);
Expand Down Expand Up @@ -1488,6 +1506,9 @@ static int rtl83xx_vlan_del(struct dsa_switch *ds, int port,
pr_debug("%s: port %d, vid %d, flags %x\n",
__func__, port, vlan->vid, vlan->flags);

/* Let no one mess with our special VLAN 0 */
if (!vlan->vid) return 0;

if (vlan->vid > 4095) {
dev_err(priv->dev, "VLAN out of range: %d", vlan->vid);
return -ENOTSUPP;
Expand Down
6 changes: 3 additions & 3 deletions tools/firmware-utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2024-01-31
PKG_SOURCE_VERSION:=c46b4b4ad7e77aab555bb41d6adc5554d11a83e8
PKG_MIRROR_HASH:=4affc0a85368ec8fc6df3719c628dd88b13ce6cc46ba2a52741a61d089e25e51
PKG_SOURCE_DATE:=2024-09-22
PKG_SOURCE_VERSION:=f3b636d0ee478ee8d757cb42d469e0a40d07627a
PKG_MIRROR_HASH:=c60f97e2c48842dd5c8e55cb214ce1139fa7586cd22ca489d656320b06bbbe68

include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
Expand Down

0 comments on commit 4130d58

Please sign in to comment.