diff --git a/dl/mt79xx_20231229-4012a0.tar.xz b/dl/mt79xx_20231229-4012a0.tar.xz new file mode 100644 index 0000000000..415bbad680 Binary files /dev/null and b/dl/mt79xx_20231229-4012a0.tar.xz differ diff --git a/package/mtk/drivers/mt_wifi/Makefile b/package/mtk/drivers/mt_wifi/Makefile index d121fc87d7..4fbb2a8f52 100644 --- a/package/mtk/drivers/mt_wifi/Makefile +++ b/package/mtk/drivers/mt_wifi/Makefile @@ -8,9 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mt_wifi -MT7981_FW_DIR := mt7981-fw-20230306 -MT7986_FW_DIR := mt7986-fw-20230808 - ifeq ($(CONFIG_MTK_CHIP_MT7981),y) PKG_SUFFIX:=mt7981 else @@ -19,10 +16,17 @@ PKG_SUFFIX:=mt7986 endif endif -PKG_BUILD_DEPENDS:=warp +ifeq ($(CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7661),y) PKG_SOURCE:=mt798x-7.6.6.1-src.tar.xz PKG_VERSION:=7.6.6.1-$(PKG_SUFFIX) +PATCH_DIR:=patches-7661 +else +PKG_SOURCE:=mt79xx_20231229-4012a0.tar.xz +PKG_VERSION:=7.6.7.2-$(PKG_SUFFIX) +PATCH_DIR:=patches-7672 +endif +PKG_BUILD_DEPENDS:=warp PKG_BUILD_PARALLEL:=1 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME) PKG_KCONFIG:= \ @@ -174,6 +178,8 @@ PKG_KCONFIG:= \ DYNAMIC_VLAN_SUPPORT \ IAP_VENDOR1_FEATURE_SUPPORT \ CUSTOMISED_HOSTAPD_SUPPORT \ + HOSTAPD_MAP_SUPPORT \ + HOSTAPD_WAPP_SUPPORT \ HOSTAPD_WPA3_SUPPORT \ HOSTAPD_WPA3R3_SUPPORT \ DBDC_ONE_BAND_SUPPORT \ @@ -272,13 +278,13 @@ PKG_KCONFIG:= \ WIFI_SKB_USES_SLAB \ WIFI_CSI_CN_INFO_SUPPORT \ 6G_AFC_SUPPORT \ + DFS_SLAVE_SUPPORT \ PKG_CONFIG_DEPENDS:=$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_MTK_$c),CONFIG_$(c))) -PKG_PREPARED_DEPENDS:= CONFIG_MTK_MT7986_NEW_FW CONFIG_MTK_MT7981_NEW_FW +PKG_PREPARED_DEPENDS:=CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7661 CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7672 CONFIG_MTK_FW_NEW_API_PATCH include $(INCLUDE_DIR)/package.mk - TAR_CMD=$(HOST_TAR) -C $(1)/ $(TAR_OPTIONS) define KernelPackage/mt_wifi @@ -299,14 +305,17 @@ define KernelPackage/mt_wifi/config source "$(SOURCE)/config.in" endef -define FIXUP_NEW_MCU_FW_API - @if [ "$$(CONFIG_MTK_MT7981_NEW_FW)" = "y" ] || [ "$$(CONFIG_MTK_MT7986_NEW_FW)" = "y" ]; then \ +define MT_WIFI_SRC_PATCH + @if [ "$$(CONFIG_MTK_FW_NEW_API_PATCH)" = "y" ]; then \ echo "Fixup new mcu fw API"; \ patch -p1 -d $(PKG_BUILD_DIR) < ./files/fix-new-mcu-fw-api.patch; \ + fi ; \ + if [ "$$(CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7661)" = "y" ]; then \ + $(CP) ./files-7661/* $(PKG_BUILD_DIR) ; \ fi endef -Hooks/Prepare/Post := FIXUP_NEW_MCU_FW_API +Hooks/Prepare/Post := MT_WIFI_SRC_PATCH define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ @@ -318,54 +327,42 @@ define Build/Compile endef define KernelPackage/mt_wifi/install +rm -rf $(1)/lib/firmware/; \ +$(INSTALL_DIR) $(1)/lib/firmware/; \ +if [ "$$(CONFIG_MTK_CHIP_MT7986)" = "y" ] ; then \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_* $(1)/lib/firmware/; \ +fi ; \ +if [ "$$(CONFIG_MTK_CHIP_MT7916)" = "y" ] ; then \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7916/rebb/MT7916_* $(1)/lib/firmware/; \ +fi ; \ +if [ "$$(CONFIG_MTK_CHIP_MT7981)" = "y" ] ; then \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7981/rebb/MT7981_* $(1)/lib/firmware/; \ +fi ; \ if [ "$$(CONFIG_MTK_WIFI_FW_BIN_LOAD)" = "y" ]; then \ - rm -rf $(1)/lib/firmware/; \ - $(INSTALL_DIR) $(1)/lib/firmware/; \ - if [ "$$(CONFIG_MTK_CHIP_MT7986)" = "y" ] ; then \ - if [ "$$(CONFIG_MTK_MT7986_NEW_FW)" = "y" ]; then \ - $(INSTALL_BIN) ./files/$$(MT7986_FW_DIR)/WIFI_RAM_CODE_MT7986.bin \ - ./files/$$(MT7986_FW_DIR)/WIFI_RAM_CODE_MT7986_MT7975.bin \ - ./files/$$(MT7986_FW_DIR)/mt7986_patch_e1_hdr.bin \ - ./files/$$(MT7986_FW_DIR)/mt7986_patch_e1_hdr_mt7975.bin \ - ./files/$$(MT7986_FW_DIR)/7986_WACPU_RAM_CODE_release.bin $(1)/lib/firmware/; \ - else \ + if [ "$$(CONFIG_MTK_MT_WIFI_FIRMWARE_PATH)" != "" ]; then \ + $(INSTALL_BIN) ./files/$$(CONFIG_MTK_MT_WIFI_FIRMWARE_PATH)/* $(1)/lib/firmware/; \ + else \ + if [ "$$(CONFIG_MTK_CHIP_MT7986)" = "y" ] ; then \ $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7986/rebb/WIFI_RAM_CODE_MT7986.bin \ $(PKG_BUILD_DIR)/bin/mt7986/rebb/WIFI_RAM_CODE_MT7986_MT7975.bin \ $(PKG_BUILD_DIR)/bin/mt7986/rebb/mt7986_patch_e1_hdr.bin \ $(PKG_BUILD_DIR)/bin/mt7986/rebb/mt7986_patch_e1_hdr_mt7975.bin \ - $(PKG_BUILD_DIR)/bin/mt7986/rebb/7986_WACPU_RAM_CODE_release.bin $(1)/lib/firmware/; \ + $(PKG_BUILD_DIR)/bin/mt7986/rebb/7986_WACPU_RAM_CODE_release.bin \ + $(1)/lib/firmware/; \ fi ; \ - if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX6000" -o "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX8400" ] ; then \ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_iPAiLNA_EEPROM_AX6000.bin $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_ePAeLNA_EEPROM_AX6000.bin \ + if [ "$$(CONFIG_MTK_CHIP_MT7916)" = "y" ] ; then \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7916/rebb/7916_WACPU_RAM_CODE_release.bin \ + $(PKG_BUILD_DIR)/bin/mt7916/rebb/mt7916_patch_e1_hdr.bin \ + $(PKG_BUILD_DIR)/bin/mt7916/rebb/WIFI_RAM_CODE_MT7916.bin \ $(1)/lib/firmware/; \ - fi; \ - if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX7800" ] ; then \ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_iPAiLNA_EEPROM_AX7800.bin $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_ePAeLNA_EEPROM_AX7800.bin \ - $(1)/lib/firmware/; \ - fi; \ - if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX4200" ] ; then \ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7986/rebb/MT7986_ePAeLNA_EEPROM_ONEADIE_DBDC.bin \ - $(1)/lib/firmware/; \ - fi; \ - fi; \ - if [ "$$(CONFIG_MTK_CHIP_MT7916)" = "y" ] ; then \ - $(INSTALL_BIN) ./files/mt7916-bin/* $(1)/lib/firmware/; \ - fi; \ - if [ "$$(CONFIG_MTK_CHIP_MT7981)" = "y" ] ; then \ - $(INSTALL_BIN) ./files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin \ - ./files/mt7981-default-eeprom/MT7981_ePAeLNA_EEPROM.bin $(1)/lib/firmware/; \ - if [ "$$(CONFIG_MTK_MT7981_NEW_FW)" = "y" ]; then \ - $(INSTALL_BIN) ./files/$$(MT7981_FW_DIR)/WIFI_RAM_CODE_MT7981.bin \ - ./files/$$(MT7981_FW_DIR)/7981_WACPU_RAM_CODE_release.bin \ - ./files/$$(MT7981_FW_DIR)/mt7981_patch_e1_hdr.bin \ - $(1)/lib/firmware/; \ - else \ + fi ; \ + if [ "$$(CONFIG_MTK_CHIP_MT7981)" = "y" ] ; then \ $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/mt7981/rebb/WIFI_RAM_CODE_MT7981.bin \ $(PKG_BUILD_DIR)/bin/mt7981/rebb/7981_WACPU_RAM_CODE_release.bin \ $(PKG_BUILD_DIR)/bin/mt7981/rebb/mt7981_patch_e1_hdr.bin \ $(1)/lib/firmware/; \ fi ; \ - fi; \ + fi ; \ fi endef diff --git a/package/mtk/drivers/mt_wifi/config.in b/package/mtk/drivers/mt_wifi/config.in index 6de0b3567c..9b2787c526 100644 --- a/package/mtk/drivers/mt_wifi/config.in +++ b/package/mtk/drivers/mt_wifi/config.in @@ -177,6 +177,77 @@ config MTK_MT_WIFI_PATH default "mt_wifi" if MTK_MT_WIFI +choice + prompt "MT_WIFI DRIVER VERSION" + default MTK_MT_WIFI_DRIVER_VERSION_7672 + + config MTK_MT_WIFI_DRIVER_VERSION_7661 + bool "7.6.6.1" + + config MTK_MT_WIFI_DRIVER_VERSION_7672 + bool "7.6.7.2" +endchoice + +choice + prompt "MT7981 custom WACPU firmware" + depends on MTK_MT_WIFI_DRIVER_VERSION_7661 && MTK_CHIP_MT7981 + + config MTK_MT_WIFI_MT7981_DEFAULT_FIRMWARE + bool "default firmware" + + config MTK_MT_WIFI_MT7981_20230306 + bool "mt7981-fw-20230306" + + config MTK_MT_WIFI_MT7981_20230330 + bool "mt7981-fw-20230330" + + config MTK_MT_WIFI_MT7981_20230411 + bool "mt7981-fw-20230411" + + config MTK_MT_WIFI_MT7981_20230717 + bool "mt7981-fw-20230717" + + config MTK_MT_WIFI_MT7981_20231024 + bool "mt7981-fw-20231024" +endchoice + +choice + prompt "MT7986 custom WACPU firmware" + depends on MTK_MT_WIFI_DRIVER_VERSION_7661 && MTK_CHIP_MT7986 + + config MTK_MT_WIFI_MT7986_DEFAULT_FIRMWARE + bool "default firmware" + + config MTK_MT_WIFI_MT7986_20221208 + bool "mt7986-fw-20221208" + + config MTK_MT_WIFI_MT7986_20230421 + bool "mt7986-fw-20230421" + + config MTK_MT_WIFI_MT7986_20230808 + bool "mt7986-fw-20230808" + + config MTK_MT_WIFI_MT7986_20231024 + bool "mt7986-fw-20231024" +endchoice + +config MTK_MT_WIFI_FIRMWARE_PATH + string + default mt7981-fw-20230306 if MTK_MT_WIFI_MT7981_20230306 + default mt7981-fw-20230330 if MTK_MT_WIFI_MT7981_20230330 + default mt7981-fw-20230411 if MTK_MT_WIFI_MT7981_20230411 + default mt7981-fw-20230717 if MTK_MT_WIFI_MT7981_20230717 + default mt7981-fw-20231024 if MTK_MT_WIFI_MT7981_20231024 + default mt7986-fw-20221208 if MTK_MT_WIFI_MT7986_20221208 + default mt7986-fw-20230421 if MTK_MT_WIFI_MT7986_20230421 + default mt7986-fw-20230808 if MTK_MT_WIFI_MT7986_20230808 + default mt7986-fw-20231024 if MTK_MT_WIFI_MT7986_20231024 + +config MTK_FW_NEW_API_PATCH + bool + depends on MTK_MT_WIFI_DRIVER_VERSION_7661 + default y if !(MTK_MT_WIFI_MT7981_DEFAULT_FIRMWARE || MTK_MT_WIFI_MT7986_DEFAULT_FIRMWARE) + menu "WiFi Generic Feature Options" choice prompt "EEPROM Type of 1st Card" @@ -763,16 +834,6 @@ choice endchoice #### PA_LNA_Type choice END -config MTK_MT7981_NEW_FW - depends on MTK_CHIP_MT7981 - bool "mt7981 new firmware" - default y - -config MTK_MT7986_NEW_FW - depends on MTK_CHIP_MT7986 - bool "mt7986 new firmware" - default n - config MTK_WIFI_FW_BIN_LOAD depends on MTK_CHIP_MT7986 || MTK_CHIP_MT7916 || MTK_CHIP_MT7981 bool "load wifi fw with bin file" @@ -1069,6 +1130,21 @@ config MTK_CUSTOMISED_HOSTAPD_SUPPORT depends on MTK_MT_AP_SUPPORT depends on MTK_CFG80211_SUPPORT default n + +#HOSTAPD_MAP_SUPPORT +config MTK_HOSTAPD_MAP_SUPPORT + bool "Hostapd MAP Support" + depends on MTK_MT_AP_SUPPORT + depends on MTK_CFG80211_SUPPORT + default n + +#HOSTAPD_WAPP_SUPPORT +config MTK_HOSTAPD_WAPP_SUPPORT + bool "Hostapd WAPP Support" + depends on MTK_MT_AP_SUPPORT + depends on MTK_CFG80211_SUPPORT + default n + #HOSTAPD_WPA3_SUPPORT config MTK_HOSTAPD_WPA3_SUPPORT bool "Hostapd WPA3 Support" @@ -1214,6 +1290,12 @@ config MTK_6G_AFC_SUPPORT depends on MTK_MT_AP_SUPPORT default n +config MTK_DFS_SLAVE_SUPPORT + bool "DFS-Slave Support" + depends on MTK_WIFI_DRIVER + depends on MTK_MT_AP_SUPPORT + default n + config MTK_VENDOR_FEATURE11_SUPPORT bool "Vendor11 Feature Enable" depends on MTK_WIFI_DRIVER diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/7916_WACPU_RAM_CODE_release.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/7916_WACPU_RAM_CODE_release.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/7916_WACPU_RAM_CODE_release.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/7916_WACPU_RAM_CODE_release.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_2T2R+1R.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_2T2R+1R.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_2T2R+1R.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_2T2R+1R.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_3T3R.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_3T3R.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_3T3R.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_5G_3T3R.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_2T2R+1R.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_2T2R+1R.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_2T2R+1R.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_2T2R+1R.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_3T3R.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_3T3R.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_3T3R.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_EEPROM_AX3000_ePAeLNA_2G_6G_3T3R.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_ePAeLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_ePAeLNA_EEPROM.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_ePAeLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_ePAeLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_ePAiLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_ePAiLNA_EEPROM.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_ePAiLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_ePAiLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_iPAeLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_iPAeLNA_EEPROM.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_iPAeLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_iPAeLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_iPAiLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_iPAiLNA_EEPROM.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/MT7916_iPAiLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/MT7916_iPAiLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/WIFI_RAM_CODE_MT7916.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/WIFI_RAM_CODE_MT7916.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/WIFI_RAM_CODE_MT7916.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/WIFI_RAM_CODE_MT7916.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7916-bin/mt7916_patch_e1_hdr.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/mt7916_patch_e1_hdr.bin old mode 100755 new mode 100644 similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7916-bin/mt7916_patch_e1_hdr.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7916/rebb/mt7916_patch_e1_hdr.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_ePAeLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_ePAeLNA_EEPROM.bin similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_ePAeLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_ePAeLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_iPAiLNA_EEPROM.bin similarity index 100% rename from package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin rename to package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_iPAiLNA_EEPROM.bin diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/7981_WACPU_RAM_CODE_release.bin b/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/7981_WACPU_RAM_CODE_release.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/WIFI_RAM_CODE_MT7981.bin b/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/WIFI_RAM_CODE_MT7981.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/mt7981_patch_e1_hdr.bin b/package/mtk/drivers/mt_wifi/files/mt7981-fw-20230330/mt7981_patch_e1_hdr.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/7986_WACPU_RAM_CODE_release.bin b/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/7986_WACPU_RAM_CODE_release.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/WIFI_RAM_CODE_MT7986.bin b/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/WIFI_RAM_CODE_MT7986.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/WIFI_RAM_CODE_MT7986_MT7975.bin b/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/WIFI_RAM_CODE_MT7986_MT7975.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/mt7986_patch_e1_hdr.bin b/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/mt7986_patch_e1_hdr.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/mt7986_patch_e1_hdr_mt7975.bin b/package/mtk/drivers/mt_wifi/files/mt7986-fw-20230808/mt7986_patch_e1_hdr_mt7975.bin old mode 100755 new mode 100644 diff --git a/package/mtk/drivers/mt_wifi/patches/001-eeprom-flash-api.patch b/package/mtk/drivers/mt_wifi/patches-7661/001-eeprom-flash-api.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/001-eeprom-flash-api.patch rename to package/mtk/drivers/mt_wifi/patches-7661/001-eeprom-flash-api.patch diff --git a/package/mtk/drivers/mt_wifi/patches/002-sort-site-survey-table.patch b/package/mtk/drivers/mt_wifi/patches-7661/002-sort-site-survey-table.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/002-sort-site-survey-table.patch rename to package/mtk/drivers/mt_wifi/patches-7661/002-sort-site-survey-table.patch diff --git a/package/mtk/drivers/mt_wifi/patches/003-fix-rxrate-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7661/003-fix-rxrate-stainfo.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/003-fix-rxrate-stainfo.patch rename to package/mtk/drivers/mt_wifi/patches-7661/003-fix-rxrate-stainfo.patch diff --git a/package/mtk/drivers/mt_wifi/patches/004-remove-apcli-bgprotect-log.patch b/package/mtk/drivers/mt_wifi/patches-7661/004-remove-apcli-bgprotect-log.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/004-remove-apcli-bgprotect-log.patch rename to package/mtk/drivers/mt_wifi/patches-7661/004-remove-apcli-bgprotect-log.patch diff --git a/package/mtk/drivers/mt_wifi/patches/005-use-ext-warp-code.patch b/package/mtk/drivers/mt_wifi/patches-7661/005-use-ext-warp-code.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/005-use-ext-warp-code.patch rename to package/mtk/drivers/mt_wifi/patches-7661/005-use-ext-warp-code.patch diff --git a/package/mtk/drivers/mt_wifi/patches/006-fix-stainfo_struct.patch b/package/mtk/drivers/mt_wifi/patches-7661/006-fix-stainfo_struct.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/006-fix-stainfo_struct.patch rename to package/mtk/drivers/mt_wifi/patches-7661/006-fix-stainfo_struct.patch diff --git a/package/mtk/drivers/mt_wifi/patches/007-fix-tx-phymode.patch b/package/mtk/drivers/mt_wifi/patches-7661/007-fix-tx-phymode.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/007-fix-tx-phymode.patch rename to package/mtk/drivers/mt_wifi/patches-7661/007-fix-tx-phymode.patch diff --git a/package/mtk/drivers/mt_wifi/patches/008-fix-he-gi-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7661/008-fix-he-gi-stainfo.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/008-fix-he-gi-stainfo.patch rename to package/mtk/drivers/mt_wifi/patches-7661/008-fix-he-gi-stainfo.patch diff --git a/package/mtk/drivers/mt_wifi/patches/009-add-secinfo-to-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7661/009-add-secinfo-to-stainfo.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/009-add-secinfo-to-stainfo.patch rename to package/mtk/drivers/mt_wifi/patches-7661/009-add-secinfo-to-stainfo.patch diff --git a/package/mtk/drivers/mt_wifi/patches/010-remove-addba-noisy-log.patch b/package/mtk/drivers/mt_wifi/patches-7661/010-remove-addba-noisy-log.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/010-remove-addba-noisy-log.patch rename to package/mtk/drivers/mt_wifi/patches-7661/010-remove-addba-noisy-log.patch diff --git a/package/mtk/drivers/mt_wifi/patches/011-fix-wext-txpwr.patch b/package/mtk/drivers/mt_wifi/patches-7661/011-fix-wext-txpwr.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/011-fix-wext-txpwr.patch rename to package/mtk/drivers/mt_wifi/patches-7661/011-fix-wext-txpwr.patch diff --git a/package/mtk/drivers/mt_wifi/patches/012-add-mt7986-memory-shrink-aggress.patch b/package/mtk/drivers/mt_wifi/patches-7661/012-add-mt7986-memory-shrink-aggress.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/012-add-mt7986-memory-shrink-aggress.patch rename to package/mtk/drivers/mt_wifi/patches-7661/012-add-mt7986-memory-shrink-aggress.patch diff --git a/package/mtk/drivers/mt_wifi/patches/013-add-rssi-for-sitesurvey.patch b/package/mtk/drivers/mt_wifi/patches-7661/013-add-rssi-for-sitesurvey.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/013-add-rssi-for-sitesurvey.patch rename to package/mtk/drivers/mt_wifi/patches-7661/013-add-rssi-for-sitesurvey.patch diff --git a/package/mtk/drivers/mt_wifi/patches/014-fix-iwrange.patch b/package/mtk/drivers/mt_wifi/patches-7661/014-fix-iwrange.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/014-fix-iwrange.patch rename to package/mtk/drivers/mt_wifi/patches-7661/014-fix-iwrange.patch diff --git a/package/mtk/drivers/mt_wifi/patches/015-fix-apcli-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7661/015-fix-apcli-stainfo.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/015-fix-apcli-stainfo.patch rename to package/mtk/drivers/mt_wifi/patches-7661/015-fix-apcli-stainfo.patch diff --git a/package/mtk/drivers/mt_wifi/patches/016-fix-apcli-scan-no-ascii-ssid.patch b/package/mtk/drivers/mt_wifi/patches-7661/016-fix-apcli-scan-no-ascii-ssid.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/016-fix-apcli-scan-no-ascii-ssid.patch rename to package/mtk/drivers/mt_wifi/patches-7661/016-fix-apcli-scan-no-ascii-ssid.patch diff --git a/package/mtk/drivers/mt_wifi/patches/017-fix-secinfo-for-iwinfo.patch b/package/mtk/drivers/mt_wifi/patches-7661/017-fix-secinfo-for-iwinfo.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/017-fix-secinfo-for-iwinfo.patch rename to package/mtk/drivers/mt_wifi/patches-7661/017-fix-secinfo-for-iwinfo.patch diff --git a/package/mtk/drivers/mt_wifi/patches/018-fix-he-max-bw.patch b/package/mtk/drivers/mt_wifi/patches-7661/018-fix-he-max-bw.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/018-fix-he-max-bw.patch rename to package/mtk/drivers/mt_wifi/patches-7661/018-fix-he-max-bw.patch diff --git a/package/mtk/drivers/mt_wifi/patches/019-fix-vht-bw.patch b/package/mtk/drivers/mt_wifi/patches-7661/019-fix-vht-bw.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/019-fix-vht-bw.patch rename to package/mtk/drivers/mt_wifi/patches-7661/019-fix-vht-bw.patch diff --git a/package/mtk/drivers/mt_wifi/patches/020-fix-6ghz-channel-list.patch b/package/mtk/drivers/mt_wifi/patches-7661/020-fix-6ghz-channel-list.patch similarity index 100% rename from package/mtk/drivers/mt_wifi/patches/020-fix-6ghz-channel-list.patch rename to package/mtk/drivers/mt_wifi/patches-7661/020-fix-6ghz-channel-list.patch diff --git a/package/mtk/drivers/mt_wifi/patches-7672/001-eeprom-flash-api.patch b/package/mtk/drivers/mt_wifi/patches-7672/001-eeprom-flash-api.patch new file mode 100644 index 0000000000..0cbb9eb50c --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/001-eeprom-flash-api.patch @@ -0,0 +1,116 @@ +--- a/mt_wifi/embedded/common/ee_flash.c 2022-04-25 18:12:11.000000000 +0800 ++++ b/mt_wifi/embedded/common/ee_flash.c 2022-11-02 20:29:54.654154912 +0800 +@@ -27,113 +27,12 @@ + #include "rt_config.h" + #include "hdev/hdev.h" + +-/*decision flash api by compiler flag*/ +-#ifdef CONFIG_PROPRIETARY_DRIVER +-/* +-* @ used for proprietary driver support, can't read/write mtd on driver +-* @ read: mtd flash patrition use request firmware to load +-* @ write: write not support, use ated to write to flash +-*/ +-static void flash_bin_read(void *ctrl, UCHAR *p, ULONG a, ULONG b) +-{ +- struct _RTMP_ADAPTER *ad = ((struct hdev_ctrl *) ctrl)->priv; +- UCHAR *buffer = NULL; +- UINT32 len = 0; +- UCHAR *name = get_dev_eeprom_binary(ad); +- +- /*load from request firmware*/ +- os_load_code_from_bin(ad, &buffer, name, &len); +- +- if (len > 0 && buffer != NULL) { +- os_move_mem(p, buffer + a, b); +- } +- +- if (buffer != NULL) { +-#ifdef MT7981 +- vfree(buffer); +-#else +- os_free_mem(buffer); +-#endif +- } +-} +- +-static void flash_bin_write(void *ctrl, UCHAR *p, ULONG a, ULONG b) +-{ +- MTWF_DBG(NULL, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, +- "proprietary driver not support flash write, will write on ated.\n"); +-} +- +-#define flash_read(_ctrl, _ptr, _offset, _len) flash_bin_read(_ctrl, _ptr, _offset, _len) +-#define flash_write(_ctrl, _ptr, _offset, _len) flash_bin_write(_ctrl, _ptr, _offset, _len) +- +-#else +- +-#ifdef CONFIG_RALINK_FLASH_API +-/* +-* @ The flag "CONFIG_RALINK_FLASH_API" is used for APSoC Linux SDK +-*/ +- +-int32_t FlashRead( +- uint32_t *dst, +- uint32_t *src, +- uint32_t count); +- +-int32_t FlashWrite( +- uint16_t *source, +- uint16_t *destination, +- uint32_t numBytes); +- +-#define flash_read(_ctrl, _ptr, _offset, _len) FlashRead((uint16_t *)_ptr, (uint16_t *)_offset, (uint32_t)_len) +-#define flash_write(_ctrl, _ptr, _offset, _len) FlashWrite(_ptr, _offset, _len) +- +-#else +-/*============================================================================*/ +-#ifdef RA_MTD_RW_BY_NUM +- +-/* +-* @ The flag "CONFIG_RALINK_FLASH_API" is used for APSoC Linux SDK +-*/ +- +-#if defined(CONFIG_RT2880_FLASH_32M) +-#define MTD_NUM_FACTORY 5 +-#else +-#define MTD_NUM_FACTORY 2 +-#endif +-extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char *buf); +-extern int ra_mtd_read(int num, loff_t from, size_t len, u_char *buf); +- +-#define flash_read(_ctrl, _ptr, _offset, _len) ra_mtd_read(MTD_NUM_FACTORY, 0, (size_t)_len, _ptr) +-#define flash_write(_ctrl, _ptr, _offset, _len) ra_mtd_write(MTD_NUM_FACTORY, 0, (size_t)_len, _ptr) +- +-#else +- +-#ifdef CONFIG_WIFI_MTD +-/* +-* @ used mtd mode flash partition from proprietary driver mt_wifi_mtd.c +-*/ + int mt_mtd_write_nm_wifi(char *name, loff_t to, size_t len, const u_char *buf); + int mt_mtd_read_nm_wifi(char *name, loff_t from, size_t len, u_char *buf); + + #define flash_read(_ctrl, _ptr, _offset, _len) mt_mtd_read_nm_wifi("Factory", _offset, (size_t)_len, _ptr) + #define flash_write(_ctrl, _ptr, _offset, _len) mt_mtd_write_nm_wifi("Factory", _offset, (size_t)_len, _ptr) + +-#else +-/* +-* @ use sdk export func. +-*/ +- +-extern int ra_mtd_write_nm(char *name, loff_t to, size_t len, const u_char *buf); +-extern int ra_mtd_read_nm(char *name, loff_t from, size_t len, u_char *buf); +- +-#define flash_read(_ctrl, _ptr, _offset, _len) ra_mtd_read_nm("Factory", _offset, (size_t)_len, _ptr) +-#define flash_write(_ctrl, _ptr, _offset, _len) ra_mtd_write_nm("Factory", _offset, (size_t)_len, _ptr) +- +-#endif /*CONFIG_WIFI_MTD*/ +-#endif /*RA_MTD_RW_BY_NUM*/ +-#endif /* CONFIG_RALINK_FLASH_API */ +-#endif /*CONFIG_PROPRIETERY_DRIVER*/ +- +- + void RtmpFlashRead( + void *hdev_ctrl, + UCHAR *p, diff --git a/package/mtk/drivers/mt_wifi/patches-7672/002-sort-site-survey-table.patch b/package/mtk/drivers/mt_wifi/patches-7672/002-sort-site-survey-table.patch new file mode 100644 index 0000000000..e157978800 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/002-sort-site-survey-table.patch @@ -0,0 +1,10 @@ +--- a/mt_wifi/embedded/common/cmm_info.c 2022-04-25 18:12:15.000000000 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2022-11-10 23:22:13.914830802 +0800 +@@ -6705,6 +6705,7 @@ VOID RTMPIoctlGetSiteSurvey( + OS_WAIT(3000); + } + ++ BssTableSortByRssi(ScanTab,FALSE); + + for (i = bss_start_idx; i < ScanTab->BssNr; i++) { + pBss = &ScanTab->BssEntry[i]; diff --git a/package/mtk/drivers/mt_wifi/patches-7672/003-fix-rxrate-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7672/003-fix-rxrate-stainfo.patch new file mode 100644 index 0000000000..1a5f42ef82 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/003-fix-rxrate-stainfo.patch @@ -0,0 +1,63 @@ +--- a/mt_wifi/embedded/common/cmm_info.c ++++ b/mt_wifi/embedded/common/cmm_info.c +@@ -7164,6 +7164,35 @@ USHORT RTMPGetLastTxRate(PRTMP_ADAPTER p + return lastTxRate.word; + } + ++USHORT RTMPGetLastRxRate(PRTMP_ADAPTER pAd, MAC_TABLE_ENTRY *pEntry) ++{ ++ HTTRANSMIT_SETTING lastRxRate; ++ UCHAR ucBand = HcGetBandByWdev(pEntry->wdev); ++#ifdef RACTRL_FW_OFFLOAD_SUPPORT ++ EXT_EVENT_PHY_STATE_RX_RATE rRxStatResult = {0, 0, 0, 0, 0, 0, 0, 0}; ++#endif ++ os_zero_mem(&lastRxRate, sizeof(HTTRANSMIT_SETTING)); ++ ++#ifdef RACTRL_FW_OFFLOAD_SUPPORT ++ MtCmdPhyGetRxRate(pAd, CMD_PHY_STATE_CONTENTION_RX_PHYRATE, ucBand, pEntry->wcid, &rRxStatResult); ++ lastRxRate.field.MODE = rRxStatResult.u1RxMode; ++ lastRxRate.field.BW = rRxStatResult.u1BW; ++ lastRxRate.field.ldpc = rRxStatResult.u1Coding; ++ lastRxRate.field.ShortGI = rRxStatResult.u1Gi ? 1 : 0; ++ lastRxRate.field.STBC = rRxStatResult.u1Stbc; ++ ++ if (lastRxRate.field.MODE >= MODE_VHT) ++ lastRxRate.field.MCS = ((rRxStatResult.u1RxNsts & 0x3) << 4) + rRxStatResult.u1RxRate; ++ else if (lastRxRate.field.MODE == MODE_OFDM) ++ lastRxRate.field.MCS = getLegacyOFDMMCSIndex(rRxStatResult.u1RxRate & 0xF); ++ else ++ lastRxRate.field.MCS = rRxStatResult.u1RxRate; ++#else ++ lastRxRate.word = pEntry->LastRxRate; ++#endif /* RACTRL_FW_OFFLOAD_SUPPORT */ ++ return lastRxRate.word; ++} ++ + VOID RTMPIoctlGetMacTableStaInfo( + IN PRTMP_ADAPTER pAd, + IN RTMP_IOCTL_INPUT_STRUCT *wrq) +@@ -7175,6 +7204,7 @@ VOID RTMPIoctlGetMacTableStaInfo( + MAC_TABLE_ENTRY *pEntry; + /* allocate memory */ + os_alloc_mem(NULL, (UCHAR **)&pMacTab, sizeof(RT_802_11_MAC_TABLE)); ++ CHAR rssi[4] = {-127, -127, -127, -127}; + + if (pMacTab == NULL) { + MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "Allocate memory fail!!!\n"); +@@ -7207,10 +7237,15 @@ VOID RTMPIoctlGetMacTableStaInfo( + pDst->AvgRssi1 = pEntry->RssiSample.AvgRssi[1]; + pDst->AvgRssi2 = pEntry->RssiSample.AvgRssi[2]; + pDst->AvgRssi3 = pEntry->RssiSample.AvgRssi[3]; ++ rtmp_get_rssi(pAd, pEntry->wcid, rssi, 4); ++ pDst->AvgRssi0 = rssi[0]; ++ pDst->AvgRssi1 = rssi[1]; ++ pDst->AvgRssi2 = rssi[2]; ++ pDst->AvgRssi3 = rssi[3]; + /* the connected time per entry*/ + pDst->ConnectedTime = pEntry->StaConnectTime; + pDst->TxRate.word = RTMPGetLastTxRate(pAd, pEntry); +- pDst->LastRxRate = pEntry->LastRxRate; ++ pDst->LastRxRate = RTMPGetLastRxRate(pAd, pEntry); + pMacTab->Num += 1; + /* Add to avoid Array cross board */ + if (pMacTab->Num >= MAX_LEN_OF_MAC_TABLE) diff --git a/package/mtk/drivers/mt_wifi/patches-7672/004-remove-apcli-bgprotect-log.patch b/package/mtk/drivers/mt_wifi/patches-7672/004-remove-apcli-bgprotect-log.patch new file mode 100644 index 0000000000..259b718a85 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/004-remove-apcli-bgprotect-log.patch @@ -0,0 +1,12 @@ +diff -rupw tmp-orig/mt_wifi/embedded/fsm/sta_mgmt_sync.c tmp/mt_wifi/embedded/fsm/sta_mgmt_sync.c +--- tmp-orig/mt_wifi/embedded/fsm/sta_mgmt_sync.c 2022-04-25 18:12:04.000000000 +0800 ++++ tmp/mt_wifi/embedded/fsm/sta_mgmt_sync.c 2022-11-16 00:51:02.766847750 +0800 +@@ -483,7 +483,7 @@ static BOOLEAN sta_rx_peer_response_upda + } + + HW_SET_PROTECT(pAd, wdev, PROT_PROTOCOL, 0, 0); +- MTWF_DBG(pAd, DBG_CAT_CLIENT, DBG_SUBCAT_ALL, DBG_LVL_WARN, ++ MTWF_DBG(pAd, DBG_CAT_CLIENT, DBG_SUBCAT_ALL, DBG_LVL_INFO, + "SYNC - AP changed B/G protection to %d\n", bUseBGProtection); + } + diff --git a/package/mtk/drivers/mt_wifi/patches-7672/005-use-ext-warp-code.patch b/package/mtk/drivers/mt_wifi/patches-7672/005-use-ext-warp-code.patch new file mode 100644 index 0000000000..c99d55ac5b --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/005-use-ext-warp-code.patch @@ -0,0 +1,16 @@ +--- a/mt_wifi_ap/Makefile ++++ b/mt_wifi_ap/Makefile +@@ -12,8 +12,8 @@ EXTRA_CFLAGS = -I$(WIFI_DRV_PATH)/mt_wifi/include \ + -I$(WIFI_DRV_PATH)/mt_wifi/ate/include \ + -I$(WIFI_DRV_PATH)/mt_wifi/include/mcu \ + -I$(WIFI_DRV_PATH)/mt_wifi/embedded/dbg_txcmd/include \ +- -I$(WIFI_DRV_PATH)/warp_driver/warp \ +- -I$(WIFI_DRV_PATH)/warp_driver/warp/mcu ++ -I$(WIFI_DRV_PATH)/../warp \ ++ -I$(WIFI_DRV_PATH)/../warp/mcu + + ifeq ($(CONFIG_SUPPORT_OPENWRT),y) + GLOBAL_DEFINES = include/uapi/linux/wapp +-- +2.25.1 + diff --git a/package/mtk/drivers/mt_wifi/patches-7672/006-fix-stainfo_struct.patch b/package/mtk/drivers/mt_wifi/patches-7672/006-fix-stainfo_struct.patch new file mode 100644 index 0000000000..21e2d98a6a --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/006-fix-stainfo_struct.patch @@ -0,0 +1,154 @@ +--- a/mt_wifi/embedded/common/cmm_info.c ++++ b/mt_wifi/embedded/common/cmm_info.c +@@ -7157,21 +7157,104 @@ USHORT RTMPGetLastTxRate(PRTMP_ADAPTER p + lastTxRate.field.MCS = getLegacyOFDMMCSIndex(rTxStatResult.rEntryTxRate.MCS) & 0x0000003F; + else + lastTxRate.field.MCS = rTxStatResult.rEntryTxRate.MCS; ++#else ++ lastTxRate.word = pEntry->HTPhyMode.word; ++#endif /* RACTRL_FW_OFFLOAD_SUPPORT */ ++ return lastTxRate.word; ++} ++ ++// fix AvgRssi3 and HTTRANSMIT_SETTING.MODE ++ ++typedef union _HTTRANSMIT_SETTING_FIX { ++#ifdef RT_BIG_ENDIAN ++ struct { ++ USHORT MODE:4; /* Use definition MODE_xxx. */ ++ USHORT iTxBF:1; ++ USHORT eTxBF:1; ++ USHORT STBC:1; /* only support in HT/VHT mode with MCS0~7 */ ++ USHORT ShortGI:1; /* TBD: need to extend to 2 bits for HE GI */ ++ USHORT BW:2; /* channel bandwidth 20MHz/40/80 MHz */ ++ USHORT ldpc:1; ++ USHORT MCS:6; /* MCS */ ++ } field; ++#else ++ struct { ++ USHORT MCS:6; ++ USHORT ldpc:1; ++ USHORT BW:2; ++ USHORT ShortGI:1; ++ USHORT STBC:1; ++ USHORT eTxBF:1; ++ USHORT iTxBF:1; ++ USHORT MODE:4; ++ } field; ++#endif ++ UINT32 word; ++} HTTRANSMIT_SETTING_FIX, *PHTTRANSMIT_SETTING_FIX; + ++typedef struct _RT_802_11_MAC_ENTRY_FIX { ++ UCHAR ApIdx; ++ UCHAR Addr[MAC_ADDR_LEN]; ++ UINT16 Aid; ++ UCHAR Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */ ++ UCHAR MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */ ++ CHAR AvgRssi0; ++ CHAR AvgRssi1; ++ CHAR AvgRssi2; ++ CHAR AvgRssi3; ++ UINT32 ConnectedTime; ++ HTTRANSMIT_SETTING_FIX TxRate; ++ HTTRANSMIT_SETTING_FIX LastRxRate; ++ /* ++ sync with WEB UI's structure for ioctl usage. ++ */ ++ SHORT StreamSnr[3]; /* BF SNR from RXWI. Units=0.25 dB. 22 dB offset removed */ ++ SHORT SoundingRespSnr[3]; /* SNR from Sounding Response. Units=0.25 dB. 22 dB offset removed */ ++ /* SHORT TxPER; */ /* TX PER over the last second. Percent */ ++ /* SHORT reserved;*/ ++} RT_802_11_MAC_ENTRY_FIX, *PRT_802_11_MAC_ENTRY_FIX; ++ ++typedef struct _RT_802_11_MAC_TABLE_FIX { ++ ULONG Num; ++ RT_802_11_MAC_ENTRY_FIX Entry[MAX_LEN_OF_MAC_TABLE]; ++} RT_802_11_MAC_TABLE_FIX, *PRT_802_11_MAC_TABLE_FIX; ++ ++UINT32 RTMPGetLastTxRate_fix(PRTMP_ADAPTER pAd, MAC_TABLE_ENTRY *pEntry) ++{ ++ HTTRANSMIT_SETTING_FIX lastTxRate; ++#ifdef RACTRL_FW_OFFLOAD_SUPPORT ++ EXT_EVENT_TX_STATISTIC_RESULT_T rTxStatResult; ++#endif ++ os_zero_mem(&lastTxRate, sizeof(HTTRANSMIT_SETTING_FIX)); ++#ifdef RACTRL_FW_OFFLOAD_SUPPORT ++ os_zero_mem(&rTxStatResult, sizeof(EXT_EVENT_TX_STATISTIC_RESULT_T)); ++ MtCmdGetTxStatistic(pAd, GET_TX_STAT_ENTRY_TX_RATE, 0/*Don't Care*/, pEntry->wcid, &rTxStatResult); ++ lastTxRate.field.MODE = rTxStatResult.rEntryTxRate.MODE; ++ lastTxRate.field.BW = rTxStatResult.rEntryTxRate.BW; ++ lastTxRate.field.ldpc = rTxStatResult.rEntryTxRate.ldpc ? 1 : 0; ++ lastTxRate.field.ShortGI = rTxStatResult.rEntryTxRate.ShortGI ? 1 : 0; ++ lastTxRate.field.STBC = rTxStatResult.rEntryTxRate.STBC; ++ ++ if (lastTxRate.field.MODE >= MODE_VHT) ++ lastTxRate.field.MCS = (((rTxStatResult.rEntryTxRate.VhtNss - 1) & 0x3) << 4) + rTxStatResult.rEntryTxRate.MCS; ++ else if (lastTxRate.field.MODE == MODE_OFDM) ++ lastTxRate.field.MCS = getLegacyOFDMMCSIndex(rTxStatResult.rEntryTxRate.MCS) & 0x0000003F; ++ else ++ lastTxRate.field.MCS = rTxStatResult.rEntryTxRate.MCS; + #else + lastTxRate.word = pEntry->HTPhyMode.word; + #endif /* RACTRL_FW_OFFLOAD_SUPPORT */ + return lastTxRate.word; + } + +-USHORT RTMPGetLastRxRate(PRTMP_ADAPTER pAd, MAC_TABLE_ENTRY *pEntry) ++UINT32 RTMPGetLastRxRate(PRTMP_ADAPTER pAd, MAC_TABLE_ENTRY *pEntry) + { +- HTTRANSMIT_SETTING lastRxRate; ++ HTTRANSMIT_SETTING_FIX lastRxRate; + UCHAR ucBand = HcGetBandByWdev(pEntry->wdev); + #ifdef RACTRL_FW_OFFLOAD_SUPPORT + EXT_EVENT_PHY_STATE_RX_RATE rRxStatResult = {0, 0, 0, 0, 0, 0, 0, 0}; + #endif +- os_zero_mem(&lastRxRate, sizeof(HTTRANSMIT_SETTING)); ++ os_zero_mem(&lastRxRate, sizeof(HTTRANSMIT_SETTING_FIX)); + + #ifdef RACTRL_FW_OFFLOAD_SUPPORT + MtCmdPhyGetRxRate(pAd, CMD_PHY_STATE_CONTENTION_RX_PHYRATE, ucBand, pEntry->wcid, &rRxStatResult); +@@ -7199,11 +7282,11 @@ VOID RTMPIoctlGetMacTableStaInfo( + { + INT i; + BOOLEAN need_send = FALSE; +- RT_802_11_MAC_TABLE *pMacTab = NULL; +- PRT_802_11_MAC_ENTRY pDst; ++ RT_802_11_MAC_TABLE_FIX *pMacTab = NULL; ++ PRT_802_11_MAC_ENTRY_FIX pDst; + MAC_TABLE_ENTRY *pEntry; + /* allocate memory */ +- os_alloc_mem(NULL, (UCHAR **)&pMacTab, sizeof(RT_802_11_MAC_TABLE)); ++ os_alloc_mem(NULL, (UCHAR **)&pMacTab, sizeof(RT_802_11_MAC_TABLE_FIX)); + CHAR rssi[4] = {-127, -127, -127, -127}; + + if (pMacTab == NULL) { +@@ -7211,7 +7294,7 @@ VOID RTMPIoctlGetMacTableStaInfo( + return; + } + +- NdisZeroMemory(pMacTab, sizeof(RT_802_11_MAC_TABLE)); ++ NdisZeroMemory(pMacTab, sizeof(RT_802_11_MAC_TABLE_FIX)); + + for (i = 0; VALID_UCAST_ENTRY_WCID(pAd, i); i++) { + pEntry = &(pAd->MacTab.Content[i]); +@@ -7244,8 +7327,8 @@ VOID RTMPIoctlGetMacTableStaInfo( + pDst->AvgRssi3 = rssi[3]; + /* the connected time per entry*/ + pDst->ConnectedTime = pEntry->StaConnectTime; +- pDst->TxRate.word = RTMPGetLastTxRate(pAd, pEntry); +- pDst->LastRxRate = RTMPGetLastRxRate(pAd, pEntry); ++ pDst->TxRate.word = RTMPGetLastTxRate_fix(pAd, pEntry); ++ pDst->LastRxRate.word = RTMPGetLastRxRate(pAd, pEntry); + pMacTab->Num += 1; + /* Add to avoid Array cross board */ + if (pMacTab->Num >= MAX_LEN_OF_MAC_TABLE) +@@ -7254,7 +7337,7 @@ VOID RTMPIoctlGetMacTableStaInfo( + } + } + +- wrq->u.data.length = sizeof(RT_802_11_MAC_TABLE); ++ wrq->u.data.length = sizeof(RT_802_11_MAC_TABLE_FIX); + + if (copy_to_user(wrq->u.data.pointer, pMacTab, wrq->u.data.length)) + MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "copy_to_user() fail\n"); diff --git a/package/mtk/drivers/mt_wifi/patches-7672/007-fix-tx-phymode.patch b/package/mtk/drivers/mt_wifi/patches-7672/007-fix-tx-phymode.patch new file mode 100644 index 0000000000..35947a4a86 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/007-fix-tx-phymode.patch @@ -0,0 +1,22 @@ +--- a/mt_wifi/embedded/common/cmm_info.c 2023-08-25 01:53:57.822614787 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2023-08-25 01:51:04.886997741 +0800 +@@ -7045,6 +7045,7 @@ typedef struct _RT_802_11_MAC_TABLE_FIX + UINT32 RTMPGetLastTxRate_fix(PRTMP_ADAPTER pAd, MAC_TABLE_ENTRY *pEntry) + { + HTTRANSMIT_SETTING_FIX lastTxRate; ++ UCHAR phy_mode; + #ifdef RACTRL_FW_OFFLOAD_SUPPORT + EXT_EVENT_TX_STATISTIC_RESULT_T rTxStatResult; + #endif +@@ -7052,7 +7053,10 @@ UINT32 RTMPGetLastTxRate_fix(PRTMP_ADAPT + #ifdef RACTRL_FW_OFFLOAD_SUPPORT + os_zero_mem(&rTxStatResult, sizeof(EXT_EVENT_TX_STATISTIC_RESULT_T)); + MtCmdGetTxStatistic(pAd, GET_TX_STAT_ENTRY_TX_RATE, 0/*Don't Care*/, pEntry->wcid, &rTxStatResult); +- lastTxRate.field.MODE = rTxStatResult.rEntryTxRate.MODE; ++ phy_mode = rTxStatResult.rEntryTxRate.MODE; ++ if (phy_mode >> 3) ++ phy_mode >>= 3; ++ lastTxRate.field.MODE = phy_mode; + lastTxRate.field.BW = rTxStatResult.rEntryTxRate.BW; + lastTxRate.field.ldpc = rTxStatResult.rEntryTxRate.ldpc ? 1 : 0; + lastTxRate.field.ShortGI = rTxStatResult.rEntryTxRate.ShortGI ? 1 : 0; diff --git a/package/mtk/drivers/mt_wifi/patches-7672/008-fix-he-gi-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7672/008-fix-he-gi-stainfo.patch new file mode 100644 index 0000000000..146137008c --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/008-fix-he-gi-stainfo.patch @@ -0,0 +1,38 @@ +--- a/mt_wifi/embedded/common/cmm_info.c 2023-08-25 11:12:38.595484902 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2023-08-25 11:14:03.403925229 +0800 +@@ -6995,7 +6995,7 @@ typedef union _HTTRANSMIT_SETTING_FIX { + USHORT iTxBF:1; + USHORT eTxBF:1; + USHORT STBC:1; /* only support in HT/VHT mode with MCS0~7 */ +- USHORT ShortGI:1; /* TBD: need to extend to 2 bits for HE GI */ ++ USHORT ShortGI:2; + USHORT BW:2; /* channel bandwidth 20MHz/40/80 MHz */ + USHORT ldpc:1; + USHORT MCS:6; /* MCS */ +@@ -7005,7 +7005,7 @@ typedef union _HTTRANSMIT_SETTING_FIX { + USHORT MCS:6; + USHORT ldpc:1; + USHORT BW:2; +- USHORT ShortGI:1; ++ USHORT ShortGI:2; + USHORT STBC:1; + USHORT eTxBF:1; + USHORT iTxBF:1; +@@ -7059,7 +7059,7 @@ UINT32 RTMPGetLastTxRate_fix(PRTMP_ADAPT + lastTxRate.field.MODE = phy_mode; + lastTxRate.field.BW = rTxStatResult.rEntryTxRate.BW; + lastTxRate.field.ldpc = rTxStatResult.rEntryTxRate.ldpc ? 1 : 0; +- lastTxRate.field.ShortGI = rTxStatResult.rEntryTxRate.ShortGI ? 1 : 0; ++ lastTxRate.field.ShortGI = rTxStatResult.rEntryTxRate.ShortGI & 0x3; + lastTxRate.field.STBC = rTxStatResult.rEntryTxRate.STBC; + + if (lastTxRate.field.MODE >= MODE_VHT) +@@ -7088,7 +7088,7 @@ UINT32 RTMPGetLastRxRate(PRTMP_ADAPTER p + lastRxRate.field.MODE = rRxStatResult.u1RxMode; + lastRxRate.field.BW = rRxStatResult.u1BW; + lastRxRate.field.ldpc = rRxStatResult.u1Coding; +- lastRxRate.field.ShortGI = rRxStatResult.u1Gi ? 1 : 0; ++ lastRxRate.field.ShortGI = rRxStatResult.u1Gi & 0x3; + lastRxRate.field.STBC = rRxStatResult.u1Stbc; + + if (lastRxRate.field.MODE >= MODE_VHT) diff --git a/package/mtk/drivers/mt_wifi/patches-7672/009-add-secinfo-to-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7672/009-add-secinfo-to-stainfo.patch new file mode 100644 index 0000000000..63d8b8a538 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/009-add-secinfo-to-stainfo.patch @@ -0,0 +1,27 @@ +--- a/mt_wifi/embedded/common/cmm_info.c ++++ b/mt_wifi/embedded/common/cmm_info.c +@@ -7028,13 +7028,10 @@ typedef struct _RT_802_11_MAC_ENTRY_FIX + UINT32 ConnectedTime; + HTTRANSMIT_SETTING_FIX TxRate; + HTTRANSMIT_SETTING_FIX LastRxRate; +- /* +- sync with WEB UI's structure for ioctl usage. +- */ + SHORT StreamSnr[3]; /* BF SNR from RXWI. Units=0.25 dB. 22 dB offset removed */ + SHORT SoundingRespSnr[3]; /* SNR from Sounding Response. Units=0.25 dB. 22 dB offset removed */ +- /* SHORT TxPER; */ /* TX PER over the last second. Percent */ +- /* SHORT reserved;*/ ++ UINT32 EncryMode; ++ UINT32 AuthMode; + } RT_802_11_MAC_ENTRY_FIX, *PRT_802_11_MAC_ENTRY_FIX; + + typedef struct _RT_802_11_MAC_TABLE_FIX { +@@ -7152,6 +7149,8 @@ VOID RTMPIoctlGetMacTableStaInfo( + pDst->ConnectedTime = pEntry->StaConnectTime; + pDst->TxRate.word = RTMPGetLastTxRate_fix(pAd, pEntry); + pDst->LastRxRate.word = RTMPGetLastRxRate(pAd, pEntry); ++ pDst->EncryMode = pEntry->SecConfig.PairwiseCipher; ++ pDst->AuthMode = pEntry->SecConfig.AKMMap; + pMacTab->Num += 1; + /* Add to avoid Array cross board */ + if (pMacTab->Num >= MAX_LEN_OF_MAC_TABLE) diff --git a/package/mtk/drivers/mt_wifi/patches-7672/010-remove-addba-noisy-log.patch b/package/mtk/drivers/mt_wifi/patches-7672/010-remove-addba-noisy-log.patch new file mode 100644 index 0000000000..268b29e1ec --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/010-remove-addba-noisy-log.patch @@ -0,0 +1,11 @@ +--- a/mt_wifi/embedded/common/cmm_sanity.c 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/common/cmm_sanity.c 2023-09-02 10:45:49.871356520 +0800 +@@ -245,7 +245,7 @@ BOOLEAN PeerAddBARspActionSanity( + pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue); + + if (pAddFrame->BaParm.BAPolicy != IMMED_BA) { +- MTWF_DBG(pAd, DBG_CAT_MLME, DBG_SUBCAT_ALL, DBG_LVL_WARN, "ADDBA Resp Ba Policy[%d] not support\n", pAddFrame->BaParm.BAPolicy); ++ MTWF_DBG(pAd, DBG_CAT_MLME, DBG_SUBCAT_ALL, DBG_LVL_DEBUG, "ADDBA Resp Ba Policy[%d] not support\n", pAddFrame->BaParm.BAPolicy); + return FALSE; + } + diff --git a/package/mtk/drivers/mt_wifi/patches-7672/011-fix-wext-txpwr.patch b/package/mtk/drivers/mt_wifi/patches-7672/011-fix-wext-txpwr.patch new file mode 100644 index 0000000000..1a5e8bb6db --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/011-fix-wext-txpwr.patch @@ -0,0 +1,96 @@ +--- a/mt_wifi/embedded/ap/ap_cfg.c ++++ b/mt_wifi/embedded/ap/ap_cfg.c +@@ -29235,6 +29235,46 @@ INT32 rtmp_get_macPower(IN VOID *pAdSrc) + return retPwr; + } + ++INT32 rtmp_get_mgmtpwr(IN VOID *pAdSrc) ++{ ++ INT8 BandIdx; ++ INT32 Tx_Pwr = 0; ++ PRTMP_ADAPTER ad = (PRTMP_ADAPTER)pAdSrc; ++ POS_COOKIE pObj = NULL; ++ UCHAR apidx = 0; ++ struct wifi_dev *wdev = NULL; ++ ++ if (ad == NULL) { ++ MTWF_DBG(NULL, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "ad null!\n"); ++ return -EFAULT; ++ } ++ pObj = (POS_COOKIE)ad->OS_Cookie; ++ if (pObj == NULL) { ++ MTWF_DBG(NULL, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "pObj null!\n"); ++ return -EFAULT; ++ } ++ ++ if ((pObj->ioctl_if_type == INT_MBSSID) || (pObj->ioctl_if_type == INT_MAIN)) ++ { ++ apidx = pObj->ioctl_if; ++ if (apidx >= ad->ApCfg.BssidNum) ++ return -EFAULT; ++ ++ wdev = &ad->ApCfg.MBSSID[apidx].wdev; ++ ++ if (wdev) ++ BandIdx = HcGetBandByWdev(wdev); ++ else ++ BandIdx = BAND0; ++ ++ Tx_Pwr = (ad->ApCfg.MgmtTxPwr[BandIdx] + ad->ApCfg.EpaFeGain[BandIdx] + (wdev->TxPwrDelta)) / 2; ++ ++ return Tx_Pwr; ++ } ++ ++ return -EFAULT; ++} ++ + #ifdef CONFIG_6G_SUPPORT + INT show_bssmnger_info(RTMP_ADAPTER *pAd, RTMP_STRING *arg) + { +--- a/mt_wifi/os/linux/ap_ioctl.c ++++ b/mt_wifi/os/linux/ap_ioctl.c +@@ -574,6 +574,8 @@ const struct iw_handler_def rt28xx_ap_iw + }; + #endif /* CONFIG_APSTA_MIXED_SUPPORT */ + ++INT32 rtmp_get_mgmtpwr(IN VOID *pAdSrc); ++ + INT rt28xx_ap_ioctl(void *net_dev_obj, void *data_obj, int cmd) /* snowpin for ap/sta */ + { + struct net_device *net_dev; +@@ -801,18 +803,24 @@ INT rt28xx_ap_ioctl(void *net_dev_obj, v + { + INT32 powerval = 0; + +- wdev = pIoctlConfig->wdev; +- if (wdev->if_up_down_state == FALSE) { +- MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, +- "RT_PRIV_IOCTL interface is down, cmd [%x] return!!!\n", cmd); +- return -ENETDOWN; ++ if (RT_DEV_PRIV_FLAGS_GET(net_dev) == INT_MAIN || ++ RT_DEV_PRIV_FLAGS_GET(net_dev) == INT_MBSSID) { ++ wdev = pIoctlConfig->wdev; ++ if (wdev->if_up_down_state == FALSE) { ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, ++ "RT_PRIV_IOCTL interface is down, cmd [%x] return!!!\n", cmd); ++ return -ENETDOWN; ++ } ++ powerval = rtmp_get_mgmtpwr(pAd); ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "power = %d\n", powerval); ++ wrqin->u.txpower.value = powerval;/* The value of the parameter itself */ ++ wrqin->u.txpower.disabled = 0;/* Disable the feature */ ++ wrqin->u.txpower.flags = 0;/* dBm */ ++ wrqin->u.txpower.fixed = 0;/* Hardware should not use auto select */ ++ } else { ++ Status = RTMP_IO_EOPNOTSUPP; + } +- powerval = rtmp_get_macPower(pAd); +- MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "power = %d\n", powerval); +- wrqin->u.txpower.value = powerval;/* The value of the parameter itself */ +- wrqin->u.txpower.disabled = 0;/* Disable the feature */ +- wrqin->u.txpower.flags = 0;/* dBm */ +- wrqin->u.txpower.fixed = 0;/* Hardware should not use auto select */ ++ + break; + } + case SIOCGIWRANGE: /*Get range of parameters */ diff --git a/package/mtk/drivers/mt_wifi/patches-7672/012-add-mt7986-memory-shrink-aggress.patch b/package/mtk/drivers/mt_wifi/patches-7672/012-add-mt7986-memory-shrink-aggress.patch new file mode 100644 index 0000000000..fcd78425ab --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/012-add-mt7986-memory-shrink-aggress.patch @@ -0,0 +1,14 @@ +--- a/mt_wifi/chips/mt7986.c 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/chips/mt7986.c 2023-11-15 09:48:03.261447607 +0800 +@@ -12157,7 +12157,11 @@ + chip_cap->tkn_info.low_water_mark = 5; + chip_cap->tkn_info.hw_tx_token_cnt = 8192; + #ifdef MEMORY_SHRINK ++#ifdef MEMORY_SHRINK_AGGRESS ++ chip_cap->tkn_info.token_rx_cnt = 4592; ++#else + chip_cap->tkn_info.token_rx_cnt = 12288; ++#endif /* MEMORY_SHRINK_AGGRESS */ + #else + chip_cap->tkn_info.token_rx_cnt = 15360; + #endif diff --git a/package/mtk/drivers/mt_wifi/patches-7672/013-add-rssi-for-sitesurvey.patch b/package/mtk/drivers/mt_wifi/patches-7672/013-add-rssi-for-sitesurvey.patch new file mode 100644 index 0000000000..1f0b761b49 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/013-add-rssi-for-sitesurvey.patch @@ -0,0 +1,44 @@ +--- a/mt_wifi/embedded/common/cmm_info.c 2023-11-23 21:25:14.125168685 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2023-11-24 01:50:15.459446886 +0800 +@@ -6317,7 +6317,7 @@ RTMP_STRING *GetAuthMode(CHAR auth) + 3.) UI needs to prepare at least 4096bytes to get the results + ========================================================================== + */ +-#define LINE_LEN (4+4+33+20+23+9+11+7+3+8+10+8) /* No+Channel+SSID+Bssid+Security+Signal+WiressMode+ExtCh+NetworkType+LEN+BcnRept+MWDSCap*/ ++#define LINE_LEN (4+4+33+20+23+8+9+11+7+3+8+10+8) /* No+Channel+SSID+Bssid+Security+RSSI+Signal+WiressMode+ExtCh+NetworkType+LEN+BcnRept+MWDSCap*/ + #ifdef CUSTOMER_VENDOR_IE_SUPPORT + #ifdef CUSTOMER_MAXBITRATE_SUPPORT + #define LINE_LEN (4+4+33+20+33+9+11+7+3+10+8+8) +@@ -6420,14 +6420,13 @@ VOID RTMPCommSiteSurveyData( + Rssi_Quality = (UINT)(((Rssi + 90) * 26) / 10); + else /* < -84 dbm*/ + Rssi_Quality = 0; +-#ifdef CCAPI_API_SUPPORT ++ + LeftBufSize = MsgLen - strlen(msg); +- ret = snprintf(msg + strlen(msg), MsgLen - strlen(msg), "%-8d", Rssi); ++ ret = snprintf(msg + strlen(msg), MsgLen - strlen(msg), "%-8d", Rssi + 0x100); + if (os_snprintf_error(LeftBufSize, ret)) { + MTWF_DBG(NULL, DBG_CAT_AP, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "Snprintf failed!\n"); + return; + } +-#endif + + LeftBufSize = MsgLen - strlen(msg); + ret = snprintf(msg + strlen(msg), LeftBufSize, "%-9d", Rssi_Quality); +@@ -6729,13 +6728,10 @@ VOID RTMPIoctlGetSiteSurvey( + } + #else + LeftBufSize = TotalLen - strlen(msg); +-#ifdef CCAPI_API_SUPPORT ++ + Status = snprintf(msg + strlen(msg), LeftBufSize, "%-4s%-4s%-33s%-20s%-23s%-8s%-9s%-11s%-7s%-3s%-8s\n", + "No", "Ch", "SSID", "BSSID", "Security", "Rssi", "Siganl(%)", "W-Mode", " ExtCH", " NT", " SSID_Len"); +-#else +- Status = snprintf(msg + strlen(msg), LeftBufSize, "%-4s%-4s%-33s%-20s%-23s%-9s%-11s%-7s%-3s%-8s\n", +- "No", "Ch", "SSID", "BSSID", "Security", "Siganl(%)", "W-Mode", " ExtCH", " NT", " SSID_Len"); +-#endif ++ + if (os_snprintf_error(LeftBufSize, Status)) { + MTWF_DBG(pAdapter, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "Snprintf failed!\n"); + goto ERROR; diff --git a/package/mtk/drivers/mt_wifi/patches-7672/014-fix-iwrange.patch b/package/mtk/drivers/mt_wifi/patches-7672/014-fix-iwrange.patch new file mode 100644 index 0000000000..e7b2a86561 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/014-fix-iwrange.patch @@ -0,0 +1,76 @@ +--- a/mt_wifi/os/linux/ap_ioctl.c ++++ b/mt_wifi/os/linux/ap_ioctl.c +@@ -818,8 +818,51 @@ INT rt28xx_ap_ioctl(void *net_dev_obj, v + break; + } + case SIOCGIWRANGE: /*Get range of parameters */ +- Status = NDIS_STATUS_SUCCESS; ++ { ++ if (wrqin->u.data.pointer) { ++#if (KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE) ++ if (access_ok(VERIFY_WRITE, wrqin->u.data.pointer, sizeof(struct iw_range)) != TRUE) ++#else ++ if (access_ok(wrqin->u.data.pointer, sizeof(struct iw_range)) != TRUE) ++#endif ++ break; ++ ++ if (sizeof(struct iw_range) <= wrq->u.data.length) { ++ struct iw_range range; ++ UCHAR BandIdx; ++ UINT32 Freq; ++ USHORT i = 0; ++ CHANNEL_CTRL *pChCtrl; ++ PRTMP_ADAPTER pAdin = (PRTMP_ADAPTER)pAd; ++ wdev = pIoctlConfig->wdev; ++ ++ memset(&range, 0, sizeof(struct iw_range)); ++ ++ range.we_version_compiled = WIRELESS_EXT; ++ ++ BandIdx = HcGetBandByWdev(wdev); ++ pChCtrl = hc_get_channel_ctrl(pAdin->hdev_ctrl, BandIdx); ++ ++ for (i = 0; i < pChCtrl->ChListNum && i < IW_MAX_FREQUENCIES; i++) { ++ RTMP_MapChannelID2KHZ(pChCtrl->ChList[i].Channel, &Freq); ++ range.freq[i].m = Freq / 1000; ++ range.freq[i].e = 6; ++ range.freq[i].i = pChCtrl->ChList[i].Channel; ++ } ++ ++ range.num_channels = i; ++ range.num_frequency = i; ++ ++ wrqin->u.data.length = sizeof(struct iw_range); ++ ++ if (copy_to_user(wrqin->u.data.pointer, &range, sizeof(struct iw_range))) ++ Status = RTMP_IO_EFAULT; ++ } else { ++ Status = RTMP_IO_E2BIG; ++ } ++ } + break; ++ } + case SIOCGIWRETRY: /*get retry limits and lifetime */ + case SIOCSIWRETRY: /*set retry limits and lifetime */ + Status = RTMP_IO_EOPNOTSUPP; +@@ -832,7 +875,7 @@ INT rt28xx_ap_ioctl(void *net_dev_obj, v + if ((wdev != NULL) && (wdev->if_up_down_state == FALSE)) { + if (wdev_down_exec_ioctl(wrq, subcmd) == FALSE) { + MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, +- "interface is down, cmd [%x] return!!!\n", cmd); ++ "interface is down, cmd [%x] subcmd [%x] return!!!\n", cmd, subcmd); + return -ENETDOWN; + } + } +--- a/mt_wifi/embedded/ap/ap_cfg.c ++++ b/mt_wifi/embedded/ap/ap_cfg.c +@@ -29622,6 +29622,9 @@ BOOLEAN wdev_down_exec_ioctl(RTMP_IOCTL_ + } + } + ++ if (cmd == OID_802_11_COUNTRYCODE) ++ retval = TRUE; ++ + if (buf) + os_free_mem(buf); + diff --git a/package/mtk/drivers/mt_wifi/patches-7672/015-fix-apcli-stainfo.patch b/package/mtk/drivers/mt_wifi/patches-7672/015-fix-apcli-stainfo.patch new file mode 100644 index 0000000000..92f0e2f44f --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/015-fix-apcli-stainfo.patch @@ -0,0 +1,13 @@ +--- a/mt_wifi/embedded/common/cmm_info.c 2023-12-02 23:18:03.276254405 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2023-12-02 23:17:35.322785698 +0800 +@@ -7126,7 +7126,9 @@ VOID RTMPIoctlGetMacTableStaInfo( + else + need_send = FALSE; + } +- if (IS_ENTRY_CLIENT(pEntry) && (pEntry->Sst == SST_ASSOC) && (need_send == TRUE)) { ++ if ((IS_ENTRY_CLIENT(pEntry) || IS_ENTRY_PEER_AP(pEntry)) ++ && (pEntry->Sst == SST_ASSOC) ++ && (need_send == TRUE)) { + pDst = &pMacTab->Entry[pMacTab->Num]; + pDst->ApIdx = pEntry->func_tb_idx; + COPY_MAC_ADDR(pDst->Addr, &pEntry->Addr); diff --git a/package/mtk/drivers/mt_wifi/patches-7672/016-fix-apcli-scan-no-ascii-ssid.patch b/package/mtk/drivers/mt_wifi/patches-7672/016-fix-apcli-scan-no-ascii-ssid.patch new file mode 100644 index 0000000000..b5085d88b0 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/016-fix-apcli-scan-no-ascii-ssid.patch @@ -0,0 +1,64 @@ +--- a/mt_wifi/os/linux/ap_ioctl.c 2023-12-03 09:29:00.237904279 +0800 ++++ b/mt_wifi/os/linux/ap_ioctl.c 2023-12-03 09:29:11.851634173 +0800 +@@ -979,6 +979,8 @@ INT rt28xx_ap_ioctl(void *net_dev_obj, v + case RTPRIV_IOCTL_GSITESURVEY: + wdev = pIoctlConfig->wdev; + ++ wrq->u.data.flags = wrqin->u.data.flags; ++ + if ((wdev != NULL) && (wdev->if_up_down_state == FALSE)) { + MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, + "interface is down, cmd [%x] return!!!\n", cmd); +--- a/mt_wifi/embedded/common/cmm_info.c 2023-12-03 09:29:00.241237726 +0800 ++++ b/mt_wifi/embedded/common/cmm_info.c 2023-12-03 09:30:31.017670696 +0800 +@@ -6335,7 +6335,8 @@ RTMP_STRING *GetAuthMode(CHAR auth) + VOID RTMPCommSiteSurveyData( + IN RTMP_STRING *msg, + IN BSS_ENTRY * pBss, +- IN UINT32 MsgLen) ++ IN UINT32 MsgLen, ++ IN BOOLEAN RawSSID) + { + INT Rssi = 0; + UINT Rssi_Quality = 0; +@@ -6355,6 +6356,10 @@ VOID RTMPCommSiteSurveyData( + /*SSID*/ + NdisZeroMemory(Ssid, (MAX_LEN_OF_SSID + 1)); + ++ if (RawSSID) ++ NdisMoveMemory(Ssid, pBss->Ssid, pBss->SsidLen); ++ else ++ { + if (RTMPCheckStrPrintAble((PCHAR)pBss->Ssid, pBss->SsidLen)) + NdisMoveMemory(Ssid, pBss->Ssid, pBss->SsidLen); + else { +@@ -6375,6 +6380,7 @@ VOID RTMPCommSiteSurveyData( + } + } + } ++ } + + LeftBufSize = MsgLen - strlen(msg); + ret = snprintf(msg + strlen(msg), LeftBufSize, "%-33s", Ssid); +@@ -6602,6 +6608,7 @@ BOOLEAN ascii2int(RTMP_STRING *in, UINT3 + } + + #if defined(AP_SCAN_SUPPORT) || defined(CONFIG_STA_SUPPORT) ++#define GET_MAC_TABLE_STRUCT_FLAG_RAW_SSID 0x1 + VOID RTMPIoctlGetSiteSurvey( + IN PRTMP_ADAPTER pAdapter, + IN RTMP_IOCTL_INPUT_STRUCT *wrq) +@@ -6807,7 +6814,12 @@ VOID RTMPIoctlGetSiteSurvey( + MTWF_DBG(pAdapter, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "Snprintf failed!\n"); + goto ERROR; + } +- RTMPCommSiteSurveyData(msg, pBss, TotalLen); ++ ++ if (wrq->u.data.flags & GET_MAC_TABLE_STRUCT_FLAG_RAW_SSID) ++ RTMPCommSiteSurveyData(msg, pBss, TotalLen, true); ++ else ++ RTMPCommSiteSurveyData(msg, pBss, TotalLen, false); ++ + #ifdef WSC_INCLUDED + + /*WPS*/ diff --git a/package/mtk/drivers/mt_wifi/patches-7672/017-fix-secinfo-for-iwinfo.patch b/package/mtk/drivers/mt_wifi/patches-7672/017-fix-secinfo-for-iwinfo.patch new file mode 100644 index 0000000000..b67bc11062 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/017-fix-secinfo-for-iwinfo.patch @@ -0,0 +1,77 @@ +--- a/mt_wifi/embedded/ap/ap_cfg.c 2023-12-03 11:58:49.612252012 +0800 ++++ b/mt_wifi/embedded/ap/ap_cfg.c 2023-12-03 11:58:03.205793459 +0800 +@@ -11419,7 +11419,7 @@ INT RTMPAPQueryInformation( + Status = copy_to_user(wrq->u.data.pointer, &pAd->ApCfg.MBSSID[ifIndex].AccessControlList, sizeof(RT_802_11_ACL)); + + break; +-#ifdef CONFIG_HOTSPOT ++ + #ifdef CONFIG_DOT11V_WNM + + case OID_802_11_WNM_IPV4_PROXY_ARP_LIST: { +@@ -11457,19 +11457,37 @@ INT RTMPAPQueryInformation( + + case OID_802_11_SECURITY_TYPE: { + BSS_STRUCT *pMbss; ++ PSTA_ADMIN_CONFIG pApCliEntry; + PUCHAR pType; +- struct security_type *SecurityType; ++ struct security_type_new *SecurityType; + + MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, + "Query:OID_802_11_SECURITY_TYPE\n"); ++ ++ if (pObj->ioctl_if_type == INT_APCLI && ifIndex >= MAX_APCLI_NUM) { ++ MTWF_DBG(pAd, DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "error station index\n"); ++ return FALSE; ++ } ++ + os_alloc_mem(NULL, &pType, sizeof(*SecurityType)); +- SecurityType = (struct security_type *)pType; ++ SecurityType = (struct security_type_new *)pType; ++ ++ if (pObj->ioctl_if_type == INT_APCLI) { ++ pApCliEntry = &pAd->StaCfg[ifIndex]; ++ SecurityType->ifindex = ifIndex; ++ SecurityType->auth_mode = pApCliEntry->wdev.SecConfig.AKMMap; ++ SecurityType->encryp_type = pApCliEntry->wdev.SecConfig.PairwiseCipher; ++ wrq->u.data.length = sizeof(*SecurityType); ++ Status = copy_to_user(wrq->u.data.pointer, pType, sizeof(*SecurityType)); ++ } else if(pObj->ioctl_if_type == INT_MAIN || pObj->ioctl_if_type == INT_MBSSID) { + pMbss = &pAd->ApCfg.MBSSID[ifIndex]; + SecurityType->ifindex = ifIndex; +- SecurityType->auth_mode = SecAuthModeNewToOld(pMbss->wdev.SecConfig.AKMMap); +- SecurityType->encryp_type = SecEncryModeNewToOld(pMbss->wdev.SecConfig.PairwiseCipher); ++ SecurityType->auth_mode = pMbss->wdev.SecConfig.AKMMap; ++ SecurityType->encryp_type = pMbss->wdev.SecConfig.PairwiseCipher; + wrq->u.data.length = sizeof(*SecurityType); + Status = copy_to_user(wrq->u.data.pointer, pType, sizeof(*SecurityType)); ++ } ++ + os_free_mem(pType); + } + break; +@@ -11527,7 +11545,7 @@ INT RTMPAPQueryInformation( + } + break; + #endif /* CONFIG_HOTSPOT_R3 */ +-#endif ++ + #ifdef WAPP_SUPPORT + case OID_802_11_WIFI_VER: { + int ret; +--- a/mt_wifi/embedded/include/oid.h 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/include/oid.h 2023-12-03 10:30:10.630435691 +0800 +@@ -2002,6 +2002,12 @@ struct security_type { + UINT8 encryp_type; + }; + ++struct security_type_new { ++ UINT32 ifindex; ++ UINT32 auth_mode; ++ UINT32 encryp_type; ++}; ++ + struct wnm_req_data { + UINT32 ifindex; + UCHAR peer_mac_addr[6]; diff --git a/package/mtk/drivers/mt_wifi/patches-7672/020-fix-6ghz-channel-list.patch b/package/mtk/drivers/mt_wifi/patches-7672/020-fix-6ghz-channel-list.patch new file mode 100644 index 0000000000..9d4860a74c --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches-7672/020-fix-6ghz-channel-list.patch @@ -0,0 +1,71 @@ +--- a/mt_wifi/embedded/ap/ap_cfg.c ++++ b/mt_wifi/embedded/ap/ap_cfg.c +@@ -11880,6 +11880,39 @@ INT RTMPAPQueryInformation( + os_free_mem(chn_list); + break; + } ++ case OID_GET_CHANNEL_LIST: ++ { ++ int i = 0; ++ UCHAR BandIdx = 0; ++ CHANNEL_CTRL *pChCtrl = NULL; ++ struct wifi_dev *wdev = NULL; ++ struct channel_list_basic *chn_list; ++ ++ wdev = get_wdev_by_ioctl_idx_and_iftype(pAd, pObj->ioctl_if, pObj->ioctl_if_type); ++ ++ if (wdev == NULL) ++ break; ++ ++ os_alloc_mem(pAd, (UCHAR **)&chn_list, sizeof(struct channel_list_basic)); ++ if (chn_list == NULL) ++ break; ++ NdisZeroMemory(chn_list, sizeof(struct channel_list_basic)); ++ ++ BandIdx = HcGetBandByWdev(wdev); ++ pChCtrl = hc_get_channel_ctrl(pAd->hdev_ctrl, BandIdx); ++ ++ for (i = 0; i < pChCtrl->ChListNum && i < MAX_NUM_OF_CHANNELS; i++) { ++ chn_list->ChList[i].channel_idx = i; ++ chn_list->ChList[i].channel = pChCtrl->ChList[i].Channel; ++ } ++ chn_list->ChListNum = pChCtrl->ChListNum; ++ ++ wrq->u.data.length = sizeof(struct channel_list_basic); ++ Status = copy_to_user(wrq->u.data.pointer, chn_list, wrq->u.data.length); ++ os_free_mem(chn_list); ++ ++ break; ++ } + #ifdef MAP_6E_SUPPORT + case OID_GET_OP_CLASS: + { +--- a/mt_wifi/embedded/include/oid.h ++++ b/mt_wifi/embedded/include/oid.h +@@ -1223,6 +1223,17 @@ typedef struct GNU_PACKED _channel_info + struct msg_channel_list { + CHANNEL_INFO CHANNELLIST[60]; + }; ++ ++typedef struct _channel_info_basic { ++ UINT8 channel; ++ UINT8 channel_idx; ++} CHANNEL_INFO_BASIC, *PCHANNEL_INFO_BASIC; ++ ++struct channel_list_basic { ++ CHANNEL_INFO_BASIC ChList[MAX_NUM_OF_CHANNELS]; ++ UINT8 ChListNum; ++}; ++ + typedef struct GNU_PACKED offchannel_param { + UCHAR channel[MAX_AWAY_CHANNEL]; + UCHAR scan_type[MAX_AWAY_CHANNEL]; +@@ -2565,6 +2576,8 @@ enum vendor_ie_subcmd_oid { + #define OID_SET_AFC_CONFIG 0x09BE + #endif /* CONFIG_6G_AFC_SUPPORT */ + ++#define OID_GET_CHANNEL_LIST 0x09C0 ++ + #ifdef ACS_CTCC_SUPPORT + #define OID_802_11_GET_ACS_CHANNEL_SCORE 0x2014 +