summaryrefslogtreecommitdiff
path: root/package/ramips/drivers/mt7620
diff options
context:
space:
mode:
Diffstat (limited to 'package/ramips/drivers/mt7620')
-rwxr-xr-xpackage/ramips/drivers/mt7620/Makefile87
-rwxr-xr-xpackage/ramips/drivers/mt7620/config.in267
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/SingleSKU.dat62
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/mt7620.dat132
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/mt7620.eeprom.epa.elna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.elna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.ilna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7620/files/mt7620.sh51
-rw-r--r--package/ramips/drivers/mt7620/patches/001-fix-kernel-warning.patch211
-rw-r--r--package/ramips/drivers/mt7620/patches/002-fix-insmod-fail.patch18
-rw-r--r--package/ramips/drivers/mt7620/patches/003-support-hwnat.patch17
-rw-r--r--package/ramips/drivers/mt7620/patches/025-wpa-key-mismatch.patch62
12 files changed, 907 insertions, 0 deletions
diff --git a/package/ramips/drivers/mt7620/Makefile b/package/ramips/drivers/mt7620/Makefile
new file mode 100755
index 0000000..9fc7e8b
--- /dev/null
+++ b/package/ramips/drivers/mt7620/Makefile
@@ -0,0 +1,87 @@
+# All rights reserved.
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=mt7620
+P4REV:=120998
+PKG_VERSION:=p4rev-$(P4REV)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://localhost/
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_KCONFIG:=RALINK_MT7620 RALINK_RT5350 RALINK_3883 RALINK_RT3352 RT2860V2_AP RT2860V2_AP_V24_DATA_STRUCTURE \
+ RT2860V2_AP_WSC RT2860V2_AP_WSC_V2 RT2860V2_AP_LLTD RT2860V2_AP_WDS RT2860V2_AP_MBSS NEW_MBSSID_MODE \
+ RT2860V2_AP_APCLI RT2860V2_AP_MAC_REPEATER RT2860V2_AP_IGMP_SNOOP RT2860V2_AP_NETIF_BLOCK RT2860V2_AP_DFS \
+ RT2860V2_AP_CARRIER RT2860V2_AP_DLS RT2860V2_AP_IDS RT2860V2_HW_ANTENNA_DIVERSITY RT2860V2_AP_COC \
+ RT2860V2_AP_MEMORY_OPTIMIZATION RT2860V2_AP_VIDEO_TURBINE RA_CLASSIFIER RT2860V2_AP_INTELLIGENT_RATE_ADAPTION \
+ RT2860V2_AP_TXBF RT2860V2_AP_80211N_DRAFT3 RT2860V2_ADJ_PWR_CONSUMPTION_SUPPORT RT2860V2_SINGLE_SKU \
+ RT2860V2_AP_RTMP_INTERNAL_TX_ALC RT2860V2_AP_RTMP_TEMPERATURE_COMPENSATION RT2860V2_AP_LED \
+ INTERNAL_PA_INTERNAL_LNA INTERNAL_PA_EXTERNAL_LNA EXTERNAL_PA_EXTERNAL_LNA RT2860V2_EXT_CHANNEL_LIST \
+ RT2860V2_AP_EDCCA_MONITOR RT2860V2_WIFI_HW_NAT RT2860V2_TPSK_SUPPORT RT2860V2_VEDOR_IE_CONTROL_SUPPORT \
+ RT2860V2_VEDOR_IE_FILTER_SUPPORT RT2860V2_SNIFFER_STA_PROBE_SUPPORT RT2860V2_STA_INFO_SNIFFER_SUPPORT \
+ RT2860V2_DEV_MSG_EVENT_SEND_SUPPORT
+
+PKG_CONFIG_DEPENDS:=$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)))
+
+include $(INCLUDE_DIR)/package.mk
+
+TAR_CMD=$(HOST_TAR) -C $(1)/ $(TAR_OPTIONS)
+
+define KernelPackage/mt7620
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7620 wifi AP driver
+ FILES:=$(PKG_BUILD_DIR)/build/mt7620.ko
+ DEPENDS:=@TARGET_ramips_mt7620
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt7620/config
+ source "$(SOURCE)/config.in"
+endef
+
+define P4/Info
+ P4URL:=//Embedded_WIFI/MP/MT7620/WIFI_MT7620/
+endef
+
+define P4/Release
+ make release
+ mkdir -p build
+ cp rt2860v2_ap/Makefile build/Makefile
+ cp rt2860v2_ap/Kconfig build/Kconfig
+ mv ARCH src
+ tar cjf mt7620.tar.bz2 build src
+endef
+
+define Build/Compile
+ $(MAKE) -C "$(LINUX_DIR)" V=1 \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ ARCH="$(LINUX_KARCH)" \
+ SUBDIRS="$(PKG_BUILD_DIR)/build/" \
+ $(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)=y))\
+ modules
+endef
+
+define KernelPackage/mt7620/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7620.sh $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7620/
+ $(INSTALL_BIN) ./files/mt7620.dat $(1)/etc/wireless/mt7620/
+ $(INSTALL_BIN) ./files/SingleSKU.dat $(1)/etc/wireless/mt7620/
+ -if [ "$$(CONFIG_INTERNAL_PA_INTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7620.eeprom.ipa.ilna.bin $(1)/etc/wireless/mt7620/mt7620.eeprom.bin; \
+ elif [ "$$(CONFIG_INTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7620.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7620/mt7620.eeprom.bin; \
+ elif [ "$$(CONFIG_EXTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7620.eeprom.epa.elna.bin $(1)/etc/wireless/mt7620/mt7620.eeprom.bin; \
+ else \
+ $(INSTALL_BIN) ./files/mt7620.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7620/mt7620.eeprom.bin; \
+ fi
+ echo p$(P4REV) > $(1)/etc/wireless/mt7620/version
+endef
+
+$(eval $(call KernelPackage,mt7620))
diff --git a/package/ramips/drivers/mt7620/config.in b/package/ramips/drivers/mt7620/config.in
new file mode 100755
index 0000000..a30e6e5
--- /dev/null
+++ b/package/ramips/drivers/mt7620/config.in
@@ -0,0 +1,267 @@
+if PACKAGE_kmod-mt7620
+
+config FIRST_IF_RT2860
+ bool
+ default y
+ depends on PACKAGE_kmod-mt7620
+
+config RALINK_MT7620
+ bool
+ default y
+ depends on PACKAGE_kmod-mt7620
+
+config RT_FIRST_CARD
+ int
+ depends on PACKAGE_kmod-mt7620
+ default 2860
+
+config RT_FIRST_CARD_EEPROM
+ string
+ depends on FIRST_IF_RT2860
+ default "flash"
+
+config RT2860V2_AP
+ bool # "Ralink RT2860 802.11n AP support"
+ default y
+
+config RT2860V2_AP_V24_DATA_STRUCTURE
+ bool
+ depends on RT2860V2_AP
+ default y
+
+config RT2860V2_AP_LED
+ bool "LED Support"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_WSC
+ bool "WSC (WiFi Simple Config)"
+ depends on RT2860V2_AP
+ default y
+
+config RT2860V2_AP_WSC_V2
+ bool "WSC 2.0(WiFi Simple Config 2.0)"
+ depends on RT2860V2_AP_WSC
+ default y
+
+config RT2860V2_AP_LLTD
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_WDS
+ bool "WDS"
+ depends on RT2860V2_AP
+
+#config RT2860V2_AP_WMM_ACM
+# bool "WMM ACM"
+# depends on RT2860V2_AP
+
+config RT2860V2_AP_MBSS
+ bool "MBSSID"
+ depends on RT2860V2_AP
+ default y
+
+config NEW_MBSSID_MODE
+ bool "New MBSSID MODE"
+ depends on RT2860V2_AP
+ depends on RT2860V2_AP_MBSS
+ depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352 || RALINK_MT7620
+ default y
+
+config RT2860V2_AP_APCLI
+ bool "AP-CLient Support"
+ depends on RT2860V2_AP
+ default y
+
+config RT2860V2_AP_MAC_REPEATER
+ bool "MAC Repeater Support"
+ depends on RT2860V2_AP
+ depends on RT2860V2_AP_APCLI
+ depends on RALINK_RT6352 || RALINK_MT7620
+ default y
+
+config RT2860V2_AP_IGMP_SNOOP
+ bool "IGMP snooping"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_NETIF_BLOCK
+ bool "NETIF Block"
+ depends on RT2860V2_AP
+ help
+ Support Net interface block while Tx-Sw queue full
+
+config RT2860V2_AP_DFS
+ bool "DFS"
+ depends on RT2860V2_AP && BROKEN
+ select RALINK_TIMER_DFS
+
+config RT2860V2_AP_CARRIER
+ bool "Carrier Detect"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_DLS
+ bool "DLS ((Direct-Link Setup) Support"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_IDS
+ bool "IDS (Intrusion Detection System) Support"
+ depends on RT2860V2_AP
+
+config RT2860V2_HW_ANTENNA_DIVERSITY
+ bool "Antenna Diversity Support"
+ depends on RT2860V2_AP
+ depends on RALINK_RT5350
+
+#config RT2860V2_AP_WAPI
+# bool "WAPI Support"
+# depends on RT2860V2_AP
+
+config RT2860V2_AP_COC
+ bool "CoC Support"
+ depends on RT2860V2_AP
+ default y
+
+config RT2860V2_AP_MEMORY_OPTIMIZATION
+ bool "Memory Optimization"
+ depends on RT2860V2_AP
+
+config RT2860V2_AP_VIDEO_TURBINE
+ bool "Video Turbine support"
+ depends on RT2860V2_AP && BROKEN
+
+config RA_CLASSIFIER
+ tristate "Ralink Flow Classifier"
+ depends on RT2860V2_AP_VIDEO_TURBINE
+ default n
+
+config RT2860V2_AP_INTELLIGENT_RATE_ADAPTION
+ bool "Intelligent Rate Adaption"
+ depends on RT2860V2_AP
+ depends on RALINK_RT2883 || RALINK_RT3883
+
+config RT2860V2_AP_TXBF
+ bool "Tx Bean Forming Support (Only 3883)"
+ depends on RT2860V2_AP
+ depends on RALINK_RT2883 || RALINK_RT3883
+ default y
+
+#config RT2860V2_EXT_CHANNEL_LIST
+# bool "Extension Channel List"
+# depends on RT2860V2_AP
+
+#config RT2860V2_KTHREAD
+# bool "Kernel Thread"
+# depends on RT2860V2_AP
+
+#config RT2860V2_AUTO_CH_SELECT_ENHANCE
+# bool "Auto Channel Selection Enhancement"
+# depends on RT2860V2_AP
+
+config RT2860V2_AP_80211N_DRAFT3
+ bool "802.11n Draft3"
+ depends on RT2860V2_AP
+ default y
+
+#config RT2860V2_AP_RTMP_INTERNAL_TX_ALC
+# bool "TSSI Compensation"
+# depends on RT2860V2_AP
+# depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 || RALINK_MT7620 || RALINK_RT6352
+# default n
+
+config RT2860V2_ADJ_PWR_CONSUMPTION_SUPPORT
+ bool "Adjust Power Consumption Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_TPSK_SUPPORT
+ bool "TPSK Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_VEDOR_IE_CONTROL_SUPPORT
+ bool "Vedor IE Control Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_VEDOR_IE_FILTER_SUPPORT
+ bool "Vedor IE Filter Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_SNIFFER_STA_PROBE_SUPPORT
+ bool "Sniffer STA Probe Switch Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_STA_INFO_SNIFFER_SUPPORT
+ bool "Sniffer STA Info Sniffer Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+config RT2860V2_DEV_MSG_EVENT_SEND_SUPPORT
+ bool "Dev Msg Netlink Send Support"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+
+config RT2860V2_SINGLE_SKU
+ bool "Single SKU"
+ depends on RT2860V2_AP
+ default n
+
+if PACKAGE_kmod-hw_nat
+config RT2860V2_WIFI_HW_NAT
+ bool "HW NAT"
+ depends on RT2860V2_AP
+ default n
+endif
+
+choice
+ prompt "Choose Power Design"
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default INTERNAL_PA_EXTERNAL_LNA
+
+ config INTERNAL_PA_INTERNAL_LNA
+ bool "Internal PA and Internal LNA"
+ config INTERNAL_PA_EXTERNAL_LNA
+ bool "Internal PA and External LNA"
+ config EXTERNAL_PA_EXTERNAL_LNA
+ bool "External PA and External LNA"
+endchoice
+
+config RT2860V2_AP_RTMP_INTERNAL_TX_ALC
+ bool "TSSI Compensation"
+ depends on RT2860V2_AP
+ depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 || RALINK_MT7620 || RALINK_RT6352
+ depends on INTERNAL_PA_INTERNAL_LNA || INTERNAL_PA_EXTERNAL_LNA
+ default n
+
+config RT2860V2_AP_RTMP_TEMPERATURE_COMPENSATION
+ bool "Temperature Compensation"
+ depends on RT2860V2_AP
+ depends on RALINK_MT7620 || RALINK_RT6352
+ default n
+
+#config RT2860V2_80211R_FT
+# bool "802.11r Fast BSS Transition"
+# depends on RT2860V2_AP
+
+#config RT2860V2_80211R_RR
+# bool "802.11k Radio Resource Management"
+# depends on RT2860V2_AP
+
+#config RT2860V2_MCAST_RATE_SPECIFIC
+# bool "User specific tx rate of mcast pkt"
+# depends on RT2860V2_AP
+
+#config RT2860V2_SNMP
+# bool "Net-SNMP Support"
+# depends on RT2860V2_AP
+
+endif
diff --git a/package/ramips/drivers/mt7620/files/SingleSKU.dat b/package/ramips/drivers/mt7620/files/SingleSKU.dat
new file mode 100755
index 0000000..d356536
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/SingleSKU.dat
@@ -0,0 +1,62 @@
+# Single SKU Max Power Table
+# |CCK 1~11 | | OFDM 6 ~ 54 | | HT20 MCS 0 ~ 15 | | HT40 MCS 0 ~ 15 |
+ch1 16 16 16 16 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch2 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch3 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
+ch4 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch5 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch6 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch7 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch8 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch9 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
+ch10 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
+ch11 16 16 16 16 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch12
+ch13
+ch14
+
+# OFDM 6 ~ 54 | | HT20 MCS 0 ~ 15 | | HT40 MCS 0 ~ 15 | | VHT80 MCS 0 ~ 9 |
+ch36 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch38 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch40 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch42 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch44 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch46 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch48 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch52 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13
+ch54 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13
+ch56 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13
+ch58 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13
+ch60 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch62 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch64 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch100 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch102 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch104 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
+ch106 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13
+ch108 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13
+ch110 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13
+ch112 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13
+ch116 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch118 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch120 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch122 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch124 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch126 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch128 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch132 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 18 18 18 18 18 18 18 18 18 18
+ch134 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 18 18 18 18 18 18 18 18 18 18
+ch136 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 18 18 18 18 18 18 18 18 18 18
+ch140 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
+ch149 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch151 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch153 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch155 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch157 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch159 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch161 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch165 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch169 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+ch173 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 21 21 21 21 19 19 19 19 17 17
+
+
diff --git a/package/ramips/drivers/mt7620/files/mt7620.dat b/package/ramips/drivers/mt7620/files/mt7620.dat
new file mode 100755
index 0000000..7b002c4
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/mt7620.dat
@@ -0,0 +1,132 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=1
+CountryRegionABand=0
+CountryCode=
+BssidNum=1
+SSID1=OpenWrt-MT7620
+SSID2=
+SSID3=
+SSID4=
+WirelessMode=9
+TxRate=0
+Channel=6
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+DisableOLBC=0
+BGProtection=0
+MaxStaNum=0
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+PktAggregate=0
+TurboRate=0
+WmmCapable=1
+APSDCapable=1
+DLSCapable=0
+APAifsn=3;7;1;1
+APCwmin=4;4;3;2
+APCwmax=6;10;4;3
+APTxop=0;0;94;47
+APACM=0;0;0;0
+BSSAifsn=3;7;2;2
+BSSCwmin=4;4;3;2
+BSSCwmax=10;10;4;3
+BSSTxop=0;0;94;47
+BSSACM=0;0;0;0
+AckPolicy=0;0;0;0
+NoForwarding=0
+NoForwardingBTNBSSID=0
+HideSSID=0
+StationKeepAlive=0
+ShortSlot=1
+AutoChannelSelect=0
+IEEE8021X=0
+IEEE80211H=0
+CSPeriod=10
+WirelessEvent=0
+IdsEnable=0
+AuthFloodThreshold=32
+AssocReqFloodThreshold=32
+ReassocReqFloodThreshold=32
+ProbeReqFloodThreshold=32
+DisassocFloodThreshold=32
+DeauthFloodThreshold=32
+EapReqFooldThreshold=32
+PreAuth=0
+AuthMode=OPEN
+EncrypType=NONE
+RekeyInterval=0
+RekeyMethod=DISABLE
+PMKCachePeriod=10
+WPAPSK1=
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+DefaultKeyID=1
+Key1Type=1;1;1;1
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key2Type=1;1;1;1
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key3Type=1;1;1;1
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key4Type=1;1;1;1
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+HSCounter=0
+AccessPolicy0=0
+AccessControlList0=
+AccessPolicy1=0
+AccessControlList1=
+AccessPolicy2=0
+AccessControlList2=
+AccessPolicy3=0
+AccessControlList3=
+WdsEnable=0
+WdsEncrypType=NONE
+WdsList=EOF
+WdsKey=
+RADIUS_Server=192.168.2.3
+RADIUS_Port=1812
+RADIUS_Key=ralink
+own_ip_addr=192.168.5.234
+EAPifname=br-lan
+PreAuthifname=br-lan
+HT_HTC=0
+HT_RDG=0
+HT_EXTCHA=0
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_BW=1
+HT_AutoBA=1
+HT_AMSDU=0
+HT_BAWinSize=64
+HT_GI=1
+HT_MCS=33
+
+# WPS stuff
+# 1 = enrollee, 2 = proxy, 4 = registrar (bitmask)
+# This value is enabled later on, for WPA only
+WscConfMode=0
+# 1 = disabled, 2 = enabled
+WscConfStatus=2
+# 2 = PBC, 1 = PIN
+WscMode = 2
+
+HT_TxStream=2
+HT_RxStream=2
diff --git a/package/ramips/drivers/mt7620/files/mt7620.eeprom.epa.elna.bin b/package/ramips/drivers/mt7620/files/mt7620.eeprom.epa.elna.bin
new file mode 100755
index 0000000..a4d4bba
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/mt7620.eeprom.epa.elna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.elna.bin b/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.elna.bin
new file mode 100755
index 0000000..f73d94a
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.elna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.ilna.bin b/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.ilna.bin
new file mode 100755
index 0000000..3f16dc3
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/mt7620.eeprom.ipa.ilna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7620/files/mt7620.sh b/package/ramips/drivers/mt7620/files/mt7620.sh
new file mode 100755
index 0000000..995dd56
--- /dev/null
+++ b/package/ramips/drivers/mt7620/files/mt7620.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+append DRIVERS "mt7620"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7620() {
+ prepare_ralink_wifi mt7620
+}
+
+scan_mt7620() {
+ scan_ralink_wifi mt7620 mt7620
+}
+
+
+disable_mt7620() {
+ disable_ralink_wifi mt7620
+}
+
+enable_mt7620() {
+ enable_ralink_wifi mt7620 mt7620
+}
+
+detect_mt7620() {
+# detect_ralink_wifi mt7620 mt7620
+ ssid=mt7620-`ifconfig eth0 | grep HWaddr | cut -c 51- | sed 's/://g'`
+ cd /sys/module/
+ [ -d $module ] || return
+ [ -e /etc/config/wireless ] && return
+ cat <<EOF
+config wifi-device mt7620
+ option type mt7620
+ option vendor ralink
+ option band 2.4G
+ option channel 0
+ option auotch 2
+
+config wifi-iface
+ option device mt7620
+ option ifname ra0
+ option network lan
+ option mode ap
+ option ssid $ssid
+ option encryption psk2
+ option key 12345678
+
+EOF
+
+
+}
+
+
diff --git a/package/ramips/drivers/mt7620/patches/001-fix-kernel-warning.patch b/package/ramips/drivers/mt7620/patches/001-fix-kernel-warning.patch
new file mode 100644
index 0000000..bfa6536
--- /dev/null
+++ b/package/ramips/drivers/mt7620/patches/001-fix-kernel-warning.patch
@@ -0,0 +1,211 @@
+Index: mt7620-p4rev-113050/src/common/cmm_data_pci.c
+===================================================================
+--- mt7620-p4rev-113050.orig/src/common/cmm_data_pci.c
++++ mt7620-p4rev-113050/src/common/cmm_data_pci.c
+@@ -1164,6 +1164,14 @@ VOID RTMPHandlePreTBTTInterrupt(
+ {
+ APUpdateAllBeaconFrame(pAd);
+
++ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
++#ifdef WORKQUEUE_BH
++ RTMP_OS_TASKLET_SCHE(&pObj->pretbtt_work);
++#else
++ RTMP_OS_TASKLET_SCHE(&pObj->pretbtt_task);
++#endif
++
++#if 0
+ RTMP_IO_WRITE32(pAd, MCU_INT_STATUS, 0x14);
+ pAd->MacTab.fMcastPsQEnable = FALSE;
+
+@@ -1222,6 +1230,7 @@ VOID RTMPHandlePreTBTTInterrupt(
+ pAd->MacTab.fMcastPsQEnable = TRUE;
+ }
+ }
++#endif
+ }
+ else
+ #endif /* CONFIG_AP_SUPPORT */
+Index: mt7620-p4rev-113050/src/include/os/rt_drv.h
+===================================================================
+--- mt7620-p4rev-113050.orig/src/include/os/rt_drv.h
++++ mt7620-p4rev-113050/src/include/os/rt_drv.h
+@@ -337,6 +337,7 @@ struct os_cookie {
+ RTMP_NET_TASK_STRUCT hcca_dma_done_work;
+
+ RTMP_NET_TASK_STRUCT tbtt_work;
++ RTMP_NET_TASK_STRUCT pretbtt_work;
+
+ #else
+ RTMP_NET_TASK_STRUCT rx_done_task;
+@@ -350,6 +351,7 @@ struct os_cookie {
+ RTMP_NET_TASK_STRUCT ac3_dma_done_task;
+ RTMP_NET_TASK_STRUCT hcca_dma_done_task;
+ RTMP_NET_TASK_STRUCT tbtt_task;
++ RTMP_NET_TASK_STRUCT pretbtt_task;
+ #endif /* WORKQUEUE_BH */
+
+ #ifdef RTMP_MAC_PCI
+Index: mt7620-p4rev-113050/src/include/os/rt_linux.h
+===================================================================
+--- mt7620-p4rev-113050.orig/src/include/os/rt_linux.h
++++ mt7620-p4rev-113050/src/include/os/rt_linux.h
+@@ -664,6 +664,7 @@ struct os_cookie {
+ struct work_struct hcca_dma_done_work;
+
+ struct work_struct tbtt_work;
++ struct work_struct pretbtt_work;
+
+ #else
+ RTMP_NET_TASK_STRUCT rx_done_task;
+@@ -677,6 +678,7 @@ struct os_cookie {
+ RTMP_NET_TASK_STRUCT ac3_dma_done_task;
+ RTMP_NET_TASK_STRUCT hcca_dma_done_task;
+ RTMP_NET_TASK_STRUCT tbtt_task;
++ RTMP_NET_TASK_STRUCT pretbtt_task;
+ #endif /* WORKQUEUE_BH */
+
+ #ifdef RTMP_MAC_PCI
+Index: mt7620-p4rev-113050/src/include/rtmp.h
+===================================================================
+--- mt7620-p4rev-113050.orig/src/include/rtmp.h
++++ mt7620-p4rev-113050/src/include/rtmp.h
+@@ -9631,8 +9631,10 @@ VOID RtmpMgmtTaskExit(
+
+ #ifdef WORKQUEUE_BH
+ void tbtt_workq(struct work_struct *work);
++void pretbtt_workq(struct work_struct *work);
+ #else
+ void tbtt_tasklet(unsigned long data);
++void pretbtt_tasklet(unsigned long data);
+ #endif /* WORKQUEUE_BH */
+
+
+Index: mt7620-p4rev-113050/src/os/linux/rt_profile.c
+===================================================================
+--- mt7620-p4rev-113050.orig/src/os/linux/rt_profile.c
++++ mt7620-p4rev-113050/src/os/linux/rt_profile.c
+@@ -515,6 +515,96 @@ void tbtt_tasklet(unsigned long data)
+ #endif /* CONFIG_AP_SUPPORT */
+ }
+
++#ifdef WORKQUEUE_BH
++void pretbtt_workq(struct work_struct *work)
++#else
++void pretbtt_tasklet(unsigned long data)
++#endif /* WORKQUEUE_BH */
++{
++/*#define MAX_TX_IN_TBTT (16) */
++
++#ifdef CONFIG_AP_SUPPORT
++#ifdef WORKQUEUE_BH
++ POS_COOKIE pObj = container_of(work, struct os_cookie, pretbtt_work);
++ PRTMP_ADAPTER pAd = pObj->pAd_va;
++#else
++ PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
++#endif /* WORKQUEUE_BH */
++
++ RTMP_IO_WRITE32(pAd, MCU_INT_STATUS, 0x14);
++ pAd->MacTab.fMcastPsQEnable = FALSE;
++
++ if ((pAd->ApCfg.DtimCount == 0) &&
++ (pAd->MacTab.McastPsQueue.Head))
++ {
++ UINT32 macValue;
++ PQUEUE_ENTRY pEntry;
++ BOOLEAN bPS = FALSE;
++ UINT count = 0;
++ unsigned long IrqFlags;
++
++ RTMP_IO_READ32(pAd, PBF_CFG, &macValue);
++ macValue &= (~0x0C);
++ RTMP_IO_WRITE32(pAd, PBF_CFG, macValue);
++
++ RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
++
++ while (pAd->MacTab.McastPsQueue.Head)
++ {
++ bPS = TRUE;
++#if 0
++ if (pAd->TxSwQueue[QID_AC_BE].Number <= (MAX_PACKETS_IN_QUEUE + MAX_PACKETS_IN_MCAST_PS_QUEUE))
++#else
++ if (pAd->TxSwQueue[QID_HCCA].Number <= (MAX_PACKETS_IN_QUEUE + MAX_PACKETS_IN_MCAST_PS_QUEUE))
++#endif
++ {
++ pEntry = RemoveHeadQueue(&pAd->MacTab.McastPsQueue);
++
++ if (count)
++ {
++ RTMP_SET_PACKET_MOREDATA(pEntry, TRUE);
++ }
++#if 0
++ InsertHeadQueue(&pAd->TxSwQueue[QID_AC_BE], pEntry);
++#else
++ InsertHeadQueue(&pAd->TxSwQueue[QID_HCCA], pEntry);
++#endif
++ count++;
++ }
++ else
++ {
++ break;
++ }
++ }
++
++ RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
++
++ if (pAd->MacTab.McastPsQueue.Number == 0)
++ {
++ UINT bss_index;
++
++ /* clear MCAST/BCAST backlog bit for all BSS */
++ for(bss_index=BSS0; bss_index<pAd->ApCfg.BssidNum; bss_index++)
++ WLAN_MR_TIM_BCMC_CLEAR(bss_index);
++ /* End of for */
++ }
++ pAd->MacTab.PsQIdleCount = 0;
++
++ // Dequeue outgoing framea from TxSwQueue0..3 queue and process it
++ if (bPS == TRUE)
++ {
++ UINT32 macValue1, idx;
++#if 0
++ RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, /*MAX_TX_IN_TBTT*/MAX_PACKETS_IN_MCAST_PS_QUEUE);
++#else
++ RTMPDeQueuePacket(pAd, FALSE, QID_HCCA, /*MAX_TX_IN_TBTT*/MAX_PACKETS_IN_MCAST_PS_QUEUE);
++#endif
++ pAd->MacTab.fMcastPsQEnable = TRUE;
++ }
++ }
++#endif /* CONFIG_AP_SUPPORT */
++}
++
+
+ void announce_802_3_packet(
+ IN VOID *pAdSrc,
+Index: mt7620-p4rev-113050/src/os/linux/rt_rbus_pci_drv.c
+===================================================================
+--- mt7620-p4rev-113050.orig/src/os/linux/rt_rbus_pci_drv.c
++++ mt7620-p4rev-113050/src/os/linux/rt_rbus_pci_drv.c
+@@ -93,6 +93,7 @@ NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAP
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->ac3_dma_done_work, ac3_dma_done_workq);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->hcca_dma_done_work, hcca_dma_done_workq);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->tbtt_work, tbtt_workq);
++ RTMP_OS_TASKLET_INIT(pAd, &pObj->pretbtt_work, pretbtt_workq);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->fifo_statistic_full_work, fifo_statistic_full_workq);
+ #ifdef UAPSD_SUPPORT
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->uapsd_eosp_sent_work, uapsd_eosp_sent_workq);
+@@ -121,6 +122,7 @@ NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAP
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->ac3_dma_done_task, ac3_dma_done_tasklet, (unsigned long)pAd);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->hcca_dma_done_task, hcca_dma_done_tasklet, (unsigned long)pAd);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->tbtt_task, tbtt_tasklet, (unsigned long)pAd);
++ RTMP_OS_TASKLET_INIT(pAd, &pObj->pretbtt_task, pretbtt_tasklet, (unsigned long)pAd);
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->fifo_statistic_full_task, fifo_statistic_full_tasklet, (unsigned long)pAd);
+ #ifdef UAPSD_SUPPORT
+ RTMP_OS_TASKLET_INIT(pAd, &pObj->uapsd_eosp_sent_task, uapsd_eosp_sent_tasklet, (unsigned long)pAd);
+@@ -160,6 +162,7 @@ void RtmpNetTaskExit(IN RTMP_ADAPTER *pA
+ RTMP_OS_TASKLET_KILL(&pObj->ac3_dma_done_task);
+ RTMP_OS_TASKLET_KILL(&pObj->hcca_dma_done_task);
+ RTMP_OS_TASKLET_KILL(&pObj->tbtt_task);
++ RTMP_OS_TASKLET_KILL(&pObj->pretbtt_task);
+ RTMP_OS_TASKLET_KILL(&pObj->fifo_statistic_full_task);
+ #ifdef UAPSD_SUPPORT
+ RTMP_OS_TASKLET_KILL(&pObj->uapsd_eosp_sent_task);
diff --git a/package/ramips/drivers/mt7620/patches/002-fix-insmod-fail.patch b/package/ramips/drivers/mt7620/patches/002-fix-insmod-fail.patch
new file mode 100644
index 0000000..f846b0e
--- /dev/null
+++ b/package/ramips/drivers/mt7620/patches/002-fix-insmod-fail.patch
@@ -0,0 +1,18 @@
+Index: mt7620-p4rev-113050/src/os/linux/rt_rbus_pci_drv.c
+===================================================================
+--- mt7620-p4rev-113050.orig/src/os/linux/rt_rbus_pci_drv.c
++++ mt7620-p4rev-113050/src/os/linux/rt_rbus_pci_drv.c
+@@ -773,6 +773,13 @@ static void ac0_dma_done_tasklet(unsigne
+ }
+
+
++#ifdef RALINK_ATE
++static void ate_ac0_dma_done_tasklet(unsigned long data)
++{
++ return;
++}
++#endif /* RALINK_ATE */
++
+
+ #ifdef UAPSD_SUPPORT
+ /*
diff --git a/package/ramips/drivers/mt7620/patches/003-support-hwnat.patch b/package/ramips/drivers/mt7620/patches/003-support-hwnat.patch
new file mode 100644
index 0000000..96bd7d4
--- /dev/null
+++ b/package/ramips/drivers/mt7620/patches/003-support-hwnat.patch
@@ -0,0 +1,17 @@
+Index: mt7620-p4rev-113050/build/Makefile
+===================================================================
+--- mt7620-p4rev-113050.orig/build/Makefile
++++ mt7620-p4rev-113050/build/Makefile
+@@ -251,7 +251,12 @@ EXTRA_CFLAGS += -DAGGREGATION_SUPPORT -D
+ EXTRA_CFLAGS += -DCONFIG_AP_SUPPORT -DAP_SCAN_SUPPORT -DUAPSD_AP_SUPPORT -DUAPSD_SUPPORT -DRTMP_RBUS_SUPPORT -DRTMP_MAC_PCI
+ EXTRA_CFLAGS += -DDOT11_N_SUPPORT -DSTATS_COUNT_SUPPORT -DIAPP_SUPPORT -DDOT1X_SUPPORT
+ EXTRA_CFLAGS += -DRALINK_ATE -DRALINK_QA -DCONFIG_RT2880_ATE_CMD_NEW
++
++ifeq ($(CONFIG_RT2860V2_WIFI_HW_NAT),y)
++EXTRA_CFLAGS += -DCONFIG_WIFI_HW_NAT
++else
+ EXTRA_CFLAGS += -DCONFIG_RA_NAT_NONE
++endif
+
+ #provide busy time statistics for every TBTT */
+ #EXTRA_CFLAGS += -DQLOAD_FUNC_BUSY_TIME_STATS
diff --git a/package/ramips/drivers/mt7620/patches/025-wpa-key-mismatch.patch b/package/ramips/drivers/mt7620/patches/025-wpa-key-mismatch.patch
new file mode 100644
index 0000000..97bb426
--- /dev/null
+++ b/package/ramips/drivers/mt7620/patches/025-wpa-key-mismatch.patch
@@ -0,0 +1,62 @@
+Index: mt7620-p4rev-120998/src/ap/ap.c
+===================================================================
+--- mt7620-p4rev-120998.orig/src/ap/ap.c
++++ mt7620-p4rev-120998/src/ap/ap.c
+@@ -306,6 +306,17 @@ VOID APStartUp(
+ else
+ pMbss->WpaMixPairCipher = MIX_CIPHER_NOTUSE;
+
++ if (pMbss->WepStatus == Ndis802_11Encryption2Enabled ||
++ pMbss->WepStatus == Ndis802_11Encryption3Enabled ||
++ pMbss->WepStatus == Ndis802_11Encryption4Enabled)
++ {
++ RT_CfgSetWPAPSKKey(pAd, pMbss->WPAKeyString,
++ strlen(pMbss->WPAKeyString),
++ (PUCHAR)pAd->ApCfg.MBSSID[apidx].Ssid,
++ pAd->ApCfg.MBSSID[apidx].SsidLen,
++ pAd->ApCfg.MBSSID[apidx].PMK);
++ }
++
+ /* Generate the corresponding RSNIE */
+ RTMPMakeRSNIE(pAd, pMbss->AuthMode, pMbss->WepStatus, apidx);
+
+Index: mt7620-p4rev-120998/src/ap/ap_cfg.c
+===================================================================
+--- mt7620-p4rev-120998.orig/src/ap/ap_cfg.c
++++ mt7620-p4rev-120998/src/ap/ap_cfg.c
+@@ -7157,6 +7157,9 @@ INT Set_AP_WPAPSK_Proc(
+ if (retval == FALSE)
+ return FALSE;
+
++ /* Keep this key string */
++ strcpy(pAd->ApCfg.MBSSID[apidx].WPAKeyString, arg);
++
+ #ifdef WSC_AP_SUPPORT
+ NdisZeroMemory(pMBSSStruct->WscControl.WpaPsk, 64);
+ pMBSSStruct->WscControl.WpaPskLen = 0;
+Index: mt7620-p4rev-120998/src/common/cmm_profile.c
+===================================================================
+--- mt7620-p4rev-120998.orig/src/common/cmm_profile.c
++++ mt7620-p4rev-120998/src/common/cmm_profile.c
+@@ -1710,6 +1710,9 @@ static int rtmp_parse_wpapsk_buffer_from
+ if (ret == FALSE)
+ return FALSE;
+
++ /* Keep this key string */
++ strcpy(pAd->ApCfg.MBSSID[i].WPAKeyString, tmpbuf);
++
+ #ifdef WSC_AP_SUPPORT
+ NdisZeroMemory(pAd->ApCfg.MBSSID[i].WscControl.WpaPsk, 64);
+ pAd->ApCfg.MBSSID[i].WscControl.WpaPskLen = 0;
+Index: mt7620-p4rev-120998/src/include/rtmp.h
+===================================================================
+--- mt7620-p4rev-120998.orig/src/include/rtmp.h
++++ mt7620-p4rev-120998/src/include/rtmp.h
+@@ -1475,6 +1475,7 @@ typedef struct _MULTISSID_STRUCT {
+ UCHAR TimBitmaps[WLAN_MAX_NUM_OF_TIM];
+
+ /* WPA */
++ UCHAR WPAKeyString[65];
+ UCHAR GMK[32];
+ UCHAR PMK[32];
+ UCHAR GTK[32];