基于android的WIFI流程
2024-01-11 17:27:54 0 举报
- Android 10(Q)的WIFI network代码关系图 - WIFI MT7668U模组driver ko初始化过程 - WIFI 连接AP 流程 注:包涵Driver开、关WPA3时,流程差异 - WIFI设置国家码的API流程 - WIFI驱动中开关WPA3 - WIFI自动连接AP的流程 - Enable WIFI时frameworks 在哪启动wpa_supplicant? - Android 12(S) WIFI frameworks 注册连接状态callback到wpa_supplicant - Android 12(S) WIFI frameworks 监听wpa_supplicant连接状态 - Vendor HAL层与wpa_supplicant和Kernel的关系 - Vendor HAL层与Wifi Frameworks和Kernel的关系 - Vendor HAL层与Wifi Frameworks和Kernel的关系--- 代码流程举例
作者其他创作
大纲/内容
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_mtk libwifi-hal-mt66xx
WIFI自动连接AP的流程
注册callback会从高版本一直尝试到低版本,哪个版本创建iface成功则结束
Scan AP功能
Kernel层
setCountryCode(int8_t[2] code) generates (SupplicantStatus status);
glRegisterBus()模组总线不同,函数实现内容不一样
WifiConnectivityManager.java中扫到此SSID,准备连接前会进行blocklist检查,如果blocklist还没timeout,则不会连接,类似如下打印:WifiNetworkSelector: Networks filtered out due to blocklist: Xiaomi_WPA3_5G:d4:da:21:57:7a:89 /
Android Frameworks(JAVA)
getChipCapabilities(chipResp.value)
Kernel 接收netlink命令NL80211_CMD_REQ_SET_REG,将新的国家码设置到WIFI 模组。流程如下:
wifi driver 通过wiphy_register()注册callback A,HAL 通过socket或ioctl 下命令给kernel,kernel 反馈给driver的callback A
initWlan()模块入口点
源码:/external/wpa_supplicant_8/
connectToNetwork()
mClientModeImpl.sendMessage(Message.obtain(WifiManager.CONNECT_NETWORK))
服务wpa_supplicant在其他流程已经被启动 startDaemon_V1_1()
connectToUserSelectNetwork()
wpa_drv_authenticate()
wpa_supplicant_fast_associate()
Kernel文件 net/wireless/nl80211.c, 此文件数组nl80211_ops[]将接收HAL层的cmd(如NL80211_CMD_NEW_INTERFACE、NL80211_CMD_VENDOR等),具体见左边例子:-Kernel 收到 cmd NL80211_CMD_NEW_INTERFACE时,执行函数.doit,即nl80211_new_interface()- Kernel收到 cmd NL80211_CMD_VENDOR和子命令WIFI_SUBCMD_GET_FEATURE_SET时,执行函数.doit,即nl80211_vendor_cmd(),nl80211_vendor_cmd()调用WIFI driver注册过的命令函数表(wiphy_vendor_command *vcmd = &rdev->wiphy.vendor_commands[i];)
WIFIManager
通过hidl callback,消息送回android frameworks (WifiMonitor.java)
Framework
否,driver不支持WPA3
WIFI设置国家码的API流程
WifiNative、WifiVendorHal、HalDeviceManager
Driver Part
setCountryCodeInternal
WifiManager.java
sta_network.cpp
WIFI driver code ,以MTK wifi mt7663为例
driver 通过wiphy_register()注册callback,HAL 通过socket或ioctl 下命令给kernel,kernel 反馈给driver
wpa_s->drv_flags 包涵 WPA_DRIVER_FLAGS_SME ?
getAllChipInfoCached()
更新WifiBlocklistMonitorfont color=\"#323232\
跳过前面一些流程。setupInterfaceForClientInConnectivityMode()
wpa_supplicant进程的main()函数
WifiScanningService系统服务
wifi_legacy_hal.cpp
函数wpa_driver_nl80211_driver_cmd()实现在静态库,位于/vendor/mediatek/proprietary_tv/apollo/mtk_obj/philips/PH1M_EA_9970A/rel/android/mediatek/device/prebuilt/lib_driver_cmd_mtk.a对应的实际代码估计在文件/vendor/mediatek/proprietary_tv/open/hardware/wlan/mtk/wpa_supplicant_8_lib/driver_cmd_nl80211.c,但没编译进来,使用上面说的静态库
WificondScannerImpl
- 1.5/default/wifi_legacy_hal_factory.cpp或- 1.4/default/wifi_legacy_hal.cpp
厂家HAL静态库与厂家提供的WIFI driver需要协商定义好NL80211_CMD_VENDOR对应 的子命令,否则Kernel无法找到子命令函数,出现不支持或参数错误。尤其是在HAL的厂家与Drvier厂家不同时要特别注意。如:kernel 标准命令NL80211_CMD_VENDOR对应的厂家子命令定义WIFI_SUBCMD_SET_COUNTRY_CODE等
global_func_table_.wifi_get_supported_feature_set()
Set<String> bssidBlocklist = mWifiBlocklistMonitor.updateAndGetBssidBlocklistForSsids( connectedSsids);
wpa_supplicant.c
是
hidl/1.2/supplicant.cpphidl/1.2/supplicant.h: class Supplicant : public V1_2::ISupplicantsupplicant.cpp继承于ISupplicant.hal,也就是supplicant.cpp是ISupplicant.hal的服务端实现文件
WIFI模组采用USB 总线
fetchRssiLinkSpeedAndFrequencyNative()
cfg80211_regd_set_wiphy(prWiphy);国家码相关:注册Regulatory domain回调函数mtk_reg_notify()到netlink
WifiSettingsStore
getCapabilities_1_4()或getCapabilities_1_5()
ScanRequestProxy
startDaemon()
external/wpa_supplicant_8/wpa_supplicant/hidl/1.4/hidl_manager.cpp
wpa_drv_associate()
wpa_supplicant_associate()连接AP时,WPA3开、关不同流程
sme_send_authentication()
blocklist超时时间计算:int baseBlockDurationMs = getBaseBlockDurationForReason(reasonCode);
wpa_supplicant.chal相关目录:/hardware/interfaces/wifi/supplicant/1.0/ISupplicant.hal
WifiNative.setCountryCode()
driver_i.h
wpas_notify_supplicant_initialized()
WifiBlocklistMonitor.java
glP2pCreateWirelessDevice()生成P2P wireless设备,根据KAL_P2P_NUM决定支持P2p数量(最大2个)
WifiServiceImpl.java
wpa_supplicant_event()处理如下部分driver消息
android.hardware.wifi@1.0-service进程
WifiCountryCode.setCountryCode()
Enable WIFI时frameworks 在哪启动wpa_supplicant?
wpa_supplicant进程
通过setLinkSpeed()来更新变量mLinkSpeed
ClientModeImpl
打印log如下
wifi_chip.cpp
wlanDebugInit()初始化调试log等级
在L2ConnectingState对象处理消息:WifiMonitor.ASSOCIATION_REJECTION_EVENT
Kernel
net/wireless/nl80211.c
registerCallback_1_4()
当总线检测到WIFI模组拔掉,则总线会call 函数wlanRemove()
getSupportedFeatures()
使用pci_register_driver()注册WIFI driver到pcie总线
Android Q(10.0) 的AP配置保存路径:/data/misc/wifiAndroid R(11.0) 的AP配置保存路径:/data/misc/apexdata/com.android.wifi
基于Android 的WIFI流程
registerHidlService()
WIFI 模组
Driver code:wlan_driver/gen4m/os/linux/gl_init.c:mtk_wlan_ops.auth = mtk_cfg80211_auth
SupplicantStaIfaceHal.setCountryCode()
WIFI自动连接AP大概是利用类WifiConnectivityManager进行定时scan AP list,并监听得到AP list,从AP list查找是否有已配置的AP,如有,连接此AP。 如遇到无法自动连接AP,则考虑以下:1. 定时Scan AP是否工作2. Scan AP list里是否包涵已配置的AP ?3. 连接过程中连接失败?
SupplicantStaIfaceHal.java
WifiServiceImpl extends IWifiManager.Stub
wpas_notify_iface_added(wpa_s)
StaIface::setCountryCode()
HIDL:ISupplicantStaIface.hal
do_process_drv_event
mWifiInfo.setLinkSpeed(newTxLinkSpeed);
Class GetFeatureSetCommand
WifiNative.java
getSupportedFeatureSet()
NetLink通信
mlme_event_auth()
WifiConnectivityManager.java
Vendor HAL层与wpa_supplicant和Kernel的关系
ClientModeImpl.java
Google Frameworks
Kernel文件 net/wireless/nl80211.c, 此文件数组nl80211_ops[]将接收HAL层的cmd(如NL80211_CMD_NEW_INTERFACE、NL80211_CMD_VENDOR等),具体见左边例子:-Kernel 收到 cmd NL80211_CMD_NEW_INTERFACE时,执行函数.doit,即nl80211_new_interface()- Kernel收到 cmd NL80211_CMD_VENDOR时,执行函数.doit,即nl80211_vendor_cmd(),nl80211_vendor_cmd()调用WIFI driver注册过的命令函数表(wiphy_vendor_command *vcmd = &rdev->wiphy.vendor_commands[i];)
Kernel: net/wireless/nl80211.c:nl80211_authenticate()
Class WifiRequest in cpp_bindings.cpp
doOneArgDriverCommand
WifiScanner
Return AP result
external/wpa_supplicant_8/wpa_supplicant/hidl/1.4/hidl.cpp
WifiMonitor.java
WIFI_HAL_FEATURE_SET
WifiConfigManager
wpa_supplicant_rx_eapol( )4次握手
legacy_hal_.lock()->getSupportedFeatureSet(ifname);
ISupplicantStaIface.hal、Supplicant.hal服务注册到系统。流程如下:
当总线检测到WIFI模组插入,则总线会call 函数wlanProbe()
lib_driver_cmd_mtk.a实现函数wpa_driver_nl80211_driver_cmd(),此函数被wpa_supplicant进程 使用
lib_driver_cmd_mtk.a
setCountryCodeNative(country)
hidl_manager->registerInterface(wpa_s);
src/drivers/driver_nl80211.c
调用 driver_cmd对应用函数
AIDL: IWificond
mISupplicantStaNetwork.select()
APP
其他总结时,glRegisterBus()会各不一样
setupIface() 在WIFI enable时创建interface
reg_process_pending_hints()
setCountryCode
hidl/1.2/hidl.cpp
Supplicant supplicant_object_ = new Supplicant(global);supplicant_object_->registerAsService()把ISupplicant.hal(supplicant.cpp)注册为系统服务
handleScanResults()
startAndWaitForSupplicantConnection()
WIFI连接、断开等功能
user_reg_hint_type == NL80211_USER_REG_HINT_INDOOR
wpa_driver_nl80211_ops.authenticate = driver_nl80211_authenticate
分配完成NL80211_CMD_ASSOCIATE
regulatory_hint_indoor()
a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/interfaces/a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/interfaces/wifi/a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/interfaces/wifi/1.4/a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/interfaces/wifi/1.4/default/a href=\"http://twtps537.tpvaoc.com:8080/2k22_mtk_msaf_r_devprod/xref/hardware/interfaces/wifi/1.4/default/wifi_chip.cpp 或hardware/interfaces/wifi/1.5/default/wifi_chip.cpp
reg_process_hint_user()
wifi_hal_fn global_func_table_初始化,参考:init_wifi_vendor_hal_func_table
EVENT_AUTH
通知Completed到Framework ???
在android版本迭代过程中,这个函数名没变,搜索时使用此关键字:startSupplicantstartSupplicant()
Kernel 接收cmd NL80211_CMD_VENDOR
WIFI 连接AP 流程
nl80211_req_set_reg()在genl_ops nl80211_ops[]进行映射
ConnectivityService服务
WIFI driver
WIFI MT7668U模组driver ko初始化过程
wifi_hal_fn global_func_table_;
wpa_driver_nl80211_ops..associate = wpa_driver_nl80211_associate
external/wpa_supplicant_8/wpa_supplicant/events.c
厂家HAL wifi_hal.cpp
为什么被assoc reject (WifiMonitor.ASSOCIATION_REJECTION_EVENT)后,要等5分钟才能再连接 ?
getAllChipInfo()
厂家HAL code,如:/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/tv/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/tv/hardware/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/tv/hardware/wlan/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/tv/hardware/wlan/mtk/wlan_hal/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/vendor/mediatek/tv/hardware/wlan/mtk/wlan_hal/wifi_hal.cpp
wpas_hidl_notify_assoc_reject()
/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/external/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/external/wpa_supplicant_8/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/external/wpa_supplicant/a href=\"http://twtps537.tpvaoc.com:8080/2k23_mtk_aow_s_devprod/xref/external/wpa_supplicant_8/wpa_supplicant/notify.c
regulatory_hint_user()initiator设为 NL80211_REGDOM_SET_BY_USER
sme_event_auth( )
WifiInfo
net/wireless/reg.c
wiphy_register(prWiphy)注册到kernel
user_reg_hint_type == NL80211_USER_REG_HINT_USER 或 NL80211_USER_REG_HINT_CELL_BASE
是,driver支持WPA3
getSupportedIfaceTypesInternal()
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_mtk libwifi-hal-mt66xx
procInitFs()创建目录:/proc/net/wlan
setupStaIface()
wpas_notify_state_changed()
sta_iface.cpp源码:/external/wpa_supplicant_8/wpa_supplicant/hidl/1.2/sta_iface.cpp
wpas_notify_assoc_status_code()
mMsg
WIFI network代码关系图
SupplicantStaIfaceHal
wpa_supplicant_event(EVENT_ASSOC)
Android 12(S) WIFI frameworks 注册连接状态callback到wpa_supplicant
font color=\"#323232\
厂家HAL,控制WIFI 驱动创建节点,设置Countrycode,获取WIFI feature集合等。参考:Vendor HAL层与Wifi Frameworks和Kernel的关系
iface.setCountryCode(code);
WifiNative
使用property方式来启动服务 wpa_supplicant INIT_SERVICE_NAME = \"wpa_supplicant\
使用usb_egister()注册WIFI driver到usb总线时,usb调用probe()
wpa_supplicant_event_assoc()
getLinkSpeed()返回变量mLinkSpeed
Driver 拿到feature 集合值此后,调用此函数返回给kernel。cfg80211_vendor_cmd_alloc_reply_skb()
认证完成NL80211_CMD_AUTHENTICATE
StaNetwork::select(select_cb _hidl_cb)
HAL层库,wifi 厂家提供的静态库MTK: libwifi-hal-mt66xx.aRTK: libwifi-hal-rtk.a具体参考: frameworks/opt/net/wifi/libwifi_hal/Android.mk
registerCallbackInternal_1_4()
ClientModeImpl.WifiNetworkAgent
HAL
fn->wifi_get_supported_feature_set = wifi_get_supported_feature_set;
onAssociationRejected_1_4()
WIFI driver定义支持的命令函数表(struct wiphy_vendor_command),并通过wiphy_register()把driver支持的命令注册到kernel. 这样kernel在收到 cmd NL80211_CMD_VENDOR和子命令WIFI_SUBCMD_GET_FEATURE_SET时,执行driver对应的函数功能 mtk_cfg80211_vendor_get_supported_feature_set()。
wpa_drv_driver_cmd
通过netlink发送 cmd=NL80211_CMD_CONNECT到kernel/driver
mtk_cfg80211_vendor_get_supported_feature_set()
msg: CMD_START_CONNECT
wlanRemove()
Start Scan AP
发消息到Kernelnl_msg *mMsg;- create(NL80211_CMD_VENDOR);-- -> genlmsg_put(mMsgspan style=\"font-size: inherit;\
HDIL层
HalDeviceManager.java
reg_process_hint_country_ie()
AIDL: IWifiScanner
NetLink或Socket
配置wireless_dev & wiphy
源码:/vendor/mediatek/proprietary_tv/apollo/linux_mts/ko_modules/wlan_driver/gen4m/
SupplicantStaIfaceHal.java
文件:frameworks/base/wifi/java/android/net/wifi/WifiManager.javaAPI:setCountryCode()
android.hardware.wifi.supplicant.V1_4.ISupplicantStaIface iface;iface.registerCallback_1_4(callback);
insmod wlan.ko时调用函数initWlan()
wpas_start_assoc_cb()
handleAssocRejectEvent(assocRejectInfo)
iface.signalPoll();
Framework处理,在哪处理?
API: connect()
wpa_driver_nl80211_driver_cmd()
SupplicantStaNetworkHal.select()
EVENT_ASSOC_REJECT
WifiVendorHal
Android Frameworks(NATIVE)
Select bssid ?
通过netlink发送 cmd=NL80211_CMD_AUTHENTICATE到kernel/driver
updateAndGetBssidBlocklistInternal
getSupplicantMockableV1_1()
onPnoNetworkFound()接收到Driver返回的AP list
selectInternal()
wpa_supplicant_event(EVENT_AUTH )
wpas_hidl_notify_state_changed()
WIFI模组采用PCIE总线
wlanCreateWirelessDevice()做如下动作:<1.1> Create wireless_dev <1.2> Create wiphy<1.3> configure wireless_dev & wiphy <1.4> wowlan support <1.5> Use wireless extension to replace IOCTL
EVENT_DISASSOC
mNetworkSelector.selectNetwork()
WificondControl
Todo : driver ...完成后发送NL80211_CMD_ASSOCIATE到wpa_supplicant
xml config来配置时间:- config_wifiBssidBlocklistMonitorConnectedScoreBaseBlockDurationMs- config_wifiBssidBlocklistMonitorBaseBlockDurationMs
sme_authenticate()
WIFI driver定义支持的命令函数表(struct wiphy_vendor_command),并通过wiphy_register()把driver支持的命令注册到kernel. 这样kernel在收到 cmd NL80211_CMD_VENDOR和子命令时,执行driver对应的函数功能。
broadcastAssociationRejectionEvent()
否
ISupplicantStaIface.hal/hardware/interfaces/wifi/supplicant/1.0/ISupplicantStaIface.hal
EVENT_AUTH_TIMED_OUT
Android 12(S) WIFI frameworks 监听wpa_supplicant连接状态
Set<String> bssidBlocklist = updateAndGetBssidBlocklist()
wiphy_update_regulatory()
handleBssidConnectionFailureInternal()
wpa_driver_nl80211_try_connect()
WifiService/WifiServiceImp系统服务
getSupportedIfaceTypes()
kalInitIOBuffer(is_pre_alloc)根据is_pre_alloc来决定是否预分配io buffer
WifiVendorHal.java
blocklist超时时间计算:int baseBlockDurationMs = getBaseBlockDurationForReason(reasonCode);
IWifiStaIface.halIWifiIface.halIWifiChip.hal
WIFI driver code ,以MTK wifi mt7663为例wiphy_vendor_command数组中包涵如下:font color=\"#e74f4c\
driver 完成authenticate认证后,发送cmd=NL80211_CMD_AUTHENTICATE到wpa_supplicant, NL80211_CMD_ASSOCIATE类似
android.hardware.wifi@1.0-service服务
mlme_event_assoc()
Wifcond进程
什么时候blocklist计数复位清0?
main.c
queue_regulatory_request()
wpa_supplicant_set_state()更新状态,并用HIDL通知状态到Framework
libwifi-hal.so编译时包涵wifi 厂家提供的静态库
global->hidl = wpas_hidl_init(global);
hidl/1.2/hidl_manager.cpp
更新WIFi configuration的状态为font color=\"#323232\
notify.c
EVENT_ASSOC_TIMED_OUT
SupplicantStaNetworkHal.java
getSupplicantMockable()
sme_associate( )请求分配ip
module_init(initWlan);
厂家HAL静态库实现:将cmd(如NL80211_CMD_NEW_INTERFACE、NL80211_CMD_VENDOR等)发给kernel。- HAL函数wifi_virtual_interface_create对应NL80211_CMD_NEW_INTERFACE- HAL函数wifi_set_country_code对应NL80211_CMD_VENDOR和GOOGLE_OUIWifiRequest mMsg;nl_msg *mMsg = nlmsg_alloc()
IWifiApIface.hal如setApCountryCode
WIFI驱动中开关WPA3
AIDL
<hal format=\"hidl\" optional=\"true\"> <name>android.hardware.wifi.supplicant</name> <transport>hwbinder</transport> <version>1.4</version> <interface> <name>ISupplicant</name> <instance>default</instance> </interface> </hal>
reg_todo()
HAL层库,wifi 厂家提供的库lib_driver_cmd_mtk.a
- Android 10(Q)的WIFI network代码关系图- WIFI MT7668U模组driver ko初始化过程- WIFI 连接AP 流程 注:包涵Driver开、关WPA3时,流程差异- WIFI设置国家码的API流程- WIFI驱动中开关WPA3- WIFI自动连接AP的流程- Enable WIFI时frameworks 在哪启动wpa_supplicant?- Android 12(S) WIFI frameworks 注册连接状态callback到wpa_supplicant- Android 12(S) WIFI frameworks 监听wpa_supplicant连接状态- Vendor HAL层与wpa_supplicant和Kernel的关系- Vendor HAL层与Wifi Frameworks和Kernel的关系- Vendor HAL层与Wifi Frameworks和Kernel的关系--- 代码流程举例
hidl/1.2/sta_iface.cpphidl/1.2/sta_iface.h: class StaIface : public V1_2::ISupplicantStaIfacesta_iface.cpp继承于ISupplicantStaIface.hal,也就是sta_iface.cpp是ISupplicantStaIface.hal的服务端实现文件
updateCountryCode
wpa_supplicant创建socket节点:/data/vendor/wifi/wpa/sockets/wlan0 和 /data/vendor/wifi/wpa/sockets/p2p0
WIFI模组采用其它总线
wlanProbe()Wlan探测功能。此函数用于探测和初始化设备
reg_process_hint()
厂家HAL静态库实现:将cmd(如NL80211_CMD_NEW_INTERFACE、NL80211_CMD_VENDOR等)发给kernel。- HAL函数wifi_virtual_interface_create对应NL80211_CMD_NEW_INTERFACE- HAL函数wifi_set_country_code对应NL80211_CMD_VENDOR和GOOGLE_OUIWifiRequest mMsg;nl_msg *mMsg = nlmsg_alloc()
SupplicantStaIfaceCallbackImpl.java
Framework获取WIFI feature集合的代码流程
mSupplicantStaIfaceHal.connectToNetwork()
mWificondControl.signalPoll(ifaceName)
wpa_supplicant_select_network()
EVENT_ASSOC
wlanCreateWirelessDevice()生成station wireless设备:注册模组设备的操作接口到kernel
Vendor HAL层与Wifi Frameworks和Kernel的关系--- 代码流程举例
wpa_supplicant_init()注册ISupplicant.hal(supplicant.cpp)为系统服务
WifiConfigStore
rdev_auth()
WIFI driver 代码: prWiphy->reg_notifier = mtk_reg_notify;
Vendor HAL层与Wifi Frameworks和Kernel的关系
HIDL
mSupplicantStaIfaceHal.startDaemon()
onAssociationRejected()
WIFI frameworks
WifiCountryCode.java
external/wpa_supplicant_8/wpa_supplicant/hidl/1.4/sta_iface.cpp
ClientModeImpl.java的class L2ConnectedState
notifyStateChange()
onAssociationRejected_1_4()调用 android framework注册的callback函数
WIFI Driver ko
API:getSupportedFeatures 流程结束
wpas_hidl_register_interface(wpa_s)
prWiphy->reg_notifier = mtk_reg_notify国家码相关
send_and_recv()调用netlink socket将命令通过kernel标准span style=\
wpa_supplicant_connect()
select()
Kernel: net/wireless/nl80211.c:nl80211_connect()
connectToNetwork(candidate)
mWifiNative.signalPoll(mInterfaceName)
USB接口
running V1_1 of the HAL ?isV1_1()?
Driver读feature 集合值u4FeatureSet =wlanGetSupportedFeatureSet(prGlueInfo)
ISupplicantStaNetwork.hal
ISupplicant iSupplicant = ISupplicant.getService();
sme_auth_start_cb()
connectToNetwork()
mCountryCode.setCountryCode(countryCode)
wifi_get_supported_feature_set()
WifiMonitor
AIDL: IWifiScannerImpl
os/linux/gl_init.c
SupplicantStaIfaceCallbackV1_4Impl.java
reg_process_hint_core()
registerInterface()
reg_process_hint_driver()
mtk_usb_probe()
hidl_manager->registerHidlService(global);
根据initiator值来判断
Linux Kernel
WifiConnectivityManager
driver_nl80211_authenticate()
收藏
收藏
0 条评论
回复 删除
下一页