android11 wifi扫描列表显示NVRAM警告 (NVRAM WARNING ERR=0X10)

问题

连接wifi时,出现了一个虚假的wifi名为(NVRAM WARNING ERR=0X10),上网查了一下可能是没有写合法的MAC地址。这个warning,是mtk提示您写合法的mac地址。

代码地址

alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen2/common/wlan_lib.c [changed mode: 0644->0755] diff | blob | history
alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen3/common/wlan_lib.c [changed mode: 0644->0755] diff | blob | history
alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7663/common/wlan_lib.c [changed mode: 0644->0755] diff | blob | history
alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7668/common/wlan_lib.c diff | blob | history
alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.c diff | blob | history
alps/vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java [changed mode: 0644->0755] diff | blob | history

具体代码

diff --git a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen2/common/wlan_lib.c b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen2/common/wlan_lib.c
old mode 100644 (file)
new mode 100755 (executable)
index 4d92dcd..b026172
--- a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen2/common/wlan_lib.c
+++ b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen2/common/wlan_lib.c
@@ -4715,10 +4715,12 @@ WLAN_STATUS wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter)
                if (prRegInfo->ucTxPwrValid == 0)
                        u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR;
 
+#if 0
                if (prAdapter->fgIsEmbbededMacAddrValid == FALSE && (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr)
                                                                     || EQUAL_MAC_ADDR(aucZeroMacAddr,
                                                                                       prRegInfo->aucMacAddr)))
                        u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR;
+#endif
 
 #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
                if (prAdapter->fgIsPowerLimitTableValid == FALSE)
diff --git a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen3/common/wlan_lib.c b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen3/common/wlan_lib.c
old mode 100644 (file)
new mode 100755 (executable)
index 92e5979..226a662
--- a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen3/common/wlan_lib.c
+++ b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen3/common/wlan_lib.c
@@ -5079,11 +5079,14 @@ WLAN_STATUS wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter)
                if (prRegInfo->ucTxPwrValid == 0)
                        u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR;
 
+#if 0
                if (prAdapter->fgIsEmbbededMacAddrValid == FALSE && (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr)
                                                                     || EQUAL_MAC_ADDR(aucZeroMacAddr,
                                                                                       prRegInfo->aucMacAddr))) {
                        u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR;
                }
+#endif
+
 #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
                if (prAdapter->fgIsPowerLimitTableValid == FALSE)
                        u4ErrCode |= NVRAM_POWER_LIMIT_TABLE_INVALID;
diff --git a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7663/common/wlan_lib.c b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7663/common/wlan_lib.c
old mode 100644 (file)
new mode 100755 (executable)
index fda66c0..3a93d72
--- a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7663/common/wlan_lib.c
+++ b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7663/common/wlan_lib.c
@@ -5140,13 +5140,15 @@ uint32_t wlanCheckSystemConfiguration(IN struct ADAPTER
 
                if (prRegInfo->ucTxPwrValid == 0)
                        u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR;
-
+#if 0
                if (prAdapter->fgIsEmbbededMacAddrValid == FALSE
                    && (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr)
                        || EQUAL_MAC_ADDR(aucZeroMacAddr,
                                          prRegInfo->aucMacAddr))) {
                        u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR;
                }
+#endif
+
 #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
                if (prAdapter->fgIsPowerLimitTableValid == FALSE)
                        u4ErrCode |= NVRAM_POWER_LIMIT_TABLE_INVALID;
diff --git a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7668/common/wlan_lib.c b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7668/common/wlan_lib.c
index 09003cc..63d5d9b 100755 (executable)
--- a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7668/common/wlan_lib.c
+++ b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4-mt7668/common/wlan_lib.c
@@ -5990,11 +5990,14 @@ WLAN_STATUS wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter)
                if (prRegInfo->ucTxPwrValid == 0)
                        u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR;
 
+#if 0
                if (prAdapter->fgIsEmbbededMacAddrValid == FALSE && (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr)
                                                                     || EQUAL_MAC_ADDR(aucZeroMacAddr,
                                                                                       prRegInfo->aucMacAddr))) {
                        u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR;
                }
+#endif
+
 #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
                if (prAdapter->fgIsPowerLimitTableValid == FALSE)
                        u4ErrCode |= NVRAM_POWER_LIMIT_TABLE_INVALID;
diff --git a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.c b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.c
index a75451e..9825659 100755 (executable)
--- a/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.c
+++ b/alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.c
@@ -5820,13 +5820,15 @@ uint32_t wlanCheckSystemConfiguration(IN struct ADAPTER
                     || prAdapter->rVerInfo.u2FwOwnVersion <
                     CFG_DRV_PEER_VERSION))
                        u4ErrCode |= NVRAM_ERROR_VERSION_MISMATCH;
-
+#if 0
                if (prAdapter->fgIsEmbbededMacAddrValid == FALSE
                    && (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr)
                        || EQUAL_MAC_ADDR(aucZeroMacAddr,
                                          prRegInfo->aucMacAddr))) {
                        u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR;
                }
+#endif
+
 #if CFG_SUPPORT_PWR_LIMIT_COUNTRY
                if (prAdapter->fgIsPowerLimitTableValid == FALSE)
                        u4ErrCode |= NVRAM_POWER_LIMIT_TABLE_INVALID;
diff --git a/alps/vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/alps/vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
old mode 100644 (file)
new mode 100755 (executable)
index 11b5fa4..c3c4052
--- a/alps/vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
+++ b/alps/vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
@@ -489,6 +489,10 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro
                     result.capabilities.contains("[IBSS]")) {
                 continue;
             }
+               //lyz debuf wifi scan list show NVRAM WARNING
+               if(result.SSID.contains("NVRAM WARNING:")){
+                               continue;
+                       }
 
             String apKey = AccessPoint.getKey(mContext, result);
             List<ScanResult> resultList;

代码分析

NVRAM WARNING ERR=0X10 原因是没有写合法的MAC地址。这个warning,是mtk提示您写合法的mac地址。

nvram warning,WIFI时有个解决提示 NVRAM WARNING ERR=0X10的信号项,其实这个是WIFI的mac地址错误警告,是由于NVRAM里面没有固定的MAC地址造成的错误提示,这个时候系统会随机生成一个MAC地址,不影响使用,但是对于某些需要开启mac地址过滤的用户来说是一个麻烦的事情,因为mac地址每次都会自动变更,导致无法针对MTK的机器进行过滤。

 

猜你喜欢

转载自blog.csdn.net/m0_66587877/article/details/131490057