]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add ifname and link ID debug prints in mlme_event_ch_switch()
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Wed, 7 Aug 2024 04:18:36 +0000 (09:48 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 8 Aug 2024 19:18:49 +0000 (22:18 +0300)
This makes it easier to debug AP MLD behavior.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/drivers/driver_nl80211_event.c

index 642b327d10a44da9338a017244fca4cc40378ee2..abe90e984ad7d027dbb7fb9eb88d6549bd61f124 100644 (file)
@@ -1204,9 +1204,6 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
        int chan_offset = 0;
        int ifidx;
 
-       wpa_printf(MSG_DEBUG, "nl80211: Channel switch%s event",
-                  finished ? "" : " started");
-
        if (!freq)
                return;
 
@@ -1218,6 +1215,9 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
                return;
        }
 
+       wpa_printf(MSG_DEBUG, "nl80211: Channel switch%s event for %s",
+                  finished ? "" : " started", bss->ifname);
+
        if (type) {
                enum nl80211_channel_type ch_type = nla_get_u32(type);
 
@@ -1260,10 +1260,13 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
        if (cf2)
                data.ch_switch.cf2 = nla_get_u32(cf2);
 
-       if (link)
+       if (link) {
                data.ch_switch.link_id = nla_get_u8(link);
-       else
+               wpa_printf(MSG_DEBUG, "nl80211: Link ID: %d",
+                          data.ch_switch.link_id);
+       } else {
                data.ch_switch.link_id = NL80211_DRV_LINK_ID_NA;
+       }
 
        if (finished) {
                if (data.ch_switch.link_id != NL80211_DRV_LINK_ID_NA) {