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.cdiff | blob | history
alps/vendor/mediatek/kernel_modules/connectivity/wlan/core/gen4m/common/wlan_lib.cdiff | 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的机器进行过滤。

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android框架中,NVRAM(非易失性随机存储器)被用于存储系统相关的配置和参数,如无线通信模块的MAC地址、IMEI号码等。NVRAM的读写在Android设备的系统级别中发挥重要作用。 首先,NVRAM读取功能在Android框架中由系统服务提供,通过封装底层的硬件接口和驱动程序来实现。Android的系统服务负责与硬件之间的通信,从NVRAM中读取所需的参数。在读取过程中,通过定义和使用适当的API,应用程序或系统组件可以请求读取特定的NVRAM值,以进行相关的操作和功能。 其次,NVRAM的写入功能也是由系统服务提供的。当应用程序或系统组件需要修改某个NVRAM参数时,可以通过调用相应的API来实现。系统服务将接收到的修改请求转发给硬件接口和驱动程序,然后将新值写入NVRAM中。这样,NVRAM中对应的参数将被更新,以满足新的需求。 在Android框架中,NVRAM读写功能的正确实现对于系统的正常运行非常重要。它确保各种系统组件可以正确访问配置和参数信息,并确保设备在启动时能够正确初始化。同时,NVRAM的读写操作需要受到适当的权限控制,只有具备足够权限的应用程序或系统组件才能进行相关的操作。 综上所述,Android框架中的NVRAM读写功能通过系统服务提供,并且在系统级别中发挥重要作用。这种功能确保了系统配置和参数的正确访问和修改,从而保障设备的正常运行。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值