aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2018-03-23 13:42:56 +0100
committerFelix Fietkau <nbd@nbd.name>2018-04-06 19:37:53 +0200
commit424a9ae128bd2045cd4bfd6e3229f2529d150a25 (patch)
tree2d82652a341a08c3edb660893c20315d5cafc41e /target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
parentdea9922acd290b37a784d354892a44684a8fb696 (diff)
downloadupstream-424a9ae128bd2045cd4bfd6e3229f2529d150a25.tar.gz
upstream-424a9ae128bd2045cd4bfd6e3229f2529d150a25.tar.bz2
upstream-424a9ae128bd2045cd4bfd6e3229f2529d150a25.zip
ramips: implement hardware NAT offload for MT7621
Supports IPv4 flow offloading on MT7621 for Routing, SNAT and DNAT Supported are regular ethernet->ethernet connections, including one 802.1q VLAN and/or PPPoE encapsulation Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h')
-rw-r--r--target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
index 0601127a10..dfaa5fd9ea 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
@@ -499,11 +499,17 @@ struct fe_priv {
unsigned long vlan_map;
struct work_struct pending_work;
DECLARE_BITMAP(pending_flags, FE_FLAG_MAX);
+
+ struct reset_control *rst_ppe;
+ struct mtk_foe_entry *foe_table;
+ dma_addr_t foe_table_phys;
+ struct flow_offload __rcu **foe_flow_table;
};
extern const struct of_device_id of_fe_match[];
void fe_w32(u32 val, unsigned reg);
+void fe_m32(struct fe_priv *priv, u32 clear, u32 set, unsigned reg);
u32 fe_r32(unsigned reg);
int fe_set_clock_cycle(struct fe_priv *priv);
@@ -520,4 +526,14 @@ static inline void *priv_netdev(struct fe_priv *priv)
return (char *)priv - ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
}
+int mtk_ppe_probe(struct fe_priv *eth);
+void mtk_ppe_remove(struct fe_priv *eth);
+int mtk_flow_offload(struct fe_priv *eth,
+ enum flow_offload_type type,
+ struct flow_offload *flow,
+ struct flow_offload_hw_path *src,
+ struct flow_offload_hw_path *dest);
+int mtk_offload_check_rx(struct fe_priv *eth, struct sk_buff *skb, u32 rxd4);
+
+
#endif /* FE_ETH_H */