Commit Graph

62 Commits

Author SHA1 Message Date
mentor fd43343eb6 * Update TU variables to be u_int64_t as they are only 10 bits shorter than TSFs which are 64 bit.
* Use roundup() to calculate the next intval boundary for nexttbtt. This method is more simple to understand and computationally simpler.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3095 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-29 02:28:36 +00:00
br1 fd0bc7d1b2 Added lots of debug to understand & test IBSS merges
from the madwifi-dfs branch (benoit) r3086

Added MAC_FMT & MAC_ADDR macros that can be used as a drop-in
replacement for ether_sprintf(). Fixed some use of ether_sprintf() that
uses the same static buffer twice.

- Without the functional changes.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3091 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-28 04:35:23 +00:00
br1 f23be2b4ce cleaning up dynamic sysctl enum
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3085 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-26 03:15:42 +00:00
mentor 36d29a3180 Update TSTAMP MASK defines missed in last commit
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3077 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-24 01:10:25 +00:00
mentor ff673bb684 Rework monitor mode SKB handling, touching shared and cloned SKB handling in the TX path. This patch removes any such processing based on the assumption that the current processing is wrong even in the most conservative case (cloned SKB).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3076 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-24 01:01:47 +00:00
mentor d959c28466 Lots and lots of formatting and trivial changes that I have been collecting
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3069 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-21 17:55:45 +00:00
proski 03538d0225 Protect against NULL in ath_beacon_config()
It's called with NULL vap in several places, and the old
ath_beacon_config() had such protection.  Without this check, the kernel
panics after association in managed mode.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3064 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-16 16:40:42 +00:00
mentor 9fbdb5c7a2 Formatting for r3027
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3063 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-14 17:23:33 +00:00
nbd 07554543db remove the call to ath_phydisable, which is causing crashes on various platforms (e.g. data bus error on the next card reset on broadcom 47xx)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3053 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-13 04:16:35 +00:00
br1 6e15444bd5 this ports, with some changes, the IBSS merging work benoit has done in the dfs
branch to trunk. especially notable is, that due to improved nexttbtt (next
"target beacon transmit time") calculation we will now get the correct backoff
behaviour for beacons, resulting in only one beacon per beacon interval (the
current head version will send N beacons for N stations in the beacon interval
because they are poorly synchronized). also because of the better timer
synchronization there is no more time lag of up to 1 minute until we see
beacons after a merge. thanks to benoit for figuring that out!

the difference between this patch and the version in the dfs-branch is that it 
still uses self linked descriptors and uses the SWBA interrupt only for 
updating the nexttbtt. this is necessary to recognize HW merges, for which we
don't get any notification by the hardware (see the thread "IBSS testing" on
this list for more details).

also i tried to clean up a bit, use a more descriptive function name for timer 
updates (ath_beacon_update_timers instead of ath_beacon_config) and generally 
better distingush between a HW merge and a SW merge.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3027 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-12 01:32:51 +00:00
br1 f0d51a7a43 clean up after my last commit. better comments and error reporting (from mentor's patch).
i verified that 0 rates also create the same problem in G mode so i removed the reference to A bands.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3015 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-11 06:37:53 +00:00
br1 45c427d337 guard against 0 rates which can be caused by wrong received frames.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3013 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-10 13:15:06 +00:00
br1 d09703c049 introduce new debug flag "tsf" (ATH_DEBUG_TSF) so TSF timestamp processing
doesn't get into the way of debugging beacon stuff



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3008 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-07 07:00:31 +00:00
mentor adb4a563ba Spelling
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3005 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-05 00:55:31 +00:00
mentor 59982ec746 Formatting changes:
* Remove comments that merely duplicate the code (i.e., they don't provide information on Why or explain the opaque)
 * Rename some variable for consistency
 * Line length -> 80 chars
 * Reorder non-dependent code blocks in a function to make it more readable (at least to me)


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3003 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-04 00:43:10 +00:00
mentor 79bf489a8d Only try to remove padding in frames where a data body exists. Otherwise, aligning the data pushes some of it out of the buffer.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2991 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-28 21:32:50 +00:00
proski 2f1668b916 Standardize on ARRAY_SIZE, stop defining and undefining N
ARRAY_SIZE is present in all kernel versions we support.  Use it instead
of other definitions.  Define ARRAY_SIZE in the userspace tools as well.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2988 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-28 05:36:29 +00:00
proski 613b48e369 Better fix for warning in ath_return_txbuf_locked
bufaddr doesn't need to be (void *).  Make it (struct ath_buf *).


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2984 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-27 21:55:45 +00:00
mtaylor 4df2d580a7 port of r2879 from madwifi-dfs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2980 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-27 10:06:02 +00:00
mentor 9d7916a961 Formatting (whitespace only) for r2857
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2967 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-26 01:25:35 +00:00
mtaylor ec5e8e0a11 Re-enable skb debug destructor, chaining to original when present.
Split skb and node debug flags - one ending in _ref tracks minute changes to reference counts, while the non _ref flag trackes more coarse grained debug events.
Fix a node reference leak before skb_orphan detected by the debug destructor.
Fix debug flag display order for athdebug and 80211debug so that the shorter
name comes first and matches, otherwise only the _ref flags match.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2964 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 09:09:24 +00:00
mtaylor 15587c9e84 Do not assign buf->bf_skb to null before cleanup code runs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2962 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:58:23 +00:00
mtaylor 70c6a99d95 Restore call to skb_orphan, as the implementation varies by kernel and we cannot elide some of the steps without screwing with others we dont know about.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2961 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:55:48 +00:00
mtaylor 394706c826 Allow node reference to be cleaned up normally
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2960 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:53:41 +00:00
mtaylor 9e643fab44 remove superfluous null assignment and do not use _locked version of ath_take_txbuf for txcont
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2959 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:51:08 +00:00
mtaylor 479c140cde Missed call during r2902 changes
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2958 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:49:33 +00:00
mtaylor 652f013b99 Cleanup some null checks
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2957 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:48:04 +00:00
mtaylor 7b3e465558 Fix a typo.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2956 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:42:12 +00:00
proski 09e5677445 Fix the last sparse warning - find key index in a loop
ath_key_alloc() was using pointer subtraction to determine the group key
index.  This is not optimal, as it's done by dividing a pointer-sized
integer by a number that is generally not a power of two.

Since there are only 4 (IEEE80211_WEP_NKID) keys to try, it's easier to
try them all in a loop.  It also makes the code more reliable, as it now
detects the cases when the key pointer is within the valid range, but
doesn't point to the beginning of an array element.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2954 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 05:42:23 +00:00
mentor 3f9f5f6a53 Modify function names for brevity and consistency
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2953 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 04:13:49 +00:00
mentor 79e3ccd6ae Formatting changes, parentheses style this time
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2952 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 04:08:38 +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 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
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 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
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
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 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 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 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
proski 3bb4181d67 Unexpand tabs in the lines different from the DFS branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2871 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-20 20:33:58 +00:00
proski 6b697f9589 Merge whitespace changes made on the DFS branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2869 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-20 18:19:55 +00:00
benoit b2be90d89d Merge RX timestamps changes from madwifi-dfs branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2859 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-18 22:04:47 +00:00