u8 fid;
};
+struct rtl8366_vlan_4k {
+ u16 vid;
+ u8 untag;
+ u8 member;
+ u8 fid;
+};
+
int rtl8366_smi_init(struct rtl8366_smi *smi);
void rtl8366_smi_cleanup(struct rtl8366_smi *smi);
int rtl8366_smi_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data);
}
static int rtl8366rb_get_vlan_4k(struct rtl8366rb *rtl, u32 vid,
- struct rtl8366rb_vlan_4k *vlan4k)
+ struct rtl8366_vlan_4k *vlan4k)
{
struct rtl8366_smi *smi = &rtl->smi;
+ struct rtl8366rb_vlan_4k vlan4k_priv;
int err;
u32 data;
u16 *tableaddr;
- memset(vlan4k, '\0', sizeof(struct rtl8366rb_vlan_4k));
- vlan4k->vid = vid;
+ memset(vlan4k, '\0', sizeof(struct rtl8366_vlan_4k));
+ vlan4k_priv.vid = vid;
if (vid >= RTL8366_NUM_VIDS)
return -EINVAL;
- tableaddr = (u16 *)vlan4k;
+ tableaddr = (u16 *)&vlan4k_priv;
/* write VID */
data = *tableaddr;
if (err)
return err;
*tableaddr = data;
+
vlan4k->vid = vid;
+ vlan4k->untag = vlan4k_priv.untag;
+ vlan4k->member = vlan4k_priv.member;
+ vlan4k->fid = vlan4k_priv.fid;
return 0;
}
static int rtl8366rb_set_vlan_4k(struct rtl8366rb *rtl,
- const struct rtl8366rb_vlan_4k *vlan4k)
+ const struct rtl8366_vlan_4k *vlan4k)
{
struct rtl8366_smi *smi = &rtl->smi;
+ struct rtl8366rb_vlan_4k vlan4k_priv;
int err;
u32 data;
u16 *tableaddr;
vlan4k->fid > RTL8366S_FIDMAX)
return -EINVAL;
- tableaddr = (u16 *)vlan4k;
+ vlan4k_priv.vid = vlan4k->vid;
+ vlan4k_priv.untag = vlan4k->untag;
+ vlan4k_priv.member = vlan4k->member;
+ vlan4k_priv.fid = vlan4k->fid;
+
+ tableaddr = (u16 *)&vlan4k_priv;
data = *tableaddr;
{
int i;
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366rb_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
if (port >= RTL8366_NUM_PORTS || val >= RTL8366_NUM_VIDS)
return -EINVAL;
static int rtl8366rb_reset_vlan(struct rtl8366rb *rtl)
{
- struct rtl8366rb_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366_vlan_mc vlanmc;
int err;
int i;
int i;
u32 len = 0;
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366rb_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366rb *rtl = sw_to_rtl8366rb(dev);
char *buf = rtl->buf;
struct switch_val *val)
{
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366rb_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366rb *rtl = sw_to_rtl8366rb(dev);
struct switch_port *port;
int i;
}
static int rtl8366s_get_vlan_4k(struct rtl8366s *rtl, u32 vid,
- struct rtl8366s_vlan_4k *vlan4k)
+ struct rtl8366_vlan_4k *vlan4k)
{
struct rtl8366_smi *smi = &rtl->smi;
+ struct rtl8366s_vlan_4k vlan4k_priv;
int err;
u32 data;
u16 *tableaddr;
- memset(vlan4k, '\0', sizeof(struct rtl8366s_vlan_4k));
- vlan4k->vid = vid;
+ memset(vlan4k, '\0', sizeof(struct rtl8366_vlan_4k));
+ vlan4k_priv.vid = vid;
if (vid >= RTL8366_NUM_VIDS)
return -EINVAL;
- tableaddr = (u16 *)vlan4k;
+ tableaddr = (u16 *)&vlan4k_priv;
/* write VID */
data = *tableaddr;
return err;
*tableaddr = data;
+
vlan4k->vid = vid;
+ vlan4k->untag = vlan4k_priv.untag;
+ vlan4k->member = vlan4k_priv.member;
+ vlan4k->fid = vlan4k_priv.fid;
return 0;
}
static int rtl8366s_set_vlan_4k(struct rtl8366s *rtl,
- const struct rtl8366s_vlan_4k *vlan4k)
+ const struct rtl8366_vlan_4k *vlan4k)
{
struct rtl8366_smi *smi = &rtl->smi;
+ struct rtl8366s_vlan_4k vlan4k_priv;
int err;
u32 data;
u16 *tableaddr;
vlan4k->fid > RTL8366S_FIDMAX)
return -EINVAL;
- tableaddr = (u16 *)vlan4k;
+ vlan4k_priv.vid = vlan4k->vid;
+ vlan4k_priv.untag = vlan4k->untag;
+ vlan4k_priv.member = vlan4k->member;
+ vlan4k_priv.fid = vlan4k->fid;
+
+ tableaddr = (u16 *)&vlan4k_priv;
data = *tableaddr;
{
int i;
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366s_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
if (port >= RTL8366_NUM_PORTS || val >= RTL8366_NUM_VIDS)
return -EINVAL;
static int rtl8366s_reset_vlan(struct rtl8366s *rtl)
{
- struct rtl8366s_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366_vlan_mc vlanmc;
int err;
int i;
int i;
u32 len = 0;
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366s_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366s *rtl = sw_to_rtl8366s(dev);
char *buf = rtl->buf;
struct switch_val *val)
{
struct rtl8366_vlan_mc vlanmc;
- struct rtl8366s_vlan_4k vlan4k;
+ struct rtl8366_vlan_4k vlan4k;
struct rtl8366s *rtl = sw_to_rtl8366s(dev);
struct switch_port *port;
int i;