target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl839x.c
static void rtl839x_setup_port_macs(struct rtl838x_switch_priv *priv)
{
	int i;
	struct net_device *dev;
	u64 mac;

	pr_debug("%s: got port %08x\n", __func__, (u32)priv->ports[priv->cpu_port].dp);
	dev = priv->ports[priv->cpu_port].dp->slave;
	mac = ether_addr_to_u64(dev->dev_addr);

	for (i = 0; i < 15; i++) {
		mac++;  // BUG: VRRP for testing
		sw_w32(mac >> 32, RTL839X_ROUTING_SA_CTRL + i * 8);
		sw_w32(mac, RTL839X_ROUTING_SA_CTRL + i * 8 + 4);
	}
}
/*
 * Configure the switch's own MAC addresses used when routing packets
 */
Configure the switch's own MAC addresses used when routing packets
Configure the switch ' s own MAC addresses used when routing packets
static void rtl839x_setup_port_macs(struct rtl838x_switch_priv *priv)
{
	int i;
	struct net_device *dev;
	u64 mac;
	pr_debug("%s: got port %08x\n", __func__, (u32)priv->ports[priv->cpu_port].dp);
	dev = priv->ports[priv->cpu_port].dp->slave;
	mac = ether_addr_to_u64(dev->dev_addr);
	for (i = 0; i < 15; i++) {
		mac++;  
		sw_w32(mac >> 32, RTL839X_ROUTING_SA_CTRL + i * 8);
		sw_w32(mac, RTL839X_ROUTING_SA_CTRL + i * 8 + 4);
	}
}
static void rtl839x_setup_port_macs ( struct rtl838x_switch_priv * priv ) { int i ; struct net_device * dev ; u64 mac ; pr_debug ( " \n " , __func__ , ( u32 ) priv -> ports [ priv -> cpu_port ] . dp ) ; dev = priv -> ports [ priv -> cpu_port ] . dp -> slave ; mac = ether_addr_to_u64 ( dev -> dev_addr ) ; for ( i = 0 ; i < 15 ; i ++ ) { mac ++ ; sw_w32 ( mac >> 32 , RTL839X_ROUTING_SA_CTRL + i * 8 ) ; sw_w32 ( mac , RTL839X_ROUTING_SA_CTRL + i * 8 + 4 ) ; } }
Configure the switch's own MAC addresses used when routing packets
Configure the switch ' s own MAC addresses used when routing packets
// BUG: VRRP for testing