| .. | .. |
|---|
| 11 | 11 | #include <linux/if_bridge.h> |
|---|
| 12 | 12 | #include <net/dsa.h> |
|---|
| 13 | 13 | |
|---|
| 14 | | -#include "realtek-smi.h" |
|---|
| 14 | +#include "realtek-smi-core.h" |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | int rtl8366_mc_is_used(struct realtek_smi *smi, int mc_index, int *used) |
|---|
| 17 | 17 | { |
|---|
| .. | .. |
|---|
| 311 | 311 | /* For the CPU port, make all ports members of this |
|---|
| 312 | 312 | * VLAN. |
|---|
| 313 | 313 | */ |
|---|
| 314 | | - mask = GENMASK(smi->num_ports - 1, 0); |
|---|
| 314 | + mask = GENMASK((int)smi->num_ports - 1, 0); |
|---|
| 315 | 315 | else |
|---|
| 316 | 316 | /* For all other ports, enable itself plus the |
|---|
| 317 | 317 | * CPU port. |
|---|
| .. | .. |
|---|
| 340 | 340 | } |
|---|
| 341 | 341 | EXPORT_SYMBOL_GPL(rtl8366_init_vlan); |
|---|
| 342 | 342 | |
|---|
| 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) |
|---|
| 344 | 345 | { |
|---|
| 345 | 346 | struct realtek_smi *smi = ds->priv; |
|---|
| 346 | 347 | struct rtl8366_vlan_4k vlan4k; |
|---|
| 347 | 348 | int ret; |
|---|
| 348 | 349 | |
|---|
| 349 | 350 | /* 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 | + } |
|---|
| 352 | 357 | |
|---|
| 353 | 358 | dev_info(smi->dev, "%s filtering on port %d\n", |
|---|
| 354 | 359 | vlan_filtering ? "enable" : "disable", |
|---|