Project : madwifi
Revision : 2965
Author : mtaylor (Michael Taylor)
Date : 2007-11-25 10:18:39 +0100 (Sun, 25 Nov 2007)
Log Message :
Merge to trunk r2964
Affected Files:
* madwifi/branches/madwifi-dfs/ath/if_ath.c updated
* madwifi/branches/madwifi-dfs/ath/if_ath_debug.h updated
* madwifi/branches/madwifi-dfs/net80211/ieee80211_debug.h updated
* madwifi/branches/madwifi-dfs/net80211/ieee80211_linux.h updated
* madwifi/branches/madwifi-dfs/net80211/ieee80211_node.c updated
* madwifi/branches/madwifi-dfs/net80211/ieee80211_skb.c updated
* madwifi/branches/madwifi-dfs/tools/80211debug.c updated
* madwifi/branches/madwifi-dfs/tools/athdebug.c updated
Modified: madwifi/branches/madwifi-dfs/ath/if_ath.c
===================================================================
--- madwifi/branches/madwifi-dfs/ath/if_ath.c 2007-11-25 09:09:24 UTC (rev
2964)
+++ madwifi/branches/madwifi-dfs/ath/if_ath.c 2007-11-25 09:18:39 UTC (rev
2965)
@@ -6058,6 +6058,8 @@
SKB_CB(skb)->ni = ieee80211_ref_node(SKB_CB(skb_orig)->ni);
ieee80211_dev_kfree_skb(&skb_orig);
} else {
+ if (SKB_CB(skb)->ni != NULL)
+ ieee80211_unref_node(&SKB_CB(skb)->ni);
skb_orphan(skb);
}
Modified: madwifi/branches/madwifi-dfs/ath/if_ath_debug.h
===================================================================
--- madwifi/branches/madwifi-dfs/ath/if_ath_debug.h 2007-11-25 09:09:24 UTC
(rev 2964)
+++ madwifi/branches/madwifi-dfs/ath/if_ath_debug.h 2007-11-25 09:18:39 UTC
(rev 2965)
@@ -30,7 +30,7 @@
ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */
ATH_DEBUG_RATE = 0x00000010, /* rate control */
ATH_DEBUG_RESET = 0x00000020, /* reset processing */
- /* 0x00000040 was ATH_DEBUG_MODE */
+ ATH_DEBUG_SKB_REF = 0x00000040, /* sbk references */
ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */
ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */
ATH_DEBUG_INTR = 0x00001000, /* ISR */
@@ -53,7 +53,7 @@
ATH_DEBUG_SKB = 0x40000000, /* SKB usage/leak debugging
[applies to all vaps] */
ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */
ATH_DEBUG_ANY = 0xffffffff,
- ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB)
+ ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF)
};
#define DPRINTF(sc, _m, _fmt, ...) do {
\
if (sc->sc_debug & (_m)) { \
Modified: madwifi/branches/madwifi-dfs/net80211/ieee80211_debug.h
===================================================================
--- madwifi/branches/madwifi-dfs/net80211/ieee80211_debug.h 2007-11-25
09:09:24 UTC (rev 2964)
+++ madwifi/branches/madwifi-dfs/net80211/ieee80211_debug.h 2007-11-25
09:18:39 UTC (rev 2965)
@@ -40,6 +40,7 @@
/* Set to true if ANY sc has skb debugging on */
extern int ath_debug_global;
enum {
+ GLOBAL_DEBUG_SKB_REF = 0x00000040, /* SKB referernce counting */
GLOBAL_DEBUG_SKB = 0x40000000, /* SKB usage/leak debugging,
must match ATH_DEBUG_SKB */
};
Modified: madwifi/branches/madwifi-dfs/net80211/ieee80211_linux.h
===================================================================
--- madwifi/branches/madwifi-dfs/net80211/ieee80211_linux.h 2007-11-25
09:09:24 UTC (rev 2964)
+++ madwifi/branches/madwifi-dfs/net80211/ieee80211_linux.h 2007-11-25
09:18:39 UTC (rev 2965)
@@ -381,7 +381,7 @@
* NB: sizeof(cb) == 48 and the vlan code grabs the first
* 8 bytes so we reserve/avoid it.
*/
-struct ieee80211_cb {
+ struct ieee80211_cb {
u_int8_t vlan[8]; /* reserve for vlan tag info */
struct ieee80211_node *ni;
u_int32_t flags;
@@ -392,6 +392,7 @@
#define M_RAW 0x10
#ifdef IEEE80211_DEBUG_REFCNT
int tracked;
+ void (*next_destructor)(struct sk_buff *skb);
#endif
struct sk_buff *next; /* fast frame sk_buf chain */
};
Modified: madwifi/branches/madwifi-dfs/net80211/ieee80211_node.c
===================================================================
--- madwifi/branches/madwifi-dfs/net80211/ieee80211_node.c 2007-11-25
09:09:24 UTC (rev 2964)
+++ madwifi/branches/madwifi-dfs/net80211/ieee80211_node.c 2007-11-25
09:18:39 UTC (rev 2965)
@@ -909,6 +909,7 @@
}
static void node_print_message(
+ u_int32_t flags,
int show_counter,
int refcnt_adjust,
const struct ieee80211_node *ni,
@@ -924,7 +925,7 @@
char node_count[32] = { '\0' };
char expanded_message[1024] = { '\0' };
- if (0 == (ni->ni_ic->ic_debug & IEEE80211_MSG_NODE_REF))
+ if (0 == (ni->ni_ic->ic_debug & flags) && (flags != IEEE80211_MSG_ANY))
return;
if (adjusted_refcount == 0)
@@ -1093,7 +1094,8 @@
ni->ni_vap = vap;
ni->ni_ic = ic;
atomic_inc(&ni->ni_ic->ic_node_counter);
- node_print_message(1 /* show counter */,
+ node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF,
+ 1 /* show counter */,
0 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
@@ -1642,7 +1644,8 @@
struct ieee80211vap *vap = ni->ni_vap;
atomic_dec(&ni->ni_ic->ic_node_counter);
- node_print_message(1 /* show counter */,
+ node_print_message(IEEE80211_MSG_NODE|IEEE80211_MSG_NODE_REF,
+ 1 /* show counter */,
0 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
@@ -2368,7 +2371,8 @@
return ni;
}
if (atomic_read(&ni->ni_refcnt) < 1) {
- node_print_message(0 /* show counter */,
+ node_print_message(IEEE80211_MSG_ANY,
+ 0 /* show counter */,
0 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
@@ -2382,7 +2386,8 @@
return ni;
}
atomic_inc(&ni->ni_refcnt);
- node_print_message(0 /* show counter */,
+ node_print_message(IEEE80211_MSG_NODE_REF,
+ 0 /* show counter */,
0 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
@@ -2418,7 +2423,8 @@
return;
}
if (atomic_read(&ni->ni_refcnt) < 1) {
- node_print_message(0 /* show counter */,
+ node_print_message(IEEE80211_MSG_ANY,
+ 0 /* show counter */,
0 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
@@ -2432,7 +2438,8 @@
return;
}
- node_print_message(0 /* show counter */,
+ node_print_message(IEEE80211_MSG_NODE_REF,
+ 0 /* show counter */,
-1 /* adjust refcount */,
ni,
#ifdef IEEE80211_DEBUG_REFCNT
Modified: madwifi/branches/madwifi-dfs/net80211/ieee80211_skb.c
===================================================================
--- madwifi/branches/madwifi-dfs/net80211/ieee80211_skb.c 2007-11-25
09:09:24 UTC (rev 2964)
+++ madwifi/branches/madwifi-dfs/net80211/ieee80211_skb.c 2007-11-25
09:18:39 UTC (rev 2965)
@@ -195,12 +195,16 @@
static void skb_destructor(struct sk_buff* skb) {
/* Report any node reference leaks - caused by kernel net device queue
* dropping buffer, rather than passing it to the driver. */
- if ((ath_debug_global & GLOBAL_DEBUG_SKB) && SKB_CB(skb)->ni != NULL) {
+ if (SKB_CB(skb)->ni != NULL) {
printk(KERN_ERR "%s:%d - ERROR: non-NULL node pointer in %p,
%p<%s>! "
"Leak Detected!\n",
__func__, __LINE__,
skb, SKB_CB(skb)->ni,
ether_sprintf(SKB_CB(skb)->ni->ni_macaddr));
+ dump_stack();
}
+ if (SKB_CB(skb)->next_destructor != NULL) {
+ SKB_CB(skb)->next_destructor(skb);
+ }
}
EXPORT_SYMBOL(skb_destructor);
@@ -232,7 +236,7 @@
const char* func2, int line2)
{
char skb_desc[128] = { '\0' };
- if (0 == (ath_debug_global & GLOBAL_DEBUG_SKB))
+ if (0 == (ath_debug_global & GLOBAL_DEBUG_SKB_REF))
return;
get_skb_description(skb_desc, sizeof(skb_desc),
"skb", skb, users_adjustment);
@@ -293,8 +297,9 @@
print_skb_trackchange_message(skb, users_adjustment,
func1, line1, func2, line2,
" is now ** TRACKED **");
- /* Always use our debug destructor, when we can... */
- if (NULL == skb->destructor) {
+ /* Install our debug destructor, chaining to the original... */
+ if (skb->destructor != skb_destructor) {
+ SKB_CB(skb)->next_destructor = skb->destructor;
skb->destructor = skb_destructor;
}
return skb;
@@ -327,6 +332,11 @@
atomic_dec(&skb_total_counter);
atomic_dec(&skb_refs_counter);
SKB_CB(skb)->tracked = 0;
+ /* Install our debug destructor, chaining to the original... */
+ if (skb->destructor != skb_destructor) {
+ SKB_CB(skb)->next_destructor = skb->destructor;
+ skb->destructor = skb_destructor;
+ }
print_skb_trackchange_message(skb, users_adjustment,
func1, line1, func2, line2,
" is now ** UNTRACKED **");
Modified: madwifi/branches/madwifi-dfs/tools/80211debug.c
===================================================================
--- madwifi/branches/madwifi-dfs/tools/80211debug.c 2007-11-25 09:09:24 UTC
(rev 2964)
+++ madwifi/branches/madwifi-dfs/tools/80211debug.c 2007-11-25 09:18:39 UTC
(rev 2965)
@@ -89,7 +89,6 @@
u_int bit;
const char *desc;
} flags[] = {
- { "node_ref", IEEE80211_MSG_NODE_REF, "node ref counting (affects all
devs)" },
{ "debug", IEEE80211_MSG_DEBUG, "IFF_DEBUG equivalent" },
{ "dumppkts", IEEE80211_MSG_DUMPPKTS, "dump packets" },
{ "crypto", IEEE80211_MSG_CRYPTO, "crypto modules" },
@@ -97,6 +96,7 @@
{ "xrate", IEEE80211_MSG_XRATE, "rate set handling" },
{ "elemid", IEEE80211_MSG_ELEMID, "element id parsing"},
{ "node", IEEE80211_MSG_NODE, "node management" },
+ { "node_ref", IEEE80211_MSG_NODE_REF, "node ref counting (affects all
devs)" },
{ "assoc", IEEE80211_MSG_ASSOC, "association handling" },
{ "auth", IEEE80211_MSG_AUTH, "authentication handling" },
{ "scan", IEEE80211_MSG_SCAN, "scanning" },
Modified: madwifi/branches/madwifi-dfs/tools/athdebug.c
===================================================================
--- madwifi/branches/madwifi-dfs/tools/athdebug.c 2007-11-25 09:09:24 UTC
(rev 2964)
+++ madwifi/branches/madwifi-dfs/tools/athdebug.c 2007-11-25 09:18:39 UTC
(rev 2965)
@@ -63,7 +63,7 @@
ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */
ATH_DEBUG_RATE = 0x00000010, /* rate control */
ATH_DEBUG_RESET = 0x00000020, /* reset processing */
- ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */
+ ATH_DEBUG_SKB_REF = 0x00000040, /* skb ref counting */
ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */
ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */
ATH_DEBUG_INTR = 0x00001000, /* ISR */
@@ -86,7 +86,7 @@
ATH_DEBUG_SKB = 0x40000000, /* SKB usage/leak debugging
[applies to all vaps] */
ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */
ATH_DEBUG_ANY = 0xffffffff,
- ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB)
+ ATH_DEBUG_GLOBAL = (ATH_DEBUG_SKB|ATH_DEBUG_SKB_REF)
};
static struct {
@@ -100,7 +100,6 @@
{ "recv_desc", ATH_DEBUG_RECV_DESC, "recv descriptors" },
{ "rate", ATH_DEBUG_RATE, "rate control modules" },
{ "reset", ATH_DEBUG_RESET, "reset processing and
initialization" },
- { "mode", ATH_DEBUG_MODE, "mode initialization and
changes" },
{ "beacon", ATH_DEBUG_BEACON, "beacon handling" },
{ "watchdog", ATH_DEBUG_WATCHDOG, "watchdog timer" },
{ "intr", ATH_DEBUG_INTR, "interrupt processing" },
@@ -112,6 +111,7 @@
{ "state", ATH_DEBUG_STATE, "802.11 state transitions" },
{ "txbuf", ATH_DEBUG_TXBUF, "ath_buf management" },
{ "skb", ATH_DEBUG_SKB, "skb management (affects all
devs)" },
+ { "skb_ref", ATH_DEBUG_SKB_REF, "skb ref counting (affects all
devs)" },
{ "led", ATH_DEBUG_LED, "led management" },
{ "ff", ATH_DEBUG_FF, "fast frame handling" },
{ "turbo", ATH_DEBUG_TURBO, "dynamic turbo handling" },
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
|