P2P: Filter out 6 GHz frequencies if not allowed for P2P connection
Add check to filter out 6 GHz frequencies from the local driver frequency preference list when 6 GHz is not allowed for the P2P connection. Earlier, 6 GHz frequency channels were included in the preferred list if the p2p_6ghz_disable parameter was not set irrespective of the allow_6ghz parameter. Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
This commit is contained in:
parent
b2bf7e39ec
commit
2c32026827
1 changed files with 7 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "utils/eloop.h"
|
#include "utils/eloop.h"
|
||||||
#include "common/ieee802_11_defs.h"
|
#include "common/ieee802_11_defs.h"
|
||||||
|
#include "common/ieee802_11_common.h"
|
||||||
#include "common/wpa_ctrl.h"
|
#include "common/wpa_ctrl.h"
|
||||||
#include "wps/wps_defs.h"
|
#include "wps/wps_defs.h"
|
||||||
#include "p2p_i.h"
|
#include "p2p_i.h"
|
||||||
|
@ -697,6 +698,7 @@ void p2p_check_pref_chan(struct p2p_data *p2p, int go,
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
u8 op_class, op_channel;
|
u8 op_class, op_channel;
|
||||||
char txt[100], *pos, *end;
|
char txt[100], *pos, *end;
|
||||||
|
bool is_6ghz_capab;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -718,6 +720,8 @@ void p2p_check_pref_chan(struct p2p_data *p2p, int go,
|
||||||
if (!size)
|
if (!size)
|
||||||
return;
|
return;
|
||||||
/* Filter out frequencies that are not acceptable for P2P use */
|
/* Filter out frequencies that are not acceptable for P2P use */
|
||||||
|
is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
|
||||||
|
p2p_is_peer_6ghz_capab(p2p, dev->info.p2p_device_addr);
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < size) {
|
while (i < size) {
|
||||||
if (p2p_freq_to_channel(p2p->pref_freq_list[i].freq,
|
if (p2p_freq_to_channel(p2p->pref_freq_list[i].freq,
|
||||||
|
@ -725,7 +729,9 @@ void p2p_check_pref_chan(struct p2p_data *p2p, int go,
|
||||||
(!p2p_channels_includes(&p2p->cfg->channels,
|
(!p2p_channels_includes(&p2p->cfg->channels,
|
||||||
op_class, op_channel) &&
|
op_class, op_channel) &&
|
||||||
(go || !p2p_channels_includes(&p2p->cfg->cli_channels,
|
(go || !p2p_channels_includes(&p2p->cfg->cli_channels,
|
||||||
op_class, op_channel)))) {
|
op_class, op_channel))) ||
|
||||||
|
(is_6ghz_freq(p2p->pref_freq_list[i].freq) &&
|
||||||
|
!is_6ghz_capab)) {
|
||||||
p2p_dbg(p2p,
|
p2p_dbg(p2p,
|
||||||
"Ignore local driver frequency preference %u MHz since it is not acceptable for P2P use (go=%d)",
|
"Ignore local driver frequency preference %u MHz since it is not acceptable for P2P use (go=%d)",
|
||||||
p2p->pref_freq_list[i].freq, go);
|
p2p->pref_freq_list[i].freq, go);
|
||||||
|
|
Loading…
Add table
Reference in a new issue