return portmask;
}
-static void store_mcgroups(struct rtl838x_switch_priv *priv, int port)
-{
- int mc_group;
-
- for (mc_group = 0; mc_group < MAX_MC_GROUPS; mc_group++) {
- u64 portmask = priv->r->read_mcast_pmask(mc_group);
- if (portmask & BIT_ULL(port)) {
- priv->mc_group_saves[mc_group] = port;
- rtl83xx_mc_group_del_port(priv, mc_group, port);
- }
- }
-}
-
-static void load_mcgroups(struct rtl838x_switch_priv *priv, int port)
-{
- int mc_group;
-
- for (mc_group = 0; mc_group < MAX_MC_GROUPS; mc_group++) {
- if (priv->mc_group_saves[mc_group] == port) {
- rtl83xx_mc_group_add_port(priv, mc_group, port);
- priv->mc_group_saves[mc_group] = -1;
- }
- }
-}
-
static int rtl83xx_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phydev)
{
/* add port to switch mask of CPU_PORT */
priv->r->traffic_enable(priv->cpu_port, port);
- load_mcgroups(priv, port);
-
if (priv->is_lagmember[port]) {
pr_debug("%s: %d is lag slave. ignore\n", __func__, port);
return 0;
// BUG: This does not work on RTL931X
/* remove port from switch mask of CPU_PORT */
priv->r->traffic_disable(priv->cpu_port, port);
- store_mcgroups(priv, port);
/* remove all other ports in the same bridge from switch mask of port */
v = priv->r->traffic_get(port);
port_bitmap |= BIT_ULL(i);
}
}
- load_mcgroups(priv, port);
/* Add all other ports to this port matrix. */
if (priv->ports[port].enable) {
port_bitmap |= BIT_ULL(i);
}
}
- store_mcgroups(priv, port);
/* Remove all other ports from this port matrix. */
if (priv->ports[port].enable) {
struct notifier_block fib_nb;
bool eee_enabled;
unsigned long int mc_group_bm[MAX_MC_GROUPS >> 5];
- int mc_group_saves[MAX_MC_GROUPS];
int n_pie_blocks;
struct rhashtable tc_ht;
unsigned long int pie_use_bm[MAX_PIE_ENTRIES >> 5];
return portmask;
}
-static void store_mcgroups(struct rtl838x_switch_priv *priv, int port)
-{
- for (int mc_group = 0; mc_group < MAX_MC_GROUPS; mc_group++) {
- u64 portmask = priv->r->read_mcast_pmask(mc_group);
- if (portmask & BIT_ULL(port)) {
- priv->mc_group_saves[mc_group] = port;
- rtl83xx_mc_group_del_port(priv, mc_group, port);
- }
- }
-}
-
-static void load_mcgroups(struct rtl838x_switch_priv *priv, int port)
-{
- for (int mc_group = 0; mc_group < MAX_MC_GROUPS; mc_group++) {
- if (priv->mc_group_saves[mc_group] == port) {
- rtl83xx_mc_group_add_port(priv, mc_group, port);
- priv->mc_group_saves[mc_group] = -1;
- }
- }
-}
-
static int rtl83xx_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phydev)
{
/* add port to switch mask of CPU_PORT */
priv->r->traffic_enable(priv->cpu_port, port);
- load_mcgroups(priv, port);
-
if (priv->is_lagmember[port]) {
pr_debug("%s: %d is lag slave. ignore\n", __func__, port);
return 0;
/* BUG: This does not work on RTL931X */
/* remove port from switch mask of CPU_PORT */
priv->r->traffic_disable(priv->cpu_port, port);
- store_mcgroups(priv, port);
/* remove all other ports in the same bridge from switch mask of port */
v = priv->r->traffic_get(port);
port_bitmap |= BIT_ULL(i);
}
}
- load_mcgroups(priv, port);
/* Add all other ports to this port matrix. */
if (priv->ports[port].enable) {
port_bitmap |= BIT_ULL(i);
}
}
- store_mcgroups(priv, port);
/* Remove all other ports from this port matrix. */
if (priv->ports[port].enable) {
struct notifier_block fib_nb;
bool eee_enabled;
unsigned long int mc_group_bm[MAX_MC_GROUPS >> 5];
- int mc_group_saves[MAX_MC_GROUPS];
int n_pie_blocks;
struct rhashtable tc_ht;
unsigned long int pie_use_bm[MAX_PIE_ENTRIES >> 5];