P2P: Allow PSC channel to be used for 6 GHz BW40

For the 6 GHz opclass 132, ch for loop only allows non-PSC channels { 1,
9, 17, 25, 33, 41, 49,... } to be used. This does not match the IEEE Std
802.11ax-2021 expectation of a 6 GHz-only AP "should set up the BSS with
a primary 20 MHz channel that coincides with a preferred scanning
channel".

Increase ch by 4 to allow PSC channel to be used for 6 GHz BW40.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Hu Wang 2022-10-11 23:52:12 -07:00 committed by Jouni Malinen
parent 9c830d9178
commit ae517789fa
2 changed files with 18 additions and 9 deletions

View file

@ -1965,11 +1965,14 @@ const struct oper_class_map global_op_class[] = {
/*
* IEEE Std 802.11ax-2021, Table E-4 actually talks about channel center
* frequency index 42, 58, 106, 122, 138, 155, 171 with channel spacing
* of 80 MHz, but currently use the following definition for simplicity
* frequency index for operation classes 128, 129, 130, 132, 133, 134,
* and 135, but currently use the lowest 20 MHz channel for simplicity
* (these center frequencies are not actual channels, which makes
* wpas_p2p_verify_channel() fail). wpas_p2p_verify_80mhz() should take
* care of removing invalid channels.
* wpas_p2p_verify_channel() fail).
* Specially for the operation class 136, it is also defined to use the
* channel center frequency index value, but it happens to be a 20 MHz
* channel and the channel number in the channel set would match the
* value in for the frequency center.
*/
{ HOSTAPD_MODE_IEEE80211A, 128, 36, 177, 4, BW80, P2P_SUPP },
{ HOSTAPD_MODE_IEEE80211A, 129, 36, 177, 4, BW160, P2P_SUPP },

View file

@ -3947,8 +3947,7 @@ int wpas_p2p_get_sec_channel_offset_40mhz(struct wpa_supplicant *wpa_s,
for (op = 0; global_op_class[op].op_class; op++) {
const struct oper_class_map *o = &global_op_class[op];
u16 ch;
int chan = channel;
u16 ch = 0;
/* Allow DFS channels marked as NO_P2P_SUPP to be used with
* driver offloaded DFS. */
@ -3959,15 +3958,22 @@ int wpas_p2p_get_sec_channel_offset_40mhz(struct wpa_supplicant *wpa_s,
wpa_s->conf->p2p_6ghz_disable))
continue;
/* IEEE Std 802.11ax-2021 26.17.2.3.2: "A 6 GHz-only AP should
* set up the BSS with a primary 20 MHz channel that coincides
* with a preferred scanning channel (PSC)."
* 6 GHz BW40 operation class 132 in wpa_supplicant uses the
* lowest 20 MHz channel for simplicity, so increase ch by 4 to
* match the PSC.
*/
if (is_6ghz_op_class(o->op_class) && o->bw == BW40 &&
get_6ghz_sec_channel(channel) < 0)
chan = channel - 4;
ch = 4;
for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) {
for (ch += o->min_chan; ch <= o->max_chan; ch += o->inc) {
if (o->mode != HOSTAPD_MODE_IEEE80211A ||
(o->bw != BW40PLUS && o->bw != BW40MINUS &&
o->bw != BW40) ||
ch != chan)
ch != channel)
continue;
ret = wpas_p2p_verify_channel(wpa_s, mode, o->op_class,
ch, o->bw);