mac80211: improve peer link management debugging
authorRui Paulo <rpaulo@gmail.com>
Mon, 9 Nov 2009 23:46:48 +0000 (23:46 +0000)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 11 Nov 2009 20:23:59 +0000 (15:23 -0500)
Print the FSM state strings instead of just the numbers.

Signed-off-by: Rui Paulo <rpaulo@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Andrey Yurovsky <andrey@cozybit.com>
Tested-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh_plink.c

index 8a54bc836c923dfc4287ef72abf963fb56034e9c..cf12f616c5b1e9379268b91a857f4eba1f44302e 100644 (file)
@@ -398,6 +398,17 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
        u8 ie_len;
        u8 *baseaddr;
        __le16 plid, llid, reason;
+#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
+       static const char *mplstates[] = {
+               [PLINK_LISTEN] = "LISTEN",
+               [PLINK_OPN_SNT] = "OPN-SNT",
+               [PLINK_OPN_RCVD] = "OPN-RCVD",
+               [PLINK_CNF_RCVD] = "CNF_RCVD",
+               [PLINK_ESTAB] = "ESTAB",
+               [PLINK_HOLDING] = "HOLDING",
+               [PLINK_BLOCKED] = "BLOCKED"
+       };
+#endif
 
        /* need action_code, aux */
        if (len < IEEE80211_MIN_ACTION_SIZE + 3)
@@ -536,8 +547,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
                }
        }
 
-       mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %d %d %d %d\n",
-               mgmt->sa, sta->plink_state,
+       mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n",
+               mgmt->sa, mplstates[sta->plink_state],
                le16_to_cpu(sta->llid), le16_to_cpu(sta->plid),
                event);
        reason = 0;