rtl83xx: merge bkobl's vlan cleanup
authorJohn Crispin <john@phrozen.org>
Tue, 24 Nov 2020 12:57:51 +0000 (13:57 +0100)
committerJohn Crispin <john@phrozen.org>
Tue, 24 Nov 2020 14:55:59 +0000 (15:55 +0100)
Signed-off-by: John Crispin <john@phrozen.org>
target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl83xx/dsa.c
target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.h
target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c

index 5a274b700e4267fff7319e1d3d10efddfcd1d950..bd756dd88f9524386a48f7007e4d60bd884ef5cb 100644 (file)
@@ -782,7 +782,7 @@ static int rtl83xx_vlan_prepare(struct dsa_switch *ds, int port,
 
        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;
@@ -791,7 +791,7 @@ static int rtl83xx_vlan_prepare(struct dsa_switch *ds, int port,
 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;
index 9fa135db1b19496ead94e96009dcd12816cf8c2a..4b2a2d14341a47a6b367143c1a50625cc714cfbb 100644 (file)
@@ -60,8 +60,8 @@ static void rtl838x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info)
        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;
 
 
@@ -84,8 +84,8 @@ static void rtl838x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info)
        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));
index b7f2086aca1f7fd75c0674680ef1258d3aaf3dae..f120aba81a4674d1f1c1d5c0f03da0ad36dcdfb8 100644 (file)
@@ -187,8 +187,8 @@ struct rtl838x_vlan_info {
        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;
 };
 
index 14e67af09a4511bb4997ab4f635db3c9a896c0a6..8a694b129d77df5370850cbdb0bb44fd0c9341ac 100644 (file)
@@ -96,8 +96,8 @@ static void rtl839x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info)
        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 */
@@ -121,8 +121,8 @@ static void rtl839x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info)
        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));