summaryrefslogtreecommitdiff
path: root/target/linux/mediatek/patches/1014-hwnat.patch
blob: d4a6379ab0b1023a4b1e24dfea7192cc318f7513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Index: linux-3.10.20/net/nat/hw_nat/ra_nat.c
===================================================================
--- linux-3.10.20.orig/net/nat/hw_nat/ra_nat.c
+++ linux-3.10.20/net/nat/hw_nat/ra_nat.c
@@ -3577,12 +3577,14 @@ static void PpeSetDstPort(uint32_t Ebl)
 	struct net_device *dev;
 #if defined (CONFIG_SUPPORT_OPENWRT)
 	dev=ra_dev_get_by_name("eth0");
-	printk("eth2 ifindex =%x\n", dev->ifindex);
+	printk("eth0 ifindex =%x\n", dev->ifindex);
 	DstPort[dev->ifindex] = dev;
+	DP_GMAC1 = dev->ifindex;
 #ifdef CONFIG_RAETH_GMAC2
 	dev=ra_dev_get_by_name("eth1");
-	printk("eth2 ifindex =%x\n", dev->ifindex);
+	printk("eth1 ifindex =%x\n", dev->ifindex);
 	DstPort[dev->ifindex] = dev;
+	DPORT_GMAC2 = dev->ifindex;;
 #endif
 #else
 	dev=ra_dev_get_by_name("eth2");
@@ -3616,9 +3618,12 @@ static void PpeSetDstPort(uint32_t Ebl)
 	DstPort[DP_USB] = ra_dev_get_by_name("eth1");	// USB interface name
 #endif // CONFIG_RA_HW_NAT_NIC_USB //
     } else {
-    	
-    	
-#if defined (CONFIG_RA_HW_NAT_WIFI_NEW_ARCH)   	
+#if defined (CONFIG_RA_HW_NAT_WIFI_NEW_ARCH)
+
+#if 1
+	if (DstPort[DP_GMAC]) dev_put(DstPort[DP_GMAC]);
+	if (DstPort[DP_GMAC2]) dev_put(DstPort[DP_GMAC2]);
+#else
 
 	int j = 0;
 	for (j=0; j<MAX_IF_NUM; j++){
@@ -3627,9 +3632,9 @@ static void PpeSetDstPort(uint32_t Ebl)
 			DstPort[j] = NULL;
 		}
 	}
-#endif  	
-    
-    	
+#endif
+#endif
+
 #if !defined (CONFIG_RA_HW_NAT_WIFI_NEW_ARCH)
 #if defined (CONFIG_RA_HW_NAT_WIFI)
 	if (DstPort[DP_RA0] != NULL) {
@@ -3943,15 +3948,7 @@ static void SetAclFwd(uint32_t Ebl)
 
 	if(Ebl){
 #if defined (CONFIG_SUPPORT_OPENWRT)
-#if defined (CONFIG_RAETH_SPECIAL_TAG)
-#if defined (CONFIG_WAN_AT_P4)
-		WanInt = ra_dev_get_by_name("eth0.5");
-#else
-		WanInt = ra_dev_get_by_name("eth0.1");
-#endif
-#else
-		WanInt = ra_dev_get_by_name("eth0.2");
-#endif
+		WanInt = ra_dev_get_by_name("eth1")
 #else
 #if defined (CONFIG_RAETH_SPECIAL_TAG)
 #if defined (CONFIG_WAN_AT_P4)
@@ -3963,7 +3960,7 @@ static void SetAclFwd(uint32_t Ebl)
 		WanInt = ra_dev_get_by_name("eth2.2");
 #endif
 #endif
-		LanInt = ra_dev_get_by_name("br0");
+		LanInt = ra_dev_get_by_name("br-lan");
 		for(i = 0;i< 6;i++){
 			value = RegRead(RALINK_ETH_SW_BASE + 0x2004 + (i * 0x100));
 			value |= (0x1 << 10);
Index: linux-3.10.20/net/nat/hw_nat/Kconfig
===================================================================
--- linux-3.10.20.orig/net/nat/hw_nat/Kconfig
+++ linux-3.10.20/net/nat/hw_nat/Kconfig
@@ -370,11 +370,10 @@ config  PPE_MCAST
 config  RA_HW_NAT_WIFI
 	bool "WiFi Acceleration"
 	depends on RA_HW_NAT 
-	select RA_HW_NAT_WIFI_NEW_ARCH if CHIP_MT7615E
 	
 config  RA_HW_NAT_WIFI_NEW_ARCH
-	bool "WiFi Acceleration New Architecture"
-	depends on RA_HW_NAT_WIFI && CHIP_MT7615E
+	bool "WiFi Acceleration New Architecture (7615 only)"
+	depends on RA_HW_NAT_WIFI
 	
 config  RA_HW_NAT_NIC_USB
 	bool "PCIe Ethernet NIC/USB Acceleration"
Index: linux-3.10.20/net/nat/hw_nat/Makefile
===================================================================
--- linux-3.10.20.orig/net/nat/hw_nat/Makefile
+++ linux-3.10.20/net/nat/hw_nat/Makefile
@@ -23,3 +23,6 @@ ifeq ($(CONFIG_RAETH_GMAC2),y)
 	EXTRA_CFLAGS += -DCONFIG_PSEUDO_SUPPORT
 endif
 
+# support wifi hwnat in openwrt
+EXTRA_CFLAGS += -DCONFIG_MBSS_SUPPORT -DCONFIG_RTDEV
+