summaryrefslogtreecommitdiff
path: root/package/ramips/drivers/mt76x2e
diff options
context:
space:
mode:
Diffstat (limited to 'package/ramips/drivers/mt76x2e')
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/Makefile98
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/config.in376
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/files/SingleSKU.dat62
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/files/mt7602e.dat280
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/files/mt7602e.sh49
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/files/mt7612e.dat280
-rwxr-xr-xpackage/ramips/drivers/mt76x2e/files/mt7612e.sh49
-rw-r--r--package/ramips/drivers/mt76x2e/patches/001-build.patch30
-rw-r--r--package/ramips/drivers/mt76x2e/patches/002-peak_TP_downgrade.patch14
-rw-r--r--package/ramips/drivers/mt76x2e/patches/002-startup_exception_division_0.patch13
-rw-r--r--package/ramips/drivers/mt76x2e/patches/003-kickout_msg_fail.patch55
11 files changed, 1306 insertions, 0 deletions
diff --git a/package/ramips/drivers/mt76x2e/Makefile b/package/ramips/drivers/mt76x2e/Makefile
new file mode 100755
index 0000000..9283fe8
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/Makefile
@@ -0,0 +1,98 @@
+# 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:=mt76x2e
+P4REV:=130093
+PKG_VERSION:=3.0.4.0
+
+PKG_SOURCE:=MT76x2e_MT7620_LinuxAP_V3.0.4.0_DPA_20150617.tar.bz2
+PKG_SOURCE_URL:=http://localhost/
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_KCONFIG:= \
+ RALINK_MT7612E RALINK_MT7620 RLT_AP_SUPPORT WDS_SUPPORT MBSS_SUPPORT ENHANCE_NEW_MBSSID_MODE \
+ APCLI_SUPPORT APCLI_CERT_SUPPORT DFS_SUPPORT LLTD_SUPPORT NINTENDO_AP COC_SUPPORT \
+ DELAYED_TCP_ACK_SUPPORT RT_FIRST_CARD_EEPROM \
+ RT_FIRST_IF_RF_OFFSET RT_SECOND_IF_RF_OFFSET \
+ RT_FIRST_CARD RT_SECOND_CARD SNIFFER_SUPPORT CFG80211_SUPPORT \
+ RT_FIRST_CARD_EEPROM FIRST_IF_EEPROM_PROM FIRST_IF_EEPROM_EFUSE FIRST_IF_EEPROM_FLASH \
+ SECOND_IF_EEPROM_PROM SECOND_IF_EEPROM_EFUSE SECOND_IF_EEPROM_FLASH \
+ WIFI_BASIC_FUNC WSC_INCLUDED WSC_V2_SUPPORT WSC_NFC_SUPPORT DOT11N_DRAFT3 DOT11_VHT_AC \
+ DOT11W_PMF_SUPPORT TXBF_SUPPORT LLTD_SUPPORT QOS_DLS_SUPPORT \
+ CARRIER_DETECTION_SUPPORT IGMP_SNOOP_SUPPORT BLOCK_NET_IF \
+ TXBF_SUPPORT RATE_ADAPTION NEW_RATE_ADAPT_SUPPORT AGS_SUPPORT \
+ IDS_SUPPORT WIFI_WORK_QUEUE WIFI_SKB_RECYCLE RTMP_FLASH_SUPPORT \
+ LED_CONTROL_SUPPORT HW_ANTENNA_DIVERSITY ATE_SUPPORT \
+ RT2860V2_AP_V24_DATA_STRUCTURE RT2860V2_AP_32B_DESC MEMORY_OPTIMIZATION \
+ RTMP_INTERNAL_TX_ALC RTMP_TEMPERATURE_CALIBRATION HOTSPOT \
+ SINGLE_SKU_V2 RLT_MAC RLT_BBP RLT_RF RTMP_MAC RTMP_BBP RTMP_RF \
+ RTMP_PCI_SUPPORT RTMP_USB_SUPPORT RTMP_RBUS_SUPPORT DISABLE_EDCCA MULTI_CORE_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/mt76x2e
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT76x2e wifi AP driver
+ FILES:=$(PKG_BUILD_DIR)/rlt_wifi_ap/mt76x2e.ko
+ DEPENDS:=+kmod-cfg80211
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt76x2e/config
+ source "$(SOURCE)/config.in"
+endef
+
+define P4/Info
+ P4URL:=//Embedded_WIFI/MP/MT76x2/MT7612e/AP/rlt_wifi/
+endef
+
+define P4/Release
+ make release
+ mkdir -p build
+ cp os/linux/Makefile.rlt_wifi_ap build/Makefile
+ cp os/linux/Kconfig.rlt_wifi_ap build/Kconfig
+ mv DPA src
+ tar cjf mt76x2e.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)/rlt_wifi_ap/" \
+ $(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_MT76X2E_$c),CONFIG_$(c)=$(CONFIG_MT76X2E_$c)))\
+ modules
+endef
+
+define KernelPackage/mt76x2e/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ echo ------------------------------------------------------------------- $(CONFIG_RT_SECOND_CARD)
+ if [ "$$(CONFIG_MT76X2E_RT_FIRST_CARD)" = "7602" ] || [ "$$(CONFIG_MT76X2E_RT_FIRST_CARD)" = "7602e" ]; then \
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7602e/ ; \
+ $(INSTALL_BIN) ./files/mt7602e.sh $(1)/lib/wifi/ ; \
+ $(INSTALL_BIN) ./files/mt7602e.dat $(1)/etc/wireless/mt7602e/ ; \
+ $(INSTALL_BIN) ./files/mt7602e*.bin $(1)/etc/wireless/mt7602e/ ; \
+ $(INSTALL_BIN) ./files/SingleSKU.dat $(1)/etc/wireless/mt7602/SingleSKU.dat ; \
+ echo p$(P4REV) > $(1)/etc/wireless/mt7602e/version; \
+ fi
+ if [ "$$(CONFIG_MT76X2E_RT_SECOND_CARD)" = "7612" ] || [ "$$(CONFIG_MT76X2E_RT_SECOND_CARD)" = "7612e" ]; then \
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7612e/ ; \
+ $(INSTALL_BIN) ./files/mt7612e.sh $(1)/lib/wifi/ ; \
+ $(INSTALL_BIN) ./files/mt7612e.dat $(1)/etc/wireless/mt7612e/ ; \
+ $(INSTALL_BIN) ./files/mt7612e*.bin $(1)/etc/wireless/mt7612e/ ; \
+ $(INSTALL_BIN) ./files/SingleSKU.dat $(1)/etc/wireless/mt7612/SingleSKU.dat ; \
+ echo p$(P4REV) > $(1)/etc/wireless/mt7612e/version; \
+ fi
+endef
+
+$(eval $(call KernelPackage,mt76x2e))
diff --git a/package/ramips/drivers/mt76x2e/config.in b/package/ramips/drivers/mt76x2e/config.in
new file mode 100755
index 0000000..35f56da
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/config.in
@@ -0,0 +1,376 @@
+if PACKAGE_kmod-mt76x2e
+
+config MT76X2E_RT_FIRST_CARD
+ int
+ default 7602
+ depends on ! PACKAGE_kmod-mt7620
+ depends on ! PACKAGE_kmod-mt7628
+ depends on ! PACKAGE_kmod-mt7603e
+
+config MT76X2E_RT_SECOND_CARD
+ int
+ default 7612
+ depends on PACKAGE_kmod-mt76x2e
+
+config MT76X2E_WIFI_MODE_AP
+ bool
+ default y
+
+config MT76X2E_RT_FIRST_IF_RF_OFFSET
+ int
+ default 262144
+
+config MT76X2E_RT_SECOND_IF_RF_OFFSET
+ int
+ default 294912
+
+config MT76X2E_RALINK_MT7612E
+ bool
+ default y
+
+menu "AP Features"
+ depends on MT76X2E_WIFI_MODE_AP
+
+config MT76X2E_RLT_AP_SUPPORT
+ tristate "Ralink RT2860 802.11n AP support"
+ # depends on NET_RADIO
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ default y
+
+config MT76X2E_WDS_SUPPORT
+ bool "WDS"
+ depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_SNIFFER_SUPPORT
+ bool "Sniffer Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default n
+
+config MT76X2E_CFG80211_SUPPORT
+ bool "CFG80211 Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default n
+
+config MT76X2E_MBSS_SUPPORT
+ bool "MBSSID"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default y
+
+config MT76X2E_NEW_MBSSID_MODE
+ bool "New MBSSID MODE"
+ depends on MT76X2E_RLT_AP_SUPPORT && MT76X2E_MBSS_SUPPORT
+ depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352 || RALINK_MT7620
+ default y
+
+config MT76X2E_ENHANCE_NEW_MBSSID_MODE
+ bool "Enhanced MBSSID mode"
+ depends on MT76X2E_WNEW_MBSSID_MODE
+ default y
+
+config MT76X2E_APCLI_SUPPORT
+ bool "AP-Client Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default y
+
+config MT_76X2E_APCLI_CERT_SUPPORT
+ bool "AP-Client TGn Cert Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ depends on MT76X2E_APCLI_SUPPORT
+ default n
+
+config MT76X2E_MAC_REPEATER_SUPPORT
+ bool "MAC Repeater Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ depends on MT76X2E_APCLI_SUPPORT
+ depends on RALINK_RT6352 || RALINK_MT7620 || RALINK_MT7603E || MT76X2E_RLT_AP_SUPPORT
+ default y
+
+#config MT76X2E_MESH_SUPPORT
+# bool "MESH Support"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_DFS_SUPPORT
+ bool "DFS"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ select RALINK_TIMER_DFS
+
+#config MT76X2E_DOT11R_FT_SUPPORT
+# bool "802.11r Fast BSS Transition"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+#config MT76X2E_DOT11K_RRM_SUPPORT
+# bool "802.11k Radio Resource Management"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_NINTENDO_AP
+ bool "Nintendo AP"
+ depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_COC_SUPPORT
+ bool "CoC Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default n
+
+config MT76X2E_DELAYED_TCP_ACK_SUPPORT
+ bool "Delayed TCP ACK Support"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default n
+
+#config MT76X2E_ RT2860V2_SNMP
+# bool "Net-SNMP Support"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+#config MT76X2E_MCAST_RATE_SPECIFIC
+# bool "User specific tx rate of mcast pkt"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+#config MT76X2E_EXT_BUILD_CHANNEL_LIST
+# bool "Extension Channel List"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+#config MT76X2E_AUTO_CH_SELECT_ENHANCE
+# bool "Auto Channel Selection Enhancement"
+# depends on MT76X2E_RLT_AP_SUPPORT
+
+config MT76X2E_DISABLE_EDCCA
+ bool "Disable EDCCA"
+ depends on MT76X2E_RLT_AP_SUPPORT
+ default n
+
+config MT76X2E_MULTI_CORE_SUPPORT
+ bool "multi core support"
+ depends on TARGET_ramips_mt7621
+ default y
+endmenu
+
+menu "WiFi Features"
+
+config MT76X2E_FIRST_IF_EEPROM_FLASH
+ bool
+ default y
+
+config MT76X2E_SECOND_IF_EEPROM_FLASH
+ bool
+ default y
+
+config MT76X2E_RT_FIRST_CARD_EEPROM
+ string
+ default "flash"
+
+config MT76X2E_RT_SECOND_CARD_EEPROM
+ string
+ default "flash"
+
+config MT76X2E_MULTI_INF_SUPPORT
+ bool
+ #default y if !MT76X2E_WFIRST_IF_NONE && !MT76X2E_WSECOND_IF_NONE
+
+config MT76X2E_WIFI_BASIC_FUNC
+ bool "Basic Functions"
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ default y
+
+config MT76X2E_WSC_INCLUDED
+ bool "WSC (WiFi Simple Config)"
+ default y
+
+config MT76X2E_WSC_V2_SUPPORT
+ bool "WSC V2(WiFi Simple Config Version 2.0)"
+ default y
+ depends on MT76X2E_WSC_INCLUDED
+
+config MT76X2E_WSC_NFC_SUPPORT
+ bool "WSC by NFC"
+ default n
+ depends on MT76X2E_WSC_INCLUDED
+
+config MT76X2E_DOT11N_DRAFT3
+ bool "802.11n Draft3"
+ default y
+
+config MT76X2E_DOT11_VHT_AC
+ bool "802.11 ac"
+ default y
+
+config MT76X2E_DOT11W_PMF_SUPPORT
+ bool "PMF"
+ default n
+
+config MT76X2E_TXBF_SUPPORT
+ bool "Tx Bean Forming Support"
+ default n
+
+#config MT76X2E_WMM_ACM_SUPPORT
+# bool "WMM ACM"
+# default n
+
+config MT76X2E_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ default y
+
+config MT76X2E_QOS_DLS_SUPPORT
+ bool "802.11e DLS ((Direct-Link Setup) Support"
+ default n
+
+#config MT76X2E_WAPI_SUPPORT
+# bool "WAPI Support"
+# default n
+
+config MT76X2E_CARRIER_DETECTION_SUPPORT
+ bool "Carrier Detect"
+ default n
+
+config MT76X2E_IGMP_SNOOP_SUPPORT
+ bool "IGMP snooping"
+ default n
+
+config MT76X2E_BLOCK_NET_IF
+ bool "NETIF Block"
+ default n
+ help
+ Support Net interface block while Tx-Sw queue full
+
+config MT76X2E_TXBF_SUPPORT
+ bool "Tx Bean Forming Support (Only 3883)"
+ depends on RALINK_RT2883 || RALINK_RT3883
+ default n
+
+#config MT76X2E_VIDEO_TURBINE_SUPPORT
+# bool "Video Turbine support"
+# default n
+
+#config MT76X2E_RA_CLASSIFIER
+# tristate "Ralink Flow Classifier"
+# default n
+
+config MT76X2E_RATE_ADAPTION
+ bool "New Rate Adaptation support"
+ default y
+
+config MT76X2E_NEW_RATE_ADAPT_SUPPORT
+ bool "Intelligent Rate Adaption"
+ default y
+
+config MT76X2E_AGS_SUPPORT
+ bool "Adaptive Group Switching"
+ default n
+
+config MT76X2E_IDS_SUPPORT
+ bool "IDS (Intrusion Detection System) Support"
+ default n
+
+config MT76X2E_WIFI_WORK_QUEUE
+ bool "Work Queue"
+ default n
+
+config MT76X2E_WIFI_SKB_RECYCLE
+ bool "SKB Recycle(Linux)"
+ default y
+
+config MT76X2E_RTMP_FLASH_SUPPORT
+ bool "Flash Support"
+ default y
+
+config MT76X2E_LED_CONTROL_SUPPORT
+ bool "LED Support"
+ default y
+
+#config MT76X2E_SINGLE_SKU
+# bool "Single SKU"
+# default n
+
+#config MT76X2E_SINGLE_SKU_V2
+# bool "Single SKU V2"
+# depends on MT76X2E_WSINGLE_SKU && RALINK_RT6352
+# default n
+
+config MT76X2E_HW_ANTENNA_DIVERSITY
+ bool "Antenna Diversity Support"
+ depends on MT76X2E_RLT_AP_SUPPORT || MT76X2E_WRLT_STA_SUPPORT
+ depends on RALINK_RT5350
+ default n
+
+config MT76X2E_ATE_SUPPORT
+ bool "ATE/QA Support"
+ default y
+
+config MT76X2E_RT2860V2_AP_V24_DATA_STRUCTURE
+ bool
+ default y
+
+config MT76X2E_RT2860V2_AP_32B_DESC
+ bool "32 Byte Descriptor Support"
+ depends on RALINK_RT6352 || RALINK_MT7620
+ default n
+
+config MT76X2E_MEMORY_OPTIMIZATION
+ bool "Memory Optimization"
+ default n
+
+config MT76X2E_RTMP_INTERNAL_TX_ALC
+ bool "TSSI Compensation"
+ depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352
+ default n
+
+config MT76X2E_RTMP_TEMPERATURE_CALIBRATION
+ bool "Temperature Calibration"
+ depends on RALINK_RT6352
+ default n
+
+config MT76X2E_HOTSPOT
+ bool "Passpoint-R1"
+ default n
+
+config MT76X2E_SINGLE_SKU_V2
+ bool "Single SKU V2"
+ default n
+
+#
+# Section for chip architectures
+#
+# "RLT MAC Support"
+config MT76X2E_RLT_MAC
+ bool
+ default y
+
+config MT76X2E_RLT_BBP
+ bool
+
+config MT76X2E_RLT_RF
+ bool
+
+# "RTMP MAC Support"
+#config MT76X2E_RTMP_MAC
+# bool
+# default y
+#
+#config MT76X2E_RTMP_BBP
+# bool
+#
+#config MT76X2E_RTMP_RF
+# bool
+
+#
+# Section for interfaces
+#
+config MT76X2E_RTMP_PCI_SUPPORT
+ bool
+
+config MT76X2E_RTMP_USB_SUPPORT
+ bool
+
+config MT76X2E_RTMP_RBUS_SUPPORT
+ bool
+
+endmenu
+
+endif
+
diff --git a/package/ramips/drivers/mt76x2e/files/SingleSKU.dat b/package/ramips/drivers/mt76x2e/files/SingleSKU.dat
new file mode 100755
index 0000000..d356536
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/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/mt76x2e/files/mt7602e.dat b/package/ramips/drivers/mt76x2e/files/mt7602e.dat
new file mode 100755
index 0000000..d67cb20
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/files/mt7602e.dat
@@ -0,0 +1,280 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=1
+CountryRegionABand=7
+CountryCode=
+BssidNum=1
+SSID1=OpenWrt-MT7602e
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+WirelessMode=9
+FixedTxMode=HT
+TxRate=0
+Channel=6
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=0
+PktAggregate=1
+AutoProvisionEn=0
+FreqDelta=0
+TurboRate=0
+WmmCapable=1
+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
+APSDCapable=0
+DLSCapable=0
+NoForwarding=0
+NoForwardingBTNBSSID=0
+HideSSID=0
+ShortSlot=1
+AutoChannelSelect=0
+IEEE8021X=0
+IEEE80211H=0
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsLowerLimit=0
+DfsUpperLimit=0
+DfsOutdoor=0
+SymRoundFromCfg=0
+BusyIdleFromCfg=0
+DfsRssiHighFromCfg=0
+DfsRssiLowFromCfg=0
+DFSParamFromConfig=0
+FCCParamCh0=
+FCCParamCh1=
+FCCParamCh2=
+FCCParamCh3=
+CEParamCh0=
+CEParamCh1=
+CEParamCh2=
+CEParamCh3=
+JAPParamCh0=
+JAPParamCh1=
+JAPParamCh2=
+JAPParamCh3=
+JAPW53ParamCh0=
+JAPW53ParamCh1=
+JAPW53ParamCh2=
+JAPW53ParamCh3=
+FixDfsLimit=0
+LongPulseRadarTh=0
+AvgRssiReq=0
+DFS_R66=0
+BlockCh=
+GreenAP=0
+PreAuth=0
+AuthMode=OPEN
+EncrypType=NONE
+WapiPsk1=
+WapiPsk2=
+WapiPsk3=
+WapiPsk4=
+WapiPsk5=
+WapiPsk6=
+WapiPsk7=
+WapiPsk8=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK1=12345678
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+DefaultKeyID=1
+Key1Type=1;1;1;1;1;1;1;1
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key2Type=1;1;1;1;1;1;1;1
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key3Type=1;1;1;1;1;1;1;1
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key4Type=1;1;1;1;1;1;1;1
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+HSCounter=1;1;1;1;1;1;1;1
+HT_HTC=1
+HT_RDG=0
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=0
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=0
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=0
+HT_BSSCoexistence=0
+HT_LDPC=1
+GreenAP=0
+VHT_BW=0
+VHT_STBC=0
+VHT_SGI=0
+VHT_BW_SIGNAL=0
+VHT_LDPC=0
+WscConfMode=0
+WscConfStatus=2
+WCNTest=0
+AccessPolicy0=0
+AccessControlList0=
+AccessPolicy1=0
+AccessControlList1=
+AccessPolicy2=0
+AccessControlList2=
+AccessPolicy3=0
+AccessControlList3=
+AccessPolicy4=0
+AccessControlList4=
+AccessPolicy5=0
+AccessControlList5=
+AccessPolicy6=0
+AccessControlList6=
+AccessPolicy7=0
+AccessControlList7=
+WdsEnable=0
+WdsPhyMode=
+WdsEncrypType=NONE
+WdsList=
+Wds0Key=
+Wds1Key=
+Wds2Key=
+Wds3Key=
+RADIUS_Server=0
+RADIUS_Port=1812
+RADIUS_Key1=
+RADIUS_Key2=
+RADIUS_Key3=
+RADIUS_Key4=
+RADIUS_Key5=
+RADIUS_Key6=
+RADIUS_Key7=
+RADIUS_Key8=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=
+Ethifname=
+EAPifname=
+PreAuthifname=
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=0
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=0
+ApCliKey1Type=0
+ApCliKey1Str=
+ApCliKey2Type=0
+ApCliKey2Str=
+ApCliKey3Type=0
+ApCliKey3Str=
+ApCliKey4Type=0
+ApCliKey4Str=
+EfuseBufferMode=0
+E2pAccessMode=2
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+SSID=
+WPAPSK=
+Key1Str=
+Key2Str=
+Key3Str=
+Key4Str=
diff --git a/package/ramips/drivers/mt76x2e/files/mt7602e.sh b/package/ramips/drivers/mt76x2e/files/mt7602e.sh
new file mode 100755
index 0000000..e3eb4a9
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/files/mt7602e.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+append DRIVERS "mt7602e"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7602e() {
+ prepare_ralink_wifi mt7602e
+}
+
+scan_mt7602e() {
+ scan_ralink_wifi mt7602e mt76x2e
+}
+
+disable_mt7602e() {
+ disable_ralink_wifi mt7602e
+}
+
+enable_mt7602e() {
+ enable_ralink_wifi mt7602e mt76x2e
+}
+
+detect_mt7602e() {
+# detect_ralink_wifi mt7602e mt76x2e
+ ssid=mt7602e #-`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 mt7602e
+ option type mt7602e
+ option vendor ralink
+ option band 2.4G
+ option channel 0
+ option autoch 2
+
+config wifi-iface
+ option device mt7602e
+ 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/mt76x2e/files/mt7612e.dat b/package/ramips/drivers/mt76x2e/files/mt7612e.dat
new file mode 100755
index 0000000..2863e46
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/files/mt7612e.dat
@@ -0,0 +1,280 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=1
+CountryRegionABand=7
+CountryCode=
+BssidNum=1
+SSID1=OpenWrt-MT7612e
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+WirelessMode=14
+FixedTxMode=0
+TxRate=0
+Channel=44
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=1
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=0
+PktAggregate=1
+AutoProvisionEn=0
+FreqDelta=0
+TurboRate=0
+WmmCapable=1
+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
+APSDCapable=0
+DLSCapable=0
+NoForwarding=0
+NoForwardingBTNBSSID=0
+HideSSID=0
+ShortSlot=1
+AutoChannelSelect=0
+IEEE8021X=0
+IEEE80211H=0
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=1
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsLowerLimit=0
+DfsUpperLimit=0
+DfsOutdoor=0
+SymRoundFromCfg=0
+BusyIdleFromCfg=0
+DfsRssiHighFromCfg=0
+DfsRssiLowFromCfg=0
+DFSParamFromConfig=0
+FCCParamCh0=
+FCCParamCh1=
+FCCParamCh2=
+FCCParamCh3=
+CEParamCh0=
+CEParamCh1=
+CEParamCh2=
+CEParamCh3=
+JAPParamCh0=
+JAPParamCh1=
+JAPParamCh2=
+JAPParamCh3=
+JAPW53ParamCh0=
+JAPW53ParamCh1=
+JAPW53ParamCh2=
+JAPW53ParamCh3=
+FixDfsLimit=0
+LongPulseRadarTh=0
+AvgRssiReq=0
+DFS_R66=0
+BlockCh=
+GreenAP=0
+PreAuth=0
+AuthMode=OPEN
+EncrypType=NONE
+WapiPsk1=
+WapiPsk2=
+WapiPsk3=
+WapiPsk4=
+WapiPsk5=
+WapiPsk6=
+WapiPsk7=
+WapiPsk8=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK1=12345678
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+DefaultKeyID=1
+Key1Type=1;1;1;1;1;1;1;1
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key2Type=1;1;1;1;1;1;1;1
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key3Type=1;1;1;1;1;1;1;1
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key4Type=1;1;1;1;1;1;1;1
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+HSCounter=0
+HT_HTC=1
+HT_RDG=0
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=0
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=0
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=0
+HT_BSSCoexistence=0
+HT_LDPC=1
+GreenAP=0
+VHT_BW=1
+VHT_STBC=0
+VHT_SGI=1
+VHT_BW_SIGNAL=0
+VHT_LDPC=1
+WscConfMode=0
+WscConfStatus=2
+WCNTest=0
+AccessPolicy0=0
+AccessControlList0=
+AccessPolicy1=0
+AccessControlList1=
+AccessPolicy2=0
+AccessControlList2=
+AccessPolicy3=0
+AccessControlList3=
+AccessPolicy4=0
+AccessControlList4=
+AccessPolicy5=0
+AccessControlList5=
+AccessPolicy6=0
+AccessControlList6=
+AccessPolicy7=0
+AccessControlList7=
+WdsEnable=0
+WdsPhyMode=
+WdsEncrypType=NONE
+WdsList=
+Wds0Key=
+Wds1Key=
+Wds2Key=
+Wds3Key=
+RADIUS_Server=0
+RADIUS_Port=1812
+RADIUS_Key1=
+RADIUS_Key2=
+RADIUS_Key3=
+RADIUS_Key4=
+RADIUS_Key5=
+RADIUS_Key6=
+RADIUS_Key7=
+RADIUS_Key8=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=
+Ethifname=
+EAPifname=br-lan
+PreAuthifname=br-lan
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=0
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=0
+ApCliKey1Type=0
+ApCliKey1Str=
+ApCliKey2Type=0
+ApCliKey2Str=
+ApCliKey3Type=0
+ApCliKey3Str=
+ApCliKey4Type=0
+ApCliKey4Str=
+EfuseBufferMode=0
+E2pAccessMode=2
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+SSID=
+WPAPSK=
+Key1Str=
+Key2Str=
+Key3Str=
+Key4Str=
diff --git a/package/ramips/drivers/mt76x2e/files/mt7612e.sh b/package/ramips/drivers/mt76x2e/files/mt7612e.sh
new file mode 100755
index 0000000..908d980
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/files/mt7612e.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+append DRIVERS "mt7612e"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7612e() {
+ prepare_ralink_wifi mt7612e
+}
+
+scan_mt7612e() {
+ scan_ralink_wifi mt7612e mt76x2e
+}
+
+disable_mt7612e() {
+ disable_ralink_wifi mt7612e
+}
+
+enable_mt7612e() {
+ enable_ralink_wifi mt7612e mt76x2e
+}
+
+detect_mt7612e() {
+# detect_ralink_wifi mt7612e mt76x2e
+ ssid=mt7612e #-`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 mt7612e
+ option type mt7612e
+ option vendor ralink
+ option band 5G
+ option channel 0
+ option autoch 2
+
+config wifi-iface
+ option device mt7612e
+ option ifname rai0
+ option network lan
+ option mode ap
+ option ssid $ssid
+ option encryption psk2
+ option key 12345678
+
+EOF
+
+}
+
+
diff --git a/package/ramips/drivers/mt76x2e/patches/001-build.patch b/package/ramips/drivers/mt76x2e/patches/001-build.patch
new file mode 100644
index 0000000..fa47d55
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/patches/001-build.patch
@@ -0,0 +1,30 @@
+Index: mt76x2e-3.0.4.0/rlt_wifi_ap/Makefile
+===================================================================
+--- mt76x2e-3.0.4.0.orig/rlt_wifi_ap/Makefile
++++ mt76x2e-3.0.4.0/rlt_wifi_ap/Makefile
+@@ -1,12 +1,6 @@
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+-EXTRA_CFLAGS = -I$(src)/../src/include -I$(src)/../src/ate/include
++EXTRA_CFLAGS = -I$(src)/../rlt_wifi/include -I$(src)/../rlt_wifi/ate/include
+ DRV_NAME = mt76x2e
+-RT_WIFI_DIR = ../src
+-else
+-EXTRA_CFLAGS = -Idrivers/net/wireless/rlt_wifi/include -Idrivers/net/wireless/rlt_wifi/ate/include
+-DRV_NAME = rlt_wifi
+ RT_WIFI_DIR = ../rlt_wifi
+-endif
+
+ ########################################################
+ # Common files
+@@ -649,11 +643,7 @@ endif
+ #
+ # Root
+ #
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+ obj-m += $(DRV_NAME).o
+-else
+-obj-$(CONFIG_RLT_AP_SUPPORT) += $(DRV_NAME).o
+-endif
+
+ $(DRV_NAME)-objs += $(cmm_objs) $(asic_objs) $(chip_objs) $(rate_objs)\
+ $(spec_objs) $(func_objs) $(ap_objs) $(os_objs)
diff --git a/package/ramips/drivers/mt76x2e/patches/002-peak_TP_downgrade.patch b/package/ramips/drivers/mt76x2e/patches/002-peak_TP_downgrade.patch
new file mode 100644
index 0000000..6d2ad8d
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/patches/002-peak_TP_downgrade.patch
@@ -0,0 +1,14 @@
+Index: mt76x2e-3.0.4.0/rlt_wifi/common/cmm_data.c
+===================================================================
+--- mt76x2e-3.0.4.0.orig/rlt_wifi/common/cmm_data.c
++++ mt76x2e-3.0.4.0/rlt_wifi/common/cmm_data.c
+@@ -1997,8 +1997,7 @@ VOID RTMPDeQueuePacket(
+ #endif /* DBG_TX_RING_DEPTH */
+ #endif /* DBG_DIAGNOSE */
+
+- if (FreeNumber[QueIdx] <= 5 ||
+- (pAd->RalinkCounters.OneSecTxRetryOkCount + pAd->RalinkCounters.OneSecTxNoRetryOkCount) <= (TX_RING_SIZE >> 1))
++ if (FreeNumber[QueIdx] <= 5 )
+ {
+ /* free Tx(QueIdx) resources*/
+ RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
diff --git a/package/ramips/drivers/mt76x2e/patches/002-startup_exception_division_0.patch b/package/ramips/drivers/mt76x2e/patches/002-startup_exception_division_0.patch
new file mode 100644
index 0000000..58f8171
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/patches/002-startup_exception_division_0.patch
@@ -0,0 +1,13 @@
+Index: mt76x2e-3.0.4.0/rlt_wifi/common/cmm_info.c
+===================================================================
+--- mt76x2e-3.0.4.0.orig/rlt_wifi/common/cmm_info.c
++++ mt76x2e-3.0.4.0/rlt_wifi/common/cmm_info.c
+@@ -2131,7 +2131,7 @@ VOID RTMPSetPhyMode(RTMP_ADAPTER *pAd, U
+ {
+ #ifdef CONFIG_AP_SUPPORT
+ IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
+- if (pAd->CommonCfg.Channel != 0)
++ //if (pAd->CommonCfg.Channel != 0)
+ pAd->CommonCfg.Channel = FirstChannel(pAd);
+ #endif /* CONFIG_AP_SUPPORT */
+ #ifdef CONFIG_STA_SUPPORT
diff --git a/package/ramips/drivers/mt76x2e/patches/003-kickout_msg_fail.patch b/package/ramips/drivers/mt76x2e/patches/003-kickout_msg_fail.patch
new file mode 100644
index 0000000..5130c3a
--- /dev/null
+++ b/package/ramips/drivers/mt76x2e/patches/003-kickout_msg_fail.patch
@@ -0,0 +1,55 @@
+Index: mt76x2e-3.0.4.0/rlt_wifi/ap/ap.c
+===================================================================
+--- mt76x2e-3.0.4.0.orig/rlt_wifi/ap/ap.c
++++ mt76x2e-3.0.4.0/rlt_wifi/ap/ap.c
+@@ -707,7 +707,8 @@ DBGPRINT(RT_DEBUG_OFF, ("%s(): AP Set Ce
+
+ #ifdef RTMP_MAC_PCI
+ //enable IRQ after init ready
+- RTMP_IRQ_ENABLE(pAd);
++ //RTMP_IRQ_ENABLE(pAd);
++ RTMP_MAC_RX_ENABLE(pAd);
+ #endif /*RTMP_MAC_PCI*/
+
+ #ifdef WAPI_SUPPORT
+@@ -817,7 +818,8 @@ VOID APStop(
+
+ #ifdef RTMP_MAC_PCI
+ //disable IRQ before init ready
+- RTMP_ASIC_INTERRUPT_DISABLE(pAd);
++ //RTMP_ASIC_INTERRUPT_DISABLE(pAd);
++ RTMP_MAC_RX_DISABLE(pAd);
+ #endif /*RTMP_MAC_PCI*/
+ MacTableReset(pAd);
+
+Index: mt76x2e-3.0.4.0/rlt_wifi/include/mac_ral/mac_pci.h
+===================================================================
+--- mt76x2e-3.0.4.0.orig/rlt_wifi/include/mac_ral/mac_pci.h
++++ mt76x2e-3.0.4.0/rlt_wifi/include/mac_ral/mac_pci.h
+@@ -319,6 +319,26 @@ typedef enum _RTMP_TX_DONE_MASK{
+ } while(0)
+
+
++ /* Disable MAC RX */
++#define RTMP_MAC_RX_DISABLE(pAd) \
++ do{ \
++ UINT32 value; \
++ RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &value); \
++ value &= ~(1<<3); \
++ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, value); \
++ } while(0)
++
++
++ /* Enable MAC RX */
++#define RTMP_MAC_RX_ENABLE(pAd) \
++ do{ \
++ UINT32 value; \
++ RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &value); \
++ value |= (1<<3); \
++ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, value); \
++ } while(0)
++
++
+
+ /* ----------------- MLME Related MACRO ----------------- */
+ // TODO: shiang-usw, need to verify this to make sure that's solid enough!