ACS: Handle ACS channel selected event in specified link
When ACS offloaded to the driver, the channel selected event carries link id to specify the link if operating as AP MLD. Find the specified link to handle this event. Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
This commit is contained in:
parent
0e91a86ec5
commit
e650fa4d79
3 changed files with 25 additions and 3 deletions
|
@ -1278,6 +1278,18 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
|
|||
int err = 0;
|
||||
struct hostapd_channel_data *pri_chan;
|
||||
|
||||
#ifdef CONFIG_IEEE80211BE
|
||||
if (acs_res->link_id != -1) {
|
||||
hapd = hostapd_mld_get_link_bss(hapd, acs_res->link_id);
|
||||
if (!hapd) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"MLD: Failed to get link BSS for EVENT_ACS_CHANNEL_SELECTED link_id=%d",
|
||||
acs_res->link_id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211BE */
|
||||
|
||||
if (hapd->iconf->channel) {
|
||||
wpa_printf(MSG_INFO, "ACS: Channel was already set to %d",
|
||||
hapd->iconf->channel);
|
||||
|
|
|
@ -6618,7 +6618,9 @@ union wpa_event_data {
|
|||
* @ch_width: Selected Channel width by driver. Driver may choose to
|
||||
* change hostapd configured ACS channel width due driver internal
|
||||
* channel restrictions.
|
||||
* hw_mode: Selected band (used with hw_mode=any)
|
||||
* @hw_mode: Selected band (used with hw_mode=any)
|
||||
* @puncture_bitmap: Indicate the puncturing channels
|
||||
* @link_id: Indicate the link id if operating as AP MLD; -1 otherwise
|
||||
*/
|
||||
struct acs_selected_channels {
|
||||
unsigned int pri_freq;
|
||||
|
@ -6629,6 +6631,7 @@ union wpa_event_data {
|
|||
u16 ch_width;
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
u16 puncture_bitmap;
|
||||
int link_id;
|
||||
} acs_selected_channels;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2737,8 +2737,14 @@ static void qca_nl80211_acs_select_ch(struct wpa_driver_nl80211_data *drv,
|
|||
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_PUNCTURE_BITMAP])
|
||||
event.acs_selected_channels.puncture_bitmap =
|
||||
nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_PUNCTURE_BITMAP]);
|
||||
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_LINK_ID])
|
||||
event.acs_selected_channels.link_id =
|
||||
nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_LINK_ID]);
|
||||
else
|
||||
event.acs_selected_channels.link_id = -1;
|
||||
|
||||
wpa_printf(MSG_INFO,
|
||||
"nl80211: ACS Results: PFreq: %d SFreq: %d BW: %d VHT0: %d VHT1: %d HW_MODE: %d EDMGCH: %d PUNCBITMAP: 0x%x",
|
||||
"nl80211: ACS Results: PFreq: %d SFreq: %d BW: %d VHT0: %d VHT1: %d HW_MODE: %d EDMGCH: %d PUNCBITMAP: 0x%x, LinkId: %d",
|
||||
event.acs_selected_channels.pri_freq,
|
||||
event.acs_selected_channels.sec_freq,
|
||||
event.acs_selected_channels.ch_width,
|
||||
|
@ -2746,7 +2752,8 @@ static void qca_nl80211_acs_select_ch(struct wpa_driver_nl80211_data *drv,
|
|||
event.acs_selected_channels.vht_seg1_center_ch,
|
||||
event.acs_selected_channels.hw_mode,
|
||||
event.acs_selected_channels.edmg_channel,
|
||||
event.acs_selected_channels.puncture_bitmap);
|
||||
event.acs_selected_channels.puncture_bitmap,
|
||||
event.acs_selected_channels.link_id);
|
||||
|
||||
/* Ignore ACS channel list check for backwards compatibility */
|
||||
|
||||
|
|
Loading…
Reference in a new issue