summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-09-16 19:55:45 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-09-16 19:55:45 +0200
commitc0ce88c586a467665b35d93c2f6962cac8e8dc27 (patch)
treedf24b1ae76338fa83f45c14f8518720f0266705d /package
parentffb3f790a5075e5c294420e8348dfe6c429ac921 (diff)
downloadmtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.zip
mtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.tar.gz
mtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.tar.bz2
mt7xxx proprietary Wifi drivers integration + mac80211 weird changes
Diffstat (limited to 'package')
-rwxr-xr-xpackage/base-files/files/lib/wifi/ralink_common.sh271
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh35
-rw-r--r--package/kernel/mac80211/files/regdb.txt2
-rwxr-xr-xpackage/ramips/drivers/mt7603e/Makefile82
-rwxr-xr-xpackage/ramips/drivers/mt7603e/config.in527
-rwxr-xr-xpackage/ramips/drivers/mt7603e/files/mt7603e.dat147
-rwxr-xr-xpackage/ramips/drivers/mt7603e/files/mt7603e.eeprom.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7603e/files/mt7603e.sh49
-rw-r--r--package/ramips/drivers/mt7603e/patches/001-fix-build.patch114
-rwxr-xr-xpackage/ramips/drivers/mt7610e/Makefile74
-rwxr-xr-xpackage/ramips/drivers/mt7610e/config.in221
-rwxr-xr-xpackage/ramips/drivers/mt7610e/files/mt7610e.dat132
-rwxr-xr-xpackage/ramips/drivers/mt7610e/files/mt7610e.sh50
-rwxr-xr-xpackage/ramips/drivers/mt7615e/Makefile63
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e-sku-bf.dat65
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e-sku.dat65
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.1.2G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.1.5G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.2.2G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.2.5G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.3.2G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.3.5G.dat432
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.eeprom.binbin0 -> 1024 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.inc45
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e2.sh116
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e5.sh117
-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
-rwxr-xr-xpackage/ramips/drivers/mt7628/Makefile87
-rwxr-xr-xpackage/ramips/drivers/mt7628/config.in249
-rwxr-xr-xpackage/ramips/drivers/mt7628/files/mt7628.dat132
-rwxr-xr-xpackage/ramips/drivers/mt7628/files/mt7628.eeprom.epa.elna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.elna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.ilna.binbin0 -> 512 bytes
-rwxr-xr-xpackage/ramips/drivers/mt7628/files/mt7628.sh51
-rwxr-xr-xpackage/ramips/drivers/mt7628sta/Makefile111
-rwxr-xr-xpackage/ramips/drivers/mt7628sta/config.in246
-rwxr-xr-xpackage/ramips/drivers/mt7628sta/files/mt7628sta.dat95
-rw-r--r--package/ramips/drivers/mt7628sta/files/mt7628sta.sh63
-rwxr-xr-xpackage/ramips/drivers/mt7628sta/files/wpa_supplicant.sh194
-rw-r--r--package/ramips/drivers/mt7628sta/patches/001-openwrt-build.patch20
-rw-r--r--package/ramips/drivers/mt7628sta/patches/002-path.patch31
-rw-r--r--package/ramips/drivers/mt7628sta/patches/003-log.patch30
-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
64 files changed, 8285 insertions, 4 deletions
diff --git a/package/base-files/files/lib/wifi/ralink_common.sh b/package/base-files/files/lib/wifi/ralink_common.sh
new file mode 100755
index 0000000..8182629
--- /dev/null
+++ b/package/base-files/files/lib/wifi/ralink_common.sh
@@ -0,0 +1,271 @@
+# this file will be included in
+# /lib/wifi/mt{chipname}.sh
+
+repair_wireless_uci() {
+ echo "repair_wireless_uci" >>/tmp/wifi.log
+ vifs=`uci show wireless | grep "=wifi-iface" | sed -n "s/=wifi-iface//gp"`
+ echo $vifs >>/tmp/wifi.log
+
+ ifn5g=0
+ ifn2g=0
+ for vif in $vifs; do
+ local netif nettype device netif_new
+ echo "<<<<<<<<<<<<<<<<<" >>/tmp/wifi.log
+ netif=`uci -q get ${vif}.ifname`
+ nettype=`uci -q get ${vif}.network`
+ device=`uci -q get ${vif}.device`
+ if [ "$device" == "" ]; then
+ echo "device cannot be empty!!" >>/tmp/wifi.log
+ return
+ fi
+ echo "device name $device!!" >>/tmp/wifi.log
+ echo "netif $netif" >>/tmp/wifi.log
+ echo "nettype $nettype" >>/tmp/wifi.log
+
+ case "$device" in
+ mt7620 | mt7602e | mt7603e | mt7628 | mt7688 | mt7615e2)
+ netif_new="ra"${ifn2g}
+ ifn2g=$(( $ifn2g + 1 ))
+ ;;
+ mt7610e | mt7612e | mt7615e5)
+ netif_new="rai"${ifn5g}
+ ifn5g=$(( $ifn5g + 1 ))
+ ;;
+ * )
+ echo "device $device not recognized!! " >>/tmp/wifi.log
+ ;;
+ esac
+
+ echo "ifn5g = ${ifn5g}, ifn2g = ${ifn2g}" >>/tmp/wifi.log
+ echo "netif_new = ${netif_new}" >>/tmp/wifi.log
+
+ #if [ "$netif" == "" ]; then
+ echo "ifname set to ${netif_new}" >>/tmp/wifi.log
+ uci -q set ${vif}.ifname=${netif_new}
+ #fi
+ if [ "$nettype" == "" ]; then
+ nettype="lan"
+ echo "nettype empty, we'll fix it with ${nettype}" >>/tmp/wifi.log
+ uci -q set ${vif}.network=${nettype}
+ fi
+ echo ">>>>>>>>>>>>>>>>>" >>/tmp/wifi.log
+ done
+ uci changes >>/tmp/wifi.log
+ uci commit
+}
+
+
+sync_uci_with_dat() {
+ echo "sync_uci_with_dat($1,$2,$3,$4)" >>/tmp/wifi.log
+ local device="$1"
+ local datpath="$2"
+ uci2dat -d $device -f $datpath > /tmp/uci2dat.log
+}
+
+
+
+chk8021x() {
+ local x8021x="0" encryption device="$1" prefix
+ #vifs=`uci show wireless | grep "=wifi-iface" | sed -n "s/=wifi-iface//gp"`
+ echo "u8021x dev $device" > /tmp/802.$device.log
+ config_get vifs "$device" vifs
+ for vif in $vifs; do
+ local ifname
+ config_get ifname $vif ifname
+ echo "ifname = $ifname" >> /tmp/802.$device.log
+ config_get encryption $vif encryption
+ echo "enc = $encryption" >> /tmp/802.$device.log
+ case "$encryption" in
+ wpa+*)
+ [ "$x8021x" == "0" ] && x8021x=1
+ echo 111 >> /tmp/802.$device.log
+ ;;
+ wpa2+*)
+ [ "$x8021x" == "0" ] && x8021x=1
+ echo 1l2 >> /tmp/802.$device.log
+ ;;
+ wpa-mixed*)
+ [ "$x8021x" == "0" ] && x8021x=1
+ echo 1l3 >> /tmp/802.$device.log
+ ;;
+ esac
+ ifpre=$(echo $ifname | cut -c1-3)
+ echo "prefix = $ifpre" >> /tmp/802.$device.log
+ if [ "$ifpre" == "rai" ]; then
+ prefix="rai"
+ else
+ prefix="ra"
+ fi
+ if [ "1" == "$x8021x" ]; then
+ break
+ fi
+ done
+ echo "x8021x $x8021x, pre $prefix" >>/tmp/802.$device.log
+ if [ "1" == $x8021x ]; then
+ if [ "$prefix" == "ra" ]; then
+ echo "killall 8021xd" >>/tmp/802.$device.log
+ killall 8021xd
+ echo "/bin/8021xd -d 9" >>/tmp/802.$device.log
+ 8021xd -d 9 >> /tmp/802.$device.log 2>&1
+ else # $prefixa == rai
+ echo "killall 8021xdi" >>/tmp/802.$device.log
+ killall 8021xdi
+ echo "/bin/8021xdi -d 9" >>/tmp/802.$device.log
+ 8021xdi -d 9 >> /tmp/802.$device.log 2>&1
+ fi
+ else
+ if [ "$prefix" == "ra" ]; then
+ echo "killall 8021xd" >>/tmp/802.$device.log
+ killall 8021xd
+ else # $prefixa == rai
+ echo "killall 8021xdi" >>/tmp/802.$device.log
+ killall 8021xdi
+ fi
+ fi
+}
+
+
+prepare_ralink_wifi() {
+ echo "prepare_ralink_wifi($1,$2,$3,$4)" >>/tmp/wifi.log
+ local device=$1
+ config_get channel $device channel
+ config_get ssid $2 ssid
+ config_get mode $device mode
+ config_get ht $device ht
+ config_get country $device country
+ config_get regdom $device regdom
+
+ # HT40 mode can be enabled only in bgn (mode = 9), gn (mode = 7)
+ # or n (mode = 6).
+ HT=0
+ [ "$mode" = 6 -o "$mode" = 7 -o "$mode" = 9 ] && [ "$ht" != "20" ] && HT=1
+
+ # In HT40 mode, a second channel is used. If EXTCHA=0, the extra
+ # channel is $channel + 4. If EXTCHA=1, the extra channel is
+ # $channel - 4. If the channel is fixed to 1-4, we'll have to
+ # use + 4, otherwise we can just use - 4.
+ EXTCHA=0
+ [ "$channel" != auto ] && [ "$channel" -lt "5" ] && EXTCHA=1
+
+}
+
+scan_ralink_wifi() {
+ local device="$1"
+ local module="$2"
+ echo "scan_ralink_wifi($1,$2,$3,$4)" >>/tmp/wifi.log
+ repair_wireless_uci
+ sync_uci_with_dat $device /etc/wireless/$device/$device.dat
+}
+
+disable_ralink_wifi() {
+ echo "disable_ralink_wifi($1,$2,$3,$4)" >>/tmp/wifi.log
+ local device="$1"
+ config_get vifs "$device" vifs
+ for vif in $vifs; do
+ config_get ifname $vif ifname
+ ifconfig $ifname down
+ done
+
+ # kill any running ap_clients
+ killall ap_client || true
+}
+
+enable_ralink_wifi() {
+ echo "enable_ralink_wifi($1,$2,$3,$4)" >>/tmp/wifi.log
+ local device="$1"
+ local module="$2"
+ config_get vifs "$device" vifs
+
+ # shut down all vifs first
+ for vif in $vifs; do
+ config_get ifname $vif ifname
+ ifconfig $ifname down
+ done
+
+ # in some case we have to reload drivers. (mbssid)
+ ref=`cat /sys/module/$module/refcnt`
+ if [ $ref != "0" ]; then
+ # but for single driver, we only need to reload once.
+ echo "$module ref=$ref, skip reload module" >>/tmp/wifi.log
+ else
+ echo "rmmod $module" >>/tmp/wifi.log
+ rmmod $module
+ echo "insmod $module" >>/tmp/wifi.log
+ insmod $module
+ fi
+
+ # bring up vifs
+ for vif in $vifs; do
+ config_get ifname $vif ifname
+ config_get disabled $vif disabled
+ config_get radio $device radio
+
+ # here's the tricky part. we need at least 1 vif to trigger
+ # the creation of all other vifs.
+ ifconfig $ifname up
+ echo "ifconfig $ifname up" >> /tmp/wifi.log
+ if [ "$disabled" == "1" ]; then
+ echo "$ifname sets to disabled." >> /tmp/wifi.log
+ ifconfig $ifname down
+ fi
+ #Radio On/Off only support iwpriv command but dat file
+ [ "$radio" == "0" ] && iwpriv $ifname set RadioOn=0
+ local net_cfg bridge
+ net_cfg="$(find_net_config "$vif")"
+ [ -z "$net_cfg" ] || {
+ bridge="$(bridge_interface "$net_cfg")"
+ config_set "$vif" bridge "$bridge"
+ start_net "$ifname" "$net_cfg"
+ }
+ set_wifi_up "$vif" "$ifname"
+ done
+ chk8021x $device
+ setsmp.sh
+}
+
+detect_ralink_wifi() {
+ echo "detect_ralink_wifi($1,$2,$3,$4)" >>/tmp/wifi.log
+ local channel
+ local device="$1"
+ local module="$2"
+ local band
+ local ifname
+ cd /sys/module/
+ [ -d $module ] || return
+ config_get channel $device channel
+ [ -z "$channel" ] || return
+ case "$device" in
+ mt7620 | mt7602e | mt7603e | mt7628 | mt7615e2)
+ ifname="ra0"
+ band="2.4G"
+ ;;
+ mt7610e | mt7612e | mt7615e5)
+ ifname="rai0"
+ band="5G"
+ ;;
+ * )
+ echo "device $device not recognized!! " >>/tmp/wifi.log
+ ;;
+ esac
+ cat <<EOF
+config wifi-device $device
+ option type $device
+ option vendor ralink
+ option band $band
+ option channel 0
+ option autoch 2
+
+config wifi-iface
+ option device $device
+ option ifname $ifname
+ option network lan
+ option mode ap
+ option ssid OpenWrt-$device
+ option encryption psk2
+ option key 12345678
+
+EOF
+}
+
+
+
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index e6241de..a464cc9 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -88,7 +88,7 @@ mac80211_hostapd_setup_base() {
[ "$auto_channel" -gt 0 ] && channel=acs_survey
- json_get_vars noscan htmode
+ json_get_vars noscan
json_get_values ht_capab_list ht_capab
ieee80211n=1
@@ -505,7 +505,36 @@ mac80211_setup_adhoc() {
mcval=
[ -n "$mcast_rate" ] && hostapd_add_rate mcval "$mcast_rate"
- iw dev "$ifname" ibss join "$ssid" $freq $htmode fixed-freq $bssid \
+ case "$htmode" in
+ VHT20|HT20) ibss_htmode=HT20;;
+ HT40*|VHT40|VHT80|VHT160)
+ case "$hwmode" in
+ a)
+ case "$(( ($channel / 4) % 2 ))" in
+ 1) ibss_htmode="HT40+" ;;
+ 0) ibss_htmode="HT40-";;
+ esac
+ ;;
+ *)
+ case "$htmode" in
+ HT40+) ibss_htmode="HT40+";;
+ HT40-) ibss_htmode="HT40-";;
+ *)
+ if [ "$channel" -lt 7 ]; then
+ ibss_htmode="HT40+"
+ else
+ ibss_htmode="HT40-"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ [ "$auto_channel" -gt 0 ] && ibss_htmode="HT40+"
+ ;;
+ *) ibss_htmode="" ;;
+ esac
+
+ iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \
${beacon_int:+beacon-interval $beacon_int} \
${brstr:+basic-rates $brstr} \
${mcval:+mcast-rate $mcval} \
@@ -596,7 +625,7 @@ drv_mac80211_setup() {
country chanbw distance \
txpower antenna_gain \
rxantenna txantenna \
- frag rts beacon_int
+ frag rts beacon_int htmode
json_get_values basic_rate_list basic_rate
json_select ..
diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt
index 3d15930..c9d9abc 100644
--- a/package/kernel/mac80211/files/regdb.txt
+++ b/package/kernel/mac80211/files/regdb.txt
@@ -6,7 +6,7 @@ country 00:
# Channel 14. Only JP enables this and for 802.11b only
(2474 - 2494 @ 20), (20), NO-IR, NO-OFDM
# Channel 36 - 48
- (5170 - 5250 @ 160), (20), NO-IR
+ (5170 - 5250 @ 160), (20)
# Channel 52 - 64
(5250 - 5330 @ 160), (20), NO-IR, DFS
# Channel 100 - 144
diff --git a/package/ramips/drivers/mt7603e/Makefile b/package/ramips/drivers/mt7603e/Makefile
new file mode 100755
index 0000000..cd7c0f0
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/Makefile
@@ -0,0 +1,82 @@
+# 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:=mt7603e
+P4REV:=
+PKG_VERSION:=4.0.1.0
+PKG_SOURCE:=MT7603e_LinuxAP_V4.0.1.0rev1_DPA_20150629.tar.bz2
+PKG_SOURCE_URL:=http://localhost/
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_KCONFIG:= \
+ RALINK_MT7620 RALINK_RT7621 RLT_WIFI MT_WIFI_PATH\
+ FIRST_IF_EEPROM_PROM FIRST_IF_EEPROM_EFUSE FIRST_IF_EEPROM_FLASH RT_FIRST_CARD_EEPROM WIFI_BASIC_FUNC\
+ MULTI_INF_SUPPORT WSC_INCLUDED WSC_V2_SUPPORT DOT11N_DRAFT3 DOT11_VHT_AC DOT11W_PMF_SUPPORT\
+ TXBF_SUPPORT WMM_ACM_SUPPORT QOS_DLS_SUPPORT WAPI_SUPPORT CARRIER_DETECTION_SUPPORT\
+ IGMP_SNOOP_SUPPORT BLOCK_NET_IF RATE_ADAPTION NEW_RATE_ADAPT_SUPPORT AGS_SUPPORT\
+ IDS_SUPPORT WIFI_WORK_QUEUE WIFI_SKB_RECYCLE RTMP_FLASH_SUPPORT LED_CONTROL_SUPPORT\
+ SINGLE_SKU_V2 HW_ANTENNA_DIVERSITY ATE_SUPPORT RT2860V2_AP_V24_DATA_STRUCTURE RT2860V2_AP_32B_DESC\
+ MEMORY_OPTIMIZATION HOTSPOT HOTSPOT_R2 ACL_V2_SUPPORT UAPSD PA_LNA RLT_BBP RLT_RF RTMP_BBP RTMP_RF RLT_MAC RLT_BBP RLT_RF RTMP_MAC RTMP_BBP RTMP_RF \
+ RTMP_PCI_SUPPORT RTMP_USB_SUPPORT RTMP_RBUS_SUPPORT RLT_AP_SUPPORT RALINK_MT7603E MT_MAC AP_SUPPORT\
+ WDS_SUPPORT MBSS_SUPPORT NEW_MBSSID_MODE ENHANCE_NEW_MBSSID_MODE APCLI_SUPPORT MULTI_APCLI_SUPPORT \
+ AIRPLAY_SUPPORT MAC_REPEATER_SUPPORT DFS_SUPPORT NINTENDO_AP DOT11K_RRM_SUPPORT RT2860V2_SNMP\
+ LLTD_SUPPORT NINTENDO_AP COC_SUPPORT MULTI_CORE_SUPPORT MCAST_RATE_SPECIFIC PREVENT_ARP_SPOOFING_SUPPORT \
+ EXT_BUILD_CHANNEL_LIST AUTO_CH_SELECT_ENHANCE MEMORY_OPTIMIZATION RTMP_TEMPERATURE_CALIBRATION\
+ SNIFFER_SUPPORT CFG80211_SUPPORT SNIFFER_MIB_CMD ALL_NET_EVENT
+
+
+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/mt7603e
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7603e wifi AP driver
+ FILES:=$(PKG_BUILD_DIR)/rlt_wifi_ap/mt7603e.ko
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt7603e/config
+ source "$(SOURCE)/config.in"
+endef
+
+define P4/Info
+ P4URL:=//Embedded_WIFI/MP/MT7603/rlt_wifi/
+endef
+
+define P4/Release
+ make RT28xx_MODE=AP CHIPSET=mt7603e build_tools
+ make WIFI_MODE=AP CHIPSET=mt7603e RELEASE=DPA release 2>&1
+ mv DPA src
+ cp -rf rlt_wifi_ap build
+ #cp build/Makefile.mt_wifi_ap build/Makefile
+ #cp build/Kconfig.mt_wifi_ap build/Kconfig
+ tar cjf mt7603e.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_MT7603E_$c),CONFIG_$(c)=$(CONFIG_MT7603E_$(c)))) \
+ modules
+endef
+
+define KernelPackage/mt7603e/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7603e.sh $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7603e/
+ $(INSTALL_BIN) ./files/mt7603e.dat $(1)/etc/wireless/mt7603e/
+ -$(INSTALL_BIN) ./files/mt7603e.eeprom.bin $(1)/etc/wireless/mt7603e/
+ echo p$(P4REV) > $(1)/etc/wireless/mt7603e/version
+endef
+
+$(eval $(call KernelPackage,mt7603e))
diff --git a/package/ramips/drivers/mt7603e/config.in b/package/ramips/drivers/mt7603e/config.in
new file mode 100755
index 0000000..5e3d9e1
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/config.in
@@ -0,0 +1,527 @@
+if PACKAGE_kmod-mt7603e
+
+#if FIRST_IF_MT7603E || SECOND_IF_MT7603E
+config MT7603E_FIRST_IF_MT7603E
+ bool
+ default y
+ depends on PACKAGE_kmod-mt7603e
+
+config MT7603E_RLT_WIFI
+ tristate "MT WIFI Driver"
+ default y
+
+config MT7603E_MT_WIFI_PATH
+ string
+ depends on MT7603E_RLT_WIFI
+ default "rlt_wifi"
+
+if MT7603E_RLT_WIFI
+menu "WiFi Generic Feature Options"
+
+if MT7603E_FIRST_IF_MT7603E
+choice
+ prompt "EEPROM Type of 1st Card"
+ default MT7603E_FIRST_MT_IF_EEPROM_FLASH
+ #depends on ! FIRST_IF_NONE
+
+ config MT7603E_FIRST_IF_EEPROM_FLASH
+ bool "FLASH"
+
+ config MT7603E_FIRST_IF_EEPROM_PROM
+ bool "EEPROM"
+
+ config MT7603E_FIRST_IF_EEPROM_EFUSE
+ bool "EFUSE"
+endchoice
+
+config MT7603E_RT_FIRST_CARD_EEPROM
+ string
+ #depends on ! FIRST_IF_NONE
+ default "prom" if MT7603E_FIRST_IF_EEPROM_PROM
+ default "efuse" if MT7603E_FIRST_IF_EEPROM_EFUSE
+ default "flash" if MT7603E_FIRST_IF_EEPROM_FLASH
+endif
+
+
+
+
+config MT7603E_MULTI_INF_SUPPORT
+ bool
+ #default y if !FIRST_IF_NONE && !SECOND_IF_NONE
+ default n
+
+#config MT7603E_WIFI_BASIC_FUNC
+# bool "Basic Functions"
+# select WIRELESS_EXT
+# select WEXT_SPY
+# select WEXT_PRIV
+
+config MT7603E_WSC_INCLUDED
+ bool "WSC (WiFi Simple Config)"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_WSC_V2_SUPPORT
+ bool "WSC V2(WiFi Simple Config Version 2.0)"
+ depends on MT7603E_MMT_WSC_INCLUDED
+ default y
+config MT7603E_WSC_NFC_SUPPORT
+ bool "WSC out-of-band(NFC)"
+ # depends on WIFI_DRIVER
+ default n
+config MT7603E_DOT11N_DRAFT3
+ bool "802.11n Draft3"
+# depends on WIFI_DRIVER
+ default y
+
+#config MT7603E_DOT11_VHT_AC
+# bool "802.11 ac"
+# depends on WIFI_DRIVER
+# default n
+
+config MT7603E_DOT11W_PMF_SUPPORT
+ bool "PMF Support"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_TXBF_SUPPORT
+ bool "Tx Bean Forming Support"
+# depends on WIFI_DRIVER
+ default n
+
+#config MT7603E_WMM_ACM_SUPPORT
+# bool "WMM ACM"
+# depends on WIFI_DRIVER
+# default n
+
+config MT7603E_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_QOS_DLS_SUPPORT
+ bool "802.11e DLS ((Direct-Link Setup) Support"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_WAPI_SUPPORT
+ bool "WAPI Support"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_CARRIER_DETECTION_SUPPORT
+ bool "Carrier Detect"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_IGMP_SNOOP_SUPPORT
+ bool "IGMP Snooping"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_BLOCK_NET_IF
+ bool "NETIF Block"
+# depends on WIFI_DRIVER
+ default n
+ help
+ Support Net interface block while Tx-Sw queue full
+
+#config MT7603E_MT_TXBF_SUPPORT
+# bool "Tx Bean Forming Support (Only 3883)"
+# depends on WIFI_DRIVER
+# depends on RALINK_RT2883 || RALINK_RT3883
+# default n
+
+#config MT7603E_MT_VIDEO_TURBINE_SUPPORT
+# bool "Video Turbine support"
+# depends on WIFI_DRIVER
+# default n
+
+#config MT7603E_RATE_ADAPTION
+# tristate "Ralink Flow Classifier"
+# depends on WIFI_DRIVER
+# default n
+
+config MT7603E_NEW_RATE_ADAPT_SUPPORT
+ bool "New Rate Adaptation support"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_MT_NEW_RATE_ADAPT_SUPPORT
+ bool "Intelligent Rate Adaption"
+# depends on WIFI_DRIVER && MT_RATE_ADAPTION
+ default y
+
+config MT7603E_AGS_SUPPORT
+ bool "Adaptive Group Switching"
+ depends on MT7603E_MT_RATE_ADAPTION
+ default n
+
+config MT7603E_IDS_SUPPORT
+ bool "IDS (Intrusion Detection System) Support"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_WIFI_WORK_QUEUE
+ bool "Work Queue"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_WIFI_SKB_RECYCLE
+ bool "SKB Recycle(Linux)"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_RTMP_FLASH_SUPPORT
+ bool "Flash Support"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_LED_CONTROL_SUPPORT
+ bool "LED Support"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_SINGLE_SKU
+ bool "Single SKU"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_SINGLE_SKU_V2
+ bool "Single SKU V2"
+ depends on MT7603E_SINGLE_SKU && RALINK_RT6352
+ default n
+
+config MT7603E_HW_ANTENNA_DIVERSITY
+ bool "Antenna Diversity Support"
+ depends on MT7603E_RLT_AP_SUPPORT || MT7603E_RLT_STA_SUPPORT
+ depends on RALINK_RT5350
+ default n
+
+config MT7603E_ATE_SUPPORT
+ bool "ATE/QA Support"
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_RT2860V2_AP_V24_DATA_STRUCTURE
+ bool
+# depends on WIFI_DRIVER
+ default y
+
+config MT7603E_RT2860V2_AP_32B_DESC
+ bool "32 Byte Descriptor Support"
+# depends on WIFI_DRIVER
+ depends on RALINK_RT6352 || RALINK_MT7620
+ default n
+
+config MT7603E_MEMORY_OPTIMIZATION
+ bool "Memory Optimization"
+# depends on WIFI_DRIVER
+ default n
+
+#config MT7603E_RTMP_INTERNAL_TX_ALC
+# bool "TSSI Compensation"
+# depends on WIFI_DRIVER
+# depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352
+# default n
+
+#config MT7603E_RTMP_TEMPERATURE_CALIBRATION
+# bool "Temperature Calibration"
+# depends on WIFI_DRIVER
+# depends on RALINK_RT6352
+# default n
+
+config MT7603E_HOTSPOT
+ bool "Passpoint-R1"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_MT_HOTSPOT_R2
+ bool "Passpoint Release-2 Support"
+ depends on HOTSPOT
+ select MT7603E_MT_DOT11W_PMF_SUPPORT
+ default n
+
+config MT7603E_MT_RTMP_TEMPERATURE_TX_ALC
+ bool "Temperature Tx Power Compensation"
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_UAPSD
+ bool "UAPSD support"
+# depends on WIFI_DRIVER
+ default y
+
+
+#
+# Section for chip architectures
+#
+# "RLT MAC Support"
+config MT7603E_RLT_MAC
+ bool
+# depends on WIFI_DRIVER
+ default n
+
+config MT7603E_RLT_BBP
+ bool
+
+config MT7603E_RLT_RF
+ bool
+
+# "RTMP MAC Support"
+config MT7603E_RTMP_MAC
+ bool
+ depends on WIFI_DRIVER
+ default n
+
+config MT7603E_RTMP_BBP
+ bool
+
+config MT7603E_RTMP_RF
+ bool
+
+#config MT7603E_MT_EPA_ELNA
+# bool "ePAeLNA"
+# depends on WIFI_DRIVER
+# default n
+#choice
+# prompt "PA,LNA Type"
+# depends on MT7603E_MT_WIFI
+#
+# config MT7603E_MT_IPA_ILNA
+# bool "iPAiLNA"
+#
+# config MT7603E_MT_IPA_ELNA
+# bool "iPAeLNA"
+#
+# config MT7603E_MT_EPA_ILNA
+# bool "ePAiLNA"
+#
+# config MT7603E_MT_EPA_ELNA
+# bool "ePAeLNA"
+#endchoice
+#
+#config MT7603E_MT_PA_LNA
+# string
+# depends on MT7603E_MT_WIFI
+# default "iPAiLNA" if MT7603E_MT_IPA_ILNA
+# default "iPAeLNA" if MT7603E_MT_IPA_ELNA
+# default "ePAiLNA" if MT7603E_MT_EPA_ILNA
+# default "ePAeLNA" if MT7603E_MT_EPA_ELNA
+#
+#
+# Section for chip architectures
+#
+# "RLT MAC Support"
+#config MT7603E_RLT_MAC
+# bool
+# depends on WIFI_DRIVER
+# default n
+
+#config MT7603E_RLT_BBP
+# bool
+
+#config MT7603E_RLT_RF
+# bool
+
+# "RTMP MAC Support"
+#config MT7603E_RTMP_MAC
+# bool
+# depends on WIFI_DRIVER
+# default n
+
+#config MT7603E_RTMP_BBP
+# bool
+
+#config MT7603E_RTMP_RF
+# bool
+
+#
+# Section for interfaces
+#
+config MT7603E_RTMP_PCI_SUPPORT
+ bool
+
+config MT7603E_RTMP_USB_SUPPORT
+ bool
+
+config MT7603E_RTMP_RBUS_SUPPORT
+ bool
+
+endmenu
+
+menu "WiFi Operation Modes"
+ choice
+ prompt "Main Mode"
+ default MT7603E_MT_WIFI_MODE_AP
+
+ config MT7603E_MT_WIFI_MODE_AP
+ bool "AP"
+
+ config MT7603E_MT_WIFI_MODE_STA
+ bool "STA"
+
+ config MT7603E_MT_WIFI_MODE_BOTH
+ bool "APSTA"
+ endchoice
+
+ if MT7603E_MT_WIFI_MODE_AP || MT7603E_MT_WIFI_MODE_BOTH
+
+config MT7603E_RLT_AP_SUPPORT
+ tristate "UnifyMAC 802.11n AP support"
+ default y
+# depends on NET_RADIO
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+
+config MT7603E_WDS_SUPPORT
+ bool "WDS"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default n
+
+config MT7603E_MBSS_SUPPORT
+ bool "MBSSID"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default y
+
+config MT7603E_NEW_MBSSID_MODE
+ bool "New MBSSID MODE"
+ depends on MT7603E_RLT_AP_SUPPORT && MT7603E_MBSS_SUPPORT
+ # depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352 || RALINK_MT7620 || RALINK_MT7621
+ default n
+
+config MT7603E_ENHANCE_NEW_MBSSID_MODE
+ bool "Enhanced MBSSID mode"
+ depends on MT7603E_NEW_MBSSID_MODE
+ default n
+config MT7603E_CFG80211_SUPPORT
+ bool "CFG80211"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default n
+
+config MT7603E_SNIFFER_MIB_CMD
+ bool "SNIFFER_MIB_CMD"
+ depends on MT7603E_SNIFFER_SUPPORT
+ default n
+
+config MT7603E_ALL_NET_EVENT
+ bool "ALL_NET_EVENT"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default n
+
+config MT7603E_ACL_V2_SUPPORT
+ bool "ACL_V2"
+ depends on MT7603E_RLT_AP_SUPPORT
+
+
+config MT7603E_APCLI_SUPPORT
+ bool "AP-Client Support"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default y
+config MT7603E_MULTI_APCLI_SUPPORT
+ bool "MULTI AP-Client Support"
+ depends on MT7603E_APCLI_SUPPORT
+
+config MT7603E_MAC_REPEATER_SUPPORT
+ bool "MAC Repeater Support"
+ depends on MT7603E_RLT_AP_SUPPORT
+ depends on MT7603E_APCLI_SUPPORT
+ depends on RALINK_RT6352 || RALINK_MT7620 || MT7603E_RALINK_MT7603E
+ default n
+config MT7603E_AIRPLAY_SUPPORT
+ bool "AirPlay Support"
+ depends on MT7603E_APCLI_SUPPORT
+
+#config MT7603E_MT_MESH_SUPPORT
+# bool "MESH Support"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+config MT7603E_DFS_SUPPORT
+ bool "DFS"
+ depends on MT7603E_RLT_AP_SUPPORT
+ select RALINK_TIMER_DFS
+
+#config MT7603E_DOT11R_FT_SUPPORT
+# bool "802.11r Fast BSS Transition"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+#config MT7603E_DOT11K_RRM_SUPPORT
+# bool "802.11k Radio Resource Management"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+config MT7603E_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default y
+
+config MT7603E_NINTENDO_AP
+ bool "Nintendo AP"
+ depends on MT7603E_RLT_AP_SUPPORT
+
+config MT7603E_COC_SUPPORT
+ bool "CoC Support"
+ depends on MT7603E_RLT_AP_SUPPORT
+ default n
+
+#config MT7603E_ RT2860V2_SNMP
+# bool "Net-SNMP Support"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+config MT7603E_MCAST_RATE_SPECIFIC
+ bool "User specific tx rate of mcast pkt"
+ depends on MT7603E_RLT_AP_SUPPORT
+config MT7603E_PREVENT_ARP_SPOOFING_SUPPORT
+ bool "Detect ARP spoof pkts attack"
+ depends on MT7603E_RLT_AP_SUPPORT
+
+#config MT7603E_EXT_BUILD_CHANNEL_LIST
+# bool "Extension Channel List"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+#config MT7603E_AUTO_CH_SELECT_ENHANCE
+# bool "Auto Channel Selection Enhancement"
+# depends on MT7603E_RLT_AP_SUPPORT
+
+config MT7603E_MULTI_CORE_SUPPORT
+ bool "multi core support"
+ depends on TARGET_ramips_mt7621
+ default y
+
+ endif
+
+ #if MT7603E_WIFI_MODE_STA || MT7603E_WIFI_MODE_BOTH
+ # source "drivers/net/wireless/rlt_wifi_sta/Kconfig"
+ #endif
+endmenu
+
+#"MT7603E"
+config MT7603E_RALINK_MT7603E
+ bool
+ default y
+ select MT7603E_RTMP_PCI_SUPPORT
+
+endif
+
+#if MT7603E_RLT_MAC
+# config MT7603E_RLT_MAC
+# bool
+# default y
+#endif
+
+#if MT7603E_RTMP_MAC
+# config MT7603E_RTMP_MAC
+# bool
+# default y
+#endif
+
+#if MT7603E_MT_MAC
+if MT7603E_RALINK_MT7603E
+ config MT7603E_MT_MAC
+ bool
+ default y
+endif
+#endif MT7603E_MT_WIFI
+#endif
+#endif FIRST_IF_MT7603E || SECOND_IF_MT7603E
+endif
diff --git a/package/ramips/drivers/mt7603e/files/mt7603e.dat b/package/ramips/drivers/mt7603e/files/mt7603e.dat
new file mode 100755
index 0000000..fc24821
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/files/mt7603e.dat
@@ -0,0 +1,147 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=TW
+BssidNum=1
+SSID1=RT2860AP1
+SSID2=
+SSID3=
+SSID4=
+WirelessMode=9
+TxRate=0
+Channel=11
+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=
+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_LDPC=0
+HT_MCS=33
+VHT_BW=1
+VHT_SGI=1
+VHT_STBC=0
+VHT_BW_SIGNAL=0
+VHT_DisallowNonVHT=0
+VHT_LDPC=0
+MeshId=MESH
+MeshAutoLink=1
+MeshAuthMode=OPEN
+MeshEncrypType=NONE
+MeshWPAKEY=
+MeshDefaultkey=1
+MeshWEPKEY=
+WscManufacturer=
+WscModelName=
+WscDeviceName=
+WscModelNumber=
+WscSerialNumber=
+RadioOn=1
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+LoadCodeMethod=0
+
+HT_TxStream=2
+HT_RxStream=2
diff --git a/package/ramips/drivers/mt7603e/files/mt7603e.eeprom.bin b/package/ramips/drivers/mt7603e/files/mt7603e.eeprom.bin
new file mode 100755
index 0000000..4d9fab4
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/files/mt7603e.eeprom.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7603e/files/mt7603e.sh b/package/ramips/drivers/mt7603e/files/mt7603e.sh
new file mode 100755
index 0000000..4b28935
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/files/mt7603e.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+append DRIVERS "mt7603e"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7603e() {
+ prepare_ralink_wifi mt7603e
+}
+
+scan_mt7603e() {
+ scan_ralink_wifi mt7603e mt7603e
+}
+
+disable_mt7603e() {
+ disable_ralink_wifi mt7603e
+}
+
+enable_mt7603e() {
+ enable_ralink_wifi mt7603e mt7603e
+}
+
+detect_mt7603e() {
+# detect_ralink_wifi mt7603e mt7603e
+ ssid=mt7603e #-`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 mt7603e
+ option type mt7603e
+ option vendor ralink
+ option band 2.4G
+ option channel 1
+
+config wifi-iface
+ option device mt7603e
+ 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/mt7603e/patches/001-fix-build.patch b/package/ramips/drivers/mt7603e/patches/001-fix-build.patch
new file mode 100644
index 0000000..264f985
--- /dev/null
+++ b/package/ramips/drivers/mt7603e/patches/001-fix-build.patch
@@ -0,0 +1,114 @@
+Index: mt7603e-4.0.1.0/rlt_wifi_ap/Makefile
+===================================================================
+--- mt7603e-4.0.1.0.orig/rlt_wifi_ap/Makefile
++++ mt7603e-4.0.1.0/rlt_wifi_ap/Makefile
+@@ -1,7 +1,6 @@
+-EXTRA_CFLAGS = -Idrivers/net/wireless/rlt_wifi/include \
+- -Idrivers/net/wireless/rlt_wifi/ate/include
++EXTRA_CFLAGS = -I$(src)/../rlt_wifi/include -I$(src)/../rlt_wifi/ate/include
+
+-DRV_NAME = rlt_wifi
++DRV_NAME = mt7603e
+ RT_WIFI_DIR = ../rlt_wifi
+
+ ########################################################
+@@ -733,7 +732,7 @@ endif
+ #
+ # Root
+ #
+-obj-$(CONFIG_RLT_AP_SUPPORT) += $(DRV_NAME).o
++obj-m += $(DRV_NAME).o
+
+ $(DRV_NAME)-objs += $(ap_objs) $(cmm_objs) $(asic_objs) $(chip_objs) $(rate_objs) $(inf_objs)\
+ $(spec_objs) $(func_objs) $(os_objs)
+Index: mt7603e-4.0.1.0/rlt_wifi/os/linux/rt_linux.c
+===================================================================
+--- mt7603e-4.0.1.0.orig/rlt_wifi/os/linux/rt_linux.c
++++ mt7603e-4.0.1.0/rlt_wifi/os/linux/rt_linux.c
+@@ -43,8 +43,8 @@
+ #endif
+
+ #if defined(CONFIG_RA_HW_NAT) || defined(CONFIG_RA_HW_NAT_MODULE)
+-#include "../../../../../../net/nat/hw_nat/ra_nat.h"
+-#include "../../../../../../net/nat/hw_nat/frame_engine.h"
++#include "../../../linux-kernel/net/nat/hw_nat/ra_nat.h"
++#include "../../../linux-kernel/net/nat/hw_nat/frame_engine.h"
+ #endif
+
+ /* TODO */
+Index: mt7603e-4.0.1.0/rlt_wifi/os/linux/rt_profile.c
+===================================================================
+--- mt7603e-4.0.1.0.orig/rlt_wifi/os/linux/rt_profile.c
++++ mt7603e-4.0.1.0/rlt_wifi/os/linux/rt_profile.c
+@@ -30,8 +30,8 @@
+ #endif
+
+ #if defined (CONFIG_RA_HW_NAT) || defined (CONFIG_RA_HW_NAT_MODULE)
+-#include "../../../../../../net/nat/hw_nat/ra_nat.h"
+-#include "../../../../../../net/nat/hw_nat/frame_engine.h"
++#include "../../../linux-kernel/net/nat/hw_nat/ra_nat.h"
++#include "../../../linux-kernel/net/nat/hw_nat/frame_engine.h"
+ #endif
+
+
+@@ -60,8 +60,8 @@ struct dev_type_name_map{
+ #define xdef_to_str(s) def_to_str(s)
+ #define def_to_str(s) #s
+
+-#define FIRST_EEPROM_FILE_PATH "/etc_ro/Wireless/RT2860/"
+-#define FIRST_AP_PROFILE_PATH "/etc/Wireless/RT2860/RT2860.dat"
++#define FIRST_EEPROM_FILE_PATH "/etc/wireless/mt7603e/mt7603e.eeprom.dat"
++#define FIRST_AP_PROFILE_PATH "/etc/wireless/mt7603e/mt7603e.dat"
+ #define FIRST_CHIP_ID xdef_to_str(CONFIG_RT_FIRST_CARD)
+
+ #define SECOND_EEPROM_FILE_PATH "/etc_ro/Wireless/iNIC/"
+Index: mt7603e-4.0.1.0/rlt_wifi/include/os/rt_linux.h
+===================================================================
+--- mt7603e-4.0.1.0.orig/rlt_wifi/include/os/rt_linux.h
++++ mt7603e-4.0.1.0/rlt_wifi/include/os/rt_linux.h
+@@ -152,33 +152,19 @@ typedef struct usb_ctrlrequest devctrlre
+ ***********************************************************************************/
+ #ifdef CONFIG_AP_SUPPORT
+ #ifdef RTMP_MAC_PCI
+-#if CONFIG_RTPCI_AP_RF_OFFSET == 0x48000
+-#define AP_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_ap.dat"
+-#define AP_RTMP_FIRMWARE_FILE_NAME "/etc_ro/Wireless/iNIC/RT2860AP.bin"
+-#else
+-
+-#ifdef CONFIG_FIRST_IF_MT7603E
+-//for SDK's PATH
+-#define AP_PROFILE_PATH "/etc/Wireless/RT2860/RT2860.dat"
+-#else /* CONFIG_FIRST_IF_MT7603E */
+-//for PC's PATH
+-#define AP_PROFILE_PATH "/etc/Wireless/RT2860AP/RT2860AP.dat"
+-#endif /* !CONFIG_FIRST_IF_MT7603E */
+-#define AP_RTMP_FIRMWARE_FILE_NAME "/etc/Wireless/RT2860AP/RT2860AP.bin"
+-
+-#endif
+
++#define AP_PROFILE_PATH "/etc/wireless/mt7603e/mt7603e.dat"
+
+ #define AP_DRIVER_VERSION "4.0.1.0rev1"
+ #ifdef MULTIPLE_CARD_SUPPORT
+-#define CARD_INFO_PATH "/etc/Wireless/RT2860AP/RT2860APCard.dat"
++#define CARD_INFO_PATH "/etc/wireless/mt7603e/mt7603e.card.dat"
+ #endif /* MULTIPLE_CARD_SUPPORT */
+ #endif /* RTMP_MAC_PCI */
+
+
+
+ #ifdef SINGLE_SKU_V2
+-#define SINGLE_SKU_TABLE_FILE_NAME "/etc/Wireless/RT2860AP/SingleSKU.dat"
++#define SINGLE_SKU_TABLE_FILE_NAME "/etc/wireless/mt7603e/SingleSKU.dat"
+ #endif /* SINGLE_SKU_V2 */
+
+ #endif /* CONFIG_AP_SUPPORT */
+@@ -1589,7 +1575,7 @@ extern int rausb_control_msg(VOID *dev,
+ #define ATEDBGPRINT DBGPRINT
+ #ifdef RTMP_MAC_PCI
+ #ifdef CONFIG_AP_SUPPORT
+-#define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860AP/e2p.bin"
++#define EEPROM_BIN_FILE_NAME "/etc/wireless/mt7603e/mt7603e.eeprom.bin"
+ #endif /* CONFIG_AP_SUPPORT */
+ #endif /* RTMP_MAC_PCI */
+
diff --git a/package/ramips/drivers/mt7610e/Makefile b/package/ramips/drivers/mt7610e/Makefile
new file mode 100755
index 0000000..2fcfcf7
--- /dev/null
+++ b/package/ramips/drivers/mt7610e/Makefile
@@ -0,0 +1,74 @@
+# 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:=mt7610e
+P4REV:=118062
+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 RT_SECOND_CARD MT7610_AP MT7610_AP_V24_DATA_STRUCTURE MT7610_AP_LED MT7610_AP_WSC MT7610_AP_WSC_V2 \
+ MT7610_AP_LLTD MT7610_AP_WDS MT7610_AP_MBSS NEW_MBSSID_MODE MT7610_AP_APCLI MT7610_AP_MAC_REPEATER \
+ MT7610_AP_IGMP_SNOOP MT7610_AP_DFS MT7610_AP_CARRIER M7610_CON_WPS_SUPPORT MT7610_AP_80211N_DRAFT3 \
+ MT7610_AP_ATE MT7610_AP_QA MT7610_AP_FLASH MT7610_AP_BIG_ENDIAN MT7610_AP_TSSI_COMPENSATION \
+ RTMP_TEMPERATURE_COMPENSATION MT7610_AP_SINGLE_SKU
+
+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/mt7610e
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7610e wifi AP driver
+ FILES:=$(PKG_BUILD_DIR)/build/mt7610e.ko
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt7610e/config
+ source "$(SOURCE)/config.in"
+endef
+
+define P4/Info
+ P4URL:=//Embedded_WIFI/MP/MT7610/rlt_wifi/
+endef
+
+define P4/Release
+ make release
+ mkdir -p build
+ cp Makefile.ap.soc.dpa build/Makefile
+ cp Kconfig.ap.soc build/Kconfig
+ mv DPA src
+ tar cjf mt7610e.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)=$(CONFIG_$(c))))\
+ modules
+endef
+
+define KernelPackage/mt7610e/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7610e.sh $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7610e/
+ $(INSTALL_BIN) ./files/mt7610e.dat $(1)/etc/wireless/mt7610e/
+ -$(INSTALL_BIN) ./files/mt7610e.eeprom.bin $(1)/etc/wireless/mt7610e/
+ echo p$(P4REV) > $(1)/etc/wireless/mt7610e/version
+endef
+
+$(eval $(call KernelPackage,mt7610e))
diff --git a/package/ramips/drivers/mt7610e/config.in b/package/ramips/drivers/mt7610e/config.in
new file mode 100755
index 0000000..b76b6f2
--- /dev/null
+++ b/package/ramips/drivers/mt7610e/config.in
@@ -0,0 +1,221 @@
+if PACKAGE_kmod-mt7610e
+
+config RT_SECOND_CARD
+ string
+ default 7610
+ depends on PACKAGE_kmod-mt7610e
+
+config SECOND_IF_MT7610E
+ bool
+ default y
+ depends on PACKAGE_kmod-mt7610e
+
+config MT7610_AP
+ bool # "Ralink MT7610 802.11n AP support"
+ default y
+ depends on PACKAGE_kmod-mt7610e
+# depends on NET_RADIO
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+
+config MT7610_AP_V24_DATA_STRUCTURE
+ bool
+ depends on MT7610_AP
+ default y
+
+config MT7610_AP_LED
+ bool "LED Support"
+ depends on MT7610_AP
+
+config MT7610_AP_WSC
+ bool "WSC (WiFi Simple Config)"
+ depends on MT7610_AP
+ default y
+
+config MT7610_AP_WSC_V2
+ bool "WSC 2.0(WiFi Simple Config 2.0)"
+ depends on MT7610_AP_WSC
+ default y
+
+config MT7610_AP_LLTD
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on MT7610_AP
+
+config MT7610_AP_WDS
+ bool "WDS"
+ depends on MT7610_AP
+
+#config MT7610_AP_WMM_ACM
+# bool "WMM ACM"
+# depends on MT7610_AP
+
+config MT7610_AP_MBSS
+ bool "MBSSID"
+ depends on MT7610_AP
+ default y
+
+config NEW_MBSSID_MODE
+ bool "New MBSSID MODE"
+ depends on MT7610_AP
+ depends on MT7610_AP_MBSS
+ depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_MT7620
+ default y
+
+config MT7610_AP_APCLI
+ bool "AP-CLient Support"
+ depends on MT7610_AP
+ default y
+
+config MT7610_AP_MAC_REPEATER
+ bool "Mac Repeater Mode Support"
+ depends on MT7610_AP
+ depends on MT7610_AP_APCLI
+ default y
+
+config MT7610_AP_IGMP_SNOOP
+ bool "IGMP snooping"
+ depends on MT7610_AP
+
+#config MT7610_AP_NETIF_BLOCK
+# bool "NETIF Block"
+# depends on MT7610_AP
+# help
+# Support Net interface block while Tx-Sw queue full
+
+config MT7610_AP_DFS
+ bool "DFS"
+ depends on MT7610_AP
+# select RALINK_TIMER
+# select RALINK_TIMER_DFS
+
+config MT7610_AP_CARRIER
+ bool "Carrier Detect"
+ depends on MT7610_AP
+# select RALINK_TIMER
+# select RALINK_TIMER_DFS
+
+#config MT7610_AP_DLS
+# bool "DLS ((Direct-Link Setup) Support"
+# depends on MT7610_AP
+
+#config MT7610_AP_IDS
+# bool "IDS (Intrusion Detection System) Support"
+# depends on MT7610_AP
+
+#Not ready 20120726
+#config MT7610_RT3XXX_AP_ANTENNA_DIVERSITY
+# bool "Antenna Diversity Support"
+# depends on MT7610_AP
+
+#config MT7610_AP_WAPI
+# bool "WAPI Support"
+# depends on MT7610_AP
+
+#config MT7610_AP_COC
+# bool "CoC Support"
+# depends on MT7610_AP
+
+#config MT7610_AP_MEMORY_OPTIMIZATION
+# bool "Memory Optimization"
+# depends on MT7610_AP
+
+#config MT7610_AP_VIDEO_TURBINE
+# bool "Video Turbine support"
+# depends on MT7610_AP
+
+#config RA_CLASSIFIER
+# tristate "Ralink Flow Classifier"
+# depends on MT7610_AP_VIDEO_TURBINE
+# default n
+
+#config MT7610_AP_INTELLIGENT_RATE_ADAPTION
+# bool "Intelligent Rate Adaption"
+# depends on MT7610_AP
+# depends on RALINK_RT2883 || RALINK_RT3883
+
+#config MT7610_AP_TXBF
+# bool "Tx Bean Forming Support (Only 3883)"
+# depends on MT7610_AP
+# depends on RALINK_RT2883 || RALINK_RT3883
+
+config M7610_CON_WPS_SUPPORT
+ bool "Concurrent WPS Support"
+ depends on MT7610_AP
+ depends on MT7610_AP_APCLI
+ depends on MT7610_AP_WSC
+ depends on MT7610_AP_WSC_V2
+ default n
+
+#config MT7610_EXT_CHANNEL_LIST
+# bool "Extension Channel List"
+# depends on MT7610_AP
+
+#config MT7610_KTHREAD
+# bool "Kernel Thread"
+# depends on MT7610_AP
+
+#config MT7610_AUTO_CH_SELECT_ENHANCE
+# bool "Auto Channel Selection Enhancement"
+# depends on MT7610_AP
+
+config MT7610_AP_80211N_DRAFT3
+ bool "802.11n Draft3"
+ depends on MT7610_AP
+ default y
+
+config MT7610_AP_ATE
+ bool "ATE support"
+ depends on MT7610_AP
+
+config MT7610_AP_QA
+ bool "QA support"
+ depends on MT7610_AP
+
+#config MT7610_AP_CSO
+# bool "CSO Support"
+# depends on MT7610_AP
+
+config MT7610_AP_FLASH
+ bool "Flash Mode Support"
+ default y
+ depends on MT7610_AP
+
+#config MT7610_AP_HDR_TRANS
+# bool "Header Translation Rx Support"
+# depends on MT7610_AP
+
+config MT7610_AP_BIG_ENDIAN
+ bool "Big-endian platform Support"
+ depends on MT7610_AP
+
+config MT7610_AP_TSSI_COMPENSATION
+ bool "TSSI DC Calibration & TSSI compensation Support"
+ depends on MT7610_AP
+
+config RTMP_TEMPERATURE_COMPENSATION
+ bool "Tx Power Temperature Compensation"
+ depends on MT7610_AP
+ default y
+
+config MT7610_AP_SINGLE_SKU
+ bool "SingleSKU Support"
+ depends on MT7610_AP
+
+#config MT7610_80211R_FT
+# bool "802.11r Fast BSS Transition"
+# depends on MT7610_AP
+
+#config MT7610_80211R_RR
+# bool "802.11k Radio Resource Management"
+# depends on MT7610_AP
+
+#config MT7610_MCAST_RATE_SPECIFIC
+# bool "User specific tx rate of mcast pkt"
+# depends on MT7610_AP
+
+#config MT7610_SNMP
+# bool "Net-SNMP Support"
+# depends on MT7610_AP
+
+endif
diff --git a/package/ramips/drivers/mt7610e/files/mt7610e.dat b/package/ramips/drivers/mt7610e/files/mt7610e.dat
new file mode 100755
index 0000000..23ec24e
--- /dev/null
+++ b/package/ramips/drivers/mt7610e/files/mt7610e.dat
@@ -0,0 +1,132 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=
+CountryRegionABand=7
+CountryCode=
+BssidNum=1
+SSID1=OpenWrt-MT7610e
+SSID2=
+SSID3=
+SSID4=
+WirelessMode=9
+TxRate=0
+Channel=auto
+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=0
+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/mt7610e/files/mt7610e.sh b/package/ramips/drivers/mt7610e/files/mt7610e.sh
new file mode 100755
index 0000000..a3661bf
--- /dev/null
+++ b/package/ramips/drivers/mt7610e/files/mt7610e.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+append DRIVERS "mt7610e"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7610e() {
+ prepare_ralink_wifi mt7610e
+}
+
+scan_mt7610e() {
+ scan_ralink_wifi mt7610e mt7610e
+}
+
+disable_mt7610e() {
+ disable_ralink_wifi mt7610e
+}
+
+enable_mt7610e() {
+ enable_ralink_wifi mt7610e mt7610e
+}
+
+detect_mt7610e() {
+# detect_ralink_wifi mt7610e mt7610e
+ ssid=mt7610e-`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 mt7610e
+ option type mt7610e
+ option vendor ralink
+ option band 5G
+ option channel 0
+ option autoch 2
+
+config wifi-iface
+ option device mt7610e
+ 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/mt7615e/Makefile b/package/ramips/drivers/mt7615e/Makefile
new file mode 100755
index 0000000..97d436a
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/Makefile
@@ -0,0 +1,63 @@
+# 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
+
+# need modify wifi.mk driver version
+PKG_NAME:=mt7615e
+PKG_VERSION:=MT7615_LinuxAP_V4.4.1.2_20170514
+PKG_SOURCE:=MT7615_LinuxAP_V4.4.1.2_20170514.tar.bz2
+PKG_SOURCE_URL:=http://localhost/
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mt7615e
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7615e wifi AP profile only
+ SUBMENU:=Drivers
+# MENU:=1
+endef
+
+define Package/mt7615e/description
+ @echo "TBD"
+endef
+
+define Build/Prepare
+ @echo "this package is built with kernel"
+endef
+
+define Build/Compile
+ @echo "this package is built with kernel"
+endef
+
+define Package/mt7615e/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7615e/
+ $(INSTALL_BIN) ./files/mt7615e-sku.dat $(1)/etc/wireless/mt7615e/
+ $(INSTALL_BIN) ./files/mt7615e-sku-bf.dat $(1)/etc/wireless/mt7615e/
+ echo $(PKG_VERSION) > $(1)/etc/wireless/mt7615e/version
+ $(INSTALL_BIN) ./files/mt7615e.inc $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7615e*.sh $(1)/lib/wifi/
+
+ if [ "$$(CONFIG_PACKAGE_mt7615e)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7615e.1.*.dat $(1)/etc/wireless/mt7615e/; \
+ $(INSTALL_BIN) ./files/mt7615e*.bin $(1)/etc/wireless/mt7615e/; \
+ fi
+
+ if [ "$$(CONFIG_KCONFIG_SECOND_IF_MT7615E)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7615e.2.*.dat $(1)/etc/wireless/mt7615e/; \
+ $(INSTALL_BIN) ./files/mt7615e*.bin $(1)/etc/wireless/mt7615e/; \
+ fi
+
+ if [ "$$(CONFIG_KCONFIG_THIRD_IF_MT7615E)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7615e.3.*.dat $(1)/etc/wireless/mt7615e/; \
+ $(INSTALL_BIN) ./files/mt7615e.3.dat $(1)/etc/wireless/mt7615e/; \
+ $(INSTALL_BIN) ./files/mt7615e*.bin $(1)/etc/wireless/mt7615e/; \
+ fi
+endef
+
+$(eval $(call BuildPackage,mt7615e))
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e-sku-bf.dat b/package/ramips/drivers/mt7615e/files/mt7615e-sku-bf.dat
new file mode 100755
index 0000000..20b39c3
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e-sku-bf.dat
@@ -0,0 +1,65 @@
+# Single SKU Max Power Table | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+# 2.4G Channel |CCK | | | |OFDM | | | | | | | |VHT20 | | | | | | | | | |VHT40 | | | | | | | | | |Txstream_Delta | | | | | | | | | | | | | | | | | | | | |
+Band: 2.4G |CCK_1M |CCK_2M |CCK_5.5M |CCK_11M |OFDM_6M |OFDM_9M |OFDM_12M |OFDM_18M |OFDM_24M |OFDM_36M |OFDM_48M |OFDM_54M |VHT20_MCS0 |VHT20_MCS1 |VHT20_MCS2 |VHT20_MCS3 |VHT20_MCS4 |VHT20_MCS5 |VHT20_MCS6 |VHT20_MCS7 |VHT20_MCS8 |VHT20_MCS9 |VHT40_MCS0 |VHT40_MCS1 |VHT40_MCS2 |VHT40_MCS3 |VHT40_MCS4 |VHT40_MCS5 |VHT40_MCS6 |VHT40_MCS7 |VHT40_MCS8 |VHT40_MCS9 |Txstream_3T |Txstream_2T |Txstream_1T | | | | | | | | | | | | | | | | | | |
+Ch1 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |20 |12 |18 |16 |8 | |8 | |8 | |9 |11 |12 |2 |1 |3 | | | | | | | | | | | | | | | | | | |
+Ch2 |8 | |8 | |8 | |8 | |8 | |8 |8 |15 |8 | |8 | |8 | |19 |19 |10 |12 |8 | |8 | |8 | |9 |16 |12 |5 |4 |0 | | | | | | | | | | | | | | | | | | |
+Ch3 |8 | |8 | |8 | |8 | |8 | |8 |8 |18 |8 | |8 | |8 | |17 |18 |16 |20 |8 | |8 | |8 | |12 |8 |20 |0 |2 |0 | | | | | | | | | | | | | | | | | | |
+Ch4 |8 | |8 | |8 | |8 | |8 | |8 |8 |9 |8 | |8 | |8 | |14 |10 |14 |18 |8 | |8 | |8 | |14 |12 |10 |3 |4 |5 | | | | | | | | | | | | | | | | | | |
+Ch5 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |10 |13 |11 |8 |8 | |8 | |8 | |12 |8 |9 |4 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch6 |8 | |8 | |8 | |8 | |8 | |8 |8 |13 |8 | |8 | |8 | |11 |9 |12 |16 |8 | |8 | |8 | |9 |17 |11 |5 |2 |1 | | | | | | | | | | | | | | | | | | |
+Ch7 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |14 |11 |13 |18 |8 | |8 | |8 | |16 |13 |10 |2 |5 |4 | | | | | | | | | | | | | | | | | | |
+Ch8 |8 | |8 | |8 | |8 | |8 | |8 |8 |15 |8 | |8 | |8 | |14 |9 |11 |10 |8 | |8 | |8 | |11 |14 |8 |5 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch9 |8 | |8 | |8 | |8 | |8 | |8 |8 |11 |8 | |8 | |8 | |12 |9 |15 |19 |8 | |8 | |8 | |14 |20 |12 |2 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch10 |8 | |8 | |8 | |8 | |8 | |8 |8 |14 |8 | |8 | |8 | |17 |14 |17 |15 |8 | |8 | |8 | |9 |17 |8 |2 |4 |2 | | | | | | | | | | | | | | | | | | |
+Ch11 |8 | |8 | |8 | |8 | |8 | |8 |8 |14 |8 | |8 | |8 | |20 |10 |20 |18 |8 | |8 | |8 | |12 |8 |20 |3 |1 |4 | | | | | | | | | | | | | | | | | | |
+Ch12 |8 | |8 | |8 | |8 | |8 | |8 |8 |18 |8 | |8 | |8 | |20 |16 |17 |9 |8 | |8 | |8 | |11 |20 |9 |0 |0 |1 | | | | | | | | | | | | | | | | | | |
+Ch13 |8 | |8 | |8 | |8 | |8 | |8 |8 |8 |8 | |8 | |8 | |11 |16 |19 |16 |8 | |8 | |8 | |15 |12 |12 |2 |0 |2 | | | | | | | | | | | | | | | | | | |
+Ch14 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |15 |17 |16 |14 |8 | |8 | |8 | |12 |14 |20 |4 |1 |5 | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+# 5G Channel |OFDM | | | | | | | |VHT20 | | | | | | | | | |VHT40 | | | | | | | | | |VHT80 | | | | | | | | | |VHT160 | | | | | | | | | |Txstream_Delta | | | | |
+Band: 5G |OFDM_6M |OFDM_9M |OFDM_12M |OFDM_18M |OFDM_24M |OFDM_36M |OFDM_48M |OFDM_54M |VHT20_MCS0 |VHT20_MCS1 |VHT20_MCS2 |VHT20_MCS3 |VHT20_MCS4 |VHT20_MCS5 |VHT20_MCS6 |VHT20_MCS7 |VHT20_MCS8 |VHT20_MCS9 |VHT40_MCS0 |VHT40_MCS1 |VHT40_MCS2 |VHT40_MCS3 |VHT40_MCS4 |VHT40_MCS5 |VHT40_MCS6 |VHT40_MCS7 |VHT40_MCS8 |VHT40_MCS9 |VHT80_MCS0 |VHT80_MCS1 |VHT80_MCS2 |VHT80_MCS3 |VHT80_MCS4 |VHT80_MCS5 |VHT80_MCS6 |VHT80_MCS7 |VHT80_MCS8 |VHT80_MCS9 |VHT160_MCS0 |VHT160_MCS1 |VHT160_MCS2 |VHT160_MCS3 |VHT160_MCS4 |VHT160_MCS5 |VHT160_MCS6 |VHT160_MCS7 |VHT160_MCS8 |VHT160_MCS9 |Txstream_3T |Txstream_2T |Txstream_1T | | |
+Ch184 |18 | |18 | |18 | |18 |18 |15 |18 | |12 | |13 | |11 |14 |16 |16 |12 | |12 | |13 | |20 |17 |16 |17 |18 | |9 | |16 | |17 |20 |18 |16 |19 | |15 | |9 | |17 |8 |17 |0 |4 |4 | | |
+Ch188 |18 | |18 | |18 | |18 |18 |16 |20 | |9 | |9 | |11 |8 |12 |18 |15 | |11 | |11 | |14 |8 |17 |16 |16 | |16 | |12 | |8 |13 |19 |18 |11 | |9 | |12 | |14 |8 |13 |5 |2 |0 | | |
+Ch192 |18 | |18 | |18 | |18 |18 |15 |9 | |11 | |9 | |15 |14 |11 |19 |15 | |8 | |18 | |20 |20 |8 |9 |9 | |9 | |11 | |18 |13 |14 |20 |18 | |10 | |14 | |12 |13 |16 |0 |2 |0 | | |
+Ch196 |18 | |18 | |18 | |18 |18 |10 |11 | |19 | |13 | |12 |11 |10 |13 |11 | |19 | |10 | |16 |20 |15 |15 |8 | |14 | |8 | |18 |20 |15 |17 |17 | |14 | |12 | |12 |8 |16 |4 |3 |2 | | |
+Ch8 |18 | |18 | |18 | |18 |18 |18 |13 | |19 | |20 | |18 |10 |9 |8 |8 | |17 | |15 | |17 |9 |18 |19 |11 | |12 | |15 | |20 |12 |12 |13 |9 | |9 | |15 | |10 |11 |17 |4 |3 |3 | | |
+Ch12 |18 | |18 | |18 | |18 |18 |17 |20 | |14 | |10 | |10 |16 |15 |13 |11 | |15 | |16 | |17 |11 |15 |9 |18 | |8 | |20 | |19 |11 |9 |20 |8 | |18 | |8 | |8 |18 |18 |1 |3 |4 | | |
+Ch16 |18 | |18 | |18 | |18 |18 |10 |18 | |18 | |8 | |19 |8 |12 |19 |16 | |19 | |18 | |16 |19 |12 |18 |18 | |9 | |10 | |18 |20 |20 |20 |9 | |11 | |20 | |17 |14 |16 |2 |2 |2 | | |
+Ch36 |18 | |18 | |18 | |18 |18 |18 |19 | |8 | |11 | |16 |10 |9 |19 |11 | |19 | |9 | |8 |19 |8 |11 |17 | |20 | |14 | |9 |19 |19 |20 |13 | |12 | |19 | |13 |17 |9 |5 |1 |2 | | |
+Ch40 |18 | |18 | |18 | |18 |18 |13 |20 | |13 | |19 | |16 |11 |14 |17 |17 | |14 | |8 | |13 |8 |10 |20 |10 | |9 | |14 | |11 |14 |17 |9 |20 | |15 | |19 | |9 |8 |11 |3 |1 |1 | | |
+Ch44 |18 | |18 | |18 | |18 |18 |10 |14 | |19 | |20 | |17 |16 |12 |18 |8 | |17 | |18 | |15 |19 |14 |11 |13 | |14 | |12 | |16 |16 |19 |13 |14 | |19 | |14 | |20 |20 |11 |5 |1 |0 | | |
+Ch48 |18 | |18 | |18 | |18 |18 |8 |12 | |12 | |19 | |11 |8 |11 |20 |12 | |12 | |11 | |15 |16 |10 |12 |16 | |11 | |15 | |18 |19 |17 |16 |17 | |11 | |8 | |10 |16 |16 |5 |5 |0 | | |
+Ch52 |18 | |18 | |18 | |18 |18 |15 |12 | |15 | |20 | |9 |10 |10 |14 |8 | |20 | |10 | |16 |17 |18 |11 |16 | |17 | |10 | |17 |12 |13 |17 |17 | |13 | |18 | |18 |20 |13 |4 |3 |4 | | |
+Ch56 |18 | |18 | |18 | |18 |18 |13 |16 | |15 | |13 | |15 |20 |13 |14 |11 | |10 | |20 | |10 |8 |16 |12 |10 | |16 | |11 | |9 |11 |14 |17 |12 | |17 | |13 | |18 |10 |19 |0 |3 |3 | | |
+Ch60 |18 | |18 | |18 | |18 |18 |14 |11 | |8 | |20 | |13 |16 |13 |11 |20 | |9 | |17 | |16 |11 |8 |12 |17 | |15 | |8 | |16 |10 |20 |19 |15 | |13 | |9 | |17 |18 |11 |4 |1 |2 | | |
+Ch64 |18 | |18 | |18 | |18 |18 |13 |14 | |8 | |12 | |17 |8 |12 |18 |17 | |17 | |14 | |18 |8 |8 |20 |17 | |16 | |20 | |9 |15 |11 |10 |11 | |18 | |10 | |10 |15 |19 |2 |1 |4 | | |
+Ch68 |18 | |18 | |18 | |18 |18 |14 |19 | |17 | |9 | |18 |19 |20 |12 |14 | |8 | |14 | |20 |20 |18 |9 |18 | |11 | |19 | |19 |10 |11 |8 |18 | |9 | |8 | |16 |11 |8 |3 |3 |1 | | |
+Ch72 |18 | |18 | |18 | |18 |18 |19 |13 | |20 | |11 | |16 |9 |19 |20 |19 | |14 | |8 | |9 |17 |13 |19 |15 | |8 | |9 | |19 |14 |19 |15 |18 | |16 | |12 | |13 |15 |10 |4 |3 |1 | | |
+Ch76 |18 | |18 | |18 | |18 |18 |17 |13 | |16 | |20 | |16 |8 |9 |20 |11 | |17 | |11 | |8 |18 |9 |20 |9 | |17 | |16 | |11 |11 |11 |18 |10 | |13 | |W | |20 |17 |8 |1 |3 |3 | | |
+Ch80 |18 | |18 | |18 | |18 |18 |14 |20 | |13 | |13 | |17 |8 |10 |16 |8 | |9 | |19 | |16 |17 |17 |19 |15 | |9 | |13 | |16 |13 |14 |12 |9 | |20 | |20 | |14 |18 |18 |0 |4 |2 | | |
+Ch84 |18 | |18 | |18 | |18 |18 |11 |18 | |20 | |9 | |13 |14 |11 |16 |15 | |12 | |11 | |9 |19 |13 |11 |11 | |9 | |15 | |16 |18 |13 |12 |8 | |8 | |8 | |10 |12 |15 |3 |2 |5 | | |
+Ch88 |18 | |18 | |18 | |18 |18 |18 |19 | |9 | |17 | |15 |8 |19 |11 |11 | |14 | |9 | |14 |20 |20 |11 |11 | |15 | |12 | |14 |11 |8 |18 |15 | |19 | |18 | |12 |20 |16 |5 |5 |1 | | |
+Ch92 |18 | |18 | |18 | |18 |18 |11 |8 | |15 | |13 | |13 |13 |13 |16 |14 | |14 | |9 | |9 |15 |20 |11 |17 | |10 | |14 | |13 |17 |11 |8 |18 | |20 | |8 | |10 |19 |18 |1 |4 |4 | | |
+Ch96 |18 | |18 | |18 | |18 |18 |8 |12 | |16 | |9 | |13 |12 |9 |8 |11 | |8 | |8 | |19 |11 |15 |16 |8 | |11 | |16 | |18 |16 |9 |19 |9 | |10 | |15 | |19 |19 |15 |4 |2 |4 | | |
+Ch100 |18 | |18 | |18 | |18 |18 |18 |13 | |20 | |20 | |12 |9 |19 |10 |9 | |14 | |8 | |19 |10 |17 |9 |10 | |10 | |8 | |13 |12 |11 |20 |11 | |16 | |18 | |14 |16 |19 |1 |1 |2 | | |
+Ch104 |18 | |18 | |18 | |18 |18 |19 |12 | |20 | |14 | |16 |15 |9 |19 |11 | |15 | |11 | |12 |18 |15 |11 |15 | |19 | |10 | |14 |15 |19 |9 |13 | |19 | |13 | |11 |11 |17 |2 |2 |0 | | |
+Ch108 |18 | |18 | |18 | |18 |18 |18 |15 | |13 | |16 | |11 |19 |19 |18 |19 | |12 | |17 | |8 |9 |10 |8 |8 | |18 | |8 | |10 |11 |17 |15 |10 | |19 | |13 | |16 |10 |15 |0 |2 |3 | | |
+Ch112 |18 | |18 | |18 | |18 |18 |8 |13 | |9 | |17 | |9 |15 |17 |10 |19 | |9 | |19 | |11 |16 |14 |16 |8 | |18 | |13 | |16 |13 |17 |19 |11 | |8 | |8 | |18 |14 |17 |5 |2 |5 | | |
+Ch116 |18 | |18 | |18 | |18 |18 |8 |20 | |11 | |15 | |8 |11 |8 |18 |15 | |13 | |17 | |14 |13 |9 |8 |14 | |14 | |11 | |9 |19 |17 |11 |11 | |8 | |20 | |8 |10 |20 |5 |2 |1 | | |
+Ch120 |18 | |18 | |18 | |18 |18 |14 |20 | |8 | |20 | |14 |10 |10 |17 |12 | |16 | |20 | |10 |20 |17 |18 |9 | |15 | |14 | |17 |13 |14 |16 |8 | |18 | |10 | |15 |12 |12 |1 |5 |3 | | |
+Ch124 |18 | |18 | |18 | |18 |18 |20 |9 | |17 | |12 | |12 |8 |14 |8 |8 | |20 | |17 | |16 |20 |13 |14 |16 | |10 | |14 | |20 |15 |17 |8 |10 | |13 | |13 | |11 |13 |9 |5 |0 |5 | | |
+Ch128 |18 | |18 | |18 | |18 |18 |9 |19 | |9 | |14 | |8 |14 |11 |9 |14 | |16 | |15 | |14 |10 |15 |14 |14 | |20 | |10 | |16 |15 |11 |12 |13 | |13 | |13 | |12 |15 |20 |1 |4 |3 | | |
+Ch132 |18 | |18 | |18 | |18 |18 |20 |16 | |13 | |8 | |18 |11 |20 |12 |11 | |11 | |14 | |12 |13 |8 |12 |13 | |10 | |20 | |19 |12 |13 |14 |12 | |11 | |19 | |19 |20 |8 |3 |1 |4 | | |
+Ch136 |18 | |18 | |18 | |18 |18 |12 |12 | |19 | |10 | |20 |10 |8 |17 |8 | |12 | |10 | |10 |13 |13 |12 |8 | |11 | |18 | |14 |12 |17 |8 |14 | |14 | |9 | |11 |18 |14 |1 |2 |2 | | |
+Ch140 |18 | |18 | |18 | |18 |18 |12 |10 | |13 | |9 | |16 |8 |20 |10 |17 | |8 | |15 | |13 |20 |15 |10 |18 | |13 | |12 | |12 |16 |18 |12 |17 | |10 | |16 | |11 |15 |14 |3 |2 |5 | | |
+Ch144 |18 | |18 | |18 | |18 |18 |19 |9 | |15 | |8 | |13 |18 |17 |9 |19 | |16 | |11 | |20 |12 |15 |19 |10 | |17 | |15 | |17 |14 |9 |9 |13 | |17 | |16 | |10 |9 |10 |1 |5 |2 | | |
+Ch149 |18 | |18 | |18 | |18 |18 |15 |20 | |12 | |19 | |19 |19 |10 |10 |13 | |15 | |19 | |12 |19 |10 |14 |15 | |10 | |15 | |9 |8 |11 |15 |13 | |10 | |16 | |15 |18 |12 |5 |5 |2 | | |
+Ch153 |18 | |18 | |18 | |18 |18 |20 |17 | |8 | |19 | |16 |20 |13 |16 |18 | |14 | |11 | |10 |16 |16 |19 |15 | |13 | |17 | |19 |18 |19 |20 |8 | |18 | |9 | |17 |11 |11 |1 |2 |1 | | |
+Ch157 |18 | |18 | |18 | |18 |18 |13 |17 | |12 | |19 | |16 |8 |17 |11 |12 | |15 | |14 | |18 |11 |12 |9 |18 | |20 | |13 | |16 |13 |20 |17 |19 | |10 | |12 | |20 |18 |16 |5 |2 |3 | | |
+Ch161 |18 | |18 | |18 | |18 |18 |12 |12 | |16 | |12 | |15 |11 |18 |11 |13 | |17 | |19 | |11 |13 |13 |9 |15 | |10 | |10 | |19 |13 |20 |13 |9 | |8 | |8 | |20 |14 |12 |0 |4 |1 | | |
+Ch165 |18 | |18 | |18 | |18 |18 |13 |16 | |15 | |13 | |15 |8 |19 |15 |10 | |17 | |13 | |13 |19 |20 |8 |18 | |15 | |20 | |16 |9 |14 |11 |20 | |11 | |19 | |15 |16 |8 |1 |2 |0 | | |
+Ch169 |18 | |18 | |18 | |18 |18 |8 |17 | |17 | |13 | |16 |8 |14 |18 |11 | |8 | |18 | |20 |14 |8 |17 |8 | |13 | |18 | |19 |20 |19 |20 |17 | |13 | |20 | |9 |15 |18 |0 |3 |4 | | |
+Ch173 |18 | |18 | |18 | |18 |18 |14 |9 | |13 | |12 | |15 |14 |15 |10 |10 | |18 | |16 | |16 |8 |13 |16 |11 | |11 | |13 | |13 |15 |12 |20 |15 | |14 | |13 | |16 |11 |14 |3 |3 |4 | | |
+Ch177 |18 | |18 | |18 | |18 |18 |19 |18 | |16 | |10 | |20 |13 |11 |16 |12 | |16 | |18 | |18 |11 |18 |8 |13 | |14 | |11 | |18 |14 |16 |16 |19 | |16 | |13 | |15 |8 |13 |5 |0 |0 | | |
+Ch181 |18 | |18 | |18 | |18 |18 |20 |11 | |10 | |9 | |8 |9 |15 |15 |8 | |8 | |12 | |11 |9 |18 |20 |11 | |17 | |11 | |8 |15 |8 |18 |12 | |18 | |16 | |19 |9 |14 |4 |1 |4 | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e-sku.dat b/package/ramips/drivers/mt7615e/files/mt7615e-sku.dat
new file mode 100755
index 0000000..20b39c3
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e-sku.dat
@@ -0,0 +1,65 @@
+# Single SKU Max Power Table | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+# 2.4G Channel |CCK | | | |OFDM | | | | | | | |VHT20 | | | | | | | | | |VHT40 | | | | | | | | | |Txstream_Delta | | | | | | | | | | | | | | | | | | | | |
+Band: 2.4G |CCK_1M |CCK_2M |CCK_5.5M |CCK_11M |OFDM_6M |OFDM_9M |OFDM_12M |OFDM_18M |OFDM_24M |OFDM_36M |OFDM_48M |OFDM_54M |VHT20_MCS0 |VHT20_MCS1 |VHT20_MCS2 |VHT20_MCS3 |VHT20_MCS4 |VHT20_MCS5 |VHT20_MCS6 |VHT20_MCS7 |VHT20_MCS8 |VHT20_MCS9 |VHT40_MCS0 |VHT40_MCS1 |VHT40_MCS2 |VHT40_MCS3 |VHT40_MCS4 |VHT40_MCS5 |VHT40_MCS6 |VHT40_MCS7 |VHT40_MCS8 |VHT40_MCS9 |Txstream_3T |Txstream_2T |Txstream_1T | | | | | | | | | | | | | | | | | | |
+Ch1 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |20 |12 |18 |16 |8 | |8 | |8 | |9 |11 |12 |2 |1 |3 | | | | | | | | | | | | | | | | | | |
+Ch2 |8 | |8 | |8 | |8 | |8 | |8 |8 |15 |8 | |8 | |8 | |19 |19 |10 |12 |8 | |8 | |8 | |9 |16 |12 |5 |4 |0 | | | | | | | | | | | | | | | | | | |
+Ch3 |8 | |8 | |8 | |8 | |8 | |8 |8 |18 |8 | |8 | |8 | |17 |18 |16 |20 |8 | |8 | |8 | |12 |8 |20 |0 |2 |0 | | | | | | | | | | | | | | | | | | |
+Ch4 |8 | |8 | |8 | |8 | |8 | |8 |8 |9 |8 | |8 | |8 | |14 |10 |14 |18 |8 | |8 | |8 | |14 |12 |10 |3 |4 |5 | | | | | | | | | | | | | | | | | | |
+Ch5 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |10 |13 |11 |8 |8 | |8 | |8 | |12 |8 |9 |4 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch6 |8 | |8 | |8 | |8 | |8 | |8 |8 |13 |8 | |8 | |8 | |11 |9 |12 |16 |8 | |8 | |8 | |9 |17 |11 |5 |2 |1 | | | | | | | | | | | | | | | | | | |
+Ch7 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |14 |11 |13 |18 |8 | |8 | |8 | |16 |13 |10 |2 |5 |4 | | | | | | | | | | | | | | | | | | |
+Ch8 |8 | |8 | |8 | |8 | |8 | |8 |8 |15 |8 | |8 | |8 | |14 |9 |11 |10 |8 | |8 | |8 | |11 |14 |8 |5 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch9 |8 | |8 | |8 | |8 | |8 | |8 |8 |11 |8 | |8 | |8 | |12 |9 |15 |19 |8 | |8 | |8 | |14 |20 |12 |2 |5 |3 | | | | | | | | | | | | | | | | | | |
+Ch10 |8 | |8 | |8 | |8 | |8 | |8 |8 |14 |8 | |8 | |8 | |17 |14 |17 |15 |8 | |8 | |8 | |9 |17 |8 |2 |4 |2 | | | | | | | | | | | | | | | | | | |
+Ch11 |8 | |8 | |8 | |8 | |8 | |8 |8 |14 |8 | |8 | |8 | |20 |10 |20 |18 |8 | |8 | |8 | |12 |8 |20 |3 |1 |4 | | | | | | | | | | | | | | | | | | |
+Ch12 |8 | |8 | |8 | |8 | |8 | |8 |8 |18 |8 | |8 | |8 | |20 |16 |17 |9 |8 | |8 | |8 | |11 |20 |9 |0 |0 |1 | | | | | | | | | | | | | | | | | | |
+Ch13 |8 | |8 | |8 | |8 | |8 | |8 |8 |8 |8 | |8 | |8 | |11 |16 |19 |16 |8 | |8 | |8 | |15 |12 |12 |2 |0 |2 | | | | | | | | | | | | | | | | | | |
+Ch14 |8 | |8 | |8 | |8 | |8 | |8 |8 |10 |8 | |8 | |8 | |15 |17 |16 |14 |8 | |8 | |8 | |12 |14 |20 |4 |1 |5 | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+# 5G Channel |OFDM | | | | | | | |VHT20 | | | | | | | | | |VHT40 | | | | | | | | | |VHT80 | | | | | | | | | |VHT160 | | | | | | | | | |Txstream_Delta | | | | |
+Band: 5G |OFDM_6M |OFDM_9M |OFDM_12M |OFDM_18M |OFDM_24M |OFDM_36M |OFDM_48M |OFDM_54M |VHT20_MCS0 |VHT20_MCS1 |VHT20_MCS2 |VHT20_MCS3 |VHT20_MCS4 |VHT20_MCS5 |VHT20_MCS6 |VHT20_MCS7 |VHT20_MCS8 |VHT20_MCS9 |VHT40_MCS0 |VHT40_MCS1 |VHT40_MCS2 |VHT40_MCS3 |VHT40_MCS4 |VHT40_MCS5 |VHT40_MCS6 |VHT40_MCS7 |VHT40_MCS8 |VHT40_MCS9 |VHT80_MCS0 |VHT80_MCS1 |VHT80_MCS2 |VHT80_MCS3 |VHT80_MCS4 |VHT80_MCS5 |VHT80_MCS6 |VHT80_MCS7 |VHT80_MCS8 |VHT80_MCS9 |VHT160_MCS0 |VHT160_MCS1 |VHT160_MCS2 |VHT160_MCS3 |VHT160_MCS4 |VHT160_MCS5 |VHT160_MCS6 |VHT160_MCS7 |VHT160_MCS8 |VHT160_MCS9 |Txstream_3T |Txstream_2T |Txstream_1T | | |
+Ch184 |18 | |18 | |18 | |18 |18 |15 |18 | |12 | |13 | |11 |14 |16 |16 |12 | |12 | |13 | |20 |17 |16 |17 |18 | |9 | |16 | |17 |20 |18 |16 |19 | |15 | |9 | |17 |8 |17 |0 |4 |4 | | |
+Ch188 |18 | |18 | |18 | |18 |18 |16 |20 | |9 | |9 | |11 |8 |12 |18 |15 | |11 | |11 | |14 |8 |17 |16 |16 | |16 | |12 | |8 |13 |19 |18 |11 | |9 | |12 | |14 |8 |13 |5 |2 |0 | | |
+Ch192 |18 | |18 | |18 | |18 |18 |15 |9 | |11 | |9 | |15 |14 |11 |19 |15 | |8 | |18 | |20 |20 |8 |9 |9 | |9 | |11 | |18 |13 |14 |20 |18 | |10 | |14 | |12 |13 |16 |0 |2 |0 | | |
+Ch196 |18 | |18 | |18 | |18 |18 |10 |11 | |19 | |13 | |12 |11 |10 |13 |11 | |19 | |10 | |16 |20 |15 |15 |8 | |14 | |8 | |18 |20 |15 |17 |17 | |14 | |12 | |12 |8 |16 |4 |3 |2 | | |
+Ch8 |18 | |18 | |18 | |18 |18 |18 |13 | |19 | |20 | |18 |10 |9 |8 |8 | |17 | |15 | |17 |9 |18 |19 |11 | |12 | |15 | |20 |12 |12 |13 |9 | |9 | |15 | |10 |11 |17 |4 |3 |3 | | |
+Ch12 |18 | |18 | |18 | |18 |18 |17 |20 | |14 | |10 | |10 |16 |15 |13 |11 | |15 | |16 | |17 |11 |15 |9 |18 | |8 | |20 | |19 |11 |9 |20 |8 | |18 | |8 | |8 |18 |18 |1 |3 |4 | | |
+Ch16 |18 | |18 | |18 | |18 |18 |10 |18 | |18 | |8 | |19 |8 |12 |19 |16 | |19 | |18 | |16 |19 |12 |18 |18 | |9 | |10 | |18 |20 |20 |20 |9 | |11 | |20 | |17 |14 |16 |2 |2 |2 | | |
+Ch36 |18 | |18 | |18 | |18 |18 |18 |19 | |8 | |11 | |16 |10 |9 |19 |11 | |19 | |9 | |8 |19 |8 |11 |17 | |20 | |14 | |9 |19 |19 |20 |13 | |12 | |19 | |13 |17 |9 |5 |1 |2 | | |
+Ch40 |18 | |18 | |18 | |18 |18 |13 |20 | |13 | |19 | |16 |11 |14 |17 |17 | |14 | |8 | |13 |8 |10 |20 |10 | |9 | |14 | |11 |14 |17 |9 |20 | |15 | |19 | |9 |8 |11 |3 |1 |1 | | |
+Ch44 |18 | |18 | |18 | |18 |18 |10 |14 | |19 | |20 | |17 |16 |12 |18 |8 | |17 | |18 | |15 |19 |14 |11 |13 | |14 | |12 | |16 |16 |19 |13 |14 | |19 | |14 | |20 |20 |11 |5 |1 |0 | | |
+Ch48 |18 | |18 | |18 | |18 |18 |8 |12 | |12 | |19 | |11 |8 |11 |20 |12 | |12 | |11 | |15 |16 |10 |12 |16 | |11 | |15 | |18 |19 |17 |16 |17 | |11 | |8 | |10 |16 |16 |5 |5 |0 | | |
+Ch52 |18 | |18 | |18 | |18 |18 |15 |12 | |15 | |20 | |9 |10 |10 |14 |8 | |20 | |10 | |16 |17 |18 |11 |16 | |17 | |10 | |17 |12 |13 |17 |17 | |13 | |18 | |18 |20 |13 |4 |3 |4 | | |
+Ch56 |18 | |18 | |18 | |18 |18 |13 |16 | |15 | |13 | |15 |20 |13 |14 |11 | |10 | |20 | |10 |8 |16 |12 |10 | |16 | |11 | |9 |11 |14 |17 |12 | |17 | |13 | |18 |10 |19 |0 |3 |3 | | |
+Ch60 |18 | |18 | |18 | |18 |18 |14 |11 | |8 | |20 | |13 |16 |13 |11 |20 | |9 | |17 | |16 |11 |8 |12 |17 | |15 | |8 | |16 |10 |20 |19 |15 | |13 | |9 | |17 |18 |11 |4 |1 |2 | | |
+Ch64 |18 | |18 | |18 | |18 |18 |13 |14 | |8 | |12 | |17 |8 |12 |18 |17 | |17 | |14 | |18 |8 |8 |20 |17 | |16 | |20 | |9 |15 |11 |10 |11 | |18 | |10 | |10 |15 |19 |2 |1 |4 | | |
+Ch68 |18 | |18 | |18 | |18 |18 |14 |19 | |17 | |9 | |18 |19 |20 |12 |14 | |8 | |14 | |20 |20 |18 |9 |18 | |11 | |19 | |19 |10 |11 |8 |18 | |9 | |8 | |16 |11 |8 |3 |3 |1 | | |
+Ch72 |18 | |18 | |18 | |18 |18 |19 |13 | |20 | |11 | |16 |9 |19 |20 |19 | |14 | |8 | |9 |17 |13 |19 |15 | |8 | |9 | |19 |14 |19 |15 |18 | |16 | |12 | |13 |15 |10 |4 |3 |1 | | |
+Ch76 |18 | |18 | |18 | |18 |18 |17 |13 | |16 | |20 | |16 |8 |9 |20 |11 | |17 | |11 | |8 |18 |9 |20 |9 | |17 | |16 | |11 |11 |11 |18 |10 | |13 | |W | |20 |17 |8 |1 |3 |3 | | |
+Ch80 |18 | |18 | |18 | |18 |18 |14 |20 | |13 | |13 | |17 |8 |10 |16 |8 | |9 | |19 | |16 |17 |17 |19 |15 | |9 | |13 | |16 |13 |14 |12 |9 | |20 | |20 | |14 |18 |18 |0 |4 |2 | | |
+Ch84 |18 | |18 | |18 | |18 |18 |11 |18 | |20 | |9 | |13 |14 |11 |16 |15 | |12 | |11 | |9 |19 |13 |11 |11 | |9 | |15 | |16 |18 |13 |12 |8 | |8 | |8 | |10 |12 |15 |3 |2 |5 | | |
+Ch88 |18 | |18 | |18 | |18 |18 |18 |19 | |9 | |17 | |15 |8 |19 |11 |11 | |14 | |9 | |14 |20 |20 |11 |11 | |15 | |12 | |14 |11 |8 |18 |15 | |19 | |18 | |12 |20 |16 |5 |5 |1 | | |
+Ch92 |18 | |18 | |18 | |18 |18 |11 |8 | |15 | |13 | |13 |13 |13 |16 |14 | |14 | |9 | |9 |15 |20 |11 |17 | |10 | |14 | |13 |17 |11 |8 |18 | |20 | |8 | |10 |19 |18 |1 |4 |4 | | |
+Ch96 |18 | |18 | |18 | |18 |18 |8 |12 | |16 | |9 | |13 |12 |9 |8 |11 | |8 | |8 | |19 |11 |15 |16 |8 | |11 | |16 | |18 |16 |9 |19 |9 | |10 | |15 | |19 |19 |15 |4 |2 |4 | | |
+Ch100 |18 | |18 | |18 | |18 |18 |18 |13 | |20 | |20 | |12 |9 |19 |10 |9 | |14 | |8 | |19 |10 |17 |9 |10 | |10 | |8 | |13 |12 |11 |20 |11 | |16 | |18 | |14 |16 |19 |1 |1 |2 | | |
+Ch104 |18 | |18 | |18 | |18 |18 |19 |12 | |20 | |14 | |16 |15 |9 |19 |11 | |15 | |11 | |12 |18 |15 |11 |15 | |19 | |10 | |14 |15 |19 |9 |13 | |19 | |13 | |11 |11 |17 |2 |2 |0 | | |
+Ch108 |18 | |18 | |18 | |18 |18 |18 |15 | |13 | |16 | |11 |19 |19 |18 |19 | |12 | |17 | |8 |9 |10 |8 |8 | |18 | |8 | |10 |11 |17 |15 |10 | |19 | |13 | |16 |10 |15 |0 |2 |3 | | |
+Ch112 |18 | |18 | |18 | |18 |18 |8 |13 | |9 | |17 | |9 |15 |17 |10 |19 | |9 | |19 | |11 |16 |14 |16 |8 | |18 | |13 | |16 |13 |17 |19 |11 | |8 | |8 | |18 |14 |17 |5 |2 |5 | | |
+Ch116 |18 | |18 | |18 | |18 |18 |8 |20 | |11 | |15 | |8 |11 |8 |18 |15 | |13 | |17 | |14 |13 |9 |8 |14 | |14 | |11 | |9 |19 |17 |11 |11 | |8 | |20 | |8 |10 |20 |5 |2 |1 | | |
+Ch120 |18 | |18 | |18 | |18 |18 |14 |20 | |8 | |20 | |14 |10 |10 |17 |12 | |16 | |20 | |10 |20 |17 |18 |9 | |15 | |14 | |17 |13 |14 |16 |8 | |18 | |10 | |15 |12 |12 |1 |5 |3 | | |
+Ch124 |18 | |18 | |18 | |18 |18 |20 |9 | |17 | |12 | |12 |8 |14 |8 |8 | |20 | |17 | |16 |20 |13 |14 |16 | |10 | |14 | |20 |15 |17 |8 |10 | |13 | |13 | |11 |13 |9 |5 |0 |5 | | |
+Ch128 |18 | |18 | |18 | |18 |18 |9 |19 | |9 | |14 | |8 |14 |11 |9 |14 | |16 | |15 | |14 |10 |15 |14 |14 | |20 | |10 | |16 |15 |11 |12 |13 | |13 | |13 | |12 |15 |20 |1 |4 |3 | | |
+Ch132 |18 | |18 | |18 | |18 |18 |20 |16 | |13 | |8 | |18 |11 |20 |12 |11 | |11 | |14 | |12 |13 |8 |12 |13 | |10 | |20 | |19 |12 |13 |14 |12 | |11 | |19 | |19 |20 |8 |3 |1 |4 | | |
+Ch136 |18 | |18 | |18 | |18 |18 |12 |12 | |19 | |10 | |20 |10 |8 |17 |8 | |12 | |10 | |10 |13 |13 |12 |8 | |11 | |18 | |14 |12 |17 |8 |14 | |14 | |9 | |11 |18 |14 |1 |2 |2 | | |
+Ch140 |18 | |18 | |18 | |18 |18 |12 |10 | |13 | |9 | |16 |8 |20 |10 |17 | |8 | |15 | |13 |20 |15 |10 |18 | |13 | |12 | |12 |16 |18 |12 |17 | |10 | |16 | |11 |15 |14 |3 |2 |5 | | |
+Ch144 |18 | |18 | |18 | |18 |18 |19 |9 | |15 | |8 | |13 |18 |17 |9 |19 | |16 | |11 | |20 |12 |15 |19 |10 | |17 | |15 | |17 |14 |9 |9 |13 | |17 | |16 | |10 |9 |10 |1 |5 |2 | | |
+Ch149 |18 | |18 | |18 | |18 |18 |15 |20 | |12 | |19 | |19 |19 |10 |10 |13 | |15 | |19 | |12 |19 |10 |14 |15 | |10 | |15 | |9 |8 |11 |15 |13 | |10 | |16 | |15 |18 |12 |5 |5 |2 | | |
+Ch153 |18 | |18 | |18 | |18 |18 |20 |17 | |8 | |19 | |16 |20 |13 |16 |18 | |14 | |11 | |10 |16 |16 |19 |15 | |13 | |17 | |19 |18 |19 |20 |8 | |18 | |9 | |17 |11 |11 |1 |2 |1 | | |
+Ch157 |18 | |18 | |18 | |18 |18 |13 |17 | |12 | |19 | |16 |8 |17 |11 |12 | |15 | |14 | |18 |11 |12 |9 |18 | |20 | |13 | |16 |13 |20 |17 |19 | |10 | |12 | |20 |18 |16 |5 |2 |3 | | |
+Ch161 |18 | |18 | |18 | |18 |18 |12 |12 | |16 | |12 | |15 |11 |18 |11 |13 | |17 | |19 | |11 |13 |13 |9 |15 | |10 | |10 | |19 |13 |20 |13 |9 | |8 | |8 | |20 |14 |12 |0 |4 |1 | | |
+Ch165 |18 | |18 | |18 | |18 |18 |13 |16 | |15 | |13 | |15 |8 |19 |15 |10 | |17 | |13 | |13 |19 |20 |8 |18 | |15 | |20 | |16 |9 |14 |11 |20 | |11 | |19 | |15 |16 |8 |1 |2 |0 | | |
+Ch169 |18 | |18 | |18 | |18 |18 |8 |17 | |17 | |13 | |16 |8 |14 |18 |11 | |8 | |18 | |20 |14 |8 |17 |8 | |13 | |18 | |19 |20 |19 |20 |17 | |13 | |20 | |9 |15 |18 |0 |3 |4 | | |
+Ch173 |18 | |18 | |18 | |18 |18 |14 |9 | |13 | |12 | |15 |14 |15 |10 |10 | |18 | |16 | |16 |8 |13 |16 |11 | |11 | |13 | |13 |15 |12 |20 |15 | |14 | |13 | |16 |11 |14 |3 |3 |4 | | |
+Ch177 |18 | |18 | |18 | |18 |18 |19 |18 | |16 | |10 | |20 |13 |11 |16 |12 | |16 | |18 | |18 |11 |18 |8 |13 | |14 | |11 | |18 |14 |16 |16 |19 | |16 | |13 | |15 |8 |13 |5 |0 |0 | | |
+Ch181 |18 | |18 | |18 | |18 |18 |20 |11 | |10 | |9 | |8 |9 |15 |15 |8 | |8 | |12 | |11 |9 |18 |20 |11 | |17 | |11 | |8 |15 |8 |18 |12 | |18 | |16 | |19 |9 |14 |4 |1 |4 | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.1.2G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.1.2G.dat
new file mode 100755
index 0000000..c707520
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.1.2G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=US
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=
+SSID1=MT7615E.1.2G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=9
+FixedTxMode=HT
+EthConvertMode=dongle
+TxRate=0
+Channel=6
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=1
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=1
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+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=1
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=0
+DfsApplyStopWifi=0
+DfsZeroWait=0
+DfsZeroWaitCacTime=255
+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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK=
+WPAPSK1=12345678
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=1
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=1
+HT_BSSCoexistence=0
+HT_LDPC=1
+VHT_BW=0
+VHT_Sec80_Channel=0
+VHT_STBC=0
+VHT_SGI=0
+VHT_BW_SIGNAL=0
+VHT_LDPC=0
+G_BAND_256QAM=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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+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_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=9
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=2
+BgndScanSkipCh=
+EDCCAEnable=1
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.1.5G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.1.5G.dat
new file mode 100755
index 0000000..a72307e
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.1.5G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=US
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=TVWS
+SSID1=MT7615E.1.5G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=15
+FixedTxMode=HT
+EthConvertMode=
+TxRate=0
+Channel=157
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=1
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=1
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+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=1
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=1
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=1
+DfsApplyStopWifi=0
+DfsZeroWait=1
+DfsZeroWaitCacTime=255
+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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK=
+WPAPSK1=
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=1
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=1
+HT_BSSCoexistence=1
+HT_LDPC=1
+VHT_BW=1
+VHT_Sec80_Channel=0
+VHT_STBC=1
+VHT_SGI=1
+VHT_BW_SIGNAL=0
+VHT_LDPC=1
+G_BAND_256QAM=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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+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_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=15
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=
+BgndScanSkipCh=
+EDCCAEnable=0
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.2.2G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.2.2G.dat
new file mode 100755
index 0000000..80f7a07
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.2.2G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=
+SSID1=MT7615E.2.2G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=9
+FixedTxMode=HT
+EthConvertMode=dongle
+TxRate=0
+Channel=6
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=1
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+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=1
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=0
+DfsApplyStopWifi=0
+DfsZeroWait=0
+DfsZeroWaitCacTime=255
+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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK=
+WPAPSK1=12345678
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=1
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=1
+HT_BSSCoexistence=0
+HT_LDPC=1
+VHT_BW=0
+VHT_Sec80_Channel=0
+VHT_STBC=0
+VHT_SGI=0
+VHT_BW_SIGNAL=0
+VHT_LDPC=0
+G_BAND_256QAM=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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+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_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=9
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=2
+BgndScanSkipCh=
+EDCCAEnable=1
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.2.5G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.2.5G.dat
new file mode 100755
index 0000000..9e96606
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.2.5G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=TVWS
+SSID1=MT7615E.2.5G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=15
+FixedTxMode=HT
+EthConvertMode=
+TxRate=0
+Channel=157
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=0
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+PktAggregate=1
+AutoProvisionEn=0
+FreqDelta=0
+TurboRate=0
+WmmCapable=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
+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
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=10
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=0
+DfsApplyStopWifi=0
+DfsZeroWait=0
+DfsZeroWaitCacTime=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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=0
+PMKCachePeriod=10
+MeshAutoLink=1
+MeshAuthMode=OPEN
+MeshEncrypType=NONE
+MeshDefaultkey=1
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=MESH
+WPAPSK=
+WPAPSK1=
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=0
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=0
+HT_DisallowTKIP=0
+HT_BSSCoexistence=1
+HT_LDPC=1
+VHT_BW=1
+VHT_Sec80_Channel=0
+VHT_STBC=1
+VHT_SGI=1
+VHT_BW_SIGNAL=0
+VHT_LDPC=1
+G_BAND_256QAM=0
+WscConfMode=
+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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+WdsEnable=0
+WdsPhyMode=
+WdsEncrypType=NONE
+WdsList=
+Wds0Key=
+Wds1Key=
+Wds2Key=
+Wds3Key=
+RADIUS_Server=192.168.2.3
+RADIUS_Port=1812
+RADIUS_Key1=
+RADIUS_Key2=
+RADIUS_Key3=
+RADIUS_Key4=
+RADIUS_Key5=
+RADIUS_Key6=
+RADIUS_Key7=
+RADIUS_Key8=
+RADIUS_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=0
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=15
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=
+BgndScanSkipCh=
+EDCCAEnable=0
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.3.2G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.3.2G.dat
new file mode 100755
index 0000000..04a3852
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.3.2G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=
+SSID1=MT7615E.3.2G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=9
+FixedTxMode=HT
+EthConvertMode=dongle
+TxRate=0
+Channel=6
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=1
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+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=1
+CarrierDetect=0
+ITxBfEn=0
+PreAntSwitch=
+PhyRateLimit=0
+DebugFlags=0
+ETxBfEnCond=0
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=6
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=0
+DfsApplyStopWifi=0
+DfsZeroWait=0
+DfsZeroWaitCacTime=255
+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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=3600
+PMKCachePeriod=10
+MeshAutoLink=0
+MeshAuthMode=
+MeshEncrypType=
+MeshDefaultkey=0
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=
+WPAPSK=
+WPAPSK1=12345678
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=1
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=1
+HT_DisallowTKIP=1
+HT_BSSCoexistence=0
+HT_LDPC=1
+VHT_BW=0
+VHT_Sec80_Channel=0
+VHT_STBC=0
+VHT_SGI=0
+VHT_BW_SIGNAL=0
+VHT_LDPC=0
+G_BAND_256QAM=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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+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_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=1813
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=9
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=2
+BgndScanSkipCh=
+EDCCAEnable=1
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.3.5G.dat b/package/ramips/drivers/mt7615e/files/mt7615e.3.5G.dat
new file mode 100755
index 0000000..a405b1a
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.3.5G.dat
@@ -0,0 +1,432 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=
+AutoChannelSkipList=
+DBDC_MODE=1
+IcapMode=0
+BssidNum=1
+SSID=TVWS
+SSID1=MT7615E.3.5G
+SSID2=
+SSID3=
+SSID4=
+SSID5=
+SSID6=
+SSID7=
+SSID8=
+SSID9=
+SSID10=
+SSID11=
+SSID12=
+SSID13=
+SSID14=
+SSID15=
+SSID16=
+RRMEnable=0
+FtSupport=0
+ChannelGrp=
+WirelessMode=15
+FixedTxMode=HT
+EthConvertMode=
+TxRate=0
+Channel=157
+BasicRate=15
+BeaconPeriod=100
+DtimPeriod=1
+TxPower=100
+LinkTestSupport=0
+ThermalRecal=0
+SKUenable=0
+PERCENTAGEenable=0
+BFBACKOFFenable=0
+CalCacheApply=0
+DisableOLBC=0
+BGProtection=0
+TxAntenna=
+RxAntenna=
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+PktAggregate=1
+AutoProvisionEn=0
+FreqDelta=0
+TurboRate=0
+WmmCapable=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
+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
+MUTxRxEnable=0
+ITxBfTimeout=0
+ETxBfTimeout=0
+ETxBfNoncompress=0
+ETxBfIncapable=0
+FineAGC=0
+StreamMode=0
+StreamModeMac0=
+StreamModeMac1=
+StreamModeMac2=
+StreamModeMac3=
+CSPeriod=10
+RDRegion=
+StationKeepAlive=0
+DfsCalibration=0
+DfsEnable=0
+DfsApplyStopWifi=0
+DfsZeroWait=0
+DfsZeroWaitCacTime=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=
+WapiPsk9=
+WapiPsk10=
+WapiPsk11=
+WapiPsk12=
+WapiPsk13=
+WapiPsk14=
+WapiPsk15=
+WapiPsk16=
+WapiPskType=
+Wapiifname=
+WapiAsCertPath=
+WapiUserCertPath=
+WapiAsIpAddr=
+WapiAsPort=
+RekeyMethod=DISABLE
+RekeyInterval=0
+PMKCachePeriod=10
+MeshAutoLink=1
+MeshAuthMode=OPEN
+MeshEncrypType=NONE
+MeshDefaultkey=1
+MeshWEPKEY=
+MeshWPAKEY=
+MeshId=MESH
+WPAPSK=
+WPAPSK1=
+WPAPSK2=
+WPAPSK3=
+WPAPSK4=
+WPAPSK5=
+WPAPSK6=
+WPAPSK7=
+WPAPSK8=
+WPAPSK9=
+WPAPSK10=
+WPAPSK11=
+WPAPSK12=
+WPAPSK13=
+WPAPSK14=
+WPAPSK15=
+WPAPSK16=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key1Str1=
+Key1Str2=
+Key1Str3=
+Key1Str4=
+Key1Str5=
+Key1Str6=
+Key1Str7=
+Key1Str8=
+Key1Str9=
+Key1Str10=
+Key1Str11=
+Key1Str12=
+Key1Str13=
+Key1Str14=
+Key1Str15=
+Key1Str16=
+Key2Type=0
+Key2Str=
+Key2Str1=
+Key2Str2=
+Key2Str3=
+Key2Str4=
+Key2Str5=
+Key2Str6=
+Key2Str7=
+Key2Str8=
+Key2Str9=
+Key2Str10=
+Key2Str11=
+Key2Str12=
+Key2Str13=
+Key2Str14=
+Key2Str15=
+Key2Str16=
+Key3Type=0
+Key3Str=
+Key3Str1=
+Key3Str2=
+Key3Str3=
+Key3Str4=
+Key3Str5=
+Key3Str6=
+Key3Str7=
+Key3Str8=
+Key3Str9=
+Key3Str10=
+Key3Str11=
+Key3Str12=
+Key3Str13=
+Key3Str14=
+Key3Str15=
+Key3Str16=
+Key4Type=0
+Key4Str=
+Key4Str1=
+Key4Str2=
+Key4Str3=
+Key4Str4=
+Key4Str5=
+Key4Str6=
+Key4Str7=
+Key4Str8=
+Key4Str9=
+Key4Str10=
+Key4Str11=
+Key4Str12=
+Key4Str13=
+Key4Str14=
+Key4Str15=
+Key4Str16=
+HSCounter=0
+HT_HTC=0
+HT_RDG=1
+HT_LinkAdapt=0
+HT_OpMode=0
+HT_MpduDensity=5
+HT_EXTCHA=1
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=1
+HT_BAWinSize=64
+HT_GI=1
+HT_STBC=1
+HT_MCS=33
+HT_TxStream=2
+HT_RxStream=2
+HT_PROTECT=0
+HT_DisallowTKIP=0
+HT_BSSCoexistence=1
+HT_LDPC=1
+VHT_BW=1
+VHT_Sec80_Channel=0
+VHT_STBC=1
+VHT_SGI=1
+VHT_BW_SIGNAL=0
+VHT_LDPC=1
+G_BAND_256QAM=0
+WscConfMode=
+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=
+AccessPolicy8=0
+AccessControlList8=
+AccessPolicy9=0
+AccessControlList9=
+AccessPolicy10=0
+AccessControlList10=
+AccessPolicy11=0
+AccessControlList11=
+AccessPolicy12=0
+AccessControlList12=
+AccessPolicy13=0
+AccessControlList13=
+AccessPolicy14=0
+AccessControlList14=
+AccessPolicy15=0
+AccessControlList15=
+WdsEnable=0
+WdsPhyMode=
+WdsEncrypType=NONE
+WdsList=
+Wds0Key=
+Wds1Key=
+Wds2Key=
+Wds3Key=
+RADIUS_Server=192.168.2.3
+RADIUS_Port=1812
+RADIUS_Key1=
+RADIUS_Key2=
+RADIUS_Key3=
+RADIUS_Key4=
+RADIUS_Key5=
+RADIUS_Key6=
+RADIUS_Key7=
+RADIUS_Key8=
+RADIUS_Key9=
+RADIUS_Key10=
+RADIUS_Key11=
+RADIUS_Key12=
+RADIUS_Key13=
+RADIUS_Key14=
+RADIUS_Key15=
+RADIUS_Key16=
+RADIUS_Acct_Server=
+RADIUS_Acct_Port=0
+RADIUS_Acct_Key=
+own_ip_addr=10.10.10.254
+Ethifname=
+EAPifname=br0
+PreAuthifname=br0
+session_timeout_interval=0
+idle_timeout_interval=0
+WiFiTest=0
+TGnWifiTest=0
+ApCliEnable=
+ApCliSsid=
+ApCliBssid=
+ApCliAuthMode=
+ApCliEncrypType=
+ApCliWPAPSK=
+ApCliDefaultKeyID=
+ApCliKey1Type=
+ApCliKey1Str=
+ApCliKey2Type=
+ApCliKey2Str=
+ApCliKey3Type=
+ApCliKey3Str=
+ApCliKey4Type=
+ApCliKey4Str=
+MACRepeaterEn=
+MACRepeaterOuiMode=2
+ApCliWirelessMode=15
+ApCliWPAPSK1=
+ApCliKey1Str1=
+ApCliKey2Str1=
+ApCliKey3Str1=
+ApCliKey4Str1=
+EfuseBufferMode=0
+E2pAccessMode=2
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+RadioOn=1
+BW_Enable=0
+BW_Root=0
+BW_Priority=
+BW_Guarantee_Rate=
+BW_Maximum_Rate=
+VOW_BW_Ctrl=
+VOW_Airtime_Fairness_En=1
+VOW_RX_En=
+VOW_Refill_Period=
+VOW_Sta_VO_DWRR_Quantum=
+VOW_Sta_VI_DWRR_Quantum=
+VOW_Sta_BE_DWRR_Quantum=
+VOW_Sta_BK_DWRR_Quantum=
+VOW_WMM_Search_Rule_Band0=
+VOW_WMM_Search_Rule_Band1=
+VOW_Sta_DWRR_Max_Wait_Time=
+VOW_Group_DWRR_Max_Wait_Time=
+VOW_Group_Min_Rate=
+VOW_Group_Max_Rate=
+VOW_Group_Min_Ratio=
+VOW_Group_Max_Ratio=
+VOW_Airtime_Ctrl_En=
+VOW_Rate_Ctrl_En=
+VOW_Group_Min_Rate_Bucket_Size=
+VOW_Group_Max_Rate_Bucket_Size=
+VOW_Group_Min_Airtime_Bucket_Size=
+VOW_Group_Max_Airtime_Bucket_Size=
+VOW_Group_Backlog=
+VOW_Group_Max_Wait_Time=
+VOW_Group_DWRR_Quantum=
+VOW_WATF_Enable=
+VOW_WATF_Q_LV0=
+VOW_WATF_Q_LV1=
+VOW_WATF_Q_LV2=
+VOW_WATF_Q_LV3=
+VOW_WATF_MAC_LV0=
+VOW_WATF_MAC_LV1=
+VOW_WATF_MAC_LV2=
+VOW_WATF_MAC_LV3=
+RED_Enable=1
+CP_SUPPORT=
+BgndScanSkipCh=
+EDCCAEnable=0
+BandSteering=0
+BndStrgBssIdx=
+RadioLinkSelection=0
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.eeprom.bin b/package/ramips/drivers/mt7615e/files/mt7615e.eeprom.bin
new file mode 100755
index 0000000..3255685
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.eeprom.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.inc b/package/ramips/drivers/mt7615e/files/mt7615e.inc
new file mode 100755
index 0000000..783191d
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.inc
@@ -0,0 +1,45 @@
+#!/bin/sh
+# this file will be included into mt7615e2.sh and mt7615e5.sh
+
+disable_mt7615e() {
+ cd /sys/class/net/
+
+ # disable apcli interfaces
+ for vif in apcli*; do
+ ifconfig $vif down;
+ done
+ # disable ap interfaces
+ for vif in ra*; do
+ ifconfig $vif down;
+ ubus call network.interface.lan remove_device "{\"name\":\"$vif\"}"
+ done
+
+ cd -
+}
+
+
+enable_mt7615e() {
+ cd /sys/class/net/
+ uci2dat -d mt7615e2 -f /etc/wireless/mt7615e/mt7615e.1.2G.dat > /tmp/uci2dat.log
+ uci2dat -d mt7615e5 -f /etc/wireless/mt7615e/mt7615e.1.5G.dat >> /tmp/uci2dat.log
+
+ ifconfig ra0 up # ra0 is the root vif
+
+ # enable ap interfaces
+ for vif in ra*; do
+ ifconfig $vif up;
+ ubus call network.interface.lan add_device "{\"name\":\"$vif\"}"
+ local tmp=$(brctl show | grep $vif)
+ if [ x"$tmp" == x"" ]
+ then
+ echo "add $vif to br-lan" >> /tmp/wifi.log
+ brctl addif br-lan $vif
+ fi
+ done
+
+ # enable apcli interfaces
+ for vif in apcli*; do
+ ifconfig $vif up;
+ done
+ cd -
+} \ No newline at end of file
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e2.sh b/package/ramips/drivers/mt7615e/files/mt7615e2.sh
new file mode 100755
index 0000000..e440893
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e2.sh
@@ -0,0 +1,116 @@
+#!/bin/sh
+append DRIVERS "mt7615e2"
+
+. /lib/wifi/mt7615e.inc
+
+# Hua Shao : This script assumes that:
+# 1. 7615 is the only wifi device.
+# 2. DBDC=1
+# 3. MULTI_PROFILE=1
+# 4. DEFAULT_5G=1, which means ra0/rai0/rae0 -> 5G, rax0/ray0/raz0 -> 2G
+# If your product is not exactly the same as above, then some minor fixes are necessary.
+
+prepare_mt7615e2() {
+ #prepare_ralink_wifi mt7615e
+ :
+}
+
+scan_mt7615e2() {
+ #scan_ralink_wifi mt7615e mt7615e
+ :
+}
+
+disable_mt7615e2() {
+ # unregister hwnat hook.
+ iwpriv rax0 set hw_nat_register=0 2>/dev/null || true
+
+ [ x"$2" == x"" ] && {
+ disable_mt7615e
+ return
+ }
+
+ cd /sys/class/net/
+ for vif in apcli*; do
+ if echo "$vif" | grep -q -e "apcli[xyz]" ; then
+ ifconfig $vif down;
+ fi
+ done
+ for vif in ra*; do
+ if echo "$vif" | grep -q -e "ra[xyz]" ; then
+ ifconfig $vif down;
+ ubus call network.interface.lan remove_device "{\"name\":\"$vif\"}"
+ fi
+ done
+}
+
+enable_mt7615e2() {
+
+ [ x"$2" == x"" ] && {
+ enable_mt7615e
+ return
+ }
+
+ [ -f /tmp/mtk/wifi/.mt7615e.1.2g.need_reload ] && {
+ cd /sys/class/net/
+ for vif in apcli*; do
+ ifconfig $vif down;
+ done
+ for vif in ra*; do
+ ifconfig $vif down;
+ done
+ rmmod mt7615e
+ modprobe mt7615e
+ }
+
+ uci2dat -d mt7615e2 -f /etc/wireless/mt7615e/mt7615e.1.2G.dat > /tmp/uci2dat.log
+ ifconfig ra0 up # ra0 is the root vif
+ cd /sys/class/net/
+ for vif in ra*; do
+ if echo "$vif" | grep -q -e "ra[xyz]" ; then
+ ifconfig $vif up;
+ ubus call network.interface.lan add_device "{\"name\":\"$vif\"}"
+
+ local tmp=$(brctl show | grep $vif)
+ if [ x"$tmp" == x"" ]
+ then
+ echo "add $vif to br-lan" >> /tmp/wifi.log
+ brctl addif br-lan $vif
+ fi
+ fi
+ done
+ for vif in apcli*; do
+ if echo "$vif" | grep -q -e "apcli[xyz]" ; then
+ ifconfig $vif up;
+ fi
+ done
+
+ # register hwnat hook.
+ iwpriv rax0 set hw_nat_register=1
+}
+
+detect_mt7615e2() {
+ ssid2g=mt7615e-2g-`ifconfig eth0 | grep HWaddr | cut -c 51- | sed 's/://g'`
+ [ -e /etc/config/wireless ] && return
+ cat <<EOF
+config wifi-device mt7615e2
+ option type mt7615e2
+ option vendor ralink
+ option band 2.4g
+ option channel 0
+ option autoch 2
+ option g256qam 1
+ option e2paccmode 2
+
+config wifi-iface
+ option device mt7615e2
+ option ifname rax0
+ option network lan
+ option mode ap
+ option ssid $ssid2g
+ option encryption psk2
+ option key 12345678
+
+EOF
+}
+
+
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e5.sh b/package/ramips/drivers/mt7615e/files/mt7615e5.sh
new file mode 100755
index 0000000..9822ad2
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e5.sh
@@ -0,0 +1,117 @@
+#!/bin/sh
+append DRIVERS "mt7615e5"
+
+. /lib/wifi/mt7615e.inc
+
+# Hua Shao : This script assumes that:
+# 1. 7615 is the only wifi device.
+# 2. DBDC=1
+# 3. MULTI_PROFILE=1
+# 4. DEFAULT_5G=1, which means ra0/rai0/rae0 -> 5G, rax0/ray0/raz0 -> 2G
+# If your product is not exactly the same as above, then some minor fixes are necessary.
+
+prepare_mt7615e5() {
+ #prepare_ralink_wifi mt7615e
+ :
+}
+
+scan_mt7615e5() {
+ #scan_ralink_wifi mt7615e mt7615e
+ :
+}
+
+disable_mt7615e5() {
+ # unregister hwnat hook.
+ iwpriv ra0 set hw_nat_register=0 2>/dev/null || true
+
+ [ x"$2" == x"" ] && {
+ # let mt7615e2 do the work
+ return
+ }
+
+ cd /sys/class/net/
+ for vif in apcli*; do
+ if echo "$vif" | grep -q -e "apcli[0-9ie]" ; then
+ ifconfig $vif down;
+ fi
+ done
+ for vif in ra*; do
+ if echo "$vif" | grep -q -e "ra[0-9ie]" ; then
+ ifconfig $vif down;
+ ubus call network.interface.lan remove_device "{\"name\":\"$vif\"}"
+ fi
+ done
+}
+
+enable_mt7615e5() {
+
+ [ x"$2" == x"" ] && {
+ # let mt7615e2 do the work
+ return
+ }
+
+ [ -f /tmp/mtk/wifi/.mt7615e.1.2g.need_reload ] && {
+ cd /sys/class/net/
+ for vif in apcli*; do
+ ifconfig $vif down;
+ done
+ for vif in ra*; do
+ ifconfig $vif down;
+ done
+ rmmod mt7615e
+ modprobe mt7615e
+ }
+
+ uci2dat -d mt7615e5 -f /etc/wireless/mt7615e/mt7615e.1.5G.dat > /tmp/uci2dat.log
+ ifconfig ra0 up # ra0 is the root vif
+
+ cd /sys/class/net/
+ for vif in ra*; do
+ if echo "$vif" | grep -q -e "ra[0-9ie]" ; then
+ ifconfig $vif up;
+ ubus call network.interface.lan add_device "{\"name\":\"$vif\"}"
+
+ local tmp=$(brctl show | grep $vif)
+ if [ x"$tmp" == x"" ]
+ then
+ echo "add $vif to br-lan" >> /tmp/wifi.log
+ brctl addif br-lan $vif
+ fi
+ fi
+ done
+ for vif in apcli*; do
+ if echo "$vif" | grep -q -e "apcli[0-9ie]" ; then
+ ifconfig $vif up;
+ fi
+ done
+
+ # register hwnat hook.
+ iwpriv ra0 set hw_nat_register=1 2>/dev/null || true
+}
+
+detect_mt7615e5() {
+ ssid5g=mt7615e-5g-`ifconfig eth0 | grep HWaddr | cut -c 51- | sed 's/://g'`
+ [ -e /etc/config/wireless ] && return
+ cat <<EOF
+config wifi-device mt7615e5
+ option type mt7615e5
+ option vendor ralink
+ option band 5g
+ option channel 0
+ option autoch 2
+ option g256qam 1
+ option e2paccmode 2
+
+config wifi-iface
+ option device mt7615e5
+ option ifname ra0
+ option network lan
+ option mode ap
+ option ssid $ssid5g
+ option encryption psk2
+ option key 12345678
+
+EOF
+}
+
+
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];
diff --git a/package/ramips/drivers/mt7628/Makefile b/package/ramips/drivers/mt7628/Makefile
new file mode 100755
index 0000000..99b5978
--- /dev/null
+++ b/package/ramips/drivers/mt7628/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:=mt7628
+P4REV:=120395
+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_MT7628 \
+ MT_WIFI MT_WIFI_PATH FIRST_IF_EEPROM_PROM FIRST_IF_EEPROM_EFUSE \
+ FIRST_IF_EEPROM_FLASH RT_FIRST_CARD_EEPROM RT_SECOND_CARD_EEPROM \
+ MULTI_INF_SUPPORT WIFI_BASIC_FUNC WSC_INCLUDED WSC_V2_SUPPORT \
+ DOT11N_DRAFT3 DOT11W_PMF_SUPPORT LLTD_SUPPORT QOS_DLS_SUPPORT \
+ WAPI_SUPPORT IGMP_SNOOP_SUPPORT BLOCK_NET_IF RATE_ADAPTION \
+ NEW_RATE_ADAPT_SUPPORT AGS_SUPPORT IDS_SUPPORT WIFI_WORKQUEUE \
+ WIFI_SKB_RECYCLE LED_CONTROL_SUPPORT ATE_SUPPORT MEMORY_OPTIMIZATION \
+ UAPSD RLT_MAC RLT_BBP RLT_RF RTMP_MAC RTMP_BBP RTMP_RF RTMP_PCI_SUPPORT \
+ RTMP_USB_SUPPORT RTMP_RBUS_SUPPORT WIFI_MODE_AP WIFI_MODE_STA \
+ WIFI_MODE_BOTH MT_AP_SUPPORT WDS_SUPPORT MBSS_SUPPORT \
+ NEW_MBSSID_MODE ENHANCE_NEW_MBSSID_MODE APCLI_SUPPORT \
+ MAC_REPEATER_SUPPORT CON_WPS_SUPPORT LLTD_SUPPORT COC_SUPPORT MT_MAC SNIFFER_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/mt7628
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7628 wifi AP driver
+ FILES:=$(PKG_BUILD_DIR)/build/mt7628.ko
+ DEPENDS:=@TARGET_ramips_mt7628
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt7628/config
+ source "$(SOURCE)/config.in"
+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_MT7628_$c),CONFIG_$(c)=$(CONFIG_MT7628_$(c))))\
+ modules
+endef
+
+define P4/Info
+ P4URL:=//Jedi/MP/jedi.MT7628.MP/wifi_driver/
+endef
+
+define P4/Release
+ make -C embedded release CHIPSET=mt7628 MODE=AP RELEASE=DPA
+ mkdir -p build
+ cp embedded/mt_wifi_ap/Makefile build/Makefile
+ cp embedded/mt_wifi_ap/Kconfig build/Kconfig
+ mv embedded/DPA src
+ tar cjf mt7628.tar.bz2 build src
+endef
+
+define KernelPackage/mt7628/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7628.sh $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7628/
+ $(INSTALL_BIN) ./files/mt7628.dat $(1)/etc/wireless/mt7628/
+ -if [ "$$(CONFIG_INTERNAL_PA_INTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7628.eeprom.ipa.ilna.bin $(1)/etc/wireless/mt7628/mt7628.eeprom.bin; \
+ elif [ "$$(CONFIG_INTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7628.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7628/mt7628.eeprom.bin; \
+ elif [ "$$(CONFIG_EXTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ $(INSTALL_BIN) ./files/mt7628.eeprom.epa.elna.bin $(1)/etc/wireless/mt7628/mt7628.eeprom.bin; \
+ else \
+ $(INSTALL_BIN) ./files/mt7628.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7628/mt7628.eeprom.bin; \
+ fi
+ echo p$(P4REV) > $(1)/etc/wireless/mt7628/version
+endef
+
+$(eval $(call KernelPackage,mt7628))
diff --git a/package/ramips/drivers/mt7628/config.in b/package/ramips/drivers/mt7628/config.in
new file mode 100755
index 0000000..9de319e
--- /dev/null
+++ b/package/ramips/drivers/mt7628/config.in
@@ -0,0 +1,249 @@
+if PACKAGE_kmod-mt7628
+
+config MT7628_RT_FIRST_CARD
+ int
+ default 7628
+
+config MT7628_MT_WIFI
+ bool
+ select MT7628_WIFI_BASIC_FUNC
+ default y
+
+config MT7628_MT_WIFI_PATH
+ string
+ depends on MT7628_MT_WIFI
+ default "rlt_wifi"
+
+menu "WiFi Generic Feature Options"
+
+config MT7628_FIRST_IF_EEPROM_FLASH
+ bool
+ default y
+
+config MT7628_RT_FIRST_CARD_EEPROM
+ string
+ default "flash"
+
+
+config MT7628_SECOND_IF_EEPROM_FLASH
+ bool
+ default y
+
+config MT7628_RT_SECOND_CARD_EEPROM
+ string
+ default "flash"
+
+config MT7628_MULTI_INF_SUPPORT
+ bool
+ default n
+
+config MT7628_WIFI_BASIC_FUNC
+ bool "Basic Functions"
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+
+config MT7628_WSC_INCLUDED
+ bool "WSC (WiFi Simple Config)"
+ default y
+
+config MT7628_WSC_V2_SUPPORT
+ bool "WSC V2(WiFi Simple Config Version 2.0)"
+ default y
+
+config MT7628_DOT11N_DRAFT3
+ bool "802.11n Draft3"
+ default y
+
+config MT7628_DOT11W_PMF_SUPPORT
+ bool "PMF"
+ default y
+
+config MT7628_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ default n
+
+config MT7628_QOS_DLS_SUPPORT
+ bool "802.11e DLS ((Direct-Link Setup) Support"
+ default n
+
+config MT7628_WAPI_SUPPORT
+ bool "WAPI Support"
+ default n
+
+#config MT7628_CARRIER_DETECTION_SUPPORT
+# bool "Carrier Detect"
+# default n
+
+config MT7628_IGMP_SNOOP_SUPPORT
+ bool "IGMP snooping"
+ default n
+
+config MT7628_BLOCK_NET_IF
+ bool "NETIF Block"
+ default n
+ help
+ Support Net interface block while Tx-Sw queue full
+
+config MT7628_RATE_ADAPTION
+ bool "New Rate Adaptation support"
+ default y
+
+config MT7628_NEW_RATE_ADAPT_SUPPORT
+ bool "Intelligent Rate Adaption"
+ default y
+
+config MT7628_AGS_SUPPORT
+ bool "Adaptive Group Switching"
+ default n
+
+config MT7628_IDS_SUPPORT
+ bool "IDS (Intrusion Detection System) Support"
+ default n
+
+config MT7628_WIFI_WORK_QUEUE
+ bool "Work Queue"
+ default n
+
+config MT7628_WIFI_SKB_RECYCLE
+ bool "SKB Recycle(Linux)"
+ default n
+
+#config MT7628_RTMP_FLASH_SUPPORT
+# bool "Flash Support"
+# default y
+
+config MT7628_LED_CONTROL_SUPPORT
+ bool "LED Support"
+ default n
+
+config MT7628_ATE_SUPPORT
+ bool "ATE/QA Support"
+ default n
+
+config MT7628_MEMORY_OPTIMIZATION
+ bool "Memory Optimization"
+ default n
+
+config MT7628_UAPSD
+ bool "UAPSD support"
+ default y
+
+#
+# Section for chip architectures
+#
+config MT7628_MT_MAC
+ bool
+ default y
+
+#
+# Section for interfaces
+#
+config MT7628_RTMP_PCI_SUPPORT
+ bool
+
+config MT7628_RTMP_USB_SUPPORT
+ bool
+
+config MT7628_RTMP_RBUS_SUPPORT
+ bool
+
+endmenu
+
+menu "WiFi Operation Modes"
+config MT7628_WIFI_MODE_AP
+ bool
+ default y
+
+config MT7628_MT_AP_SUPPORT
+ bool #"Ralink RT2860 802.11n AP support"
+# depends on NET_RADIO
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ default y
+
+config MT7628_WDS_SUPPORT
+ bool "WDS"
+ depends on MT7628_MT_AP_SUPPORT
+
+config MT7628_MBSS_SUPPORT
+ bool "MBSSID"
+ depends on MT7628_MT_AP_SUPPORT
+ default y
+
+config MT7628_NEW_MBSSID_MODE
+ bool "New MBSSID MODE"
+ depends on MT7628_MT_AP_SUPPORT && MT7628_WMBSS_SUPPORT
+ depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_RT5350 || RALINK_RT6352 || RALINK_MT7620
+ default y
+
+config MT7628_ENHANCE_NEW_MBSSID_MODE
+ bool "Enhanced MBSSID mode"
+ depends on MT7628_NEW_MBSSID_MODE
+ default y
+
+config MT7628_APCLI_SUPPORT
+ bool "AP-Client Support"
+ depends on MT7628_MT_AP_SUPPORT
+
+config MT7628_MAC_REPEATER_SUPPORT
+ bool "MAC Repeater Support"
+ depends on MT7628_MT_AP_SUPPORT
+ depends on MT7628_APCLI_SUPPORT
+ depends on RALINK_RT6352 || RALINK_MT7620 || RALINK_MT7603E || MT7628_MT_AP_SUPPORT
+ default n
+
+config MT7628_SNIFFER_SUPPORT
+ bool "SNIFFER"
+ depends on MT7628_MT_AP_SUPPORT
+ default n
+
+#config MT7628_DOT11R_FT_SUPPORT
+# bool "802.11r Fast BSS Transition"
+# depends on MT7628_MT_AP_SUPPORT
+
+#config MT7628_DOT11K_RRM_SUPPORT
+# bool "802.11k Radio Resource Management"
+# depends on MT7628_MT_AP_SUPPORT
+
+config MT7628_CON_WPS_SUPPORT
+ bool "Concurrent WPS Support"
+ depends on MT7628_MT_AP_SUPPORT
+ depends on MT7628_APCLI_SUPPORT
+ depends on MT7628_WSC_INCLUDED
+ depends on MT7628_WSC_V2_SUPPORT
+ default n
+
+config MT7628_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on MT7628_MT_AP_SUPPORT
+
+#config MT7628_COC_SUPPORT
+# bool "CoC Support"
+# depends on MT7628_MT_AP_SUPPORT
+# default n
+
+#config MT7628_ RT2860V2_SNMP
+# bool "Net-SNMP Support"
+# depends on MT7628_MT_AP_SUPPORT
+
+#config MT7628_MCAST_RATE_SPECIFIC
+# bool "User specific tx rate of mcast pkt"
+# depends on MT7628_MT_AP_SUPPORT
+
+#config MT7628_EXT_BUILD_CHANNEL_LIST
+# bool "Extension Channel List"
+# depends on MT7628_MT_AP_SUPPORT
+
+#config MT7628_AUTO_CH_SELECT_ENHANCE
+# bool "Auto Channel Selection Enhancement"
+# depends on MT7628_MT_AP_SUPPORT
+
+config MT7628_AIREPLAY_SUPPORT
+ bool "Airplay Support"
+ depends on MT7628_MT_AP_SUPPORT
+ default n
+endmenu
+
+endif
diff --git a/package/ramips/drivers/mt7628/files/mt7628.dat b/package/ramips/drivers/mt7628/files/mt7628.dat
new file mode 100755
index 0000000..848dcdc
--- /dev/null
+++ b/package/ramips/drivers/mt7628/files/mt7628.dat
@@ -0,0 +1,132 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=1
+CountryRegionABand=0
+CountryCode=
+BssidNum=1
+SSID1=OpenWrt-MT7628
+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=0
+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/mt7628/files/mt7628.eeprom.epa.elna.bin b/package/ramips/drivers/mt7628/files/mt7628.eeprom.epa.elna.bin
new file mode 100755
index 0000000..a4d4bba
--- /dev/null
+++ b/package/ramips/drivers/mt7628/files/mt7628.eeprom.epa.elna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.elna.bin b/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.elna.bin
new file mode 100755
index 0000000..f73d94a
--- /dev/null
+++ b/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.elna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.ilna.bin b/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.ilna.bin
new file mode 100755
index 0000000..3f16dc3
--- /dev/null
+++ b/package/ramips/drivers/mt7628/files/mt7628.eeprom.ipa.ilna.bin
Binary files differ
diff --git a/package/ramips/drivers/mt7628/files/mt7628.sh b/package/ramips/drivers/mt7628/files/mt7628.sh
new file mode 100755
index 0000000..56da3c6
--- /dev/null
+++ b/package/ramips/drivers/mt7628/files/mt7628.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+append DRIVERS "mt7628"
+
+. /lib/wifi/ralink_common.sh
+
+prepare_mt7628() {
+ prepare_ralink_wifi mt7628
+}
+
+scan_mt7628() {
+ scan_ralink_wifi mt7628 mt7628
+}
+
+
+disable_mt7628() {
+ disable_ralink_wifi mt7628
+}
+
+enable_mt7628() {
+ enable_ralink_wifi mt7628 mt7628
+}
+
+detect_mt7628() {
+# detect_ralink_wifi mt7628 mt7628
+ ssid=mt7628-`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 mt7628
+ option type mt7628
+ option vendor ralink
+ option band 2.4G
+ option channel 0
+ option auotch 2
+
+config wifi-iface
+ option device mt7628
+ 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/mt7628sta/Makefile b/package/ramips/drivers/mt7628sta/Makefile
new file mode 100755
index 0000000..daa9d63
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/Makefile
@@ -0,0 +1,111 @@
+# 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:=mt7628sta
+P4REV:=130908
+PKG_VERSION:=4.0.1.4
+PKG_SOURCE:=MT7628-STA-4.0.1.4.tar.bz2
+PKG_SOURCE_URL:=http://localhost/
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_KCONFIG:=RALINK_MT7628 \
+ MT_WIFI \
+ FIRST_IF_EEPROM_PROM \
+ FIRST_IF_EEPROM_EFUSE \
+ FIRST_IF_EEPROM_FLASH \
+ RT_FIRST_CARD_EEPROM \
+ SECOND_IF_EEPROM_PROM \
+ SECOND_IF_EEPROM_EFUSE \
+ SECOND_IF_EEPROM_FLASH \
+ RT_SECOND_CARD_EEPROM \
+ MULTI_INF_SUPPORT \
+ WIFI_BASIC_FUNC \
+ MT7628_WSC_INCLUDED \
+ MT7628_WSC_V2_SUPPORT \
+ MT7628_DOT11W_PMF_SUPPORT \
+ MT7628_LLTD_SUPPORT \
+ MT7628_QOS_DLS_SUPPORT \
+ MT7628_IGMP_SNOOP_SUPPORT \
+ MT7628_BLOCK_NET_IF \
+ MT7628_RATE_ADAPTION \
+ MT7628_NEW_RATE_ADAPT_SUPPORT \
+ MT7628_AGS_SUPPORT \
+ MT7628_IDS_SUPPORT \
+ MT7628_WIFI_WORKQUEUE \
+ MT7628_WIFI_SKB_RECYCLE \
+ MT7628_SMART_CARRIER_SENSE_SUPPORT \
+ MT7628_LED_CONTROL_SUPPORT \
+ MT7628_ATE_SUPPORT \
+ MT7628_MEMORY_OPTIMIZATION \
+ MT7628_PASSPOINT_R2 \
+ MT7628_SINGLE_SKU \
+ MT7628_UAPSD \
+ MT_MAC \
+ RTMP_PCI_SUPPORT \
+ RTMP_USB_SUPPORT \
+ RTMP_RBUS_SUPPORT \
+ MT_WIFI_MODE_AP \
+ MT_WIFI_MODE_STA \
+ MT_WIFI_MODE_BOTH \
+ MT_AP_SUPPORT \
+ MT_STA_SUPPORT
+
+include $(INCLUDE_DIR)/package.mk
+
+TAR_CMD=$(HOST_TAR) -C $(1)/ $(TAR_OPTIONS)
+
+define KernelPackage/mt7628sta
+ CATEGORY:=MTK Properties
+ TITLE:=MTK MT7628 wifi STA driver
+ FILES:=$(PKG_BUILD_DIR)/mt_wifi_sta/mt7628sta.ko
+ AUTOLOAD:=$(call AutoLoad,90,mt7628sta)
+ DEPENDS:=@TARGET_ramips_mt7628 +kmod-cfg80211-normal +wpa-supplicant-20
+ SUBMENU:=Drivers
+ MENU:=1
+endef
+
+define KernelPackage/mt7628sta/config
+ source "$(SOURCE)/config.in"
+endef
+
+define Build/Compile
+ $(MAKE) -C "$(LINUX_DIR)" V=1 \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ ARCH="$(LINUX_KARCH)" \
+ SUBDIRS="$(PKG_BUILD_DIR)/mt_wifi_sta/" \
+ $(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)=$(CONFIG_$(c)))) \
+ modules
+endef
+
+define P4/Info
+ P4URL:=//Jedi/MP/jedi.MT7628.MP/wifi_driver/
+endef
+
+define P4/Release
+ echo "Gone with the wind."
+endef
+
+define KernelPackage/mt7628sta/install
+ $(INSTALL_DIR) $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/mt7628sta.sh $(1)/lib/wifi/
+ $(INSTALL_BIN) ./files/wpa_supplicant.sh $(1)/lib/wifi/
+ $(INSTALL_DIR) $(1)/etc/wireless/mt7628sta/
+ $(INSTALL_BIN) ./files/mt7628sta.dat $(1)/etc/wireless/mt7628sta/
+ #-if [ "$$(CONFIG_INTERNAL_PA_INTERNAL_LNA)" = "y" ]; then \
+ # $(INSTALL_BIN) ./files/mt7628sta.eeprom.ipa.ilna.bin $(1)/etc/wireless/mt7628sta/mt7628sta.eeprom.bin; \
+ #elif [ "$$(CONFIG_INTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ # $(INSTALL_BIN) ./files/mt7628sta.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7628sta/mt7628sta.eeprom.bin; \
+ #elif [ "$$(CONFIG_EXTERNAL_PA_EXTERNAL_LNA)" = "y" ]; then \
+ # $(INSTALL_BIN) ./files/mt7628sta.eeprom.epa.elna.bin $(1)/etc/wireless/mt7628sta/mt7628sta.eeprom.bin; \
+ #else \
+ # $(INSTALL_BIN) ./files/mt7628sta.eeprom.ipa.elna.bin $(1)/etc/wireless/mt7628sta/mt7628sta.eeprom.bin; \
+ #fi
+ echo $(PKG_VERSION) > $(1)/etc/wireless/mt7628sta/version
+endef
+
+$(eval $(call KernelPackage,mt7628sta))
diff --git a/package/ramips/drivers/mt7628sta/config.in b/package/ramips/drivers/mt7628sta/config.in
new file mode 100755
index 0000000..6b74237
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/config.in
@@ -0,0 +1,246 @@
+if PACKAGE_kmod-mt7628sta
+
+config MT7628_RT_FIRST_CARD
+ int
+ default 7628
+
+config MT7628_MT_WIFI
+ bool
+ select WIFI_BASIC_FUNC
+ default y
+
+config MT7628_MT_WIFI_PATH
+ string
+ depends on MT7628_MT_WIFI
+ default "rlt_wifi"
+
+config MT_WIFI
+ tristate #"MT WIFI Driver"
+ select WIFI_BASIC_FUNC if MT_WIFI
+ default y
+
+#config MT_WIFI_PATH
+# string
+# depends on MT_WIFI
+# default "rlt_wifi"
+
+if MT_WIFI
+menu "WiFi Generic Feature Options"
+
+config FIRST_IF_EEPROM_FLASH
+ bool
+ default y
+
+config RT_FIRST_CARD_EEPROM
+ string
+ default "flash"
+
+config SECOND_IF_EEPROM_FLASH
+ bool
+ default y
+
+config RT_SECOND_CARD_EEPROM
+ string
+ default "flash"
+
+config MULTI_INF_SUPPORT
+ bool
+ #default y if !FIRST_IF_NONE && !SECOND_IF_NONE
+ default n
+
+config WIFI_BASIC_FUNC
+ bool "Basic Functions"
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+
+config MT7628_WSC_INCLUDED
+ bool "WSC (WiFi Simple Config)"
+ depends on MT7628_AP_SUPPORT
+ default y
+
+config MT7628_WSC_V2_SUPPORT
+ bool "WSC V2(WiFi Simple Config Version 2.0)"
+ depends on MT7628_AP_SUPPORT
+ default y
+
+config MT7628_DOT11W_PMF_SUPPORT
+ bool "PMF"
+ depends on MT7628_AP_SUPPORT
+ default y
+
+config MT7628_LLTD_SUPPORT
+ bool "LLTD (Link Layer Topology Discovery Protocol)"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_QOS_DLS_SUPPORT
+ bool "802.11e DLS ((Direct-Link Setup) Support"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+#config MT7628_WAPI_SUPPORT
+# bool "WAPI Support"
+## default n
+
+#config MT7628_FTM_SUPPORT
+# bool "FTM Support"
+## default n
+
+config MT7628_IGMP_SNOOP_SUPPORT
+ bool "IGMP snooping"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_BLOCK_NET_IF
+ bool "NETIF Block"
+ depends on MT7628_AP_SUPPORT
+ default n
+ help
+ Support Net interface block while Tx-Sw queue full
+
+config MT7628_RATE_ADAPTION
+ bool "New Rate Adaptation support"
+ default y
+
+config MT7628_NEW_RATE_ADAPT_SUPPORT
+ bool "Intelligent Rate Adaption"
+ depends on MT7628_RATE_ADAPTION
+ default y
+
+config MT7628_AGS_SUPPORT
+ bool "Adaptive Group Switching"
+ depends on MT7628_RATE_ADAPTION
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_IDS_SUPPORT
+ bool "IDS (Intrusion Detection System) Support"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_WIFI_WORK_QUEUE
+ bool "Work Queue"
+ default n
+
+config MT7628_WIFI_SKB_RECYCLE
+ bool "SKB Recycle(Linux)"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_SMART_CARRIER_SENSE_SUPPORT
+ bool "Smart Carrier Sense"
+ default y
+
+config MT7628_LED_CONTROL_SUPPORT
+ bool "LED Support"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_ATE_SUPPORT
+ bool "ATE/QA Support"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_MEMORY_OPTIMIZATION
+ bool "Memory Optimization"
+ default n
+
+config MT7628_PASSPOINT_R2
+ bool "Passpoint Release-2 Support"
+ select MT7628_DOT11W_PMF_SUPPORT
+ depends on MT7628_AP_SUPPORT
+ default n
+
+#config MT7628_TRACE_IPARP
+# bool "IP/ARP trace log"
+#
+config MT7628_SINGLE_SKU
+ bool "Single SKU Support"
+ depends on MT7628_AP_SUPPORT
+ default n
+
+config MT7628_UAPSD
+ bool "UAPSD support"
+ depends on MT7628_AP_SUPPORT
+ default y
+
+#
+# Section for chip architectures
+#
+# "MT MAC Support"
+config MT_MAC
+ bool
+ default y
+
+# "RLT MAC Support"
+#config RLT_MAC
+# bool
+## default n
+
+#config RLT_BBP
+# bool
+
+#config RLT_RF
+# bool
+
+# "RTMP MAC Support"
+#config RTMP_MAC
+# bool
+## default n
+
+#config RTMP_BBP
+# bool
+
+#config RTMP_RF
+# bool
+
+#
+# Section for interfaces
+#
+config RTMP_PCI_SUPPORT
+ bool
+
+config RTMP_USB_SUPPORT
+ bool
+
+config RTMP_RBUS_SUPPORT
+ bool
+
+endmenu
+
+menu "WiFi Operation Modes"
+ choice
+ prompt "Main Mode"
+ default MT_WIFI_MODE_STA
+
+ config MT_WIFI_MODE_AP
+ bool "AP"
+ select MT_AP_SUPPORT
+
+ config MT_WIFI_MODE_STA
+ bool "STA"
+ select MT_STA_SUPPORT
+
+ config MT_WIFI_MODE_BOTH
+ bool "APSTA"
+ select MT_AP_SUPPORT
+ select MT_STA_SUPPORT
+
+ endchoice
+
+ config MT_STA_SUPPORT
+ tristate "Mediatek 802.11n STA support"
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ default y
+
+config MT_AP_SUPPORT
+ bool
+
+endmenu
+
+endif
+
+endif
diff --git a/package/ramips/drivers/mt7628sta/files/mt7628sta.dat b/package/ramips/drivers/mt7628sta/files/mt7628sta.dat
new file mode 100755
index 0000000..5f306b9
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/files/mt7628sta.dat
@@ -0,0 +1,95 @@
+#The word of "Default" must not be removed
+Default
+CountryRegion=5
+CountryRegionABand=7
+CountryCode=
+ChannelGeography=1
+SSID=Dennis2860AP
+NetworkType=Infra
+WirelessMode=9
+Channel=0
+BeaconPeriod=100
+TxPower=100
+BGProtection=0
+TxPreamble=0
+RTSThreshold=2347
+FragThreshold=2346
+TxBurst=1
+PktAggregate=0
+WmmCapable=1
+AckPolicy=0;0;0;0
+AuthMode=OPEN
+EncrypType=NONE
+WPAPSK=
+DefaultKeyID=1
+Key1Type=0
+Key1Str=
+Key2Type=0
+Key2Str=
+Key3Type=0
+Key3Str=
+Key4Type=0
+Key4Str=
+PSMode=CAM
+AutoRoaming=0
+RoamThreshold=70
+APSDCapable=0
+APSDAC=0;0;0;0
+HT_RDG=1
+HT_EXTCHA=0
+HT_OpMode=0
+HT_MpduDensity=4
+HT_BW=1
+HT_AutoBA=1
+HT_BADecline=0
+HT_AMSDU=0
+HT_BAWinSize=64
+HT_GI=1
+HT_MCS=33
+HT_MIMOPSMode=3
+HT_DisallowTKIP=1
+HT_LDPC=0
+HT_STBC=0
+VHT_BW=1
+VHT_SGI=1
+VHT_STBC=0
+VHT_BW_SIGNAL=0
+VHT_DisallowNonVHT=0
+VHT_LDPC=0
+EthConvertMode=
+EthCloneMac=
+IEEE80211H=0
+TGnWifiTest=0
+WirelessEvent=0
+MeshId=MESH
+MeshAutoLink=1
+MeshAuthMode=OPEN
+MeshEncrypType=NONE
+MeshWPAKEY=
+MeshDefaultkey=1
+MeshWEPKEY=
+CarrierDetect=0
+AntDiversity=0
+BeaconLostTime=4
+FtSupport=0
+Wapiifname=ra0
+WapiPsk=
+WapiPskType=
+WapiUserCertPath=
+WapiAsCertPath=
+PSP_XLINK_MODE=0
+WscManufacturer=
+WscModelName=
+WscDeviceName=
+WscModelNumber=
+WscSerialNumber=
+RadioOn=1
+WIDIEnable=1
+P2P_L2SD_SCAN_TOGGLE=3
+Wsc4digitPinCode=0
+P2P_WIDIEnable=0
+PMFMFPC=0
+PMFMFPR=0
+PMFSHA256=0
+SnifferType=0
+LoadCodeMethod=0
diff --git a/package/ramips/drivers/mt7628sta/files/mt7628sta.sh b/package/ramips/drivers/mt7628sta/files/mt7628sta.sh
new file mode 100644
index 0000000..093101a
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/files/mt7628sta.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+append DRIVERS "mt7628sta"
+
+. /lib/wifi/ralink_common.sh
+. /lib/wifi/wpa_supplicant.sh
+
+prepare_mt7628sta() {
+ logger prepare_mt7628sta
+}
+
+scan_mt7628sta() {
+ logger scan_mt7628sta
+}
+
+
+disable_mt7628sta() {
+ logger disable_mt7628sta
+ local ifname
+ config_get vifs "$device" vifs
+ for vif in $vifs; do
+ config_get ifname $vif ifname
+ uci -q delete wireless.${vif}.bssid # for luci
+ uci -q commit wireless # for luci
+ ifconfig $ifname down
+ done
+
+ killall wpa_supplicant 2>/dev/null
+ echo 0 > /dev/null
+}
+
+enable_mt7628sta() {
+ logger enable_mt7628sta
+ local ifname disabled
+ config_get vifs "$device" vifs
+ for vif in $vifs; do
+ config_get ifname $vif ifname
+ config_get disabled $vif disabled
+ [ "$disabled" == "1" ] || {
+ ifconfig $ifname up
+ wpa_supplicant_setup_vif $vif nl80211
+ }
+ done
+}
+
+detect_mt7628sta() {
+ cd /sys/module/
+ [ -d mt7628sta ] || return
+ [ -e /etc/config/wireless ] && return
+ cat <<EOF
+config wifi-device mt7628sta
+ option type mt7628sta
+ option vendor ralink
+ option ifname rai0
+
+config wifi-iface
+ option device mt7628sta
+ option ifname rai0
+ option mode sta
+
+EOF
+}
+
+
diff --git a/package/ramips/drivers/mt7628sta/files/wpa_supplicant.sh b/package/ramips/drivers/mt7628sta/files/wpa_supplicant.sh
new file mode 100755
index 0000000..ee4ed50
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/files/wpa_supplicant.sh
@@ -0,0 +1,194 @@
+wpa_supplicant_setup_vif() {
+ local vif="$1"
+ local driver="$2"
+ local key="$key"
+ local options="$3"
+ local freq=""
+ local ht="$5"
+ local ap_scan=""
+ local scan_ssid="1"
+ [ -n "$4" ] && freq="frequency=$4"
+
+ config_get enc "$vif" encryption
+ config_get key "$vif" key
+
+ local net_cfg bridge
+ config_get bridge "$vif" bridge
+ [ -z "$bridge" ] && {
+ net_cfg="$(find_net_config "$vif")"
+ [ -z "$net_cfg" ] || bridge="$(bridge_interface "$net_cfg")"
+ config_set "$vif" bridge "$bridge"
+ }
+
+ local mode ifname wds modestr=""
+ config_get mode "$vif" mode
+ config_get ifname "$vif" ifname
+ config_get_bool wds "$vif" wds 0
+ [ -z "$bridge" ] || [ "$mode" = ap ] || [ "$mode" = sta -a $wds -eq 1 ] || {
+ echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface"
+ return 1
+ }
+ [ "$mode" = "adhoc" ] && {
+ modestr="mode=1"
+ scan_ssid="0"
+ ap_scan="ap_scan=2"
+ }
+
+ key_mgmt='NONE'
+ case "$enc" in
+ *none*) ;;
+ *wep*)
+ config_get key "$vif" key
+ key="${key:-1}"
+ case "$key" in
+ [1234])
+ for idx in 1 2 3 4; do
+ local zidx
+ zidx=$(($idx - 1))
+ config_get ckey "$vif" "key${idx}"
+ [ -n "$ckey" ] && \
+ append "wep_key${zidx}" "wep_key${zidx}=$(prepare_key_wep "$ckey")"
+ done
+ wep_tx_keyidx="wep_tx_keyidx=$((key - 1))"
+ ;;
+ *)
+ wep_key0="wep_key0=$(prepare_key_wep "$key")"
+ wep_tx_keyidx="wep_tx_keyidx=0"
+ ;;
+ esac
+ ;;
+ *psk*)
+ key_mgmt='WPA-PSK'
+ # if you want to use PSK with a non-nl80211 driver you
+ # have to use WPA-NONE and wext driver for wpa_s
+ [ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && {
+ key_mgmt='WPA-NONE'
+ driver='wext'
+ }
+ if [ ${#key} -eq 64 ]; then
+ passphrase="psk=${key}"
+ else
+ passphrase="psk=\"${key}\""
+ fi
+ case "$enc" in
+ *psk2*)
+ proto='proto=RSN'
+ config_get ieee80211w "$vif" ieee80211w
+ ;;
+ *psk*)
+ proto='proto=WPA'
+ ;;
+ esac
+ ;;
+ *wpa*|*8021x*)
+ proto='proto=WPA2'
+ key_mgmt='WPA-EAP'
+ config_get ieee80211w "$vif" ieee80211w
+ config_get ca_cert "$vif" ca_cert
+ config_get eap_type "$vif" eap_type
+ ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
+ case "$eap_type" in
+ tls)
+ pairwise='pairwise=CCMP'
+ group='group=CCMP'
+ config_get identity "$vif" identity
+ config_get client_cert "$vif" client_cert
+ config_get priv_key "$vif" priv_key
+ config_get priv_key_pwd "$vif" priv_key_pwd
+ identity="identity=\"$identity\""
+ client_cert="client_cert=\"$client_cert\""
+ priv_key="private_key=\"$priv_key\""
+ priv_key_pwd="private_key_passwd=\"$priv_key_pwd\""
+ ;;
+ peap|ttls)
+ config_get auth "$vif" auth
+ config_get identity "$vif" identity
+ config_get password "$vif" password
+ phase2="phase2=\"auth=${auth:-MSCHAPV2}\""
+ identity="identity=\"$identity\""
+ password="${password:+password=\"$password\"}"
+ ;;
+ esac
+ eap_type="eap=$(echo $eap_type | tr 'a-z' 'A-Z')"
+ ;;
+ esac
+
+ case "$ieee80211w" in
+ [012])
+ ieee80211w="ieee80211w=$ieee80211w"
+ ;;
+ esac
+
+ local fixed_freq bssid1 beacon_int brates mrate
+ config_get ifname "$vif" ifname
+ config_get bridge "$vif" bridge
+ config_get ssid "$vif" ssid
+ config_get bssid "$vif" bssid
+ bssid1=${bssid:+"bssid=$bssid"}
+ beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
+
+ local br brval brsub brstr
+ [ -n "$basic_rate_list" ] && {
+ for br in $basic_rate_list; do
+ brval="$(($br / 1000))"
+ brsub="$((($br / 100) % 10))"
+ [ "$brsub" -gt 0 ] && brval="$brval.$brsub"
+ [ -n "$brstr" ] && brstr="$brstr,"
+ brstr="$brstr$brval"
+ done
+ brates=${basic_rate_list:+"rates=$brstr"}
+ }
+
+ local mcval=""
+ [ -n "$mcast_rate" ] && {
+ mcval="$(($mcast_rate / 1000))"
+ mcsub="$(( ($mcast_rate / 100) % 10 ))"
+ [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
+ mrate=${mcast_rate:+"mcast_rate=$mcval"}
+ }
+
+ local ht_str
+ [ -n "$ht" ] && ht_str="htmode=$ht"
+
+ rm -rf /var/run/wpa_supplicant-$ifname
+ cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
+ctrl_interface=/var/run/wpa_supplicant-$ifname
+$ap_scan
+network={
+ $modestr
+ scan_ssid=$scan_ssid
+ ssid="$ssid"
+ $bssid1
+ key_mgmt=$key_mgmt
+ $proto
+ $freq
+ ${fixed:+"fixed_freq=1"}
+ $beacon_int
+ $brates
+ $mrate
+ $ht_str
+ $ieee80211w
+ $passphrase
+ $pairwise
+ $group
+ $eap_type
+ $ca_cert
+ $client_cert
+ $priv_key
+ $priv_key_pwd
+ $phase2
+ $identity
+ $password
+ $wep_key0
+ $wep_key1
+ $wep_key2
+ $wep_key3
+ $wep_tx_keyidx
+}
+EOF
+ if [ -n "$proto" -o "$key_mgmt" == "NONE" ]; then
+# wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf $options
+ else
+ return 0
+ fi
+}
diff --git a/package/ramips/drivers/mt7628sta/patches/001-openwrt-build.patch b/package/ramips/drivers/mt7628sta/patches/001-openwrt-build.patch
new file mode 100644
index 0000000..3429f57
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/patches/001-openwrt-build.patch
@@ -0,0 +1,20 @@
+Index: mt7628sta-4.0.1.4/mt_wifi_sta/Makefile
+===================================================================
+--- mt7628sta-4.0.1.4.orig/mt_wifi_sta/Makefile
++++ mt7628sta-4.0.1.4/mt_wifi_sta/Makefile
+@@ -1,10 +1,10 @@
+-EXTRA_CFLAGS = -Idrivers/net/wireless/mt_wifi/include \
+- -Idrivers/net/wireless/mt_wifi/embedded/include \
+- -Idrivers/net/wireless/mt_wifi/ate/include
++EXTRA_CFLAGS = -I$(src)/../mt_wifi/include \
++ -I$(src)/../mt_wifi/embedded/include \
++ -I$(src)/../mt_wifi/ate/include
+
+-DRV_NAME = mt_wifi
++DRV_NAME = mt7628sta
+ SRC_DIR = ../mt_wifi/embedded
+-obj-$(CONFIG_MT_STA_SUPPORT) += $(DRV_NAME).o
++obj-m += $(DRV_NAME).o
+
+ ########################################################
+ # Common files
diff --git a/package/ramips/drivers/mt7628sta/patches/002-path.patch b/package/ramips/drivers/mt7628sta/patches/002-path.patch
new file mode 100644
index 0000000..c23ed27
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/patches/002-path.patch
@@ -0,0 +1,31 @@
+Index: mt7628sta-4.0.1.4/mt_wifi/embedded/include/os/rt_linux.h
+===================================================================
+--- mt7628sta-4.0.1.4.orig/mt_wifi/embedded/include/os/rt_linux.h
++++ mt7628sta-4.0.1.4/mt_wifi/embedded/include/os/rt_linux.h
+@@ -174,7 +174,7 @@ typedef struct usb_ctrlrequest devctrlre
+
+ #ifdef CONFIG_STA_SUPPORT
+ #ifdef RTMP_MAC_PCI
+-#define STA_PROFILE_PATH "/etc/Wireless/RT2860STA/RT2860STA.dat"
++#define STA_PROFILE_PATH "/etc/wireless/mt7628sta/mt7628sta.dat"
+ #define STA_DRIVER_VERSION "4.0.1.4"
+ #ifdef MULTIPLE_CARD_SUPPORT
+ #define CARD_INFO_PATH "/etc/Wireless/RT2860STA/RT2860STACard.dat"
+@@ -194,7 +194,7 @@ typedef struct usb_ctrlrequest devctrlre
+ #ifdef RTMP_RBUS_SUPPORT
+ #define RTMP_FIRMWARE_FILE_NAME "/etc_ro/Wireless/RT2860STA/RT2860STA.bin"
+ #define PROFILE_PATH "/etc/Wireless/RT2860i.dat"
+-#define STA_PROFILE_PATH_RBUS "/etc/Wireless/RT2860/RT2860.dat"
++#define STA_PROFILE_PATH_RBUS "/etc/wireless/mt7628sta/mt7628sta.dat"
+ #define RT2880_STA_DRIVER_VERSION "4.0.1.4"
+ #endif /* RTMP_RBUS_SUPPORT */
+
+@@ -1689,7 +1689,7 @@ extern int rausb_control_msg(VOID *dev,
+ #ifdef CONFIG_AP_SUPPORT
+ #ifndef CONFIG_STA_SUPPORT /* avoid wrong usage when enabling P2P_SUPPORT */
+ #if defined(CONFIG_SUPPORT_OPENWRT)
+-#define EEPROM_BIN_FILE_NAME "/etc/wireless/mt7628/mt7628.eeprom.bin"
++#define EEPROM_BIN_FILE_NAME "/etc/wireless/mt7628/mt7628sta.eeprom.bin"
+ #else
+ #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860AP/e2p.bin"
+ #endif /* CONFIG_SUPPORT_OPENWRT */
diff --git a/package/ramips/drivers/mt7628sta/patches/003-log.patch b/package/ramips/drivers/mt7628sta/patches/003-log.patch
new file mode 100644
index 0000000..945003e
--- /dev/null
+++ b/package/ramips/drivers/mt7628sta/patches/003-log.patch
@@ -0,0 +1,30 @@
+Index: mt7628sta-4.0.1.4/mt_wifi/embedded/mcu/andes_mt.c
+===================================================================
+--- mt7628sta-4.0.1.4.orig/mt_wifi/embedded/mcu/andes_mt.c
++++ mt7628sta-4.0.1.4/mt_wifi/embedded/mcu/andes_mt.c
+@@ -4346,7 +4346,11 @@ error:
+ ret = AndesSendCmdMsg(pAd, msg);
+
+ error:
+- MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("%s:(ret = %d)\n", __FUNCTION__, ret));
++ if (ret)
++ MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("%s:(ret = %d)\n", __FUNCTION__, ret));
++ else
++ MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_LOUD, ("%s:(ret = %d)\n", __FUNCTION__, ret));
++
+ return ret;
+ }
+
+Index: mt7628sta-4.0.1.4/mt_wifi/hw_ctrl/cmm_asic_mt.c
+===================================================================
+--- mt7628sta-4.0.1.4.orig/mt_wifi/hw_ctrl/cmm_asic_mt.c
++++ mt7628sta-4.0.1.4/mt_wifi/hw_ctrl/cmm_asic_mt.c
+@@ -1225,7 +1225,7 @@ UINT32 MtAsicGetRetryLimit(RTMP_ADAPTER
+ VOID MtAsicSetSlotTime(RTMP_ADAPTER *pAd, UINT32 SlotTime, UINT32 SifsTime)
+ {
+ CmdSlotTimeSet(pAd,(UINT8)SlotTime,(UINT8)SifsTime,(UINT8)RIFS_TIME, EIFS_TIME);
+- MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("%s(%d): SetSlotTime!\n",__FUNCTION__, __LINE__));
++ MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_LOUD, ("%s(%d): SetSlotTime!\n",__FUNCTION__, __LINE__));
+ }
+
+ #define MAX_RX_PKT_LENGTH 0x400 /* WORD(4 Bytes) unit */
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!