{
int i;
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
if (port >= RTL8366_NUM_PORTS || val >= RTL8366_NUM_VIDS)
return -EINVAL;
/* Updating the 4K entry; lookup it and change the port member set */
- 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);
+ 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);
/* For the 16 entries more work needs to be done. First see if such
VID is already there and change it */
static int rtl8366s_reset_vlan(struct rtl8366_smi *smi)
{
int i;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366s_vlanconfig vlanMC;
/* clear 16 VLAN member configuration */
}
/* Set a default VLAN with vid 1 to 4K table for all ports */
- vlan4K.vid = 1;
- vlan4K.member = RTL8366_PORT_ALL;
- vlan4K.untag = RTL8366_PORT_ALL;
- vlan4K.fid = 0;
- if (rtl8366s_set_vlan_4k_entry(smi, &vlan4K) != 0)
+ vlan4k.vid = 1;
+ vlan4k.member = RTL8366_PORT_ALL;
+ vlan4k.untag = RTL8366_PORT_ALL;
+ vlan4k.fid = 0;
+ if (rtl8366s_set_vlan_4k_entry(smi, &vlan4k) != 0)
return -EIO;
/* Set all ports PVID to default VLAN */
char buf[1024];
u32 len = 0;
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366_smi *smi = to_rtl8366(dev);
if (val->port_vlan >= RTL8366_NUM_PORTS)
memset(buf, '\0', sizeof(buf));
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4k);
len += snprintf(buf + len, sizeof(buf) - len, "VLAN %d: Ports: ",
val->port_vlan);
len += snprintf(buf + len, sizeof(buf) - len, "\t4K:\t");
len += snprintf(buf + len, sizeof(buf) - len,
"%d \t \t 0x%04x \t 0x%04x \t %d",
- vlan4K.vid, vlan4K.member, vlan4K.untag, vlan4K.fid);
+ vlan4k.vid, vlan4k.member, vlan4k.untag, vlan4k.fid);
val->value.s = buf;
val->len = len;
struct switch_val *val)
{
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366_smi *smi = to_rtl8366(dev);
if (val->port_vlan >= RTL8366_NUM_VLANS)
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4k);
- vlan4K.member = vlanMC.member = val->value.i;
+ vlan4k.member = vlanMC.member = val->value.i;
rtl8366s_set_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_set_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_set_vlan_4k_entry(smi, &vlan4k);
return 0;
}
struct switch_val *val)
{
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366_smi *smi = to_rtl8366(dev);
if (val->port_vlan >= RTL8366_NUM_VLANS)
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4k);
val->value.i = vlanMC.member;
struct switch_val *val)
{
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366_smi *smi = to_rtl8366(dev);
if (val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4k);
- vlan4K.untag = vlanMC.untag = val->value.i;
+ vlan4k.untag = vlanMC.untag = val->value.i;
rtl8366s_set_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_set_vlan_4k_entry(smi, &vlan4K);
+ rtl8366s_set_vlan_4k_entry(smi, &vlan4k);
return 0;
}
struct switch_val *val)
{
struct rtl8366s_vlanconfig vlanMC;
- struct rtl8366s_vlan4kentry vlan4K;
+ struct rtl8366s_vlan4kentry vlan4k;
struct rtl8366_smi *smi = to_rtl8366(dev);
if (val->port_vlan >= RTL8366_NUM_VLANS)
return -EINVAL;
rtl8366s_get_vlan_member_config(smi, val->port_vlan, &vlanMC);
- rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4K);
+ rtl8366s_get_vlan_4k_entry(smi, vlanMC.vid, &vlan4k);
val->value.i = vlanMC.untag;