|
|
@@ -907,6 +907,9 @@ static void rtl930x_init_eee(struct rtl838x_switch_priv *priv, bool enable)
|
|
|
|
|
|
priv->eee_enabled = enable;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
|
|
|
+
|
|
|
#define HASH_PICK(val, lsb, len) ((val & (((1 << len) - 1) << lsb)) >> lsb)
|
|
|
|
|
|
static u32 rtl930x_l3_hash4(u32 ip, int algorithm, bool move_dip)
|
|
|
@@ -1460,6 +1463,8 @@ static void rtl930x_set_l3_nexthop(int idx, u16 dmac_id, u16 interface)
|
|
|
rtl_table_release(r);
|
|
|
}
|
|
|
|
|
|
+#endif /* CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD */
|
|
|
+
|
|
|
static void rtl930x_pie_lookup_enable(struct rtl838x_switch_priv *priv, int index)
|
|
|
{
|
|
|
int block = index / PIE_BLOCK_SIZE;
|
|
|
@@ -1987,6 +1992,8 @@ static void rtl930x_pie_init(struct rtl838x_switch_priv *priv)
|
|
|
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
|
|
|
+
|
|
|
/* Sets up an egress interface for L3 actions
|
|
|
* Actions for ip4/6_icmp_redirect, ip4/6_pbr_icmp_redirect are:
|
|
|
* 0: FORWARD, 1: DROP, 2: TRAP2CPU, 3: COPY2CPU, 4: TRAP2MASTERCPU 5: COPY2MASTERCPU
|
|
|
@@ -2193,6 +2200,8 @@ static int rtl930x_l3_setup(struct rtl838x_switch_priv *priv)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+#endif /* CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD */
|
|
|
+
|
|
|
static u32 rtl930x_packet_cntr_read(int counter)
|
|
|
{
|
|
|
u32 v;
|
|
|
@@ -2508,6 +2517,7 @@ const struct rtl838x_reg rtl930x_reg = {
|
|
|
.l2_learning_setup = rtl930x_l2_learning_setup,
|
|
|
.packet_cntr_read = rtl930x_packet_cntr_read,
|
|
|
.packet_cntr_clear = rtl930x_packet_cntr_clear,
|
|
|
+#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD
|
|
|
.route_read = rtl930x_route_read,
|
|
|
.route_write = rtl930x_route_write,
|
|
|
.host_route_write = rtl930x_host_route_write,
|
|
|
@@ -2521,6 +2531,7 @@ const struct rtl838x_reg rtl930x_reg = {
|
|
|
.get_l3_router_mac = rtl930x_get_l3_router_mac,
|
|
|
.set_l3_router_mac = rtl930x_set_l3_router_mac,
|
|
|
.set_l3_egress_intf = rtl930x_set_l3_egress_intf,
|
|
|
+#endif
|
|
|
.set_distribution_algorithm = rtl930x_set_distribution_algorithm,
|
|
|
.led_init = rtl930x_led_init,
|
|
|
.enable_learning = rtldsa_930x_enable_learning,
|