summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-07-15 13:05:47 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-07-15 13:05:47 +0000
commitdac77d22afb3976d6ff87e6b764d09bbe19f9f0b (patch)
treebc783410ead924ea35c865a9a4e3101d5a061d64 /target/linux/generic/files/drivers/net/phy/rtl8366rb.c
parent4bcb729a13df5c821c069d7b13b53818be7cbf4d (diff)
generic: rtl8366: add common rtl8366_sw_get_vlan_info
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22203 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/rtl8366rb.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366rb.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index ae976f45b..231e48291 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -705,47 +705,6 @@ static int rtl8366rb_sw_get_port_link(struct switch_dev *dev,
return 0;
}
-static int rtl8366rb_sw_get_vlan_info(struct switch_dev *dev,
- const struct switch_attr *attr,
- struct switch_val *val)
-{
- int i;
- u32 len = 0;
- struct rtl8366_vlan_4k vlan4k;
- struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
- char *buf = smi->buf;
- int err;
-
- if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
- return -EINVAL;
-
- memset(buf, '\0', sizeof(smi->buf));
-
- 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 < smi->num_ports; i++) {
- if (!(vlan4k.member & (1 << i)))
- continue;
-
- len += snprintf(buf + len, sizeof(smi->buf) - len, "%d%s", i,
- (vlan4k.untag & (1 << i)) ? "" : "t");
- }
-
- len += snprintf(buf + len, sizeof(smi->buf) - len,
- "', members=%04x, untag=%04x, fid=%u",
- vlan4k.member, vlan4k.untag, vlan4k.fid);
-
- val->value.s = buf;
- val->len = len;
-
- return 0;
-}
-
static int rtl8366rb_sw_set_port_led(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@@ -937,7 +896,7 @@ static struct switch_attr rtl8366rb_vlan[] = {
.description = "Get vlan information",
.max = 1,
.set = NULL,
- .get = rtl8366rb_sw_get_vlan_info,
+ .get = rtl8366_sw_get_vlan_info,
},
};