Commit Graph

198 Commits

Author SHA1 Message Date
mtaylor
5d546c1ea1 Doh! Fix boneheaded mistake.
Preprocessor flag now used to toggle printk output prior to blocking on
a spinlock.

There is of course a chance that the spinlock will be taken between the time we check it and print our little message, but this should still be of some assistance troubleshoot locking mistakes that come up in the future.

If you turn on the flag, you can find out what locks are being contended for and from which functions... i.e. ath_intr fights for a particular lock, etc.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2944 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-24 06:46:19 +00:00
mtaylor
99f62ecfab backout 2942.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2943 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-24 05:24:53 +00:00
mtaylor
f91e998352 Two places we did not unlock txq lock
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2942 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-24 05:22:31 +00:00
mtaylor
734a08b321 dont call netif_stop_queue if only one txq is full.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2940 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-24 04:46:15 +00:00
mtaylor
e5854bed77 Added lock assertion macros for all locks. Assert locks in all new _locked functions. Assert lock state in all LOCK/UNLOCK macros.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2938 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 23:42:38 +00:00
benoit
8f7da38c30 Fixed a double locking bug - Merge from madwifi-dfs branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2936 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 22:50:01 +00:00
benoit
230a7edfe9 Removed sc_last_tsf alltogether (was just for debugging anyway)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2934 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 22:18:33 +00:00
proski
a992820b57 Streamline _OS_REG_WRITE/_OS_REG_READ implementation
Use a new is_reg_le macro to determine whether the register points to a
little-endian area.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2933 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 09:38:18 +00:00
proski
9a8cf27ead Provide replacements for iowrite32be and ioread32be if needed
The architectures that don't set CONFIG_GENERIC_IOMAP are supposed to
provide replacements for functions in lib/iomap.c, but not all provide
iowrite32be() and ioread32be().

Only MIPS, PARISC and PowerPC implement iowrite32be and ioread32be as
functions, while SH and AVR32 provide macros.  Other architectures, in
particular ARM, provide no replacement at all.

This should fix ticket #1539.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2932 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 09:28:21 +00:00
proski
62ca1ef3ab Re-format, rewrite some comments, fix typos
Fix inconsistent formatting of the comments.  Fix the text along the
way.  Run the file through madwifi-indent, but undo some overzealous
formatting.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2931 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 07:50:33 +00:00
proski
7f6072f9ae Remove __printflike definition, it's not used anywhere in the code
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2930 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 07:41:07 +00:00
proski
18178f002d Filter out -mapcs-32, it's not universally supported
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2929 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-23 06:31:11 +00:00
mtaylor
ea868797b6 Comment out some stuff added after 2.4 kernel. 2.6.0 is just a guess, but should serve as a starting point.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2927 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 07:57:43 +00:00
mtaylor
c428bb7406 Remove references to skbuff.input_dev as it seems to have had a relatively short lifespan, despite the references in the textbooks on network internals. ;-)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2925 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 06:57:45 +00:00
mtaylor
cbc24dce2a Switch back to plain old int for gfp_t definition for pre 2.6.14...
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2923 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 04:46:27 +00:00
mtaylor
f30e5aa80b Add gfp_t for pre 2.6.14 kernels in compat.h
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2921 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 04:43:06 +00:00
mtaylor
aa7fddfba7 Allow WDS nodes with cloned BSSID
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2920 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 03:36:48 +00:00
mentor
2a7bdfd500 Fix some indentation from a regex gone wrong in r2915
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2918 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 02:37:19 +00:00
mentor
5afdef8cae Formatting changes. Mostly line lengths with some whitespace. Also, remove author info from any comments.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2915 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 02:08:35 +00:00
proski
22436a7615 Avoid using preprocessor conditionals inside macro arguments
Sparse doesn't like it, and it's ugly indeed.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2914 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 01:28:29 +00:00
mtaylor
9dc2e2884a Wrap use of input_dev in preprocessor conditionals. Went away in 2.6.20.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2913 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 01:02:08 +00:00
mtaylor
3edfc8a644 Restore error message on alloc_skb failure
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2910 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 00:49:31 +00:00
mtaylor
54d2029f21 Fix sparse warnings and compile errors reported with includes in ieee80211_skb.h
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2908 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-22 00:24:26 +00:00
proski
932d54e246 Make ath_buf_counter static. Reported by sparse.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2907 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 22:49:25 +00:00
proski
562bdbac4a Use void* to keep an address, not u_int32_t
Pointers don't fit u_int32_t on 64-bit systems.  Besides, conversion
from pointers to integers and vice versa should be generally avoided.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2906 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 22:44:32 +00:00
mtaylor
ebe8ee9736 This patch augments the current reference counting code with:
* Counters for total outstanding instances for each resource type (skb, ath_node and ath_buf)
* One pair of acquisition/release functions per resource type in unlocked and one in locked
* Adds some more _debug versions of functions in the call chain that acquire/release resources so that the original func/line in the driver as well as the func/line that affected the resource use can be shown in the trace.  Intermediate stack frames aren't necessary to trace the leaks.
* Changes naming convention for "lock-required" functions to suffix _locked for the versions that expect locking, to be consistent with some other places in the code.
* Consolidate debug messages to the helper functions that actually affect the reference count or acquire/release a resource
* Additional sanity checks and leak detection (esp for detecting node ref leaks through skb)
* skb references are nulled out by the new sbk unref/free function.

I've tested these changes extensively and found lots of cases where we didn't get enough node references when cloning skbuff, and where the kernel drops packets due to performance issues and leaks our node references.

With these changes and the tracing enabled I have verified that:

* TX BUF: tx buffers always go down to zero when the tx queue is done, and you can watch tx queue usage ratio go up and down again as the driver is working.  There are no leaks here at the moment, although there *are* some in the madwifi-dfs branch during CAC at the moment.

* skbuff leaks in all the common flows are fixed.  We were leaking node references in a lot of places where kernel was dropping skb's due to congestion and we were failing to increment node references when cloning skbuffs.  These are now detected, as are skbuffs that are reaped by the kernel while still holding a node reference.

* the ath_node count works correctly and on an idle system we get about 5 references per station table node, with 2 node instances per VAP.  One for the bss and one for the node in the station table, I believe.  The ath_node count goes up and down but always lands back at the stable number based on the vaps you have configured and the number of actual stations in the station table.  The point here is that it's pretty constant what you will see over time, despite excessive node creation/release in our code during input (esp input_all).  Thank god for the slab allocator.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2902 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 20:14:11 +00:00
proski
4ea262da0e Fix sparse warning about ni_tmp
Move the outer ni_tmp in ieee80211_deliver_data() to the scope where
it's used.  Don't set it to NULL, it goes out of scope and cannot be
used elsewhere.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2901 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 19:43:25 +00:00
mtaylor
640f86f562 Put the zeroing of the CB back in. It was supposed to move up to the top and not dissapear. In another change I will commit, some of the logic depends upon zeroing earlier before assigning some values to cb
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2900 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 18:25:00 +00:00
proski
61e57408ea Port some formatting fixes from DFS branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2898 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 17:18:09 +00:00
mtaylor
0624a5b03e More SKB_CB macro use and cleanup of dropped references from kernel dropped skbuff
structures.  More refcount bumps due to skb_clone/skb_copy.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2896 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:47:50 +00:00
mtaylor
5470ea57f4 More reference count increments after skbuff copies and more releases of
node references if the kernel drops the skbuff.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2895 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:43:42 +00:00
mtaylor
0c4e2a41e9 Refcount fix for netif_rx() and friends, returning error and dropping SKB but we were not releasing our node reference.
Refcount fix for skb_clone/etc where we were not keeping reference counter matching the number of skbuff instances and were not having enough references.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2894 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:38:42 +00:00
mtaylor
09b1e7bb56 More SKB_CB macro use
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2893 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:27:21 +00:00
mtaylor
fea3f135d3 Add missing symbols used by txcont
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2892 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:20:36 +00:00
mtaylor
b43465c8f9 Missed checkin for new debug flags
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2891 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:16:05 +00:00
mtaylor
831cbc8da0 More use of macros to access cb, per kernel conventions
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2890 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:13:54 +00:00
mtaylor
6f471d5f17 Backport of continous transmit function from madwifi-dfs.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2889 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 11:08:51 +00:00
mtaylor
76ef1fd56b Support for setting default VAP debug flags at module load time, so you can
catch messages that occur during VAP startup (before you can possibly invoke 
80211debug).

Support for shared debug flags where they take effect across all devices
(i.e. shared flags in athdebug), and when they take effect across all VAPs
(i.e. shared flags in 80211debug).

Some additional debugging flags, including some in preparation for more leak 
detection code to be merged shortly as well as some from madwifi-dfs.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2888 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:45:58 +00:00
mtaylor
3511ea0ea9 Add SKB_CB macro and begin using it in a few places, eventually everywhere
we use skb->cb (will be in a subsequent commit/merge) should use 
   this macro.  This is part of a larger batch of changes I am in the process
   of merging that add better visibility into skbuff usage/leaks in the driver.

ieee80211_node_refcnt use atomic_read for consistency and because it is 
   the correct thing to do.  atomic_read is a macro that expands to the same 
   thing in most architectures anyway.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2887 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:39:06 +00:00
mtaylor
5fadd3cdaa Missed include
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2886 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:27:53 +00:00
mtaylor
bf8d475c98 Backport some additional 802.11 defines from madwifi-dfs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2885 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:24:35 +00:00
mtaylor
c5469cede8 More whitespace cleanup backported from madwifi-dfs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2884 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:22:23 +00:00
mtaylor
6d8bbfe271 Remove duplicate copy of VAP_DEV_NAME
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2883 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 10:16:48 +00:00
mtaylor
09e974b2db since ieee80211_input() can be called by ieee80211_input_all(), we need to check that we are not
updating statistics of all known nodes for every inbound packet for an unknown node. 

Merging this fix back from DFS branch, found by Benoit.
-gThis line, and those below, will be ignored--

M    ieee80211_input.c


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2882 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 09:39:42 +00:00
mtaylor
0d6e81e270 Relocate refcounting macro defines so they are visible in more places, in preparation for
merging some other changes that need this.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2881 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 09:24:56 +00:00
mtaylor
12aa3fb33e Add parent device to debug output lines from ieee80211_* debug functions.
Add VAP mac address to debug output lines from ieee80211_* debug functions.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2880 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 09:15:37 +00:00
mtaylor
c717e369fd Move DEV_NAME macro from if_ath.c to ieee80211_var.h, and expand on it.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2879 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 09:13:44 +00:00
benoit
8173daf0ad Merge changeset 2877 to trunk. Fixed sc_last_tsf.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2878 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 08:45:54 +00:00
mtaylor
e4dc719a3c Add labs macro
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2876 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 08:31:35 +00:00
mtaylor
34a98e1501 Add null check around dev_kfree_skb
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2875 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 08:23:43 +00:00