target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl930x.c
static void rtl930x_set_l3_nexthop(int idx, u16 dmac_id, u16 interface)
{
	// Access L3_NEXTHOP table (3) via register RTL9300_TBL_1
	struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 3);

	pr_info("%s: Writing to L3_NEXTHOP table, index %d, dmac_id %d, interface %d\n",
		__func__, idx, dmac_id, interface);
	sw_w32(((dmac_id & 0x7fff) << 7) | (interface & 0x7f), rtl_table_data(r, 0));

	pr_info("%s: %08x\n", __func__, sw_r32(rtl_table_data(r,0)));
	rtl_table_write(r, idx);
	rtl_table_release(r);
}
/*
 * Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC's
 * L3_NEXTHOP table. The nexthop entry is identified by idx.
 * dmac_id is the reference to the L2 entry in the L2 forwarding table, special values are
 * 0x7ffe: TRAP2CPU
 * 0x7ffd: TRAP2MASTERCPU
 * 0x7fff: DMAC_ID_DROP
 */
Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC's
L3_NEXTHOP table. The nexthop entry is identified by idx.
dmac_id is the reference to the L2 entry in the L2 forwarding table, special values are
0x7ffe: TRAP2CPU
0x7ffd: TRAP2MASTERCPU
0x7fff: DMAC_ID_DROP
Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC ' s L3_NEXTHOP table . The nexthop entry is identified by idx . dmac_id is the reference to the L2 entry in the L2 forwarding table special values are 0x7ffe : TRAP2CPU 0x7ffd : TRAP2MASTERCPU 0x7fff : DMAC_ID_DROP
static void rtl930x_set_l3_nexthop(int idx, u16 dmac_id, u16 interface)
{
	struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 3);
	pr_info("%s: Writing to L3_NEXTHOP table, index %d, dmac_id %d, interface %d\n",
		__func__, idx, dmac_id, interface);
	sw_w32(((dmac_id & 0x7fff) << 7) | (interface & 0x7f), rtl_table_data(r, 0));
	pr_info("%s: %08x\n", __func__, sw_r32(rtl_table_data(r,0)));
	rtl_table_write(r, idx);
	rtl_table_release(r);
}
static void rtl930x_set_l3_nexthop ( int idx , u16 dmac_id , u16 interface ) { struct table_reg * r = rtl_table_get ( RTL9300_TBL_1 , 3 ) ; pr_info ( " \n " , __func__ , idx , dmac_id , interface ) ; sw_w32 ( ( ( dmac_id & 0x7fff ) << 7 ) | ( interface & 0x7f ) , rtl_table_data ( r , 0 ) ) ; pr_info ( " \n " , __func__ , sw_r32 ( rtl_table_data ( r , 0 ) ) ) ; rtl_table_write ( r , idx ) ; rtl_table_release ( r ) ; }
Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC's
 L3_NEXTHOP table.
Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC ' s L3_NEXTHOP table .
// Access L3_NEXTHOP table (3) via register RTL9300_TBL_1