aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_hwmp.c
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@gmail.com>2009-11-09 18:46:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 15:23:58 -0500
commit27db2e423fdeae8815087677261ab72cca7b3c28 (patch)
treeef2f90620597b8cd0a8b4e290b5605842292dd6f /net/mac80211/mesh_hwmp.c
parent095de01325962e7574d5793193c6f3ae9a175aab (diff)
mac80211: add MAC80211_VERBOSE_MHWMP_DEBUG
Add MAC80211_VERBOSE_MHWMP_DEBUG, a debugging option for HWMP frame processing. 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>
Diffstat (limited to 'net/mac80211/mesh_hwmp.c')
-rw-r--r--net/mac80211/mesh_hwmp.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index c291cdb75317..6dbaec53653d 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -9,6 +9,12 @@
9 9
10#include "mesh.h" 10#include "mesh.h"
11 11
12#ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG
13#define mhwmp_dbg(fmt, args...) printk(KERN_DEBUG "Mesh HWMP: " fmt, ##args)
14#else
15#define mhwmp_dbg(fmt, args...) do { (void)(0); } while (0)
16#endif
17
12#define TEST_FRAME_LEN 8192 18#define TEST_FRAME_LEN 8192
13#define MAX_METRIC 0xffffffff 19#define MAX_METRIC 0xffffffff
14#define ARITH_SHIFT 8 20#define ARITH_SHIFT 8
@@ -109,11 +115,13 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
109 115
110 switch (action) { 116 switch (action) {
111 case MPATH_PREQ: 117 case MPATH_PREQ:
118 mhwmp_dbg("sending PREQ\n");
112 ie_len = 37; 119 ie_len = 37;
113 pos = skb_put(skb, 2 + ie_len); 120 pos = skb_put(skb, 2 + ie_len);
114 *pos++ = WLAN_EID_PREQ; 121 *pos++ = WLAN_EID_PREQ;
115 break; 122 break;
116 case MPATH_PREP: 123 case MPATH_PREP:
124 mhwmp_dbg("sending PREP\n");
117 ie_len = 31; 125 ie_len = 31;
118 pos = skb_put(skb, 2 + ie_len); 126 pos = skb_put(skb, 2 + ie_len);
119 *pos++ = WLAN_EID_PREP; 127 *pos++ = WLAN_EID_PREP;
@@ -432,6 +440,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
432 orig_dsn = PREQ_IE_ORIG_DSN(preq_elem); 440 orig_dsn = PREQ_IE_ORIG_DSN(preq_elem);
433 dst_flags = PREQ_IE_DST_F(preq_elem); 441 dst_flags = PREQ_IE_DST_F(preq_elem);
434 442
443 mhwmp_dbg("received PREQ\n");
444
435 if (memcmp(dst_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) { 445 if (memcmp(dst_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) {
436 forward = false; 446 forward = false;
437 reply = true; 447 reply = true;
@@ -467,13 +477,14 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
467 if (reply) { 477 if (reply) {
468 lifetime = PREQ_IE_LIFETIME(preq_elem); 478 lifetime = PREQ_IE_LIFETIME(preq_elem);
469 ttl = ifmsh->mshcfg.dot11MeshTTL; 479 ttl = ifmsh->mshcfg.dot11MeshTTL;
470 if (ttl != 0) 480 if (ttl != 0) {
481 mhwmp_dbg("replying to the PREQ\n");
471 mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr, 482 mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
472 cpu_to_le32(dst_dsn), 0, orig_addr, 483 cpu_to_le32(dst_dsn), 0, orig_addr,
473 cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl, 484 cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
474 cpu_to_le32(lifetime), cpu_to_le32(metric), 485 cpu_to_le32(lifetime), cpu_to_le32(metric),
475 0, sdata); 486 0, sdata);
476 else 487 } else
477 ifmsh->mshstats.dropped_frames_ttl++; 488 ifmsh->mshstats.dropped_frames_ttl++;
478 } 489 }
479 490
@@ -661,7 +672,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
661 672
662 preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); 673 preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC);
663 if (!preq_node) { 674 if (!preq_node) {
664 printk(KERN_DEBUG "Mesh HWMP: could not allocate PREQ node\n"); 675 mhwmp_dbg("could not allocate PREQ node\n");
665 return; 676 return;
666 } 677 }
667 678
@@ -670,7 +681,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
670 spin_unlock(&ifmsh->mesh_preq_queue_lock); 681 spin_unlock(&ifmsh->mesh_preq_queue_lock);
671 kfree(preq_node); 682 kfree(preq_node);
672 if (printk_ratelimit()) 683 if (printk_ratelimit())
673 printk(KERN_DEBUG "Mesh HWMP: PREQ node queue full\n"); 684 mhwmp_dbg("PREQ node queue full\n");
674 return; 685 return;
675 } 686 }
676 687