diff options
author | Javier Cardona <javier@cozybit.com> | 2011-08-09 19:45:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 13:59:41 -0400 |
commit | 7646887a5390123475fdd621620b9f270b38df98 (patch) | |
tree | 1aec9cb0697ccb3997f2ad0a3edd5496b7577159 /net | |
parent | 87a8c8cb2001a64034f1bd64980ab826402ab881 (diff) |
mac80211: improve mpath debugging
make hwmp_dbg print the relevant sdata->name by default and improve
formatting. Also add mpath_dbg macro for debugging of mesh path
operations.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/Kconfig | 13 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 23 | ||||
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 6 |
3 files changed, 31 insertions, 11 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index f5fdfcbf552a..d1886b59bec4 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -199,6 +199,19 @@ config MAC80211_VERBOSE_MPL_DEBUG | |||
199 | 199 | ||
200 | Do not select this option. | 200 | Do not select this option. |
201 | 201 | ||
202 | config MAC80211_VERBOSE_MPATH_DEBUG | ||
203 | bool "Verbose mesh path debugging" | ||
204 | depends on MAC80211_DEBUG_MENU | ||
205 | depends on MAC80211_MESH | ||
206 | ---help--- | ||
207 | Selecting this option causes mac80211 to print out very | ||
208 | verbose mesh path selection debugging messages (when mac80211 | ||
209 | is taking part in a mesh network). | ||
210 | It should not be selected on production systems as those | ||
211 | messages are remotely triggerable. | ||
212 | |||
213 | Do not select this option. | ||
214 | |||
202 | config MAC80211_VERBOSE_MHWMP_DEBUG | 215 | config MAC80211_VERBOSE_MHWMP_DEBUG |
203 | bool "Verbose mesh HWMP routing debugging" | 216 | bool "Verbose mesh HWMP routing debugging" |
204 | depends on MAC80211_DEBUG_MENU | 217 | depends on MAC80211_DEBUG_MENU |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 9c3c0b86a740..abd03473cca4 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -11,7 +11,8 @@ | |||
11 | #include "mesh.h" | 11 | #include "mesh.h" |
12 | 12 | ||
13 | #ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG | 13 | #ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG |
14 | #define mhwmp_dbg(fmt, args...) printk(KERN_DEBUG "Mesh HWMP: " fmt, ##args) | 14 | #define mhwmp_dbg(fmt, args...) \ |
15 | printk(KERN_DEBUG "Mesh HWMP (%s): " fmt "\n", sdata->name, ##args) | ||
15 | #else | 16 | #else |
16 | #define mhwmp_dbg(fmt, args...) do { (void)(0); } while (0) | 17 | #define mhwmp_dbg(fmt, args...) do { (void)(0); } while (0) |
17 | #endif | 18 | #endif |
@@ -138,19 +139,19 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, | |||
138 | 139 | ||
139 | switch (action) { | 140 | switch (action) { |
140 | case MPATH_PREQ: | 141 | case MPATH_PREQ: |
141 | mhwmp_dbg("sending PREQ to %pM\n", target); | 142 | mhwmp_dbg("sending PREQ to %pM", target); |
142 | ie_len = 37; | 143 | ie_len = 37; |
143 | pos = skb_put(skb, 2 + ie_len); | 144 | pos = skb_put(skb, 2 + ie_len); |
144 | *pos++ = WLAN_EID_PREQ; | 145 | *pos++ = WLAN_EID_PREQ; |
145 | break; | 146 | break; |
146 | case MPATH_PREP: | 147 | case MPATH_PREP: |
147 | mhwmp_dbg("sending PREP to %pM\n", target); | 148 | mhwmp_dbg("sending PREP to %pM", target); |
148 | ie_len = 31; | 149 | ie_len = 31; |
149 | pos = skb_put(skb, 2 + ie_len); | 150 | pos = skb_put(skb, 2 + ie_len); |
150 | *pos++ = WLAN_EID_PREP; | 151 | *pos++ = WLAN_EID_PREP; |
151 | break; | 152 | break; |
152 | case MPATH_RANN: | 153 | case MPATH_RANN: |
153 | mhwmp_dbg("sending RANN from %pM\n", orig_addr); | 154 | mhwmp_dbg("sending RANN from %pM", orig_addr); |
154 | ie_len = sizeof(struct ieee80211_rann_ie); | 155 | ie_len = sizeof(struct ieee80211_rann_ie); |
155 | pos = skb_put(skb, 2 + ie_len); | 156 | pos = skb_put(skb, 2 + ie_len); |
156 | *pos++ = WLAN_EID_RANN; | 157 | *pos++ = WLAN_EID_RANN; |
@@ -494,10 +495,10 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, | |||
494 | orig_sn = PREQ_IE_ORIG_SN(preq_elem); | 495 | orig_sn = PREQ_IE_ORIG_SN(preq_elem); |
495 | target_flags = PREQ_IE_TARGET_F(preq_elem); | 496 | target_flags = PREQ_IE_TARGET_F(preq_elem); |
496 | 497 | ||
497 | mhwmp_dbg("received PREQ from %pM\n", orig_addr); | 498 | mhwmp_dbg("received PREQ from %pM", orig_addr); |
498 | 499 | ||
499 | if (memcmp(target_addr, sdata->vif.addr, ETH_ALEN) == 0) { | 500 | if (memcmp(target_addr, sdata->vif.addr, ETH_ALEN) == 0) { |
500 | mhwmp_dbg("PREQ is for us\n"); | 501 | mhwmp_dbg("PREQ is for us"); |
501 | forward = false; | 502 | forward = false; |
502 | reply = true; | 503 | reply = true; |
503 | metric = 0; | 504 | metric = 0; |
@@ -533,7 +534,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, | |||
533 | lifetime = PREQ_IE_LIFETIME(preq_elem); | 534 | lifetime = PREQ_IE_LIFETIME(preq_elem); |
534 | ttl = ifmsh->mshcfg.element_ttl; | 535 | ttl = ifmsh->mshcfg.element_ttl; |
535 | if (ttl != 0) { | 536 | if (ttl != 0) { |
536 | mhwmp_dbg("replying to the PREQ\n"); | 537 | mhwmp_dbg("replying to the PREQ"); |
537 | mesh_path_sel_frame_tx(MPATH_PREP, 0, target_addr, | 538 | mesh_path_sel_frame_tx(MPATH_PREP, 0, target_addr, |
538 | cpu_to_le32(target_sn), 0, orig_addr, | 539 | cpu_to_le32(target_sn), 0, orig_addr, |
539 | cpu_to_le32(orig_sn), mgmt->sa, 0, ttl, | 540 | cpu_to_le32(orig_sn), mgmt->sa, 0, ttl, |
@@ -553,7 +554,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, | |||
553 | ifmsh->mshstats.dropped_frames_ttl++; | 554 | ifmsh->mshstats.dropped_frames_ttl++; |
554 | return; | 555 | return; |
555 | } | 556 | } |
556 | mhwmp_dbg("forwarding the PREQ from %pM\n", orig_addr); | 557 | mhwmp_dbg("forwarding the PREQ from %pM", orig_addr); |
557 | --ttl; | 558 | --ttl; |
558 | flags = PREQ_IE_FLAGS(preq_elem); | 559 | flags = PREQ_IE_FLAGS(preq_elem); |
559 | preq_id = PREQ_IE_PREQ_ID(preq_elem); | 560 | preq_id = PREQ_IE_PREQ_ID(preq_elem); |
@@ -588,7 +589,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, | |||
588 | u8 next_hop[ETH_ALEN]; | 589 | u8 next_hop[ETH_ALEN]; |
589 | u32 target_sn, orig_sn, lifetime; | 590 | u32 target_sn, orig_sn, lifetime; |
590 | 591 | ||
591 | mhwmp_dbg("received PREP from %pM\n", PREP_IE_ORIG_ADDR(prep_elem)); | 592 | mhwmp_dbg("received PREP from %pM", PREP_IE_ORIG_ADDR(prep_elem)); |
592 | 593 | ||
593 | /* Note that we divert from the draft nomenclature and denominate | 594 | /* Note that we divert from the draft nomenclature and denominate |
594 | * destination to what the draft refers to as origininator. So in this | 595 | * destination to what the draft refers to as origininator. So in this |
@@ -799,7 +800,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags) | |||
799 | 800 | ||
800 | preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); | 801 | preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); |
801 | if (!preq_node) { | 802 | if (!preq_node) { |
802 | mhwmp_dbg("could not allocate PREQ node\n"); | 803 | mhwmp_dbg("could not allocate PREQ node"); |
803 | return; | 804 | return; |
804 | } | 805 | } |
805 | 806 | ||
@@ -808,7 +809,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags) | |||
808 | spin_unlock_bh(&ifmsh->mesh_preq_queue_lock); | 809 | spin_unlock_bh(&ifmsh->mesh_preq_queue_lock); |
809 | kfree(preq_node); | 810 | kfree(preq_node); |
810 | if (printk_ratelimit()) | 811 | if (printk_ratelimit()) |
811 | mhwmp_dbg("PREQ node queue full\n"); | 812 | mhwmp_dbg("PREQ node queue full"); |
812 | return; | 813 | return; |
813 | } | 814 | } |
814 | 815 | ||
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 6ffcd53fe7d6..bd6b8b3e873a 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -17,6 +17,12 @@ | |||
17 | #include "ieee80211_i.h" | 17 | #include "ieee80211_i.h" |
18 | #include "mesh.h" | 18 | #include "mesh.h" |
19 | 19 | ||
20 | #ifdef CONFIG_MAC80211_VERBOSE_MPATH_DEBUG | ||
21 | #define mpath_dbg(fmt, args...) printk(KERN_DEBUG fmt, ##args) | ||
22 | #else | ||
23 | #define mpath_dbg(fmt, args...) do { (void)(0); } while (0) | ||
24 | #endif | ||
25 | |||
20 | /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ | 26 | /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ |
21 | #define INIT_PATHS_SIZE_ORDER 2 | 27 | #define INIT_PATHS_SIZE_ORDER 2 |
22 | 28 | ||