From patchwork Sat Feb 16 18:41:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2152411 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C185A3FDF1 for ; Sat, 16 Feb 2013 18:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753972Ab3BPSmY (ORCPT ); Sat, 16 Feb 2013 13:42:24 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:37949 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753965Ab3BPSmY (ORCPT ); Sat, 16 Feb 2013 13:42:24 -0500 Received: by mail-pa0-f45.google.com with SMTP id kl14so2166390pab.4 for ; Sat, 16 Feb 2013 10:42:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=JtGTpgqcPIIEVCNXEk95TgNuz/9Dveg8WUzyPu9B1oY=; b=beJEnBkJZN58n454x5w7WFiJd+5MNUlOD9UFSxu5Op/RrLCHXwV5Ub1t5TKQc0Xpiq HRwbTe9KXFnsMsTB3JiWg9pgsA8dcbNDHM/bB1xDDtTc2UpXieOWSREvDhtK9E8qD4Vn lc1pUcYCxUd0ClZ0sQKd9aIf8W8NKhki3YPxys2HvJBZn/QJcUbC1TupeC37vaZ9o077 zwq9MH3H65kZ9Q5wpEgVxbh+rwCtkbiVeKD483qxUIziEb3x7aacVrWnQnB79pdHx3Sl 75CHSVhqdAeEABjA5tWkwmxwVb06DBIN4qKqlb9pn7LuvmqRzfVUO3VBeBbOveBtovNn E8QQ== X-Received: by 10.66.4.165 with SMTP id l5mr22827462pal.53.1361040143723; Sat, 16 Feb 2013 10:42:23 -0800 (PST) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id rn14sm8723291pbb.33.2013.02.16.10.42.16 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Feb 2013 10:42:17 -0800 (PST) From: Thomas Pedersen To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, devel@lists.open80211s.org, Thomas Pedersen Subject: [PATCH 2/3] mac80211: stringify mesh peering events Date: Sat, 16 Feb 2013 10:41:05 -0800 Message-Id: <1361040066-5771-2-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361040066-5771-1-git-send-email-thomas@cozybit.com> References: <1361040066-5771-1-git-send-email-thomas@cozybit.com> X-Gm-Message-State: ALoCoQm550gJeOsD7dGn+lRBj72zCDZ0q35lgIIHC+plOraU+AoJYyJxcUO0KCNDgFciqyKPK80W Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- net/mac80211/mesh_plink.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index d74bdf9..07d396d 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -37,6 +37,28 @@ enum plink_event { CLS_IGNR }; +static const char * const mplstates[] = { + [NL80211_PLINK_LISTEN] = "LISTEN", + [NL80211_PLINK_OPN_SNT] = "OPN-SNT", + [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", + [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", + [NL80211_PLINK_ESTAB] = "ESTAB", + [NL80211_PLINK_HOLDING] = "HOLDING", + [NL80211_PLINK_BLOCKED] = "BLOCKED" +}; + +static const char * const mplevents[] = { + [PLINK_UNDEFINED] = "NONE", + [OPN_ACPT] = "OPN_ACPT", + [OPN_RJCT] = "OPN_RJCT", + [OPN_IGNR] = "OPN_IGNR", + [CNF_ACPT] = "CNF_ACPT", + [CNF_RJCT] = "CNF_RJCT", + [CNF_IGNR] = "CNF_IGNR", + [CLS_ACPT] = "CLS_ACPT", + [CLS_IGNR] = "CLS_IGNR" +}; + static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, enum ieee80211_self_protected_actioncode action, u8 *da, __le16 llid, __le16 plid, __le16 reason); @@ -668,15 +690,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, u8 *baseaddr; u32 changed = 0; __le16 plid, llid, reason; - static const char * const mplstates[] = { - [NL80211_PLINK_LISTEN] = "LISTEN", - [NL80211_PLINK_OPN_SNT] = "OPN-SNT", - [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", - [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", - [NL80211_PLINK_ESTAB] = "ESTAB", - [NL80211_PLINK_HOLDING] = "HOLDING", - [NL80211_PLINK_BLOCKED] = "BLOCKED" - }; /* need action_code, aux */ if (len < IEEE80211_MIN_ACTION_SIZE + 3) @@ -849,11 +862,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, } } - mpl_dbg(sdata, - "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); + mpl_dbg(sdata, "peer %pM in state %s got event %s\n", mgmt->sa, + mplstates[sta->plink_state], mplevents[event]); reason = 0; spin_lock_bh(&sta->lock); switch (sta->plink_state) {