pr_debug("Tagged ports %llx, untag %llx, prof %x, MC# %d, UC# %d, FID %x\n",
info.tagged_ports, info.untagged_ports, info.profile_id,
- info.hash_mc, info.hash_uc, info.fid);
+ info.hash_mc_fid, info.hash_uc_fid, info.fid);
mutex_unlock(&priv->reg_mutex);
return 0;
static void rtl83xx_vlan_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan)
{
- struct rtl838x_vlan_info info;
+ struct rtl838x_vlan_info info = {};
struct rtl838x_switch_priv *priv = ds->priv;
int v;
u64 portmask;
info->tagged_ports = sw_r32(RTL838X_TBL_ACCESS_DATA_0(0));
v = sw_r32(RTL838X_TBL_ACCESS_DATA_0(1));
info->profile_id = v & 0x7;
- info->hash_mc = !!(v & 0x8);
- info->hash_uc = !!(v & 0x10);
+ info->hash_mc_fid = !!(v & 0x8);
+ info->hash_uc_fid = !!(v & 0x10);
info->fid = (v >> 5) & 0x3f;
sw_w32(info->tagged_ports, RTL838X_TBL_ACCESS_DATA_0(0));
v = info->profile_id;
- v |= info->hash_mc ? 0x8 : 0;
- v |= info->hash_uc ? 0x10 : 0;
+ v |= info->hash_mc_fid ? 0x8 : 0;
+ v |= info->hash_uc_fid ? 0x10 : 0;
v |= ((u32)info->fid) << 5;
sw_w32(v, RTL838X_TBL_ACCESS_DATA_0(1));
u64 untagged_ports;
u64 tagged_ports;
u8 profile_id;
- bool hash_mc;
- bool hash_uc;
+ bool hash_mc_fid;
+ bool hash_uc_fid;
u8 fid;
};
w = sw_r32(RTL838X_TBL_ACCESS_DATA_0(2));
info->profile_id = w >> 30 | ((u & 1) << 2);
- info->hash_mc = !!(u & 2);
- info->hash_uc = !!(u & 4);
+ info->hash_mc_fid = !!(u & 2);
+ info->hash_uc_fid = !!(u & 4);
info->fid = (u >> 3) & 0xff;
cmd = BIT(16) /* Execute cmd */
u64 v = info->tagged_ports << 11;
v |= info->profile_id >> 2;
- v |= info->hash_mc ? 2 : 0;
- v |= info->hash_uc ? 4 : 0;
+ v |= info->hash_mc_fid ? 2 : 0;
+ v |= info->hash_uc_fid ? 4 : 0;
v |= ((u32)info->fid) << 3;
rtl839x_set_port_reg_be(v, RTL838X_TBL_ACCESS_DATA_0(0));