Note HT overrides in debug log only if set

This makes the debug log cleaner by removing the mostly confusing prints
about HT override parameters if they are not actually used.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-02-10 00:00:35 +02:00
parent f2a6ac63ee
commit bbdb501460

View file

@ -4428,11 +4428,11 @@ static int wpa_disable_max_amsdu(struct wpa_supplicant *wpa_s,
{ {
le16 msk; le16 msk;
wpa_msg(wpa_s, MSG_DEBUG, "set_disable_max_amsdu: %d", disabled);
if (disabled == -1) if (disabled == -1)
return 0; return 0;
wpa_msg(wpa_s, MSG_DEBUG, "set_disable_max_amsdu: %d", disabled);
msk = host_to_le16(HT_CAP_INFO_MAX_AMSDU_SIZE); msk = host_to_le16(HT_CAP_INFO_MAX_AMSDU_SIZE);
htcaps_mask->ht_capabilities_info |= msk; htcaps_mask->ht_capabilities_info |= msk;
if (disabled) if (disabled)
@ -4449,11 +4449,11 @@ static int wpa_set_ampdu_factor(struct wpa_supplicant *wpa_s,
struct ieee80211_ht_capabilities *htcaps_mask, struct ieee80211_ht_capabilities *htcaps_mask,
int factor) int factor)
{ {
wpa_msg(wpa_s, MSG_DEBUG, "set_ampdu_factor: %d", factor);
if (factor == -1) if (factor == -1)
return 0; return 0;
wpa_msg(wpa_s, MSG_DEBUG, "set_ampdu_factor: %d", factor);
if (factor < 0 || factor > 3) { if (factor < 0 || factor > 3) {
wpa_msg(wpa_s, MSG_ERROR, "ampdu_factor: %d out of range. " wpa_msg(wpa_s, MSG_ERROR, "ampdu_factor: %d out of range. "
"Must be 0-3 or -1", factor); "Must be 0-3 or -1", factor);
@ -4473,11 +4473,11 @@ static int wpa_set_ampdu_density(struct wpa_supplicant *wpa_s,
struct ieee80211_ht_capabilities *htcaps_mask, struct ieee80211_ht_capabilities *htcaps_mask,
int density) int density)
{ {
wpa_msg(wpa_s, MSG_DEBUG, "set_ampdu_density: %d", density);
if (density == -1) if (density == -1)
return 0; return 0;
wpa_msg(wpa_s, MSG_DEBUG, "set_ampdu_density: %d", density);
if (density < 0 || density > 7) { if (density < 0 || density > 7) {
wpa_msg(wpa_s, MSG_ERROR, wpa_msg(wpa_s, MSG_ERROR,
"ampdu_density: %d out of range. Must be 0-7 or -1.", "ampdu_density: %d out of range. Must be 0-7 or -1.",
@ -4498,6 +4498,7 @@ static int wpa_set_disable_ht40(struct wpa_supplicant *wpa_s,
struct ieee80211_ht_capabilities *htcaps_mask, struct ieee80211_ht_capabilities *htcaps_mask,
int disabled) int disabled)
{ {
if (disabled)
wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ht40: %d", disabled); wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ht40: %d", disabled);
set_disable_ht40(htcaps, disabled); set_disable_ht40(htcaps, disabled);
@ -4516,6 +4517,7 @@ static int wpa_set_disable_sgi(struct wpa_supplicant *wpa_s,
le16 msk = host_to_le16(HT_CAP_INFO_SHORT_GI20MHZ | le16 msk = host_to_le16(HT_CAP_INFO_SHORT_GI20MHZ |
HT_CAP_INFO_SHORT_GI40MHZ); HT_CAP_INFO_SHORT_GI40MHZ);
if (disabled)
wpa_msg(wpa_s, MSG_DEBUG, "set_disable_sgi: %d", disabled); wpa_msg(wpa_s, MSG_DEBUG, "set_disable_sgi: %d", disabled);
if (disabled) if (disabled)
@ -4537,6 +4539,7 @@ static int wpa_set_disable_ldpc(struct wpa_supplicant *wpa_s,
/* Masking these out disables LDPC */ /* Masking these out disables LDPC */
le16 msk = host_to_le16(HT_CAP_INFO_LDPC_CODING_CAP); le16 msk = host_to_le16(HT_CAP_INFO_LDPC_CODING_CAP);
if (disabled)
wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ldpc: %d", disabled); wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ldpc: %d", disabled);
if (disabled) if (disabled)
@ -4557,11 +4560,11 @@ static int wpa_set_tx_stbc(struct wpa_supplicant *wpa_s,
{ {
le16 msk = host_to_le16(HT_CAP_INFO_TX_STBC); le16 msk = host_to_le16(HT_CAP_INFO_TX_STBC);
wpa_msg(wpa_s, MSG_DEBUG, "set_tx_stbc: %d", tx_stbc);
if (tx_stbc == -1) if (tx_stbc == -1)
return 0; return 0;
wpa_msg(wpa_s, MSG_DEBUG, "set_tx_stbc: %d", tx_stbc);
if (tx_stbc < 0 || tx_stbc > 1) { if (tx_stbc < 0 || tx_stbc > 1) {
wpa_msg(wpa_s, MSG_ERROR, wpa_msg(wpa_s, MSG_ERROR,
"tx_stbc: %d out of range. Must be 0-1 or -1", tx_stbc); "tx_stbc: %d out of range. Must be 0-1 or -1", tx_stbc);
@ -4583,11 +4586,11 @@ static int wpa_set_rx_stbc(struct wpa_supplicant *wpa_s,
{ {
le16 msk = host_to_le16(HT_CAP_INFO_RX_STBC_MASK); le16 msk = host_to_le16(HT_CAP_INFO_RX_STBC_MASK);
wpa_msg(wpa_s, MSG_DEBUG, "set_rx_stbc: %d", rx_stbc);
if (rx_stbc == -1) if (rx_stbc == -1)
return 0; return 0;
wpa_msg(wpa_s, MSG_DEBUG, "set_rx_stbc: %d", rx_stbc);
if (rx_stbc < 0 || rx_stbc > 3) { if (rx_stbc < 0 || rx_stbc > 3) {
wpa_msg(wpa_s, MSG_ERROR, wpa_msg(wpa_s, MSG_ERROR,
"rx_stbc: %d out of range. Must be 0-3 or -1", rx_stbc); "rx_stbc: %d out of range. Must be 0-3 or -1", rx_stbc);