summaryrefslogtreecommitdiff
path: root/package/ramips/drivers/mt7628
diff options
context:
space:
mode:
Diffstat (limited to 'package/ramips/drivers/mt7628')
-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
7 files changed, 519 insertions, 0 deletions
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
+
+
+}
+
+