Add more debug prints for 20/40 BSS Coexistence Management frame Rx
This makes it easier to understand what kind of information a STA is reporting about 20/40 MHz coexistence requirements. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
d58c3bd8b7
commit
8aa599d45a
2 changed files with 38 additions and 9 deletions
|
@ -3727,9 +3727,6 @@ static int handle_action(struct hostapd_data *hapd,
|
||||||
if (len >= IEEE80211_HDRLEN + 2 &&
|
if (len >= IEEE80211_HDRLEN + 2 &&
|
||||||
mgmt->u.action.u.public_action.action ==
|
mgmt->u.action.u.public_action.action ==
|
||||||
WLAN_PA_20_40_BSS_COEX) {
|
WLAN_PA_20_40_BSS_COEX) {
|
||||||
wpa_printf(MSG_DEBUG,
|
|
||||||
"HT20/40 coex mgmt frame received from STA "
|
|
||||||
MACSTR, MAC2STR(mgmt->sa));
|
|
||||||
hostapd_2040_coex_action(hapd, mgmt, len);
|
hostapd_2040_coex_action(hapd, mgmt, len);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,16 +237,27 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
|
||||||
const u8 *start = (const u8 *) mgmt;
|
const u8 *start = (const u8 *) mgmt;
|
||||||
const u8 *data = start + IEEE80211_HDRLEN + 2;
|
const u8 *data = start + IEEE80211_HDRLEN + 2;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"HT: Received 20/40 BSS Coexistence Management frame from "
|
||||||
|
MACSTR, MAC2STR(mgmt->sa));
|
||||||
|
|
||||||
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
|
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_DEBUG, "hostapd_public_action - action=%d",
|
HOSTAPD_LEVEL_DEBUG, "hostapd_public_action - action=%d",
|
||||||
mgmt->u.action.u.public_action.action);
|
mgmt->u.action.u.public_action.action);
|
||||||
|
|
||||||
if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
|
if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)) {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"Ignore 20/40 BSS Coexistence Management frame since 40 MHz capability is not enabled");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
|
if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"Ignore too short 20/40 BSS Coexistence Management frame");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 20/40 BSS Coexistence element */
|
||||||
bc_ie = (struct ieee80211_2040_bss_coex_ie *) data;
|
bc_ie = (struct ieee80211_2040_bss_coex_ie *) data;
|
||||||
if (bc_ie->element_id != WLAN_EID_20_40_BSS_COEXISTENCE ||
|
if (bc_ie->element_id != WLAN_EID_20_40_BSS_COEXISTENCE ||
|
||||||
bc_ie->length < 1) {
|
bc_ie->length < 1) {
|
||||||
|
@ -254,13 +265,28 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
|
||||||
bc_ie->element_id, bc_ie->length);
|
bc_ie->element_id, bc_ie->length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (len < IEEE80211_HDRLEN + 2 + 2 + bc_ie->length)
|
if (len < IEEE80211_HDRLEN + 2 + 2 + bc_ie->length) {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"Truncated 20/40 BSS Coexistence element");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
data += 2 + bc_ie->length;
|
data += 2 + bc_ie->length;
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "20/40 BSS Coexistence Information field: 0x%x",
|
wpa_printf(MSG_DEBUG,
|
||||||
bc_ie->coex_param);
|
"20/40 BSS Coexistence Information field: 0x%x (%s%s%s%s%s%s)",
|
||||||
|
bc_ie->coex_param,
|
||||||
|
(bc_ie->coex_param & BIT(0)) ? "[InfoReq]" : "",
|
||||||
|
(bc_ie->coex_param & BIT(1)) ? "[40MHzIntolerant]" : "",
|
||||||
|
(bc_ie->coex_param & BIT(2)) ? "[20MHzBSSWidthReq]" : "",
|
||||||
|
(bc_ie->coex_param & BIT(3)) ? "[OBSSScanExemptionReq]" : "",
|
||||||
|
(bc_ie->coex_param & BIT(4)) ?
|
||||||
|
"[OBSSScanExemptionGrant]" : "",
|
||||||
|
(bc_ie->coex_param & (BIT(5) | BIT(6) | BIT(7))) ?
|
||||||
|
"[Reserved]" : "");
|
||||||
|
|
||||||
if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ) {
|
if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ) {
|
||||||
|
/* Intra-BSS communication prohibiting 20/40 MHz BSS operation
|
||||||
|
*/
|
||||||
hostapd_logger(hapd, mgmt->sa,
|
hostapd_logger(hapd, mgmt->sa,
|
||||||
HOSTAPD_MODULE_IEEE80211,
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_DEBUG,
|
HOSTAPD_LEVEL_DEBUG,
|
||||||
|
@ -269,6 +295,8 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_40MHZ_INTOL) {
|
if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_40MHZ_INTOL) {
|
||||||
|
/* Inter-BSS communication prohibiting 20/40 MHz BSS operation
|
||||||
|
*/
|
||||||
hostapd_logger(hapd, mgmt->sa,
|
hostapd_logger(hapd, mgmt->sa,
|
||||||
HOSTAPD_MODULE_IEEE80211,
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_DEBUG,
|
HOSTAPD_LEVEL_DEBUG,
|
||||||
|
@ -276,12 +304,16 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
|
||||||
is_ht40_allowed = 0;
|
is_ht40_allowed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 20/40 BSS Intolerant Channel Report element (zero or more times) */
|
||||||
if (start + len - data >= 3 &&
|
if (start + len - data >= 3 &&
|
||||||
data[0] == WLAN_EID_20_40_BSS_INTOLERANT && data[1] >= 1) {
|
data[0] == WLAN_EID_20_40_BSS_INTOLERANT && data[1] >= 1) {
|
||||||
u8 ielen = data[1];
|
u8 ielen = data[1];
|
||||||
|
|
||||||
if (ielen > start + len - data - 2)
|
if (ielen > start + len - data - 2) {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"Truncated 20/40 BSS Intolerant Channel Report element");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
ic_report = (struct ieee80211_2040_intol_chan_report *) data;
|
ic_report = (struct ieee80211_2040_intol_chan_report *) data;
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"20/40 BSS Intolerant Channel Report: Operating Class %u",
|
"20/40 BSS Intolerant Channel Report: Operating Class %u",
|
||||||
|
|
Loading…
Reference in a new issue