nl80211: Move debug prints into nl80211_put_freq_params()
This way all callers can get the benefit of the same debug prints. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
cae87abd13
commit
1fc4ab2367
1 changed files with 13 additions and 8 deletions
|
@ -3392,12 +3392,17 @@ fail:
|
||||||
static int nl80211_put_freq_params(struct nl_msg *msg,
|
static int nl80211_put_freq_params(struct nl_msg *msg,
|
||||||
const struct hostapd_freq_params *freq)
|
const struct hostapd_freq_params *freq)
|
||||||
{
|
{
|
||||||
|
wpa_printf(MSG_DEBUG, " * freq=%d", freq->freq);
|
||||||
if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq->freq))
|
if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq->freq))
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, " * vht_enabled=%d", freq->vht_enabled);
|
||||||
|
wpa_printf(MSG_DEBUG, " * ht_enabled=%d", freq->ht_enabled);
|
||||||
|
|
||||||
if (freq->vht_enabled) {
|
if (freq->vht_enabled) {
|
||||||
enum nl80211_chan_width cw;
|
enum nl80211_chan_width cw;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, " * bandwidth=%d", freq->bandwidth);
|
||||||
switch (freq->bandwidth) {
|
switch (freq->bandwidth) {
|
||||||
case 20:
|
case 20:
|
||||||
cw = NL80211_CHAN_WIDTH_20;
|
cw = NL80211_CHAN_WIDTH_20;
|
||||||
|
@ -3418,6 +3423,11 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, " * channel_width=%d", cw);
|
||||||
|
wpa_printf(MSG_DEBUG, " * center_freq1=%d",
|
||||||
|
freq->center_freq1);
|
||||||
|
wpa_printf(MSG_DEBUG, " * center_freq2=%d",
|
||||||
|
freq->center_freq2);
|
||||||
if (nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, cw) ||
|
if (nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, cw) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ1,
|
nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ1,
|
||||||
freq->center_freq1) ||
|
freq->center_freq1) ||
|
||||||
|
@ -3428,6 +3438,8 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
|
||||||
} else if (freq->ht_enabled) {
|
} else if (freq->ht_enabled) {
|
||||||
enum nl80211_channel_type ct;
|
enum nl80211_channel_type ct;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, " * sec_channel_offset=%d",
|
||||||
|
freq->sec_channel_offset);
|
||||||
switch (freq->sec_channel_offset) {
|
switch (freq->sec_channel_offset) {
|
||||||
case -1:
|
case -1:
|
||||||
ct = NL80211_CHAN_HT40MINUS;
|
ct = NL80211_CHAN_HT40MINUS;
|
||||||
|
@ -3440,6 +3452,7 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, " * channel_type=%d", ct);
|
||||||
if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, ct))
|
if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, ct))
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
}
|
}
|
||||||
|
@ -4217,14 +4230,6 @@ retry:
|
||||||
os_memcpy(drv->ssid, params->ssid, params->ssid_len);
|
os_memcpy(drv->ssid, params->ssid, params->ssid_len);
|
||||||
drv->ssid_len = params->ssid_len;
|
drv->ssid_len = params->ssid_len;
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, " * freq=%d", params->freq.freq);
|
|
||||||
wpa_printf(MSG_DEBUG, " * ht_enabled=%d", params->freq.ht_enabled);
|
|
||||||
wpa_printf(MSG_DEBUG, " * sec_channel_offset=%d",
|
|
||||||
params->freq.sec_channel_offset);
|
|
||||||
wpa_printf(MSG_DEBUG, " * vht_enabled=%d", params->freq.vht_enabled);
|
|
||||||
wpa_printf(MSG_DEBUG, " * center_freq1=%d", params->freq.center_freq1);
|
|
||||||
wpa_printf(MSG_DEBUG, " * center_freq2=%d", params->freq.center_freq2);
|
|
||||||
wpa_printf(MSG_DEBUG, " * bandwidth=%d", params->freq.bandwidth);
|
|
||||||
if (nl80211_put_freq_params(msg, ¶ms->freq) < 0)
|
if (nl80211_put_freq_params(msg, ¶ms->freq) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue