diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2013-02-16 13:41:05 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-18 09:31:23 -0500 |
commit | 95e48addba6f9271aed51d9d3eaccbfc99a914b4 (patch) | |
tree | 3b1e97b483cf8f3061af5895bf5836610396abaa /net/mac80211/mesh_plink.c | |
parent | 52ac8c488774b7ac6d1b0ed4c323b5de90d39d6e (diff) |
mac80211: stringify mesh peering events
Convert mesh peering events into strings and make the
debug output a little easier to read. Also stop printing
the llid and plid since these don't change across peering
states and are random numbers anyway so they just amount
to noise.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index d74bdf94c8a4..07d396d57079 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -37,6 +37,28 @@ enum plink_event { | |||
37 | CLS_IGNR | 37 | CLS_IGNR |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static const char * const mplstates[] = { | ||
41 | [NL80211_PLINK_LISTEN] = "LISTEN", | ||
42 | [NL80211_PLINK_OPN_SNT] = "OPN-SNT", | ||
43 | [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", | ||
44 | [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", | ||
45 | [NL80211_PLINK_ESTAB] = "ESTAB", | ||
46 | [NL80211_PLINK_HOLDING] = "HOLDING", | ||
47 | [NL80211_PLINK_BLOCKED] = "BLOCKED" | ||
48 | }; | ||
49 | |||
50 | static const char * const mplevents[] = { | ||
51 | [PLINK_UNDEFINED] = "NONE", | ||
52 | [OPN_ACPT] = "OPN_ACPT", | ||
53 | [OPN_RJCT] = "OPN_RJCT", | ||
54 | [OPN_IGNR] = "OPN_IGNR", | ||
55 | [CNF_ACPT] = "CNF_ACPT", | ||
56 | [CNF_RJCT] = "CNF_RJCT", | ||
57 | [CNF_IGNR] = "CNF_IGNR", | ||
58 | [CLS_ACPT] = "CLS_ACPT", | ||
59 | [CLS_IGNR] = "CLS_IGNR" | ||
60 | }; | ||
61 | |||
40 | static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | 62 | static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, |
41 | enum ieee80211_self_protected_actioncode action, | 63 | enum ieee80211_self_protected_actioncode action, |
42 | u8 *da, __le16 llid, __le16 plid, __le16 reason); | 64 | u8 *da, __le16 llid, __le16 plid, __le16 reason); |
@@ -668,15 +690,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
668 | u8 *baseaddr; | 690 | u8 *baseaddr; |
669 | u32 changed = 0; | 691 | u32 changed = 0; |
670 | __le16 plid, llid, reason; | 692 | __le16 plid, llid, reason; |
671 | static const char * const mplstates[] = { | ||
672 | [NL80211_PLINK_LISTEN] = "LISTEN", | ||
673 | [NL80211_PLINK_OPN_SNT] = "OPN-SNT", | ||
674 | [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", | ||
675 | [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", | ||
676 | [NL80211_PLINK_ESTAB] = "ESTAB", | ||
677 | [NL80211_PLINK_HOLDING] = "HOLDING", | ||
678 | [NL80211_PLINK_BLOCKED] = "BLOCKED" | ||
679 | }; | ||
680 | 693 | ||
681 | /* need action_code, aux */ | 694 | /* need action_code, aux */ |
682 | if (len < IEEE80211_MIN_ACTION_SIZE + 3) | 695 | if (len < IEEE80211_MIN_ACTION_SIZE + 3) |
@@ -849,11 +862,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
849 | } | 862 | } |
850 | } | 863 | } |
851 | 864 | ||
852 | mpl_dbg(sdata, | 865 | mpl_dbg(sdata, "peer %pM in state %s got event %s\n", mgmt->sa, |
853 | "Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n", | 866 | mplstates[sta->plink_state], mplevents[event]); |
854 | mgmt->sa, mplstates[sta->plink_state], | ||
855 | le16_to_cpu(sta->llid), le16_to_cpu(sta->plid), | ||
856 | event); | ||
857 | reason = 0; | 867 | reason = 0; |
858 | spin_lock_bh(&sta->lock); | 868 | spin_lock_bh(&sta->lock); |
859 | switch (sta->plink_state) { | 869 | switch (sta->plink_state) { |