P2P: Allow auto GO on DFS channels if driver supports this
If a DFS forced frequency is provided in 'p2p_group_add' and the driver supports DFS offload, the frequency was rejected in wpas_p2p_init_go_params(). However, it was accepted in wpas_p2p_select_go_freq() and wpas_p2p_group_add(). To make the behavior consistent, the DFS frequency is now accepted in wpas_p2p_init_go_params() similar to the way done in wpas_p2p_select_go_freq(). Redundant check in wpas_p2p_group_add() for DFS forced frequency is removed. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
fe3e0bac1f
commit
cc6088463a
1 changed files with 21 additions and 20 deletions
|
@ -5842,12 +5842,30 @@ static int wpas_p2p_init_go_params(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
/* try using the forced freq */
|
/* try using the forced freq */
|
||||||
if (freq) {
|
if (freq) {
|
||||||
if (!wpas_p2p_supported_freq_go(wpa_s, channels, freq)) {
|
if (wpas_p2p_disallowed_freq(wpa_s->global, freq) ||
|
||||||
|
!freq_included(wpa_s, channels, freq)) {
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"P2P: Forced GO freq %d MHz not accepted",
|
"P2P: Forced GO freq %d MHz disallowed",
|
||||||
freq);
|
freq);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if (!p2p_supported_freq_go(wpa_s->global->p2p, freq)) {
|
||||||
|
if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) &&
|
||||||
|
ieee80211_is_dfs(freq)) {
|
||||||
|
/*
|
||||||
|
* If freq is a DFS channel and DFS is offloaded
|
||||||
|
* to the driver, allow P2P GO to use it.
|
||||||
|
*/
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"P2P: %s: The forced channel for GO (%u MHz) requires DFS and DFS is offloaded",
|
||||||
|
__func__, freq);
|
||||||
|
} else {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"P2P: The forced channel for GO (%u MHz) is not supported for P2P uses",
|
||||||
|
freq);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
if (freqs[i].freq == freq) {
|
if (freqs[i].freq == freq) {
|
||||||
|
@ -6086,24 +6104,7 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
|
||||||
if (wpas_p2p_init_go_params(wpa_s, ¶ms, freq, vht_center_freq2,
|
if (wpas_p2p_init_go_params(wpa_s, ¶ms, freq, vht_center_freq2,
|
||||||
ht40, vht, max_oper_chwidth, NULL))
|
ht40, vht, max_oper_chwidth, NULL))
|
||||||
return -1;
|
return -1;
|
||||||
if (params.freq &&
|
|
||||||
!p2p_supported_freq_go(wpa_s->global->p2p, params.freq)) {
|
|
||||||
if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) &&
|
|
||||||
ieee80211_is_dfs(params.freq)) {
|
|
||||||
/*
|
|
||||||
* If freq is a DFS channel and DFS is offloaded to the
|
|
||||||
* driver, allow P2P GO to use it.
|
|
||||||
*/
|
|
||||||
wpa_printf(MSG_DEBUG,
|
|
||||||
"P2P: %s: The forced channel for GO (%u MHz) is DFS, and DFS is offloaded to driver",
|
|
||||||
__func__, params.freq);
|
|
||||||
} else {
|
|
||||||
wpa_printf(MSG_DEBUG,
|
|
||||||
"P2P: The selected channel for GO (%u MHz) is not supported for P2P uses",
|
|
||||||
params.freq);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p2p_go_params(wpa_s->global->p2p, ¶ms);
|
p2p_go_params(wpa_s->global->p2p, ¶ms);
|
||||||
params.persistent_group = persistent_group;
|
params.persistent_group = persistent_group;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue