aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-07-15 13:05:43 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-07-15 13:05:43 +0000
commita59fa57985cf73c3c475bfbbb375dd9aac1815bd (patch)
tree7dd136b72920378cad1af8abd5cf8fcc72ecfb29 /target/linux
parentce7eca2dff722edfda9c91d50b51878de7c096c6 (diff)
downloadupstream-a59fa57985cf73c3c475bfbbb375dd9aac1815bd.tar.gz
upstream-a59fa57985cf73c3c475bfbbb375dd9aac1815bd.tar.bz2
upstream-a59fa57985cf73c3c475bfbbb375dd9aac1815bd.zip
generic: rtl8366: use smi->num_ports and smi->ops->get_vlan_4k
SVN-Revision: 22202
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366rb.c8
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366s.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index 2efde1df3f..ae976f45b2 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -721,14 +721,14 @@ static int rtl8366rb_sw_get_vlan_info(struct switch_dev *dev,
memset(buf, '\0', sizeof(smi->buf));
- err = rtl8366rb_get_vlan_4k(smi, val->port_vlan, &vlan4k);
+ err = smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
if (err)
return err;
len += snprintf(buf + len, sizeof(smi->buf) - len,
"VLAN %d: Ports: '", vlan4k.vid);
- for (i = 0; i < RTL8366RB_NUM_PORTS; i++) {
+ for (i = 0; i < smi->num_ports; i++) {
if (!(vlan4k.member & (1 << i)))
continue;
@@ -811,11 +811,11 @@ static int rtl8366rb_sw_get_vlan_ports(struct switch_dev *dev,
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
return -EINVAL;
- rtl8366rb_get_vlan_4k(smi, val->port_vlan, &vlan4k);
+ smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
port = &val->value.ports[0];
val->len = 0;
- for (i = 0; i < RTL8366RB_NUM_PORTS; i++) {
+ for (i = 0; i < smi->num_ports; i++) {
if (!(vlan4k.member & BIT(i)))
continue;
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
index 4f4a5f3897..4ac675ea50 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
@@ -746,14 +746,14 @@ static int rtl8366s_sw_get_vlan_info(struct switch_dev *dev,
memset(buf, '\0', sizeof(smi->buf));
- err = rtl8366s_get_vlan_4k(smi, val->port_vlan, &vlan4k);
+ err = smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
if (err)
return err;
len += snprintf(buf + len, sizeof(smi->buf) - len,
"VLAN %d: Ports: '", vlan4k.vid);
- for (i = 0; i < RTL8366S_NUM_PORTS; i++) {
+ for (i = 0; i < smi->num_ports; i++) {
if (!(vlan4k.member & (1 << i)))
continue;
@@ -838,11 +838,11 @@ static int rtl8366s_sw_get_vlan_ports(struct switch_dev *dev,
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
return -EINVAL;
- rtl8366s_get_vlan_4k(smi, val->port_vlan, &vlan4k);
+ smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
port = &val->value.ports[0];
val->len = 0;
- for (i = 0; i < RTL8366S_NUM_PORTS; i++) {
+ for (i = 0; i < smi->num_ports; i++) {
if (!(vlan4k.member & BIT(i)))
continue;