Skip to content

Commit

Permalink
mt7615: add hwnat support for 5.0.3.0 driver
Browse files Browse the repository at this point in the history
Need more testing.
  • Loading branch information
hanwckf committed Sep 30, 2019
1 parent 45bcc5c commit 88e20ec
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 14 deletions.
41 changes: 38 additions & 3 deletions trunk/configs/boards/DIR-882/kernel-3.4.x-5.0.config
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,8 @@ CONFIG_HDR_TRANS_RX_SUPPORT=y
# CONFIG_WSC_V2_SUPPORT is not set
CONFIG_DOT11W_PMF_SUPPORT=y
CONFIG_TXBF_SUPPORT=y
CONFIG_FAST_NAT_SUPPORT=y
# CONFIG_WHNAT_SUPPORT is not set
# CONFIG_FTM_SUPPORT is not set
# CONFIG_MBO_SUPPORT is not set
CONFIG_IGMP_SNOOP_SUPPORT=y
Expand Down Expand Up @@ -2029,7 +2031,7 @@ CONFIG_MCAST_RATE_SPECIFIC=y
CONFIG_VOW_SUPPORT=y
CONFIG_BAND_STEERING=y
CONFIG_LED_CONTROL_SUPPORT=y
# CONFIG_WLAN_HOOK is not set
CONFIG_WLAN_HOOK=y
# CONFIG_RADIUS_ACCOUNTING_SUPPORT is not set
# CONFIG_GREENAP_SUPPORT is not set
# CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT is not set
Expand All @@ -2045,8 +2047,41 @@ CONFIG_MT_MAC=y
#
# Ralink NAT Acceleration Mode
#
CONFIG_RA_NAT_NONE=y
# CONFIG_RA_NAT_HW is not set
# CONFIG_RA_NAT_NONE is not set
CONFIG_RA_NAT_HW=y
CONFIG_RA_HW_NAT=m
CONFIG_HNAT_V2=y
CONFIG_RA_HW_NAT_LAN_VLANID=1
CONFIG_RA_HW_NAT_WAN_VLANID=2
CONFIG_RA_HW_NAT_BINDING_THRESHOLD=30
CONFIG_RA_HW_NAT_QURT_LMT=16383
CONFIG_RA_HW_NAT_HALF_LMT=16383
CONFIG_RA_HW_NAT_FULL_LMT=16383
# CONFIG_RA_HW_NAT_TBL_1K is not set
# CONFIG_RA_HW_NAT_TBL_2K is not set
# CONFIG_RA_HW_NAT_TBL_4K is not set
# CONFIG_RA_HW_NAT_TBL_8K is not set
CONFIG_RA_HW_NAT_TBL_16K=y
# CONFIG_RA_HW_NAT_HASH0 is not set
CONFIG_RA_HW_NAT_HASH1=y
# CONFIG_RA_HW_NAT_HASH2 is not set
# CONFIG_RA_HW_NAT_HASH3 is not set
CONFIG_RA_HW_NAT_TCP_KA=1
CONFIG_RA_HW_NAT_UDP_KA=1
CONFIG_RA_HW_NAT_NTU_KA=1
CONFIG_RA_HW_NAT_UNB_DLTA=3
CONFIG_RA_HW_NAT_UNB_MNP=1000
CONFIG_RA_HW_NAT_UDP_DLTA=5
CONFIG_RA_HW_NAT_TCP_DLTA=5
CONFIG_RA_HW_NAT_FIN_DLTA=5
CONFIG_RA_HW_NAT_NTU_DLTA=5
# CONFIG_RA_HW_NAT_PREBIND is not set
# CONFIG_RA_HW_NAT_IPV6 is not set
# CONFIG_RA_HW_NAT_QDMA is not set
# CONFIG_RA_HW_NAT_MCAST is not set
# CONFIG_RA_HW_NAT_PCI is not set
CONFIG_RA_HW_NAT_WIFI=y
# CONFIG_RA_HW_NAT_DEBUG is not set

#
# Ralink HW Crypto
Expand Down
41 changes: 38 additions & 3 deletions trunk/configs/boards/JCG-AC860M/kernel-3.4.x-5.0.config
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,8 @@ CONFIG_HDR_TRANS_RX_SUPPORT=y
# CONFIG_WSC_V2_SUPPORT is not set
CONFIG_DOT11W_PMF_SUPPORT=y
CONFIG_TXBF_SUPPORT=y
CONFIG_FAST_NAT_SUPPORT=y
# CONFIG_WHNAT_SUPPORT is not set
# CONFIG_FTM_SUPPORT is not set
# CONFIG_MBO_SUPPORT is not set
CONFIG_IGMP_SNOOP_SUPPORT=y
Expand Down Expand Up @@ -2029,7 +2031,7 @@ CONFIG_MCAST_RATE_SPECIFIC=y
CONFIG_VOW_SUPPORT=y
CONFIG_BAND_STEERING=y
CONFIG_LED_CONTROL_SUPPORT=y
# CONFIG_WLAN_HOOK is not set
CONFIG_WLAN_HOOK=y
# CONFIG_RADIUS_ACCOUNTING_SUPPORT is not set
# CONFIG_GREENAP_SUPPORT is not set
# CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT is not set
Expand All @@ -2045,8 +2047,41 @@ CONFIG_MT_MAC=y
#
# Ralink NAT Acceleration Mode
#
CONFIG_RA_NAT_NONE=y
# CONFIG_RA_NAT_HW is not set
# CONFIG_RA_NAT_NONE is not set
CONFIG_RA_NAT_HW=y
CONFIG_RA_HW_NAT=m
CONFIG_HNAT_V2=y
CONFIG_RA_HW_NAT_LAN_VLANID=1
CONFIG_RA_HW_NAT_WAN_VLANID=2
CONFIG_RA_HW_NAT_BINDING_THRESHOLD=30
CONFIG_RA_HW_NAT_QURT_LMT=16383
CONFIG_RA_HW_NAT_HALF_LMT=16383
CONFIG_RA_HW_NAT_FULL_LMT=16383
# CONFIG_RA_HW_NAT_TBL_1K is not set
# CONFIG_RA_HW_NAT_TBL_2K is not set
# CONFIG_RA_HW_NAT_TBL_4K is not set
# CONFIG_RA_HW_NAT_TBL_8K is not set
CONFIG_RA_HW_NAT_TBL_16K=y
# CONFIG_RA_HW_NAT_HASH0 is not set
CONFIG_RA_HW_NAT_HASH1=y
# CONFIG_RA_HW_NAT_HASH2 is not set
# CONFIG_RA_HW_NAT_HASH3 is not set
CONFIG_RA_HW_NAT_TCP_KA=1
CONFIG_RA_HW_NAT_UDP_KA=1
CONFIG_RA_HW_NAT_NTU_KA=1
CONFIG_RA_HW_NAT_UNB_DLTA=3
CONFIG_RA_HW_NAT_UNB_MNP=1000
CONFIG_RA_HW_NAT_UDP_DLTA=5
CONFIG_RA_HW_NAT_TCP_DLTA=5
CONFIG_RA_HW_NAT_FIN_DLTA=5
CONFIG_RA_HW_NAT_NTU_DLTA=5
# CONFIG_RA_HW_NAT_PREBIND is not set
# CONFIG_RA_HW_NAT_IPV6 is not set
# CONFIG_RA_HW_NAT_QDMA is not set
# CONFIG_RA_HW_NAT_MCAST is not set
# CONFIG_RA_HW_NAT_PCI is not set
CONFIG_RA_HW_NAT_WIFI=y
# CONFIG_RA_HW_NAT_DEBUG is not set

#
# Ralink HW Crypto
Expand Down
41 changes: 38 additions & 3 deletions trunk/configs/boards/K2P/kernel-3.4.x-5.0.config
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,8 @@ CONFIG_DEFAULT_5G_PROFILE=y
# CONFIG_WSC_V2_SUPPORT is not set
CONFIG_DOT11W_PMF_SUPPORT=y
CONFIG_TXBF_SUPPORT=y
CONFIG_FAST_NAT_SUPPORT=y
# CONFIG_WHNAT_SUPPORT is not set
# CONFIG_FTM_SUPPORT is not set
# CONFIG_MBO_SUPPORT is not set
CONFIG_IGMP_SNOOP_SUPPORT=y
Expand Down Expand Up @@ -1648,7 +1650,7 @@ CONFIG_MCAST_RATE_SPECIFIC=y
CONFIG_VOW_SUPPORT=y
CONFIG_BAND_STEERING=y
# CONFIG_LED_CONTROL_SUPPORT is not set
# CONFIG_WLAN_HOOK is not set
CONFIG_WLAN_HOOK=y
# CONFIG_RADIUS_ACCOUNTING_SUPPORT is not set
# CONFIG_GREENAP_SUPPORT is not set
# CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT is not set
Expand All @@ -1664,8 +1666,41 @@ CONFIG_MT_MAC=y
#
# Ralink NAT Acceleration Mode
#
CONFIG_RA_NAT_NONE=y
# CONFIG_RA_NAT_HW is not set
# CONFIG_RA_NAT_NONE is not set
CONFIG_RA_NAT_HW=y
CONFIG_RA_HW_NAT=m
CONFIG_HNAT_V2=y
CONFIG_RA_HW_NAT_LAN_VLANID=1
CONFIG_RA_HW_NAT_WAN_VLANID=2
CONFIG_RA_HW_NAT_BINDING_THRESHOLD=30
CONFIG_RA_HW_NAT_QURT_LMT=16383
CONFIG_RA_HW_NAT_HALF_LMT=16383
CONFIG_RA_HW_NAT_FULL_LMT=16383
# CONFIG_RA_HW_NAT_TBL_1K is not set
# CONFIG_RA_HW_NAT_TBL_2K is not set
# CONFIG_RA_HW_NAT_TBL_4K is not set
# CONFIG_RA_HW_NAT_TBL_8K is not set
CONFIG_RA_HW_NAT_TBL_16K=y
# CONFIG_RA_HW_NAT_HASH0 is not set
CONFIG_RA_HW_NAT_HASH1=y
# CONFIG_RA_HW_NAT_HASH2 is not set
# CONFIG_RA_HW_NAT_HASH3 is not set
CONFIG_RA_HW_NAT_TCP_KA=1
CONFIG_RA_HW_NAT_UDP_KA=1
CONFIG_RA_HW_NAT_NTU_KA=1
CONFIG_RA_HW_NAT_UNB_DLTA=3
CONFIG_RA_HW_NAT_UNB_MNP=1000
CONFIG_RA_HW_NAT_UDP_DLTA=5
CONFIG_RA_HW_NAT_TCP_DLTA=5
CONFIG_RA_HW_NAT_FIN_DLTA=5
CONFIG_RA_HW_NAT_NTU_DLTA=5
# CONFIG_RA_HW_NAT_PREBIND is not set
# CONFIG_RA_HW_NAT_IPV6 is not set
# CONFIG_RA_HW_NAT_QDMA is not set
# CONFIG_RA_HW_NAT_MCAST is not set
# CONFIG_RA_HW_NAT_PCI is not set
CONFIG_RA_HW_NAT_WIFI=y
# CONFIG_RA_HW_NAT_DEBUG is not set

#
# Ralink HW Crypto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6023,7 +6023,7 @@ INT set_hnat_register(RTMP_ADAPTER *pAd, RTMP_STRING *arg)
MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_OFF, ("\tWDEV %02d:, Name:%s, Wdev(list) Idx:%d\n",
idx, RTMP_OS_NETDEV_GET_DEVNAME(wdev->if_dev), wdev->wdev_idx));
MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_OFF, ("\t\t Idx:%d\n", RtmpOsGetNetIfIndex(wdev->if_dev)));
#if defined(CONFIG_FAST_NAT_SUPPORT)
#if 0

if (ppe_dev_unregister_hook != NULL &&
ppe_dev_register_hook != NULL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
#define RTMP_DEC_REF(_A) 0
#define RTMP_GET_REF(_A) 0

#if defined(CONFIG_FAST_NAT_SUPPORT)
#if 0
#define RT_MOD_HNAT_DEREG(_net_dev) \
do {\
if (ppe_dev_unregister_hook != NULL) \
Expand Down Expand Up @@ -1303,8 +1303,10 @@ do{ \
#ifdef CONFIG_FAST_NAT_SUPPORT
extern int (*ra_sw_nat_hook_tx)(struct sk_buff *skb, int gmac_no);
extern int (*ra_sw_nat_hook_rx)(struct sk_buff *skb);
#if 0
extern void (*ppe_dev_register_hook) (VOID *dev);
extern void (*ppe_dev_unregister_hook) (VOID *dev);
#endif

#if defined(CONFIG_WIFI_PKT_FWD) || defined(CONFIG_WIFI_PKT_FWD_MODULE)
extern int (*wf_ra_sw_nat_hook_tx_bkup)(struct sk_buff *skb, int gmac_no);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
#endif /* MEM_ALLOC_INFO_SUPPORT */

#ifdef CONFIG_FAST_NAT_SUPPORT
#include <net/ra_nat.h>
#include "../../../../../../net/nat/hw_nat/ra_nat.h"
#include "../../../../../../net/nat/hw_nat/frame_engine.h"
#endif /*CONFIG_FAST_NAT_SUPPORT*/

/* TODO */
Expand Down Expand Up @@ -2398,7 +2399,7 @@ VOID RtmpOsPktNatMagicTag(IN PNDIS_PACKET pNetPkt)
{
struct sk_buff *pRxPkt = RTPKT_TO_OSPKT(pNetPkt);

FOE_MAGIC_TAG(pRxPkt) = FOE_MAGIC_WLAN;
FOE_MAGIC_TAG(pRxPkt) = FOE_MAGIC_EXTIF;
}
#endif /*CONFIG_FAST_NAT_SUPPORT*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@


#ifdef CONFIG_FAST_NAT_SUPPORT
#include <net/ra_nat.h>
#include "../../../../../../net/nat/hw_nat/ra_nat.h"
#include "../../../../../../net/nat/hw_nat/frame_engine.h"
#endif /*CONFIG_FAST_NAT_SUPPORT*/

#define BSSID_WCID_TO_REMOVE 1
Expand Down

0 comments on commit 88e20ec

Please sign in to comment.