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;
/* 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);
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);
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);
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;
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);
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;