91cf55b18a3a10f9133160c73b30189f839309f3
[openwrt/staging/blogic.git] /
1 From ee47ed08d75e8f16b3cf882061ee19c2ea19dd6c Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <f.fainelli@gmail.com>
3 Date: Wed, 10 Mar 2021 10:52:26 -0800
4 Subject: [PATCH] net: dsa: b53: Add debug prints in b53_vlan_enable()
5
6 Having dynamic debug prints in b53_vlan_enable() has been helpful to
7 uncover a recent but update the function to indicate the port being
8 configured (or -1 for initial setup) and include the global VLAN enabled
9 and VLAN filtering enable status.
10
11 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
12 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 drivers/net/dsa/b53/b53_common.c | 11 +++++++----
16 1 file changed, 7 insertions(+), 4 deletions(-)
17
18 --- a/drivers/net/dsa/b53/b53_common.c
19 +++ b/drivers/net/dsa/b53/b53_common.c
20 @@ -349,7 +349,7 @@ static void b53_set_forwarding(struct b5
21 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
22 }
23
24 -static void b53_enable_vlan(struct b53_device *dev, bool enable,
25 +static void b53_enable_vlan(struct b53_device *dev, int port, bool enable,
26 bool enable_filtering)
27 {
28 u8 mgmt, vc0, vc1, vc4 = 0, vc5;
29 @@ -431,6 +431,9 @@ static void b53_enable_vlan(struct b53_d
30 b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
31
32 dev->vlan_enabled = enable;
33 +
34 + dev_dbg(dev->dev, "Port %d VLAN enabled: %d, filtering: %d\n",
35 + port, enable, enable_filtering);
36 }
37
38 static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100)
39 @@ -708,7 +711,7 @@ int b53_configure_vlan(struct dsa_switch
40 b53_do_vlan_op(dev, VTA_CMD_CLEAR);
41 }
42
43 - b53_enable_vlan(dev, dev->vlan_enabled, ds->vlan_filtering);
44 + b53_enable_vlan(dev, -1, dev->vlan_enabled, ds->vlan_filtering);
45
46 b53_for_each_port(dev, i)
47 b53_write16(dev, B53_VLAN_PAGE,
48 @@ -1390,7 +1393,7 @@ int b53_vlan_filtering(struct dsa_switch
49 if (switchdev_trans_ph_prepare(trans))
50 return 0;
51
52 - b53_enable_vlan(dev, dev->vlan_enabled, vlan_filtering);
53 + b53_enable_vlan(dev, port, dev->vlan_enabled, vlan_filtering);
54
55 return 0;
56 }
57 @@ -1415,7 +1418,7 @@ int b53_vlan_prepare(struct dsa_switch *
58 if (vlan->vid_end >= dev->num_vlans)
59 return -ERANGE;
60
61 - b53_enable_vlan(dev, true, ds->vlan_filtering);
62 + b53_enable_vlan(dev, port, true, ds->vlan_filtering);
63
64 return 0;
65 }