文章目录
最近在调试wifi的热点相关的东西,做下笔记。代码根据log进行调用追踪。
之前说过,我在关闭CONFIG_ACS的开关后,可以实现热点的打开。但我尝试去打开ACS的逻辑开关过后,发现了新的问题,为了方便自己记录流程,所以做了这个笔记。
一、ACS初始化函数
log
2-23 09:29:48.979 2251 2251 I hostapd : ACS: Automatic channel selection started, this may take a bit start !!!!
02-23 09:29:48.979 2251 2251 E hostapd :acs_request_scan funcation start !!!
02-23 09:29:48.979 2251 2251 E hostapd : ACS: Scanning 1 / 5
02-23 09:29:48.979 2251 2251 E hostapd : hostapd_driver_scan 111
02-23 09:29:50.708 2251 2251 E hostapd : acs_request_scan Failed to request initial scan
02-23 09:29:50.708 2251 2251 I hostapd : wlan0: IEEE 802.11 Configured channel (0) or frequency (0) not found from the channel list of the current mode (1) IEEE 802.11g
02-23 09:29:50.708 2251 2251 W hostapd : wlan0: IEEE 802.11 Configured channel (0) or frequency (0) not found from the channel list of the current mode (1) IEEE 802.11g
02-23 09:29:50.709 2251 2251 I hostapd : wlan0: IEEE 802.11 Hardware does not support configured channel
02-23 09:29:50.709 2251 2251 W hostapd : wlan0: IEEE 802.11 Hardware does not support configured channel
02-23 09:29:50.709 2251 2251 E hostapd : Could not select hw_mode and channel. (-3)
02-23 09:29:50.709 2251 2251 I hostapd : wlan0: interface state UNINITIALIZED->DISABLED
02-23 09:29:50.709 2251 2251 I hostapd : wlan0: AP-DISABLED
02-23 09:29:50.709 2251 2251 E hostapd : wlan0: Unable to setup interface.
02-23 09:29:50.709 2251 2251 I hostapd : nl80211: deinit ifname=wlan0 disabled_11b_rates=0
external/wpa_supplicant_8/wpa_supplicant/src/ap/acs.c
/*首先进入初始化函数*/
enum hostapd_chan_status acs_init(struct hostapd_iface *iface)
{
wpa_printf(MSG_INFO, "ACS: Automatic channel selection started, this may take a bit");
if (iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) {
wpa_printf(MSG_INFO, "ACS: Offloading to driver");
if (hostapd_drv_do_acs(iface->bss[0]))
return HOSTAPD_CHAN_INVALID;
return HOSTAPD_CHAN_ACS;
}
if (!iface->current_mode &&
iface->conf->hw_mode != HOSTAPD_MODE_IEEE80211ANY)
return HOSTAPD_CHAN_INVALID;
acs_cleanup(iface);//清除之前的数据防止干扰
/*调用acs_request_scan函数进行扫描*/
if (acs_request_scan(iface) < 0)
return HOSTAPD_CHAN_INVALID;
/*设置接口状态*/
hostapd_set_state(iface, HAPD_IFACE_ACS);
wpa_msg(iface->bss[0

本文记录了在启用ACS(Automatic Channel Selection)功能时遇到的问题,涉及ACS初始化、驱动函数调用和硬件模式选择。开发者在尝试打开ACS逻辑开关后,遇到硬件不支持配置频道导致的初始化失败,重点在于`hostapd_select_hw_mode`和`acs_request_scan`函数中的错误排查。
最低0.47元/天 解锁文章
377

被折叠的 条评论
为什么被折叠?



