Skip to content

Commit

Permalink
wifi: mac80211: mlme: improve messages from config_bw()
Browse files Browse the repository at this point in the history
The ieee80211_config_bw() function is called in different
contexts: during association with the association response
and during beacon tracking with the beacon. This can be a
bit misleading, so disambiguate the messages for those.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.ee574cf7553b.Ie7c78877d20b5e9de4cce3cf8e4f1b9e0c7ee005@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jan 13, 2025
1 parent f52de50 commit 69f9556
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,8 @@ ieee80211_determine_chan_mode(struct ieee80211_sub_if_data *sdata,

static int ieee80211_config_bw(struct ieee80211_link_data *link,
struct ieee802_11_elems *elems,
bool update, u64 *changed)
bool update, u64 *changed,
const char *frame)
{
struct ieee80211_channel *channel = link->conf->chanreq.oper.chan;
struct ieee80211_sub_if_data *sdata = link->sdata;
Expand All @@ -1013,9 +1014,10 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,

if (ap_mode != link->u.mgd.conn.mode) {
link_info(link,
"AP appears to change mode (expected %s, found %s), disconnect\n",
"AP %pM appears to change mode (expected %s, found %s) in %s, disconnect\n",
link->u.mgd.bssid,
ieee80211_conn_mode_str(link->u.mgd.conn.mode),
ieee80211_conn_mode_str(ap_mode));
ieee80211_conn_mode_str(ap_mode), frame);
return -EINVAL;
}

Expand Down Expand Up @@ -1060,16 +1062,16 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,
return 0;

link_info(link,
"AP %pM changed bandwidth, new used config is %d.%03d MHz, width %d (%d.%03d/%d MHz)\n",
link->u.mgd.bssid, chanreq.oper.chan->center_freq,
"AP %pM changed bandwidth in %s, new used config is %d.%03d MHz, width %d (%d.%03d/%d MHz)\n",
link->u.mgd.bssid, frame, chanreq.oper.chan->center_freq,
chanreq.oper.chan->freq_offset, chanreq.oper.width,
chanreq.oper.center_freq1, chanreq.oper.freq1_offset,
chanreq.oper.center_freq2);

if (!cfg80211_chandef_valid(&chanreq.oper)) {
sdata_info(sdata,
"AP %pM changed caps/bw in a way we can't support - disconnect\n",
link->u.mgd.bssid);
"AP %pM changed caps/bw in %s in a way we can't support - disconnect\n",
link->u.mgd.bssid, frame);
return -EINVAL;
}

Expand Down Expand Up @@ -1098,8 +1100,8 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,
ret = ieee80211_link_change_chanreq(link, &chanreq, changed);
if (ret) {
sdata_info(sdata,
"AP %pM changed bandwidth to incompatible one - disconnect\n",
link->u.mgd.bssid);
"AP %pM changed bandwidth in %s to incompatible one - disconnect\n",
link->u.mgd.bssid, frame);
return ret;
}

Expand Down Expand Up @@ -4918,7 +4920,7 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
/* check/update if AP changed anything in assoc response vs. scan */
if (ieee80211_config_bw(link, elems,
link_id == assoc_data->assoc_link_id,
changed)) {
changed, "assoc response")) {
ret = false;
goto out;
}
Expand Down Expand Up @@ -7076,7 +7078,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,

changed |= ieee80211_recalc_twt_req(sdata, sband, link, link_sta, elems);

if (ieee80211_config_bw(link, elems, true, &changed)) {
if (ieee80211_config_bw(link, elems, true, &changed, "beacon")) {
ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
WLAN_REASON_DEAUTH_LEAVING,
true, deauth_buf);
Expand Down

0 comments on commit 69f9556

Please sign in to comment.