summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-17 21:17:46 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-17 21:17:46 +0000
commitef0ac006fffc32659c071f7ab85e167ea3608b01 (patch)
tree8fd00818c599727f7ff5323e51786ea3661de5e5 /target
parent3d899911584f9a517ba057dc4dff97e4e69c8b66 (diff)
rtl8366_smi: add vid parameter to the rtl8366s_get_vlan_4k_entry function
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19197 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c b/target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c
index f0f9a76c9..557d84902 100644
--- a/target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/ar71xx/files/drivers/net/phy/rtl8366_smi.c
@@ -597,15 +597,14 @@ static int rtl8366_get_mib_counter(struct rtl8366_smi *smi, int counter,
return 0;
}
-static int rtl8366s_get_vlan_4k_entry(struct rtl8366_smi *smi,
+static int rtl8366s_get_vlan_4k_entry(struct rtl8366_smi *smi, u32 vid,
struct rtl8366s_vlan4kentry *vlan4k)
{
int err;
u32 data;
- u32 vid;
u16 *tableaddr;
- vid = vlan4k->vid;
+ vlan4k->vid = vid;
if (vid >= RTL8366_NUM_VIDS)
return -EINVAL;
@@ -857,8 +856,7 @@ static int rtl8366_set_vlan_port_pvid(struct rtl8366_smi *smi, int port,
/* Updating the 4K entry; lookup it and change the port member set */
memset(&vlan4K, '\0', sizeof(struct rtl8366s_vlan4kentry));
- vlan4K.vid = val;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, val, &vlan4K);
vlan4K.member |= ((1 << port) | RTL8366_PORT_CPU);
vlan4K.untag = RTL8366_PORT_ALL_BUT_CPU;
rtl8366s_set_vlan_4k_entry(smi, &vlan4K);
@@ -1372,8 +1370,7 @@ static int rtl8366_attr_get_vlan_info(struct switch_dev *dev,
memset(&vlan4K, '\0', sizeof(struct rtl8366s_vlan4kentry));
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- vlan4K.vid = vlanMC.vid;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
len += snprintf(buf + len, sizeof(buf) - len, "VLAN %d: Ports: ",
val->port_vlan);
@@ -1504,8 +1501,7 @@ static int rtl8366_set_member(struct switch_dev *dev,
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- vlan4K.vid = vlanMC.vid;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
vlan4K.member = vlanMC.member = val->value.i;
rtl8366s_set_vlan_member_config(smi, val->port_vlan, &vlanMC);
@@ -1529,8 +1525,7 @@ static int rtl8366_get_member(struct switch_dev *dev,
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- vlan4K.vid = vlanMC.vid;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
val->value.i = vlanMC.member;
@@ -1551,9 +1546,7 @@ static int rtl8366_set_untag(struct switch_dev *dev,
return -EINVAL;
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
-
- vlan4K.vid = vlanMC.vid;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
vlan4K.untag = vlanMC.untag = val->value.i;
rtl8366s_set_vlan_member_config(smi, val->port_vlan, &vlanMC);
@@ -1576,8 +1569,7 @@ static int rtl8366_get_untag(struct switch_dev *dev,
return -EINVAL;
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- vlan4K.vid = vlanMC.vid;
- rtl8366s_get_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
val->value.i = vlanMC.untag;