Discussion:
[OpenWrt-Devel] Fix VLAN on Atheros AR8327N
Saverio Proto
2014-03-31 12:05:29 UTC
Permalink
Hello,

I cleaned up and rebased on current trunk the patch found on the
following ticket:
https://dev.openwrt.org/ticket/12181

I ask for help for proper testing.

I can provide binary images if needed.
My git repository is here:
https://github.com/zioproto/openwrt-trunk-zioproto/tree/ticket12181

thanks

Saverio
Damian Kaczkowski
2014-03-31 14:05:24 UTC
Permalink
Post by Saverio Proto
Hello,
I cleaned up and rebased on current trunk the patch found on the
https://dev.openwrt.org/ticket/12181
I ask for help for proper testing.
Hello there.

Have a question. What about those switch chips:
- ar8316,
- ar8227,
- ar7240.

Are they also capable of doing tagged+untagged vlan on the same port at the
same time? Do they benefit from this pach? Could anyone with a deeper
knowledge comment on this topic please? Many thanks in advance.
Saverio Proto
2014-03-31 14:20:38 UTC
Permalink
Yes,
the patch makes possible to have tagged+untagged vlan on the same port
at the same time.
please read https://dev.openwrt.org/ticket/12181 for more details

Saverio

2014-03-31 16:05 GMT+02:00 Damian Kaczkowski
Post by Damian Kaczkowski
Post by Saverio Proto
Hello,
I cleaned up and rebased on current trunk the patch found on the
https://dev.openwrt.org/ticket/12181
I ask for help for proper testing.
Hello there.
- ar8316,
- ar8227,
- ar7240.
Are they also capable of doing tagged+untagged vlan on the same port at the
same time? Do they benefit from this pach? Could anyone with a deeper
knowledge comment on this topic please? Many thanks in advance.
Damian Kaczkowski
2014-03-31 14:37:19 UTC
Permalink
Post by Saverio Proto
Yes,
the patch makes possible to have tagged+untagged vlan on the same port
at the same time.
please read https://dev.openwrt.org/ticket/12181 for more details
Thanks for pointers but I read that already and haven't found answer to my
questions.
Jonas Gorski
2014-03-31 14:39:38 UTC
Permalink
On Mon, Mar 31, 2014 at 4:05 PM, Damian Kaczkowski
Post by Damian Kaczkowski
Post by Saverio Proto
Hello,
I cleaned up and rebased on current trunk the patch found on the
https://dev.openwrt.org/ticket/12181
I ask for help for proper testing.
Hello there.
- ar8316,
- ar8227,
- ar7240.
Are they also capable of doing tagged+untagged vlan on the same port at the
same time? Do they benefit from this pach? Could anyone with a deeper
knowledge comment on this topic please? Many thanks in advance.
It's a bit more complicated.

ar8216, ar8316:
- do not support mixed traffic at all. Either everything is tagged or
nothing is tagged on a port.

ar8227/8, ar8236
- support having the PVID untagged and everything else tagged through
a special port-tag-mode, so here only one vlan untagged at most, and
it always matches the PVID.

ar8327/8, ar8337/8.
- support per untagging/tagging on a per vlan per port basis on
egress. So here more than one vlan could be untagged on egress, but
the PVID still sets the incoming VID.


No idea about ar7240, ar933x, ar934x, ar935x, qca955x, although I
suspect ar7240 will fall into the same category as ar8216, and ar933x
and newer into the ar8227/8 category, maybe the "enterprise" class
ones even like ar8327.



Jonas
Stefan Hellermann
2014-04-01 08:05:05 UTC
Permalink
Post by Jonas Gorski
Post by Damian Kaczkowski
Hello there.
- ar8316,
- ar8227,
- ar7240.
Are they also capable of doing tagged+untagged vlan on the same port at
the
Post by Damian Kaczkowski
same time? Do they benefit from this pach? Could anyone with a deeper
knowledge comment on this topic please? Many thanks in advance.
It's a bit more complicated.
- do not support mixed traffic at all. Either everything is tagged or
nothing is tagged on a port.
ar8227/8, ar8236
- support having the PVID untagged and everything else tagged through
a special port-tag-mode, so here only one vlan untagged at most, and
it always matches the PVID.
ar8327/8, ar8337/8.
- support per untagging/tagging on a per vlan per port basis on
egress. So here more than one vlan could be untagged on egress, but
the PVID still sets the incoming VID.
No idea about ar7240, ar933x, ar934x, ar935x, qca955x, although I
suspect ar7240 will fall into the same category as ar8216, and ar933x
and newer into the ar8227/8 category, maybe the "enterprise" class
ones even like ar8327.
What about ar8366s? It used to work, but currently it's broken.
https://dev.openwrt.org/ticket/7795
Post by Jonas Gorski
Jonas
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Damian Kaczkowski
2014-04-01 09:15:56 UTC
Permalink
Post by Stefan Hellermann
What about ar8366s? It used to work, but currently it's broken.
https://dev.openwrt.org/ticket/7795
It's RTL8366S not ar8336s. It's Realtek not Qualcomm/Atheros. Quite a
different story I think.
Saverio Proto
2014-04-24 10:44:06 UTC
Permalink
Hello,

talking about:
https://dev.openwrt.org/ticket/12181

patch has been tested @ Ninux.org on TP-Link WDR3600. We are now able
to successfully have tagged and untagged frames together on the same
port.

Here is the clean version of the patch rebased on current trunk:
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1

please review it and merge it into trunk.

Saverio
Post by Saverio Proto
Hello,
I cleaned up and rebased on current trunk the patch found on the
https://dev.openwrt.org/ticket/12181
I ask for help for proper testing.
I can provide binary images if needed.
https://github.com/zioproto/openwrt-trunk-zioproto/tree/ticket12181
thanks
Saverio
John Crispin
2014-04-24 10:47:26 UTC
Permalink
Post by Saverio Proto
Hello,
talking about: https://dev.openwrt.org/ticket/12181
able to successfully have tagged and untagged frames together on
the same port.
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1
please review it and merge it into trunk.
Saverio
hi Saverio,

can you send the cleaned up version to the -devel list ? that way its
inside out patchwork and we can mark the old version superseeded

John
Saverio Proto
2014-04-24 10:56:46 UTC
Permalink
Hello,

the patch is attached to this email.

thanks

Saverio
Post by John Crispin
Post by Saverio Proto
Hello,
talking about: https://dev.openwrt.org/ticket/12181
able to successfully have tagged and untagged frames together on
the same port.
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1
please review it and merge it into trunk.
Saverio
hi Saverio,
can you send the cleaned up version to the -devel list ? that way its
inside out patchwork and we can mark the old version superseeded
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Álvaro Fernández Rojas
2014-05-02 01:07:52 UTC
Permalink
Hello,

I've tested this patch but I couldn't get it completely fixed on AR8327 (TL-WDR4300).

However, I've modified it and successfully configured the switch for untagged + tagged.
https://dl.dropboxusercontent.com/u/4708147/openwrt/patches/ar8327.patch

The problem was in ar8327_sw_set_ports(), which I suspect was copied from ar8216_sw_set_ports(), without removing the code that disables all tagged ports if an untagged port is already present.

P.S: @Saverio feel free to resend the patch yourself if you agree with the changes.

Regards,
Álvaro.
Post by Saverio Proto
Hello,
the patch is attached to this email.
thanks
Saverio
Post by John Crispin
Post by Saverio Proto
Hello,
talking about: https://dev.openwrt.org/ticket/12181
able to successfully have tagged and untagged frames together on
the same port.
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1
please review it and merge it into trunk.
Saverio
hi Saverio,
can you send the cleaned up version to the -devel list ? that way its
inside out patchwork and we can mark the old version superseeded
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Saverio Proto
2014-05-02 07:46:52 UTC
Permalink
Hello Alvaro,

I have another user (Cc: in this email) reporting wdr4300 working with
the original patch.

I updated my tree with your changes, and rebased on current trunk:
https://github.com/zioproto/openwrt-trunk-zioproto/commits/ticket12181

You are just deleting this code right ?
https://github.com/zioproto/openwrt-trunk-zioproto/commit/c4a8e0a8f164d03074d55e649e883422ae03c905

Alvaro and Domantas MrVisata, can you please tell me your testing
setup? I would like to understand what is working for Domantas and
what is not working for Alvaro.

If you just post your /etc/config/network it would be enough. Thanks.

Saverio
Post by Saverio Proto
Hello,
I've tested this patch but I couldn't get it completely fixed on AR8327 (TL-WDR4300).
However, I've modified it and successfully configured the switch for untagged + tagged.
https://dl.dropboxusercontent.com/u/4708147/openwrt/patches/ar8327.patch
The problem was in ar8327_sw_set_ports(), which I suspect was copied from ar8216_sw_set_ports(), without removing the code that disables all tagged ports if an untagged port is already present.
Regards,
Álvaro.
Post by Saverio Proto
Hello,
the patch is attached to this email.
thanks
Saverio
Post by John Crispin
Post by Saverio Proto
Hello,
talking about: https://dev.openwrt.org/ticket/12181
able to successfully have tagged and untagged frames together on
the same port.
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1
please review it and merge it into trunk.
Saverio
hi Saverio,
can you send the cleaned up version to the -devel list ? that way its
inside out patchwork and we can mark the old version superseeded
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Álvaro Fernández Rojas
2014-05-02 10:15:56 UTC
Permalink
Hello Saverio,

Yeah, I just deleted that code, which was preventing my port 5 from being set as tagged on previous VLANs and removed it completely from those VLANs if it was marked as tagged later.
I think that the problem is that the code that I removed is sequential and it only removes tagged ports configured before the untagged appearence, because Domantas config has the untagged appearence port first and the tagged later, whereas mine has the tagged first and the untagged later.

And my config:
---
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd0c:518e:715b::/48'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0t 3 4 5t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 1t'
option vid '2'

config switch_vlan
option device 'switch0'
option vlan '3'
option ports '0t 1t'
option vid '3'

config switch_vlan
option device 'switch0'
option vlan '4'
option vid '4'
option ports '0t 2 5'

config interface 'lan'
option ifname 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option igmp_snooping '1'

config interface 'iptv'
option ifname 'eth0.2'
option proto 'static'
option ipaddr '172.26.208.63'
option netmask '255.255.240.0'
option gateway '10.26.208.1'
option defaultroute '0'
option peerdns '0'

config interface 'voip'
option ifname 'eth0.3'
option proto 'dhcp'
option defaultroute '0'
option peerdns '0'

config interface 'wan'
option ifname 'eth0.6'
option proto 'pppoe'
option username '***@telefonicanetpa'
option password 'adslppp'

config switch_vlan
option device 'switch0'
option vlan '6'
option ports '0t 1t'
option vid '6'

config interface 'tvlan'
option proto 'static'
option ifname 'eth0.4'
option ipaddr '10.217.47.233'
option netmask '255.255.255.248'
---

Regards,
Álvaro.
Post by Saverio Proto
Hello Alvaro,
I have another user (Cc: in this email) reporting wdr4300 working with
the original patch.
https://github.com/zioproto/openwrt-trunk-zioproto/commits/ticket12181
You are just deleting this code right ?
https://github.com/zioproto/openwrt-trunk-zioproto/commit/c4a8e0a8f164d03074d55e649e883422ae03c905
Alvaro and Domantas MrVisata, can you please tell me your testing
setup? I would like to understand what is working for Domantas and
what is not working for Alvaro.
If you just post your /etc/config/network it would be enough. Thanks.
Saverio
Post by Saverio Proto
Hello,
I've tested this patch but I couldn't get it completely fixed on AR8327 (TL-WDR4300).
However, I've modified it and successfully configured the switch for untagged + tagged.
https://dl.dropboxusercontent.com/u/4708147/openwrt/patches/ar8327.patch
The problem was in ar8327_sw_set_ports(), which I suspect was copied from ar8216_sw_set_ports(), without removing the code that disables all tagged ports if an untagged port is already present.
Regards,
Álvaro.
Post by Saverio Proto
Hello,
the patch is attached to this email.
thanks
Saverio
Post by John Crispin
Post by Saverio Proto
Hello,
talking about: https://dev.openwrt.org/ticket/12181
able to successfully have tagged and untagged frames together on
the same port.
https://github.com/zioproto/openwrt-trunk-zioproto/commit/e7226ba45d7198dff71fde3caa1be9962f9f4ef1
please review it and merge it into trunk.
Saverio
hi Saverio,
can you send the cleaned up version to the -devel list ? that way its
inside out patchwork and we can mark the old version superseeded
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Álvaro Fernández Rojas
2014-07-19 19:49:38 UTC
Permalink
Commit 40842 reverted the fix for tagged+untagged VLANs on AR8327:
https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842

According to jow, some people experienced some "issues" on older devices. Can anyone tell me what were those issues?

Anyway, that patch modified some parts of the ar8216/ar8236, so I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as much untouched as possible.
Could anyone test it on those devices?

BTW, this works for me on a TP-Link WDR4300 (ar8327).

Signed-off-by: Saverio Proto <***@gmail.com>
Signed-off-by: Álvaro Fernández <***@gmail.com>
---
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 3846159..9eae624 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -78,7 +78,7 @@ struct ar8xxx_chip {
u32 (*read_port_status)(struct ar8xxx_priv *priv, int port);
int (*atu_flush)(struct ar8xxx_priv *priv);
void (*vtu_flush)(struct ar8xxx_priv *priv);
- void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask);
+ void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vlan);

const struct ar8xxx_mib_desc *mib_decs;
unsigned num_mibs;
@@ -112,7 +112,12 @@ struct ar8327_led {
enum ar8327_led_pattern pattern;
};

+struct ar8216_data {
+ u8 vlan_tagged;
+};
+
struct ar8327_data {
+ u8 vlan_tagged[AR8X16_MAX_VLANS];
u32 port0_status;
u32 port6_status;

@@ -138,6 +143,7 @@ struct ar8xxx_priv {
u8 chip_rev;
const struct ar8xxx_chip *chip;
union {
+ struct ar8216_data ar8216;
struct ar8327_data ar8327;
} chip_data;
bool initialized;
@@ -159,7 +165,6 @@ struct ar8xxx_priv {
bool vlan;
u16 vlan_id[AR8X16_MAX_VLANS];
u8 vlan_table[AR8X16_MAX_VLANS];
- u8 vlan_tagged;
u16 pvid[AR8X16_MAX_PORTS];

/* mirroring */
@@ -641,7 +646,7 @@ ar8216_mangle_rx(struct net_device *dev, struct sk_buff *skb)
port = buf[0] & 0xf;

/* no need to fix up packets coming from a tagged source */
- if (priv->vlan_tagged & (1 << port))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(port))
return;

/* lookup port vid from local table, the switch passes an invalid vlan id */
@@ -695,10 +700,13 @@ ar8216_vtu_flush(struct ar8xxx_priv *priv)
}

static void
-ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;

+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+
op = AR8216_VTU_OP_LOAD | (vid << AR8216_VTU_VID_S);
ar8216_vtu_op(priv, op, port_mask);
}
@@ -1705,12 +1713,16 @@ ar8327_vtu_flush(struct ar8xxx_priv *priv)
}

static void
-ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;
u32 val;
int i;

+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+ u32 tagged = priv->chip_data.ar8327.vlan_tagged[vlan];
+
op = AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S);
val = AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL;
for (i = 0; i < AR8327_NUM_PORTS; i++) {
@@ -1720,7 +1732,7 @@ ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
mode = AR8327_VTU_FUNC0_EG_MODE_NOT;
else if (priv->vlan == 0)
mode = AR8327_VTU_FUNC0_EG_MODE_KEEP;
- else if (priv->vlan_tagged & BIT(i))
+ else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG;
else
mode = AR8327_VTU_FUNC0_EG_MODE_UNTAG;
@@ -1734,26 +1746,22 @@ static void
ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32 egress, u32 ingress,
u32 members, u32 pvid)
{
- u32 t;
- u32 mode;
+ u32 mode, t;
+
+ if (priv->vlan) {
+ pvid = priv->vlan_id[priv->pvid[port]];
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
+ ingress = AR8216_IN_SECURE;
+ } else {
+ pvid = port;
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
+ ingress = AR8216_IN_PORT_ONLY;
+ }

t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S;
t |= pvid << AR8327_PORT_VLAN0_DEF_CVID_S;
priv->write(priv, AR8327_REG_PORT_VLAN0(port), t);

- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
- switch (egress) {
- case AR8216_OUT_KEEP:
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
- break;
- case AR8216_OUT_STRIP_VLAN:
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTAG;
- break;
- case AR8216_OUT_ADD_VLAN:
- mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break;
- }
-
t = AR8327_PORT_VLAN1_PORT_VLAN_PROP;
t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S;
priv->write(priv, AR8327_REG_PORT_VLAN1(port), t);
@@ -1851,23 +1859,21 @@ ar8xxx_sw_get_port_link(struct switch_dev *dev, int port,
}

static int
-ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+ar8xxx_sw_get_ports(struct switch_val *val, int ports, u8 port_mask, u8 tagged)
{
- struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
- u8 ports = priv->vlan_table[val->port_vlan];
int i;

val->len = 0;
- for (i = 0; i < dev->ports; i++) {
+ for (i = 0; i < ports; i++) {
struct switch_port *p;

- if (!(ports & (1 << i)))
+ if (!(port_mask & BIT(i)))
continue;

p = &val->value.ports[val->len++];
p->id = i;
- if (priv->vlan_tagged & (1 << i))
- p->flags = (1 << SWITCH_PORT_FLAG_TAGGED);
+ if (tagged & BIT(i))
+ p->flags = BIT(SWITCH_PORT_FLAG_TAGGED);
else
p->flags = 0;
}
@@ -1875,20 +1881,55 @@ ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
}

static int
-ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+ar8216_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8216.vlan_tagged;
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8327_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8327.vlan_tagged[val->port_vlan];
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8216_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *tagged = &priv->chip_data.ar8216.vlan_tagged;
int i, j;

*vt = 0;
for (i = 0; i < val->len; i++) {
struct switch_port *p = &val->value.ports[i];

- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) {
- priv->vlan_tagged |= (1 << p->id);
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+
+ /* if port was untagged before then
+ * remove him from other vlans */
+ if(*tagged & BIT(p->id)){
+ for (j = 0; j < AR8X16_MAX_VLANS; j++) {
+ if (j == val->port_vlan)
+ continue;
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
+ }
+ }
+
+ *tagged |= BIT(p->id);
} else {
- priv->vlan_tagged &= ~(1 << p->id);
+ *tagged &= ~(BIT(p->id));
priv->pvid[p->id] = val->port_vlan;

/* make sure that an untagged port does not
@@ -1896,11 +1937,38 @@ ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
for (j = 0; j < AR8X16_MAX_VLANS; j++) {
if (j == val->port_vlan)
continue;
- priv->vlan_table[j] &= ~(1 << p->id);
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
}
}

- *vt |= 1 << p->id;
+ *vt |= BIT(p->id);
+ }
+ return 0;
+}
+
+static int
+ar8327_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *vlan_tagged = priv->chip_data.ar8327.vlan_tagged;
+ u8 *tagged = &vlan_tagged[val->port_vlan];
+
+ int i;
+
+ *vt = 0;
+ *tagged = 0;
+ for (i = 0; i < val->len; i++) {
+ struct switch_port *p = &val->value.ports[i];
+
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+ *tagged |= BIT(p->id);
+ } else {
+ priv->pvid[p->id] = val->port_vlan;
+ }
+
+ *vt |= BIT(p->id);
}
return 0;
}
@@ -2019,13 +2087,12 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
continue;

for (i = 0; i < dev->ports; i++) {
- u8 mask = (1 << i);
+ u8 mask = BIT(i);
if (vp & mask)
portmask[i] |= vp & ~mask;
}

- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j],
- priv->vlan_table[j]);
+ priv->chip->vtu_load_vlan(priv, j);
}
} else {
/* vlan disabled:
@@ -2034,8 +2101,8 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (i == AR8216_PORT_CPU)
continue;

- portmask[i] = 1 << AR8216_PORT_CPU;
- portmask[AR8216_PORT_CPU] |= (1 << i);
+ portmask[i] = BIT(AR8216_PORT_CPU);
+ portmask[AR8216_PORT_CPU] |= BIT(i);
}
}

@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)

if (priv->vlan) {
pvid = priv->vlan_id[priv->pvid[i]];
- if (priv->vlan_tagged & (1 << i))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(i))
egress = AR8216_OUT_ADD_VLAN;
else
egress = AR8216_OUT_STRIP_VLAN;
@@ -2442,8 +2509,8 @@ static const struct switch_dev_ops ar8xxx_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8216_sw_get_ports,
+ .set_vlan_ports = ar8216_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
@@ -2464,8 +2531,8 @@ static const struct switch_dev_ops ar8327_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8327_sw_get_ports,
+ .set_vlan_ports = ar8327_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
Jiri Pirko
2014-08-31 17:42:22 UTC
Permalink
Post by Álvaro Fernández Rojas
https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842
According to jow, some people experienced some "issues" on older devices. Can anyone tell me what were those issues?
Anyway, that patch modified some parts of the ar8216/ar8236, so I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as much untouched as possible.
Could anyone test it on those devices?
BTW, this works for me on a TP-Link WDR4300 (ar8327).
I tested the patch on TL-WR1043ND v2 with Atheros AR8327 rev. 4. Vlans
are working as expected. Please include this into BB (might need repost)

Thanks!
Post by Álvaro Fernández Rojas
---
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 3846159..9eae624 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -78,7 +78,7 @@ struct ar8xxx_chip {
u32 (*read_port_status)(struct ar8xxx_priv *priv, int port);
int (*atu_flush)(struct ar8xxx_priv *priv);
void (*vtu_flush)(struct ar8xxx_priv *priv);
- void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask);
+ void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vlan);
const struct ar8xxx_mib_desc *mib_decs;
unsigned num_mibs;
@@ -112,7 +112,12 @@ struct ar8327_led {
enum ar8327_led_pattern pattern;
};
+struct ar8216_data {
+ u8 vlan_tagged;
+};
+
struct ar8327_data {
+ u8 vlan_tagged[AR8X16_MAX_VLANS];
u32 port0_status;
u32 port6_status;
@@ -138,6 +143,7 @@ struct ar8xxx_priv {
u8 chip_rev;
const struct ar8xxx_chip *chip;
union {
+ struct ar8216_data ar8216;
struct ar8327_data ar8327;
} chip_data;
bool initialized;
@@ -159,7 +165,6 @@ struct ar8xxx_priv {
bool vlan;
u16 vlan_id[AR8X16_MAX_VLANS];
u8 vlan_table[AR8X16_MAX_VLANS];
- u8 vlan_tagged;
u16 pvid[AR8X16_MAX_PORTS];
/* mirroring */
@@ -641,7 +646,7 @@ ar8216_mangle_rx(struct net_device *dev, struct sk_buff *skb)
port = buf[0] & 0xf;
/* no need to fix up packets coming from a tagged source */
- if (priv->vlan_tagged & (1 << port))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(port))
return;
/* lookup port vid from local table, the switch passes an invalid vlan id */
@@ -695,10 +700,13 @@ ar8216_vtu_flush(struct ar8xxx_priv *priv)
}
static void
-ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;
+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+
op = AR8216_VTU_OP_LOAD | (vid << AR8216_VTU_VID_S);
ar8216_vtu_op(priv, op, port_mask);
}
@@ -1705,12 +1713,16 @@ ar8327_vtu_flush(struct ar8xxx_priv *priv)
}
static void
-ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;
u32 val;
int i;
+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+ u32 tagged = priv->chip_data.ar8327.vlan_tagged[vlan];
+
op = AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S);
val = AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL;
for (i = 0; i < AR8327_NUM_PORTS; i++) {
@@ -1720,7 +1732,7 @@ ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
mode = AR8327_VTU_FUNC0_EG_MODE_NOT;
else if (priv->vlan == 0)
mode = AR8327_VTU_FUNC0_EG_MODE_KEEP;
- else if (priv->vlan_tagged & BIT(i))
+ else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG;
else
mode = AR8327_VTU_FUNC0_EG_MODE_UNTAG;
@@ -1734,26 +1746,22 @@ static void
ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32 egress, u32 ingress,
u32 members, u32 pvid)
{
- u32 t;
- u32 mode;
+ u32 mode, t;
+
+ if (priv->vlan) {
+ pvid = priv->vlan_id[priv->pvid[port]];
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
+ ingress = AR8216_IN_SECURE;
+ } else {
+ pvid = port;
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
+ ingress = AR8216_IN_PORT_ONLY;
+ }
t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S;
t |= pvid << AR8327_PORT_VLAN0_DEF_CVID_S;
priv->write(priv, AR8327_REG_PORT_VLAN0(port), t);
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
- switch (egress) {
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
- break;
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTAG;
- break;
- mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break;
- }
-
t = AR8327_PORT_VLAN1_PORT_VLAN_PROP;
t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S;
priv->write(priv, AR8327_REG_PORT_VLAN1(port), t);
@@ -1851,23 +1859,21 @@ ar8xxx_sw_get_port_link(struct switch_dev *dev, int port,
}
static int
-ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+ar8xxx_sw_get_ports(struct switch_val *val, int ports, u8 port_mask, u8 tagged)
{
- struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
- u8 ports = priv->vlan_table[val->port_vlan];
int i;
val->len = 0;
- for (i = 0; i < dev->ports; i++) {
+ for (i = 0; i < ports; i++) {
struct switch_port *p;
- if (!(ports & (1 << i)))
+ if (!(port_mask & BIT(i)))
continue;
p = &val->value.ports[val->len++];
p->id = i;
- if (priv->vlan_tagged & (1 << i))
- p->flags = (1 << SWITCH_PORT_FLAG_TAGGED);
+ if (tagged & BIT(i))
+ p->flags = BIT(SWITCH_PORT_FLAG_TAGGED);
else
p->flags = 0;
}
@@ -1875,20 +1881,55 @@ ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
}
static int
-ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+ar8216_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8216.vlan_tagged;
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8327_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8327.vlan_tagged[val->port_vlan];
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8216_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *tagged = &priv->chip_data.ar8216.vlan_tagged;
int i, j;
*vt = 0;
for (i = 0; i < val->len; i++) {
struct switch_port *p = &val->value.ports[i];
- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) {
- priv->vlan_tagged |= (1 << p->id);
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+
+ /* if port was untagged before then
+ * remove him from other vlans */
+ if(*tagged & BIT(p->id)){
+ for (j = 0; j < AR8X16_MAX_VLANS; j++) {
+ if (j == val->port_vlan)
+ continue;
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
+ }
+ }
+
+ *tagged |= BIT(p->id);
} else {
- priv->vlan_tagged &= ~(1 << p->id);
+ *tagged &= ~(BIT(p->id));
priv->pvid[p->id] = val->port_vlan;
/* make sure that an untagged port does not
@@ -1896,11 +1937,38 @@ ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
for (j = 0; j < AR8X16_MAX_VLANS; j++) {
if (j == val->port_vlan)
continue;
- priv->vlan_table[j] &= ~(1 << p->id);
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
}
}
- *vt |= 1 << p->id;
+ *vt |= BIT(p->id);
+ }
+ return 0;
+}
+
+static int
+ar8327_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *vlan_tagged = priv->chip_data.ar8327.vlan_tagged;
+ u8 *tagged = &vlan_tagged[val->port_vlan];
+
+ int i;
+
+ *vt = 0;
+ *tagged = 0;
+ for (i = 0; i < val->len; i++) {
+ struct switch_port *p = &val->value.ports[i];
+
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+ *tagged |= BIT(p->id);
+ } else {
+ priv->pvid[p->id] = val->port_vlan;
+ }
+
+ *vt |= BIT(p->id);
}
return 0;
}
@@ -2019,13 +2087,12 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
continue;
for (i = 0; i < dev->ports; i++) {
- u8 mask = (1 << i);
+ u8 mask = BIT(i);
if (vp & mask)
portmask[i] |= vp & ~mask;
}
- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j],
- priv->vlan_table[j]);
+ priv->chip->vtu_load_vlan(priv, j);
}
} else {
@@ -2034,8 +2101,8 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (i == AR8216_PORT_CPU)
continue;
- portmask[i] = 1 << AR8216_PORT_CPU;
- portmask[AR8216_PORT_CPU] |= (1 << i);
+ portmask[i] = BIT(AR8216_PORT_CPU);
+ portmask[AR8216_PORT_CPU] |= BIT(i);
}
}
@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (priv->vlan) {
pvid = priv->vlan_id[priv->pvid[i]];
- if (priv->vlan_tagged & (1 << i))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(i))
egress = AR8216_OUT_ADD_VLAN;
else
egress = AR8216_OUT_STRIP_VLAN;
@@ -2442,8 +2509,8 @@ static const struct switch_dev_ops ar8xxx_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8216_sw_get_ports,
+ .set_vlan_ports = ar8216_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
@@ -2464,8 +2531,8 @@ static const struct switch_dev_ops ar8327_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8327_sw_get_ports,
+ .set_vlan_ports = ar8327_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Florian Fainelli
2014-09-17 17:47:46 UTC
Permalink
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842
According to jow, some people experienced some "issues" on older devices. Can anyone tell me what were those issues?
Anyway, that patch modified some parts of the ar8216/ar8236, so I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as much untouched as possible.
Could anyone test it on those devices?
BTW, this works for me on a TP-Link WDR4300 (ar8327).
I tested the patch on TL-WR1043ND v2 with Atheros AR8327 rev. 4. Vlans
are working as expected. Please include this into BB (might need repost)
Thanks!
Unless there are further objections, we should probably just go ahead
and apply this patch since it affects a bunch of users.
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
---
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 3846159..9eae624 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -78,7 +78,7 @@ struct ar8xxx_chip {
u32 (*read_port_status)(struct ar8xxx_priv *priv, int port);
int (*atu_flush)(struct ar8xxx_priv *priv);
void (*vtu_flush)(struct ar8xxx_priv *priv);
- void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask);
+ void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vlan);
const struct ar8xxx_mib_desc *mib_decs;
unsigned num_mibs;
@@ -112,7 +112,12 @@ struct ar8327_led {
enum ar8327_led_pattern pattern;
};
+struct ar8216_data {
+ u8 vlan_tagged;
+};
+
struct ar8327_data {
+ u8 vlan_tagged[AR8X16_MAX_VLANS];
u32 port0_status;
u32 port6_status;
@@ -138,6 +143,7 @@ struct ar8xxx_priv {
u8 chip_rev;
const struct ar8xxx_chip *chip;
union {
+ struct ar8216_data ar8216;
struct ar8327_data ar8327;
} chip_data;
bool initialized;
@@ -159,7 +165,6 @@ struct ar8xxx_priv {
bool vlan;
u16 vlan_id[AR8X16_MAX_VLANS];
u8 vlan_table[AR8X16_MAX_VLANS];
- u8 vlan_tagged;
u16 pvid[AR8X16_MAX_PORTS];
/* mirroring */
@@ -641,7 +646,7 @@ ar8216_mangle_rx(struct net_device *dev, struct sk_buff *skb)
port = buf[0] & 0xf;
/* no need to fix up packets coming from a tagged source */
- if (priv->vlan_tagged & (1 << port))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(port))
return;
/* lookup port vid from local table, the switch passes an invalid vlan id */
@@ -695,10 +700,13 @@ ar8216_vtu_flush(struct ar8xxx_priv *priv)
}
static void
-ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;
+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+
op = AR8216_VTU_OP_LOAD | (vid << AR8216_VTU_VID_S);
ar8216_vtu_op(priv, op, port_mask);
}
@@ -1705,12 +1713,16 @@ ar8327_vtu_flush(struct ar8xxx_priv *priv)
}
static void
-ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
+ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vlan)
{
u32 op;
u32 val;
int i;
+ u32 vid = priv->vlan_id[vlan];
+ u32 port_mask = priv->vlan_table[vlan];
+ u32 tagged = priv->chip_data.ar8327.vlan_tagged[vlan];
+
op = AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S);
val = AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL;
for (i = 0; i < AR8327_NUM_PORTS; i++) {
@@ -1720,7 +1732,7 @@ ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32 port_mask)
mode = AR8327_VTU_FUNC0_EG_MODE_NOT;
else if (priv->vlan == 0)
mode = AR8327_VTU_FUNC0_EG_MODE_KEEP;
- else if (priv->vlan_tagged & BIT(i))
+ else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG;
else
mode = AR8327_VTU_FUNC0_EG_MODE_UNTAG;
@@ -1734,26 +1746,22 @@ static void
ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32 egress, u32 ingress,
u32 members, u32 pvid)
{
- u32 t;
- u32 mode;
+ u32 mode, t;
+
+ if (priv->vlan) {
+ pvid = priv->vlan_id[priv->pvid[port]];
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
+ ingress = AR8216_IN_SECURE;
+ } else {
+ pvid = port;
+ mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
+ ingress = AR8216_IN_PORT_ONLY;
+ }
t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S;
t |= pvid << AR8327_PORT_VLAN0_DEF_CVID_S;
priv->write(priv, AR8327_REG_PORT_VLAN0(port), t);
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD;
- switch (egress) {
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH;
- break;
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNTAG;
- break;
- mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break;
- }
-
t = AR8327_PORT_VLAN1_PORT_VLAN_PROP;
t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S;
priv->write(priv, AR8327_REG_PORT_VLAN1(port), t);
@@ -1851,23 +1859,21 @@ ar8xxx_sw_get_port_link(struct switch_dev *dev, int port,
}
static int
-ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+ar8xxx_sw_get_ports(struct switch_val *val, int ports, u8 port_mask, u8 tagged)
{
- struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
- u8 ports = priv->vlan_table[val->port_vlan];
int i;
val->len = 0;
- for (i = 0; i < dev->ports; i++) {
+ for (i = 0; i < ports; i++) {
struct switch_port *p;
- if (!(ports & (1 << i)))
+ if (!(port_mask & BIT(i)))
continue;
p = &val->value.ports[val->len++];
p->id = i;
- if (priv->vlan_tagged & (1 << i))
- p->flags = (1 << SWITCH_PORT_FLAG_TAGGED);
+ if (tagged & BIT(i))
+ p->flags = BIT(SWITCH_PORT_FLAG_TAGGED);
else
p->flags = 0;
}
@@ -1875,20 +1881,55 @@ ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
}
static int
-ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+ar8216_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8216.vlan_tagged;
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8327_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ int ports = dev->ports;
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 port_mask = priv->vlan_table[val->port_vlan];
+ u8 tagged = priv->chip_data.ar8327.vlan_tagged[val->port_vlan];
+
+ return ar8xxx_sw_get_ports(val, ports, port_mask, tagged);
+}
+
+static int
+ar8216_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *tagged = &priv->chip_data.ar8216.vlan_tagged;
int i, j;
*vt = 0;
for (i = 0; i < val->len; i++) {
struct switch_port *p = &val->value.ports[i];
- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) {
- priv->vlan_tagged |= (1 << p->id);
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+
+ /* if port was untagged before then
+ * remove him from other vlans */
+ if(*tagged & BIT(p->id)){
+ for (j = 0; j < AR8X16_MAX_VLANS; j++) {
+ if (j == val->port_vlan)
+ continue;
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
+ }
+ }
+
+ *tagged |= BIT(p->id);
} else {
- priv->vlan_tagged &= ~(1 << p->id);
+ *tagged &= ~(BIT(p->id));
priv->pvid[p->id] = val->port_vlan;
/* make sure that an untagged port does not
@@ -1896,11 +1937,38 @@ ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
for (j = 0; j < AR8X16_MAX_VLANS; j++) {
if (j == val->port_vlan)
continue;
- priv->vlan_table[j] &= ~(1 << p->id);
+
+ priv->vlan_table[j] &= ~(BIT(p->id));
}
}
- *vt |= 1 << p->id;
+ *vt |= BIT(p->id);
+ }
+ return 0;
+}
+
+static int
+ar8327_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
+{
+ struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ u8 *vt = &priv->vlan_table[val->port_vlan];
+ u8 *vlan_tagged = priv->chip_data.ar8327.vlan_tagged;
+ u8 *tagged = &vlan_tagged[val->port_vlan];
+
+ int i;
+
+ *vt = 0;
+ *tagged = 0;
+ for (i = 0; i < val->len; i++) {
+ struct switch_port *p = &val->value.ports[i];
+
+ if (p->flags & BIT(SWITCH_PORT_FLAG_TAGGED)) {
+ *tagged |= BIT(p->id);
+ } else {
+ priv->pvid[p->id] = val->port_vlan;
+ }
+
+ *vt |= BIT(p->id);
}
return 0;
}
@@ -2019,13 +2087,12 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
continue;
for (i = 0; i < dev->ports; i++) {
- u8 mask = (1 << i);
+ u8 mask = BIT(i);
if (vp & mask)
portmask[i] |= vp & ~mask;
}
- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j],
- priv->vlan_table[j]);
+ priv->chip->vtu_load_vlan(priv, j);
}
} else {
@@ -2034,8 +2101,8 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (i == AR8216_PORT_CPU)
continue;
- portmask[i] = 1 << AR8216_PORT_CPU;
- portmask[AR8216_PORT_CPU] |= (1 << i);
+ portmask[i] = BIT(AR8216_PORT_CPU);
+ portmask[AR8216_PORT_CPU] |= BIT(i);
}
}
@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (priv->vlan) {
pvid = priv->vlan_id[priv->pvid[i]];
- if (priv->vlan_tagged & (1 << i))
+ if (priv->chip_data.ar8216.vlan_tagged & BIT(i))
egress = AR8216_OUT_ADD_VLAN;
else
egress = AR8216_OUT_STRIP_VLAN;
@@ -2442,8 +2509,8 @@ static const struct switch_dev_ops ar8xxx_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8216_sw_get_ports,
+ .set_vlan_ports = ar8216_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
@@ -2464,8 +2531,8 @@ static const struct switch_dev_ops ar8327_sw_ops = {
},
.get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid,
- .get_vlan_ports = ar8xxx_sw_get_ports,
- .set_vlan_ports = ar8xxx_sw_set_ports,
+ .get_vlan_ports = ar8327_sw_get_ports,
+ .set_vlan_ports = ar8327_sw_set_ports,
.apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
John Crispin
2014-09-17 17:50:16 UTC
Permalink
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
Commit 40842 reverted the fix for tagged+untagged VLANs on
AR8327: https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842
According to jow, some people experienced some "issues" on
older devices. Can anyone tell me what were those issues?
Anyway, that patch modified some parts of the ar8216/ar8236, so
I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as
much untouched as possible. Could anyone test it on those
devices?
BTW, this works for me on a TP-Link WDR4300 (ar8327).
I tested the patch on TL-WR1043ND v2 with Atheros AR8327 rev. 4.
Vlans are working as expected. Please include this into BB (might
need repost)
Thanks!
Unless there are further objections, we should probably just go
ahead and apply this patch since it affects a bunch of users.
and then the other bunch complains, as we had before. we keep applying
and reversing this i think. maybe we should just see what the real bug
is ?

John
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
--git a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c index
3846159..9eae624 100644 ---
a/target/linux/generic/files/drivers/net/phy/ar8216.c +++
ar8xxx_priv *priv, int port); int (*atu_flush)(struct
ar8xxx_priv *priv); void (*vtu_flush)(struct ar8xxx_priv
*priv); - void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32
vid, u32 port_mask); + void (*vtu_load_vlan)(struct ar8xxx_priv
*priv, u32 vlan);
pattern; };
+struct ar8216_data { + u8 vlan_tagged; +}; + struct
ar8327_data { + u8 vlan_tagged[AR8X16_MAX_VLANS]; u32
port0_status; u32 port6_status;
@@ -138,6 +143,7 @@ struct ar8xxx_priv { u8 chip_rev; const
struct ar8xxx_chip *chip; union { + struct ar8216_data
ar8216; struct ar8327_data ar8327; } chip_data; bool
vlan; u16 vlan_id[AR8X16_MAX_VLANS]; u8
vlan_table[AR8X16_MAX_VLANS]; - u8 vlan_tagged; u16
pvid[AR8X16_MAX_PORTS];
net_device *dev, struct sk_buff *skb) port = buf[0] & 0xf;
/* no need to fix up packets coming from a tagged source */ -
if (priv->vlan_tagged & (1 << port)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(port)) return;
/* lookup port vid from local table, the switch passes an
ar8216_vtu_flush(struct ar8xxx_priv *priv) }
static void -ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8216_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + op = AR8216_VTU_OP_LOAD | (vid <<
*priv) }
static void -ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8327_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op; u32 val; int i;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + u32 tagged =
priv->chip_data.ar8327.vlan_tagged[vlan]; + op =
AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S); val
= AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL; for (i = 0; i
ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32
port_mask) mode = AR8327_VTU_FUNC0_EG_MODE_NOT; else if
(priv->vlan == 0) mode = AR8327_VTU_FUNC0_EG_MODE_KEEP; - else
if (priv->vlan_tagged & BIT(i)) + else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG; else mode =
void ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32
egress, u32 ingress, u32 members, u32 pvid) { - u32 t; - u32
mode; + u32 mode, t; + + if (priv->vlan) { + pvid =
priv->vlan_id[priv->pvid[port]]; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNMOD; + ingress =
AR8216_IN_SECURE; + } else { + pvid = port; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + ingress =
AR8216_IN_PORT_ONLY; + }
t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S; t |= pvid <<
AR8327_PORT_VLAN0_DEF_CVID_S; priv->write(priv,
AR8327_REG_PORT_VLAN0(port), t);
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD; - switch (egress) {
- case AR8216_OUT_KEEP: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; - break; - case
AR8216_OUT_STRIP_VLAN: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTAG; - break; - case
AR8216_OUT_ADD_VLAN: - mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break; - } - t = AR8327_PORT_VLAN1_PORT_VLAN_PROP; t |= mode
<< AR8327_PORT_VLAN1_OUT_MODE_S; priv->write(priv,
ar8xxx_sw_get_port_link(struct switch_dev *dev, int port, }
static int -ar8xxx_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +ar8xxx_sw_get_ports(struct switch_val *val,
int ports, u8 port_mask, u8 tagged) { - struct ar8xxx_priv
*priv = swdev_to_ar8xxx(dev); - u8 ports =
priv->vlan_table[val->port_vlan]; int i;
val->len = 0; - for (i = 0; i < dev->ports; i++) { + for (i =
0; i < ports; i++) { struct switch_port *p;
- if (!(ports & (1 << i))) + if (!(port_mask & BIT(i)))
continue;
p = &val->value.ports[val->len++]; p->id = i; - if
(priv->vlan_tagged & (1 << i)) - p->flags = (1 <<
SWITCH_PORT_FLAG_TAGGED); + if (tagged & BIT(i)) + p->flags
*dev, struct switch_val *val) }
static int -ar8xxx_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) +ar8216_sw_get_ports(struct switch_dev *dev,
struct switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8216.vlan_tagged; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8327_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8327.vlan_tagged[val->port_vlan]; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8216_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) { struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *tagged =
&priv->chip_data.ar8216.vlan_tagged; int i, j;
*vt = 0; for (i = 0; i < val->len; i++) { struct switch_port *p
= &val->value.ports[i];
- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) { -
priv->vlan_tagged |= (1 << p->id); + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + + /* if port was untagged
before then + * remove him from other vlans */ +
if(*tagged & BIT(p->id)){ + for (j = 0; j <
AR8X16_MAX_VLANS; j++) { + if (j == val->port_vlan) +
continue; + + priv->vlan_table[j] &= ~(BIT(p->id)); + }
+ } + + *tagged |= BIT(p->id); } else { -
priv->vlan_tagged &= ~(1 << p->id); + *tagged &=
~(BIT(p->id)); priv->pvid[p->id] = val->port_vlan;
switch_val *val) for (j = 0; j < AR8X16_MAX_VLANS; j++) { if (j
== val->port_vlan) continue; - priv->vlan_table[j] &= ~(1 <<
p->id); + + priv->vlan_table[j] &= ~(BIT(p->id)); } }
- *vt |= 1 << p->id; + *vt |= BIT(p->id); + } + return 0; +}
+ +static int +ar8327_sw_set_ports(struct switch_dev *dev,
struct switch_val *val) +{ + struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); + u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *vlan_tagged =
priv->chip_data.ar8327.vlan_tagged; + u8 *tagged =
&vlan_tagged[val->port_vlan]; + + int i; + + *vt = 0; + *tagged
= 0; + for (i = 0; i < val->len; i++) { + struct switch_port
*p = &val->value.ports[i]; + + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + *tagged |= BIT(p->id); + }
else { + priv->pvid[p->id] = val->port_vlan; + } + + *vt |=
ar8xxx_sw_hw_apply(struct switch_dev *dev) continue;
for (i = 0; i < dev->ports; i++) { - u8 mask = (1 << i); +
u8 mask = BIT(i); if (vp & mask) portmask[i] |= vp & ~mask; }
- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j], -
priv->vlan_table[j]); + priv->chip->vtu_load_vlan(priv, j);
ar8xxx_sw_hw_apply(struct switch_dev *dev) if (i ==
AR8216_PORT_CPU) continue;
- portmask[i] = 1 << AR8216_PORT_CPU; -
portmask[AR8216_PORT_CPU] |= (1 << i); + portmask[i] =
BIT(AR8216_PORT_CPU); + portmask[AR8216_PORT_CPU] |= BIT(i);
} }
@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev
*dev)
if (priv->vlan) { pvid = priv->vlan_id[priv->pvid[i]]; - if
(priv->vlan_tagged & (1 << i)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(i)) egress =
ar8xxx_sw_ops = { }, .get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid, - .get_vlan_ports =
ar8xxx_sw_get_ports, - .set_vlan_ports = ar8xxx_sw_set_ports, +
.get_vlan_ports = ar8216_sw_get_ports, + .set_vlan_ports =
ar8216_sw_set_ports, .apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch, .get_port_link =
struct switch_dev_ops ar8327_sw_ops = { }, .get_port_pvid =
ar8xxx_sw_get_pvid, .set_port_pvid = ar8xxx_sw_set_pvid, -
.get_vlan_ports = ar8xxx_sw_get_ports, - .set_vlan_ports =
ar8xxx_sw_set_ports, + .get_vlan_ports = ar8327_sw_get_ports, +
.set_vlan_ports = ar8327_sw_set_ports, .apply_config =
ar8xxx_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
Post by Florian Fainelli
Post by Jiri Pirko
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Valentin Spreckels
2014-09-17 18:25:22 UTC
Permalink
Hi,
Post by John Crispin
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
Commit 40842 reverted the fix for tagged+untagged VLANs on
AR8327: https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842
According to jow, some people experienced some "issues" on
older devices. Can anyone tell me what were those issues?
Anyway, that patch modified some parts of the ar8216/ar8236, so
I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as
much untouched as possible. Could anyone test it on those
devices?
BTW, this works for me on a TP-Link WDR4300 (ar8327).
I tested the patch on TL-WR1043ND v2 with Atheros AR8327 rev. 4.
Vlans are working as expected. Please include this into BB (might
need repost)
Thanks!
Unless there are further objections, we should probably just go
ahead and apply this patch since it affects a bunch of users.
and then the other bunch complains, as we had before. we keep applying
and reversing this i think. maybe we should just see what the real bug
is ?
John
I'm interested in this feature. I tried to understand what the revoked
patch changes and rewrote it. I submitted my changes two months ago:
http://patchwork.openwrt.org/patch/5957/
http://patchwork.openwrt.org/patch/5958/

My patches attempt to minimize changes in non-ar8327-specific code.

Neither the revert commit nor ticket #12181 describe the issues. So I'm
not sure, if my patches have them too. Does anyone know details about
the issues?

- Valentin Spreckels
Post by John Crispin
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
--git a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c index
3846159..9eae624 100644 ---
a/target/linux/generic/files/drivers/net/phy/ar8216.c +++
ar8xxx_priv *priv, int port); int (*atu_flush)(struct
ar8xxx_priv *priv); void (*vtu_flush)(struct ar8xxx_priv
*priv); - void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32
vid, u32 port_mask); + void (*vtu_load_vlan)(struct ar8xxx_priv
*priv, u32 vlan);
pattern; };
+struct ar8216_data { + u8 vlan_tagged; +}; + struct
ar8327_data { + u8 vlan_tagged[AR8X16_MAX_VLANS]; u32
port0_status; u32 port6_status;
@@ -138,6 +143,7 @@ struct ar8xxx_priv { u8 chip_rev; const
struct ar8xxx_chip *chip; union { + struct ar8216_data
ar8216; struct ar8327_data ar8327; } chip_data; bool
vlan; u16 vlan_id[AR8X16_MAX_VLANS]; u8
vlan_table[AR8X16_MAX_VLANS]; - u8 vlan_tagged; u16
pvid[AR8X16_MAX_PORTS];
net_device *dev, struct sk_buff *skb) port = buf[0] & 0xf;
/* no need to fix up packets coming from a tagged source */ -
if (priv->vlan_tagged & (1 << port)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(port)) return;
/* lookup port vid from local table, the switch passes an
ar8216_vtu_flush(struct ar8xxx_priv *priv) }
static void -ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8216_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + op = AR8216_VTU_OP_LOAD | (vid <<
*priv) }
static void -ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8327_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op; u32 val; int i;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + u32 tagged =
priv->chip_data.ar8327.vlan_tagged[vlan]; + op =
AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S); val
= AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL; for (i = 0; i
ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32
port_mask) mode = AR8327_VTU_FUNC0_EG_MODE_NOT; else if
(priv->vlan == 0) mode = AR8327_VTU_FUNC0_EG_MODE_KEEP; - else
if (priv->vlan_tagged & BIT(i)) + else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG; else mode =
void ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32
egress, u32 ingress, u32 members, u32 pvid) { - u32 t; - u32
mode; + u32 mode, t; + + if (priv->vlan) { + pvid =
priv->vlan_id[priv->pvid[port]]; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNMOD; + ingress =
AR8216_IN_SECURE; + } else { + pvid = port; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + ingress =
AR8216_IN_PORT_ONLY; + }
t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S; t |= pvid <<
AR8327_PORT_VLAN0_DEF_CVID_S; priv->write(priv,
AR8327_REG_PORT_VLAN0(port), t);
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD; - switch (egress) {
- case AR8216_OUT_KEEP: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; - break; - case
AR8216_OUT_STRIP_VLAN: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTAG; - break; - case
AR8216_OUT_ADD_VLAN: - mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break; - } - t = AR8327_PORT_VLAN1_PORT_VLAN_PROP; t |= mode
<< AR8327_PORT_VLAN1_OUT_MODE_S; priv->write(priv,
ar8xxx_sw_get_port_link(struct switch_dev *dev, int port, }
static int -ar8xxx_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +ar8xxx_sw_get_ports(struct switch_val *val,
int ports, u8 port_mask, u8 tagged) { - struct ar8xxx_priv
*priv = swdev_to_ar8xxx(dev); - u8 ports =
priv->vlan_table[val->port_vlan]; int i;
val->len = 0; - for (i = 0; i < dev->ports; i++) { + for (i =
0; i < ports; i++) { struct switch_port *p;
- if (!(ports & (1 << i))) + if (!(port_mask & BIT(i)))
continue;
p = &val->value.ports[val->len++]; p->id = i; - if
(priv->vlan_tagged & (1 << i)) - p->flags = (1 <<
SWITCH_PORT_FLAG_TAGGED); + if (tagged & BIT(i)) + p->flags
*dev, struct switch_val *val) }
static int -ar8xxx_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) +ar8216_sw_get_ports(struct switch_dev *dev,
struct switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8216.vlan_tagged; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8327_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8327.vlan_tagged[val->port_vlan]; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8216_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) { struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *tagged =
&priv->chip_data.ar8216.vlan_tagged; int i, j;
*vt = 0; for (i = 0; i < val->len; i++) { struct switch_port *p
= &val->value.ports[i];
- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) { -
priv->vlan_tagged |= (1 << p->id); + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + + /* if port was untagged
before then + * remove him from other vlans */ +
if(*tagged & BIT(p->id)){ + for (j = 0; j <
AR8X16_MAX_VLANS; j++) { + if (j == val->port_vlan) +
continue; + + priv->vlan_table[j] &= ~(BIT(p->id)); + }
+ } + + *tagged |= BIT(p->id); } else { -
priv->vlan_tagged &= ~(1 << p->id); + *tagged &=
~(BIT(p->id)); priv->pvid[p->id] = val->port_vlan;
switch_val *val) for (j = 0; j < AR8X16_MAX_VLANS; j++) { if (j
== val->port_vlan) continue; - priv->vlan_table[j] &= ~(1 <<
p->id); + + priv->vlan_table[j] &= ~(BIT(p->id)); } }
- *vt |= 1 << p->id; + *vt |= BIT(p->id); + } + return 0; +}
+ +static int +ar8327_sw_set_ports(struct switch_dev *dev,
struct switch_val *val) +{ + struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); + u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *vlan_tagged =
priv->chip_data.ar8327.vlan_tagged; + u8 *tagged =
&vlan_tagged[val->port_vlan]; + + int i; + + *vt = 0; + *tagged
= 0; + for (i = 0; i < val->len; i++) { + struct switch_port
*p = &val->value.ports[i]; + + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + *tagged |= BIT(p->id); + }
else { + priv->pvid[p->id] = val->port_vlan; + } + + *vt |=
ar8xxx_sw_hw_apply(struct switch_dev *dev) continue;
for (i = 0; i < dev->ports; i++) { - u8 mask = (1 << i); +
u8 mask = BIT(i); if (vp & mask) portmask[i] |= vp & ~mask; }
- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j], -
priv->vlan_table[j]); + priv->chip->vtu_load_vlan(priv, j);
ar8xxx_sw_hw_apply(struct switch_dev *dev) if (i ==
AR8216_PORT_CPU) continue;
- portmask[i] = 1 << AR8216_PORT_CPU; -
portmask[AR8216_PORT_CPU] |= (1 << i); + portmask[i] =
BIT(AR8216_PORT_CPU); + portmask[AR8216_PORT_CPU] |= BIT(i);
} }
@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev
*dev)
if (priv->vlan) { pvid = priv->vlan_id[priv->pvid[i]]; - if
(priv->vlan_tagged & (1 << i)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(i)) egress =
ar8xxx_sw_ops = { }, .get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid, - .get_vlan_ports =
ar8xxx_sw_get_ports, - .set_vlan_ports = ar8xxx_sw_set_ports, +
.get_vlan_ports = ar8216_sw_get_ports, + .set_vlan_ports =
ar8216_sw_set_ports, .apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch, .get_port_link =
struct switch_dev_ops ar8327_sw_ops = { }, .get_port_pvid =
ar8xxx_sw_get_pvid, .set_port_pvid = ar8xxx_sw_set_pvid, -
.get_vlan_ports = ar8xxx_sw_get_ports, - .set_vlan_ports =
ar8xxx_sw_set_ports, + .get_vlan_ports = ar8327_sw_get_ports, +
.set_vlan_ports = ar8327_sw_set_ports, .apply_config =
ar8xxx_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
Post by Florian Fainelli
Post by Jiri Pirko
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Jiri Pirko
2014-09-19 09:11:32 UTC
Permalink
Post by Valentin Spreckels
Hi,
Post by John Crispin
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
Commit 40842 reverted the fix for tagged+untagged VLANs on
AR8327: https://dev.openwrt.org/changeset/40777
https://dev.openwrt.org/changeset/40842
According to jow, some people experienced some "issues" on
older devices. Can anyone tell me what were those issues?
Anyway, that patch modified some parts of the ar8216/ar8236, so
I suppose any device with those switches were affected.
However, I've modified the patch keeping the ar8216/ar8236 as
much untouched as possible. Could anyone test it on those
devices?
BTW, this works for me on a TP-Link WDR4300 (ar8327).
I tested the patch on TL-WR1043ND v2 with Atheros AR8327 rev. 4.
Vlans are working as expected. Please include this into BB (might
need repost)
Thanks!
Unless there are further objections, we should probably just go
ahead and apply this patch since it affects a bunch of users.
and then the other bunch complains, as we had before. we keep applying
and reversing this i think. maybe we should just see what the real bug
is ?
John
I'm interested in this feature. I tried to understand what the revoked
http://patchwork.openwrt.org/patch/5957/
http://patchwork.openwrt.org/patch/5958/
I like this patches. Look very clean. Will test them on wr1043v2.
Thanks.
Post by Valentin Spreckels
My patches attempt to minimize changes in non-ar8327-specific code.
Neither the revert commit nor ticket #12181 describe the issues. So I'm
not sure, if my patches have them too. Does anyone know details about
the issues?
- Valentin Spreckels
Post by John Crispin
Post by Florian Fainelli
Post by Jiri Pirko
Post by Álvaro Fernández Rojas
--git a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c index
3846159..9eae624 100644 ---
a/target/linux/generic/files/drivers/net/phy/ar8216.c +++
ar8xxx_priv *priv, int port); int (*atu_flush)(struct
ar8xxx_priv *priv); void (*vtu_flush)(struct ar8xxx_priv
*priv); - void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32
vid, u32 port_mask); + void (*vtu_load_vlan)(struct ar8xxx_priv
*priv, u32 vlan);
pattern; };
+struct ar8216_data { + u8 vlan_tagged; +}; + struct
ar8327_data { + u8 vlan_tagged[AR8X16_MAX_VLANS]; u32
port0_status; u32 port6_status;
@@ -138,6 +143,7 @@ struct ar8xxx_priv { u8 chip_rev; const
struct ar8xxx_chip *chip; union { + struct ar8216_data
ar8216; struct ar8327_data ar8327; } chip_data; bool
vlan; u16 vlan_id[AR8X16_MAX_VLANS]; u8
vlan_table[AR8X16_MAX_VLANS]; - u8 vlan_tagged; u16
pvid[AR8X16_MAX_PORTS];
net_device *dev, struct sk_buff *skb) port = buf[0] & 0xf;
/* no need to fix up packets coming from a tagged source */ -
if (priv->vlan_tagged & (1 << port)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(port)) return;
/* lookup port vid from local table, the switch passes an
ar8216_vtu_flush(struct ar8xxx_priv *priv) }
static void -ar8216_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8216_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + op = AR8216_VTU_OP_LOAD | (vid <<
*priv) }
static void -ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32
vid, u32 port_mask) +ar8327_vtu_load_vlan(struct ar8xxx_priv
*priv, u32 vlan) { u32 op; u32 val; int i;
+ u32 vid = priv->vlan_id[vlan]; + u32 port_mask =
priv->vlan_table[vlan]; + u32 tagged =
priv->chip_data.ar8327.vlan_tagged[vlan]; + op =
AR8327_VTU_FUNC1_OP_LOAD | (vid << AR8327_VTU_FUNC1_VID_S); val
= AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL; for (i = 0; i
ar8327_vtu_load_vlan(struct ar8xxx_priv *priv, u32 vid, u32
port_mask) mode = AR8327_VTU_FUNC0_EG_MODE_NOT; else if
(priv->vlan == 0) mode = AR8327_VTU_FUNC0_EG_MODE_KEEP; - else
if (priv->vlan_tagged & BIT(i)) + else if (tagged & BIT(i))
mode = AR8327_VTU_FUNC0_EG_MODE_TAG; else mode =
void ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32
egress, u32 ingress, u32 members, u32 pvid) { - u32 t; - u32
mode; + u32 mode, t; + + if (priv->vlan) { + pvid =
priv->vlan_id[priv->pvid[port]]; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNMOD; + ingress =
AR8216_IN_SECURE; + } else { + pvid = port; + mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + ingress =
AR8216_IN_PORT_ONLY; + }
t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S; t |= pvid <<
AR8327_PORT_VLAN0_DEF_CVID_S; priv->write(priv,
AR8327_REG_PORT_VLAN0(port), t);
- mode = AR8327_PORT_VLAN1_OUT_MODE_UNMOD; - switch (egress) {
- case AR8216_OUT_KEEP: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; - break; - case
AR8216_OUT_STRIP_VLAN: - mode =
AR8327_PORT_VLAN1_OUT_MODE_UNTAG; - break; - case
AR8216_OUT_ADD_VLAN: - mode = AR8327_PORT_VLAN1_OUT_MODE_TAG;
- break; - } - t = AR8327_PORT_VLAN1_PORT_VLAN_PROP; t |= mode
<< AR8327_PORT_VLAN1_OUT_MODE_S; priv->write(priv,
ar8xxx_sw_get_port_link(struct switch_dev *dev, int port, }
static int -ar8xxx_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +ar8xxx_sw_get_ports(struct switch_val *val,
int ports, u8 port_mask, u8 tagged) { - struct ar8xxx_priv
*priv = swdev_to_ar8xxx(dev); - u8 ports =
priv->vlan_table[val->port_vlan]; int i;
val->len = 0; - for (i = 0; i < dev->ports; i++) { + for (i =
0; i < ports; i++) { struct switch_port *p;
- if (!(ports & (1 << i))) + if (!(port_mask & BIT(i)))
continue;
p = &val->value.ports[val->len++]; p->id = i; - if
(priv->vlan_tagged & (1 << i)) - p->flags = (1 <<
SWITCH_PORT_FLAG_TAGGED); + if (tagged & BIT(i)) + p->flags
*dev, struct switch_val *val) }
static int -ar8xxx_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) +ar8216_sw_get_ports(struct switch_dev *dev,
struct switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8216.vlan_tagged; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8327_sw_get_ports(struct switch_dev *dev, struct
switch_val *val) +{ + int ports = dev->ports; + struct
ar8xxx_priv *priv = swdev_to_ar8xxx(dev); + u8 port_mask =
priv->vlan_table[val->port_vlan]; + u8 tagged =
priv->chip_data.ar8327.vlan_tagged[val->port_vlan]; + + return
ar8xxx_sw_get_ports(val, ports, port_mask, tagged); +} +
+static int +ar8216_sw_set_ports(struct switch_dev *dev, struct
switch_val *val) { struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *tagged =
&priv->chip_data.ar8216.vlan_tagged; int i, j;
*vt = 0; for (i = 0; i < val->len; i++) { struct switch_port *p
= &val->value.ports[i];
- if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED)) { -
priv->vlan_tagged |= (1 << p->id); + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + + /* if port was untagged
before then + * remove him from other vlans */ +
if(*tagged & BIT(p->id)){ + for (j = 0; j <
AR8X16_MAX_VLANS; j++) { + if (j == val->port_vlan) +
continue; + + priv->vlan_table[j] &= ~(BIT(p->id)); + }
+ } + + *tagged |= BIT(p->id); } else { -
priv->vlan_tagged &= ~(1 << p->id); + *tagged &=
~(BIT(p->id)); priv->pvid[p->id] = val->port_vlan;
switch_val *val) for (j = 0; j < AR8X16_MAX_VLANS; j++) { if (j
== val->port_vlan) continue; - priv->vlan_table[j] &= ~(1 <<
p->id); + + priv->vlan_table[j] &= ~(BIT(p->id)); } }
- *vt |= 1 << p->id; + *vt |= BIT(p->id); + } + return 0; +}
+ +static int +ar8327_sw_set_ports(struct switch_dev *dev,
struct switch_val *val) +{ + struct ar8xxx_priv *priv =
swdev_to_ar8xxx(dev); + u8 *vt =
&priv->vlan_table[val->port_vlan]; + u8 *vlan_tagged =
priv->chip_data.ar8327.vlan_tagged; + u8 *tagged =
&vlan_tagged[val->port_vlan]; + + int i; + + *vt = 0; + *tagged
= 0; + for (i = 0; i < val->len; i++) { + struct switch_port
*p = &val->value.ports[i]; + + if (p->flags &
BIT(SWITCH_PORT_FLAG_TAGGED)) { + *tagged |= BIT(p->id); + }
else { + priv->pvid[p->id] = val->port_vlan; + } + + *vt |=
ar8xxx_sw_hw_apply(struct switch_dev *dev) continue;
for (i = 0; i < dev->ports; i++) { - u8 mask = (1 << i); +
u8 mask = BIT(i); if (vp & mask) portmask[i] |= vp & ~mask; }
- priv->chip->vtu_load_vlan(priv, priv->vlan_id[j], -
priv->vlan_table[j]); + priv->chip->vtu_load_vlan(priv, j);
ar8xxx_sw_hw_apply(struct switch_dev *dev) if (i ==
AR8216_PORT_CPU) continue;
- portmask[i] = 1 << AR8216_PORT_CPU; -
portmask[AR8216_PORT_CPU] |= (1 << i); + portmask[i] =
BIT(AR8216_PORT_CPU); + portmask[AR8216_PORT_CPU] |= BIT(i);
} }
@@ -2046,7 +2113,7 @@ ar8xxx_sw_hw_apply(struct switch_dev
*dev)
if (priv->vlan) { pvid = priv->vlan_id[priv->pvid[i]]; - if
(priv->vlan_tagged & (1 << i)) + if
(priv->chip_data.ar8216.vlan_tagged & BIT(i)) egress =
ar8xxx_sw_ops = { }, .get_port_pvid = ar8xxx_sw_get_pvid,
.set_port_pvid = ar8xxx_sw_set_pvid, - .get_vlan_ports =
ar8xxx_sw_get_ports, - .set_vlan_ports = ar8xxx_sw_set_ports, +
.get_vlan_ports = ar8216_sw_get_ports, + .set_vlan_ports =
ar8216_sw_set_ports, .apply_config = ar8xxx_sw_hw_apply,
.reset_switch = ar8xxx_sw_reset_switch, .get_port_link =
struct switch_dev_ops ar8327_sw_ops = { }, .get_port_pvid =
ar8xxx_sw_get_pvid, .set_port_pvid = ar8xxx_sw_set_pvid, -
.get_vlan_ports = ar8xxx_sw_get_ports, - .set_vlan_ports =
ar8xxx_sw_set_ports, + .get_vlan_ports = ar8327_sw_get_ports, +
.set_vlan_ports = ar8327_sw_set_ports, .apply_config =
ar8xxx_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch,
.get_port_link = ar8xxx_sw_get_port_link,
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
Post by Florian Fainelli
Post by Jiri Pirko
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________ openwrt-devel
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Felix Fietkau
2014-09-23 10:22:02 UTC
Permalink
Post by Valentin Spreckels
I'm interested in this feature. I tried to understand what the revoked
http://patchwork.openwrt.org/patch/5957/
http://patchwork.openwrt.org/patch/5958/
My patches attempt to minimize changes in non-ar8327-specific code.
Neither the revert commit nor ticket #12181 describe the issues. So I'm
not sure, if my patches have them too. Does anyone know details about
the issues?
Hi Valentin,

I finally got around to properly reviewing your changes, and they look
correct to me. I committed them in r42652, r42653 - let's see if any new
issues show up.

Thanks,

- Felix
Jiri Pirko
2014-09-23 17:19:15 UTC
Permalink
Post by Felix Fietkau
Post by Valentin Spreckels
I'm interested in this feature. I tried to understand what the revoked
http://patchwork.openwrt.org/patch/5957/
http://patchwork.openwrt.org/patch/5958/
My patches attempt to minimize changes in non-ar8327-specific code.
Neither the revert commit nor ticket #12181 describe the issues. So I'm
not sure, if my patches have them too. Does anyone know details about
the issues?
Hi Valentin,
I finally got around to properly reviewing your changes, and they look
correct to me. I committed them in r42652, r42653 - let's see if any new
issues show up.
Just curious, are these 2 patches going to be backported to BB? How that
can happen?

Thanks.
Post by Felix Fietkau
Thanks,
- Felix
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Felix Fietkau
2014-09-23 17:48:50 UTC
Permalink
Post by Jiri Pirko
Post by Felix Fietkau
Post by Valentin Spreckels
I'm interested in this feature. I tried to understand what the revoked
http://patchwork.openwrt.org/patch/5957/
http://patchwork.openwrt.org/patch/5958/
My patches attempt to minimize changes in non-ar8327-specific code.
Neither the revert commit nor ticket #12181 describe the issues. So I'm
not sure, if my patches have them too. Does anyone know details about
the issues?
Hi Valentin,
I finally got around to properly reviewing your changes, and they look
correct to me. I committed them in r42652, r42653 - let's see if any new
issues show up.
Just curious, are these 2 patches going to be backported to BB? How that
can happen?
First I'd like to have it tested in trunk for a while.

- Felix
Aaron Z
2014-09-23 19:35:17 UTC
Permalink
Post by Felix Fietkau
Hi Valentin,
I finally got around to properly reviewing your changes, and they look
correct to me. I committed them in r42652, r42653 - let's see if any new
issues show up.
It works as expected on my TPLink TL-WR1043ND (using the r42653 image).
Is there any chance of this making 14.07, or will it need to wait for 14.07.1?

Thanks

Aaron Z
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
— Robert Heinlein, Time Enough for Love

Aaron Z
2014-09-18 12:01:46 UTC
Permalink
As someone who has spent much of the past week trying to figure out
why my TL-WR1043ND V2 wont work with both taggged and untagged packets
on the same port, I am all for it being applied.
If its not, a note on the 1043 page in the wiki explaining that you
cant have tagged and untagged packets on the same port in versions X,
Y and Z and linking to the patch would be very useful...

Aaron Z
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
— Robert Heinlein, Time Enough for Love
Loading...