mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
net: dsa: add cross-chip bridging operations
Introduce crosschip_bridge_{join,leave} operations in the dsa_switch_ops structure, which can be used by switches supporting interconnection. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e96a6e0275
commit
40ef2c9339
@ -456,6 +456,14 @@ struct dsa_switch_ops {
|
|||||||
bool ingress);
|
bool ingress);
|
||||||
void (*port_mirror_del)(struct dsa_switch *ds, int port,
|
void (*port_mirror_del)(struct dsa_switch *ds, int port,
|
||||||
struct dsa_mall_mirror_tc_entry *mirror);
|
struct dsa_mall_mirror_tc_entry *mirror);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cross-chip operations
|
||||||
|
*/
|
||||||
|
int (*crosschip_bridge_join)(struct dsa_switch *ds, int sw_index,
|
||||||
|
int port, struct net_device *br);
|
||||||
|
void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index,
|
||||||
|
int port, struct net_device *br);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dsa_switch_driver {
|
struct dsa_switch_driver {
|
||||||
|
@ -20,9 +20,9 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds,
|
|||||||
if (ds->index == info->sw_index && ds->ops->port_bridge_join)
|
if (ds->index == info->sw_index && ds->ops->port_bridge_join)
|
||||||
return ds->ops->port_bridge_join(ds, info->port, info->br);
|
return ds->ops->port_bridge_join(ds, info->port, info->br);
|
||||||
|
|
||||||
if (ds->index != info->sw_index)
|
if (ds->index != info->sw_index && ds->ops->crosschip_bridge_join)
|
||||||
dev_dbg(ds->dev, "crosschip DSA port %d.%d bridged to %s\n",
|
return ds->ops->crosschip_bridge_join(ds, info->sw_index,
|
||||||
info->sw_index, info->port, netdev_name(info->br));
|
info->port, info->br);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -33,9 +33,9 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
|
|||||||
if (ds->index == info->sw_index && ds->ops->port_bridge_leave)
|
if (ds->index == info->sw_index && ds->ops->port_bridge_leave)
|
||||||
ds->ops->port_bridge_leave(ds, info->port, info->br);
|
ds->ops->port_bridge_leave(ds, info->port, info->br);
|
||||||
|
|
||||||
if (ds->index != info->sw_index)
|
if (ds->index != info->sw_index && ds->ops->crosschip_bridge_leave)
|
||||||
dev_dbg(ds->dev, "crosschip DSA port %d.%d unbridged from %s\n",
|
ds->ops->crosschip_bridge_leave(ds, info->sw_index, info->port,
|
||||||
info->sw_index, info->port, netdev_name(info->br));
|
info->br);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user