int (*get_mib_counter)(struct rtl8366_smi *smi, int counter,
int port, unsigned long long *val);
int (*is_vlan_valid)(struct rtl8366_smi *smi, unsigned vlan);
+ int (*enable_vlan)(struct rtl8366_smi *smi, int enable);
+ int (*enable_vlan4k)(struct rtl8366_smi *smi, int enable);
};
struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent);
return 1;
}
-static int rtl8366rb_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
+static int rtl8366rb_enable_vlan(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_EN_VLAN,
(enable) ? RTL8366RB_SGCR_EN_VLAN : 0);
}
-static int rtl8366rb_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
+static int rtl8366rb_enable_vlan4k(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR,
RTL8366RB_SGCR_EN_VLAN_4KTB,
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
if (attr->ofs == 1)
- return rtl8366rb_vlan_set_vlan(smi, val->value.i);
+ return rtl8366rb_enable_vlan(smi, val->value.i);
else
- return rtl8366rb_vlan_set_4ktable(smi, val->value.i);
+ return rtl8366rb_enable_vlan4k(smi, val->value.i);
}
static int rtl8366rb_sw_get_learning_enable(struct switch_dev *dev,
.set_mc_index = rtl8366rb_set_mc_index,
.get_mib_counter = rtl8366rb_get_mib_counter,
.is_vlan_valid = rtl8366rb_is_vlan_valid,
+ .enable_vlan = rtl8366rb_enable_vlan,
+ .enable_vlan4k = rtl8366rb_enable_vlan4k,
};
static int __init rtl8366rb_probe(struct platform_device *pdev)
RTL8366S_PORT_VLAN_CTRL_SHIFT(port));
}
-static int rtl8366s_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
+static int rtl8366s_enable_vlan(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366S_SGCR, RTL8366S_SGCR_EN_VLAN,
(enable) ? RTL8366S_SGCR_EN_VLAN : 0);
}
-static int rtl8366s_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
+static int rtl8366s_enable_vlan4k(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366S_VLAN_TB_CTRL_REG,
1, (enable) ? 1 : 0);
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
if (attr->ofs == 1)
- return rtl8366s_vlan_set_vlan(smi, val->value.i);
+ return rtl8366s_enable_vlan(smi, val->value.i);
else
- return rtl8366s_vlan_set_4ktable(smi, val->value.i);
+ return rtl8366s_enable_vlan4k(smi, val->value.i);
}
static int rtl8366s_sw_get_learning_enable(struct switch_dev *dev,
.set_mc_index = rtl8366s_set_mc_index,
.get_mib_counter = rtl8366_get_mib_counter,
.is_vlan_valid = rtl8366s_is_vlan_valid,
+ .enable_vlan = rtl8366s_enable_vlan,
+ .enable_vlan4k = rtl8366s_enable_vlan4k,
};
static int __init rtl8366s_probe(struct platform_device *pdev)