|
10 | 10 | #include <linux/mii.h>
|
11 | 11 | #include <linux/phy.h>
|
12 | 12 | #include <linux/if_bridge.h>
|
| 13 | +#include <linux/if_vlan.h> |
13 | 14 | #include <linux/etherdevice.h>
|
14 | 15 |
|
15 | 16 | #include "lan9303.h"
|
@@ -1083,21 +1084,27 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port,
|
1083 | 1084 | static int lan9303_port_enable(struct dsa_switch *ds, int port,
|
1084 | 1085 | struct phy_device *phy)
|
1085 | 1086 | {
|
| 1087 | + struct dsa_port *dp = dsa_to_port(ds, port); |
1086 | 1088 | struct lan9303 *chip = ds->priv;
|
1087 | 1089 |
|
1088 |
| - if (!dsa_is_user_port(ds, port)) |
| 1090 | + if (!dsa_port_is_user(dp)) |
1089 | 1091 | return 0;
|
1090 | 1092 |
|
| 1093 | + vlan_vid_add(dp->cpu_dp->master, htons(ETH_P_8021Q), port); |
| 1094 | + |
1091 | 1095 | return lan9303_enable_processing_port(chip, port);
|
1092 | 1096 | }
|
1093 | 1097 |
|
1094 | 1098 | static void lan9303_port_disable(struct dsa_switch *ds, int port)
|
1095 | 1099 | {
|
| 1100 | + struct dsa_port *dp = dsa_to_port(ds, port); |
1096 | 1101 | struct lan9303 *chip = ds->priv;
|
1097 | 1102 |
|
1098 |
| - if (!dsa_is_user_port(ds, port)) |
| 1103 | + if (!dsa_port_is_user(dp)) |
1099 | 1104 | return;
|
1100 | 1105 |
|
| 1106 | + vlan_vid_del(dp->cpu_dp->master, htons(ETH_P_8021Q), port); |
| 1107 | + |
1101 | 1108 | lan9303_disable_processing_port(chip, port);
|
1102 | 1109 | lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
|
1103 | 1110 | }
|
|
0 commit comments