hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/dsa/rtl8366.c
....@@ -11,7 +11,7 @@
1111 #include <linux/if_bridge.h>
1212 #include <net/dsa.h>
1313
14
-#include "realtek-smi.h"
14
+#include "realtek-smi-core.h"
1515
1616 int rtl8366_mc_is_used(struct realtek_smi *smi, int mc_index, int *used)
1717 {
....@@ -311,7 +311,7 @@
311311 /* For the CPU port, make all ports members of this
312312 * VLAN.
313313 */
314
- mask = GENMASK(smi->num_ports - 1, 0);
314
+ mask = GENMASK((int)smi->num_ports - 1, 0);
315315 else
316316 /* For all other ports, enable itself plus the
317317 * CPU port.
....@@ -340,15 +340,20 @@
340340 }
341341 EXPORT_SYMBOL_GPL(rtl8366_init_vlan);
342342
343
-int rtl8366_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
343
+int rtl8366_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
344
+ struct switchdev_trans *trans)
344345 {
345346 struct realtek_smi *smi = ds->priv;
346347 struct rtl8366_vlan_4k vlan4k;
347348 int ret;
348349
349350 /* Use VLAN nr port + 1 since VLAN0 is not valid */
350
- if (!smi->ops->is_vlan_valid(smi, port + 1))
351
- return -EINVAL;
351
+ if (switchdev_trans_ph_prepare(trans)) {
352
+ if (!smi->ops->is_vlan_valid(smi, port + 1))
353
+ return -EINVAL;
354
+
355
+ return 0;
356
+ }
352357
353358 dev_info(smi->dev, "%s filtering on port %d\n",
354359 vlan_filtering ? "enable" : "disable",