mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-07 01:53:34 +08:00
mt_wifi: add mtwifi 7.6.6.1 src
warp: add warp-20221209 src
This commit is contained in:
parent
3e744a313d
commit
61700ed7eb
BIN
dl/mt798x-7.6.6.1-src.tar.xz
Normal file
BIN
dl/mt798x-7.6.6.1-src.tar.xz
Normal file
Binary file not shown.
BIN
dl/warp_20221209-3e6ae1-src.tar.xz
Normal file
BIN
dl/warp_20221209-3e6ae1-src.tar.xz
Normal file
Binary file not shown.
@ -9,16 +9,16 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
PKG_NAME:=mt_wifi
|
PKG_NAME:=mt_wifi
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_CHIP_MT7981),y)
|
ifeq ($(CONFIG_MTK_CHIP_MT7981),y)
|
||||||
PKG_VERSION:=7.6.7.0-mt7981
|
PKG_SUFFIX:=mt7981
|
||||||
PKG_SOURCE:=mt7981-7.6.7.0-20221209-b9c02f-obj.tar.xz
|
|
||||||
else
|
else
|
||||||
ifeq ($(CONFIG_MTK_CHIP_MT7986),y)
|
ifeq ($(CONFIG_MTK_CHIP_MT7986),y)
|
||||||
PKG_VERSION:=7.6.7.0-mt7986
|
PKG_SUFFIX:=mt7986
|
||||||
PKG_SOURCE:=mt7986-7.6.7.0-20221209-b9c02f-obj.tar.xz
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_BUILD_DEPENDS:=warp
|
PKG_BUILD_DEPENDS:=warp
|
||||||
|
PKG_SOURCE:=mt798x-7.6.6.1-src.tar.xz
|
||||||
|
PKG_VERSION:=7.6.6.1-$(PKG_SUFFIX)
|
||||||
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||||
@ -284,7 +284,7 @@ define KernelPackage/mt_wifi
|
|||||||
DEPENDS+=+kmod-conninfra
|
DEPENDS+=+kmod-conninfra
|
||||||
DEPENDS+=+kmod-mediatek_hnat
|
DEPENDS+=+kmod-mediatek_hnat
|
||||||
FILES:=$(PKG_BUILD_DIR)/mt_wifi_ap/mt_wifi.ko \
|
FILES:=$(PKG_BUILD_DIR)/mt_wifi_ap/mt_wifi.ko \
|
||||||
$(PKG_BUILD_DIR)/mt_wifi_ap/mtk_warp_proxy.ko
|
$(PKG_BUILD_DIR)/mt_wifi/embedded/plug_in/warp_proxy/mtk_warp_proxy.ko
|
||||||
DEPENDS+=+kmod-warp
|
DEPENDS+=+kmod-warp
|
||||||
AUTOLOAD:=$(call AutoProbe,mt_wifi mtk_warp_proxy)
|
AUTOLOAD:=$(call AutoProbe,mt_wifi mtk_warp_proxy)
|
||||||
SUBMENU:=Drivers
|
SUBMENU:=Drivers
|
||||||
|
116
package/mtk/drivers/mt_wifi/patches/001-eeprom-flash-api.patch
Normal file
116
package/mtk/drivers/mt_wifi/patches/001-eeprom-flash-api.patch
Normal file
@ -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,
|
@ -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];
|
@ -0,0 +1,66 @@
|
|||||||
|
diff -rupw tmp-orig/mt_wifi/embedded/common/cmm_info.c tmp/mt_wifi/embedded/common/cmm_info.c
|
||||||
|
--- tmp-orig/mt_wifi/embedded/common/cmm_info.c 2022-04-25 18:12:15.000000000 +0800
|
||||||
|
+++ tmp/mt_wifi/embedded/common/cmm_info.c 2022-11-12 18:39:29.117486205 +0800
|
||||||
|
@@ -6898,6 +6898,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)
|
||||||
|
@@ -6909,6 +6938,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");
|
||||||
|
@@ -6937,13 +6967,14 @@ VOID RTMPIoctlGetMacTableStaInfo(
|
||||||
|
pDst->MimoPs = pEntry->MmpsMode;
|
||||||
|
#endif /* DOT11_N_SUPPORT */
|
||||||
|
/* Fill in RSSI per entry*/
|
||||||
|
- pDst->AvgRssi0 = pEntry->RssiSample.AvgRssi[0];
|
||||||
|
- pDst->AvgRssi1 = pEntry->RssiSample.AvgRssi[1];
|
||||||
|
- pDst->AvgRssi2 = pEntry->RssiSample.AvgRssi[2];
|
||||||
|
+ rtmp_get_rssi(pAd, pEntry->wcid, rssi, 4);
|
||||||
|
+ pDst->AvgRssi0 = rssi[0];
|
||||||
|
+ pDst->AvgRssi1 = rssi[1];
|
||||||
|
+ pDst->AvgRssi2 = rssi[2];
|
||||||
|
/* 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)
|
@ -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);
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
|
@ -8,15 +8,8 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=warp
|
PKG_NAME:=warp
|
||||||
|
|
||||||
ifeq ($(CONFIG_WARP_CHIPSET),"mt7981")
|
|
||||||
PKG_VERSION:=20221209-3e6ae1
|
PKG_VERSION:=20221209-3e6ae1
|
||||||
PKG_SOURCE:=mt7981_warp-20221209-3e6ae1-obj.tar.xz
|
PKG_SOURCE:=warp_20221209-3e6ae1-src.tar.xz
|
||||||
else
|
|
||||||
ifeq ($(CONFIG_WARP_CHIPSET),"mt7986")
|
|
||||||
PKG_VERSION:=20221209-3e6ae1
|
|
||||||
PKG_SOURCE:=mt7986_warp-20221209-3e6ae1-obj.tar.xz
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||||
PKG_KCONFIG:= \
|
PKG_KCONFIG:= \
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -rupw warp/warp_ser.c warp-new/warp_ser.c
|
||||||
|
--- warp/warp_ser.c 2022-04-25 17:09:39.000000000 +0800
|
||||||
|
+++ warp-new/warp_ser.c 2022-10-23 01:33:00.447263140 +0800
|
||||||
|
@@ -287,7 +287,7 @@ wed_ser_task(void *data)
|
||||||
|
|
||||||
|
while (!kthread_should_stop()) {
|
||||||
|
wed_ser_detect(wed);
|
||||||
|
- msleep(ser_ctrl->period_time);
|
||||||
|
+ msleep_interruptible(ser_ctrl->period_time);
|
||||||
|
}
|
||||||
|
warp_dbg(WARP_DBG_OFF, "%s(): wed_ser exist, wed->irq=%d!\n", __func__,
|
||||||
|
wed->irq);
|
Loading…
x
Reference in New Issue
Block a user