aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/ar8216.c
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2019-11-24 20:53:39 +0100
committerDavid Bauer <mail@david-bauer.net>2019-11-30 16:52:33 +0100
commitdb8345d8e43f0cc8ac8cf53fbab4037bfe33cfa3 (patch)
treed8e9766af0e40705dc9a34151584d75138e790ed /target/linux/generic/files/drivers/net/phy/ar8216.c
parentcde70954effe137fac830730105853f929e9d28a (diff)
downloadupstream-db8345d8e43f0cc8ac8cf53fbab4037bfe33cfa3.tar.gz
upstream-db8345d8e43f0cc8ac8cf53fbab4037bfe33cfa3.tar.bz2
upstream-db8345d8e43f0cc8ac8cf53fbab4037bfe33cfa3.zip
generic ar8xxx: increase VLAN table for AR83x7
The Atheros AR8327 and AR8337 have (according to their datasheet) a VLAN table with a maximum of 4096 entries. Currently, there's a hard limit of 128 VLANs, which is the same as for most other Atheros switches. Increase this limit only for the AR83x7 series and modify some shared functions to allow them to work with a variable max VLAN count. Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit 3f79aaa2979793c054eae2c8b4058c8c7fccdbe7)
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8216.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 683241cf1c..5ace4e0b15 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1204,7 +1204,7 @@ ar8xxx_sw_set_vid(struct switch_dev *dev, const struct switch_attr *attr,
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
- if (val->port_vlan >= AR8X16_MAX_VLANS)
+ if (val->port_vlan >= dev->vlans)
return -EINVAL;
priv->vlan_id[val->port_vlan] = val->value.i;
@@ -1237,7 +1237,7 @@ ar8xxx_sw_get_ports(struct switch_dev *dev, struct switch_val *val)
u8 ports;
int i;
- if (val->port_vlan >= AR8X16_MAX_VLANS)
+ if (val->port_vlan >= dev->vlans)
return -EINVAL;
ports = priv->vlan_table[val->port_vlan];
@@ -1277,7 +1277,7 @@ ar8xxx_sw_set_ports(struct switch_dev *dev, struct switch_val *val)
/* make sure that an untagged port does not
* appear in other vlans */
- for (j = 0; j < AR8X16_MAX_VLANS; j++) {
+ for (j = 0; j < dev->vlans; j++) {
if (j == val->port_vlan)
continue;
priv->vlan_table[j] &= ~(1 << p->id);
@@ -1356,7 +1356,7 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
if (!priv->init) {
/* calculate the port destination masks and load vlans
* into the vlan translation unit */
- for (j = 0; j < AR8X16_MAX_VLANS; j++) {
+ for (j = 0; j < dev->vlans; j++) {
u8 vp = priv->vlan_table[j];
if (!vp)
@@ -1409,7 +1409,7 @@ ar8xxx_sw_reset_switch(struct switch_dev *dev)
memset(&priv->vlan, 0, sizeof(struct ar8xxx_priv) -
offsetof(struct ar8xxx_priv, vlan));
- for (i = 0; i < AR8X16_MAX_VLANS; i++)
+ for (i = 0; i < dev->vlans; i++)
priv->vlan_id[i] = i;
/* Configure all ports */