From patchwork Mon Nov 9 23:46:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Paulo X-Patchwork-Id: 58893 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA9NlNdV015182 for ; Mon, 9 Nov 2009 23:47:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755671AbZKIXrR (ORCPT ); Mon, 9 Nov 2009 18:47:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755665AbZKIXrR (ORCPT ); Mon, 9 Nov 2009 18:47:17 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:47150 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755671AbZKIXrP (ORCPT ); Mon, 9 Nov 2009 18:47:15 -0500 Received: by mail-ew0-f228.google.com with SMTP id 28so3974559ewy.18 for ; Mon, 09 Nov 2009 15:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=3MdSV3BErkmH8zjrEsAW29uVXP+yu2XNnecCzuUR/b0=; b=Mq3FC+XqcNKqXsTqzEMjnZR+mPtgR3W/67rYoAJzz1k3PZVSwzF3+k1gtX6F5QAvgY Iwi4ZcpA7EhzRD+ut5TFmBZapDm59YGP4viZw7eWxXy9EY4lZtxav0jzXVkUFSLD3Z0E 2tORx8PT0hyH/CF7eyzZX01vU+iAnZPzIIUfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=hbM4XLTTeLmPiaKnugdgDEv0H4qfL3tED6hQjUwopqPfN6ffi5ZfQEtRbAWVG7eVY8 0v05mphVOikQqePPY4FKv6DlVT21u+MKTuQZA8P3j59km7e6dOF/01cocUYTwMN5n6sA 5HGQtJ1L2Cd7FE+WY61g1sR9AW5w1SeWZKUS8= Received: by 10.213.110.17 with SMTP id l17mr3383619ebp.91.1257810441154; Mon, 09 Nov 2009 15:47:21 -0800 (PST) Received: from localhost (bl5-227-167.dsl.telepac.pt [82.154.227.167]) by mx.google.com with ESMTPS id 23sm441809eya.36.2009.11.09.15.47.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 15:47:20 -0800 (PST) From: Rui Paulo To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Johannes Berg , Rui Paulo , Javier Cardona Subject: [PATCH v2 07/20] mac80211: add MAC80211_VERBOSE_MHWMP_DEBUG Date: Mon, 9 Nov 2009 23:46:45 +0000 Message-Id: <1257810418-30075-8-git-send-email-rpaulo@gmail.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1257810418-30075-1-git-send-email-rpaulo@gmail.com> References: <1257810418-30075-1-git-send-email-rpaulo@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 4d5543a..a10d508 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig @@ -194,6 +194,19 @@ config MAC80211_VERBOSE_MPL_DEBUG Do not select this option. +config MAC80211_VERBOSE_MHWMP_DEBUG + bool "Verbose mesh HWMP routing debugging" + depends on MAC80211_DEBUG_MENU + depends on MAC80211_MESH + ---help--- + Selecting this option causes mac80211 to print out very + verbose mesh routing (HWMP) debugging messages (when mac80211 + is taking part in a mesh network). + It should not be selected on production systems as those + messages are remotely triggerable. + + Do not select this option. + config MAC80211_DEBUG_COUNTERS bool "Extra statistics for TX/RX debugging" depends on MAC80211_DEBUG_MENU diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index c291cdb..6dbaec5 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -9,6 +9,12 @@ #include "mesh.h" +#ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG +#define mhwmp_dbg(fmt, args...) printk(KERN_DEBUG "Mesh HWMP: " fmt, ##args) +#else +#define mhwmp_dbg(fmt, args...) do { (void)(0); } while (0) +#endif + #define TEST_FRAME_LEN 8192 #define MAX_METRIC 0xffffffff #define ARITH_SHIFT 8 @@ -109,11 +115,13 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, switch (action) { case MPATH_PREQ: + mhwmp_dbg("sending PREQ\n"); ie_len = 37; pos = skb_put(skb, 2 + ie_len); *pos++ = WLAN_EID_PREQ; break; case MPATH_PREP: + mhwmp_dbg("sending PREP\n"); ie_len = 31; pos = skb_put(skb, 2 + ie_len); *pos++ = WLAN_EID_PREP; @@ -432,6 +440,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, orig_dsn = PREQ_IE_ORIG_DSN(preq_elem); dst_flags = PREQ_IE_DST_F(preq_elem); + mhwmp_dbg("received PREQ\n"); + if (memcmp(dst_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) { forward = false; reply = true; @@ -467,13 +477,14 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, if (reply) { lifetime = PREQ_IE_LIFETIME(preq_elem); ttl = ifmsh->mshcfg.dot11MeshTTL; - if (ttl != 0) + if (ttl != 0) { + mhwmp_dbg("replying to the PREQ\n"); mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr, cpu_to_le32(dst_dsn), 0, orig_addr, cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl, cpu_to_le32(lifetime), cpu_to_le32(metric), 0, sdata); - else + } else ifmsh->mshstats.dropped_frames_ttl++; } @@ -661,7 +672,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags) preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); if (!preq_node) { - printk(KERN_DEBUG "Mesh HWMP: could not allocate PREQ node\n"); + mhwmp_dbg("could not allocate PREQ node\n"); return; } @@ -670,7 +681,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags) spin_unlock(&ifmsh->mesh_preq_queue_lock); kfree(preq_node); if (printk_ratelimit()) - printk(KERN_DEBUG "Mesh HWMP: PREQ node queue full\n"); + mhwmp_dbg("PREQ node queue full\n"); return; }