Commit Graph

289 Commits

Author SHA1 Message Date
mentor 2ecfeab07e Move the maximum monitor headroom definition to a nice header file
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3593 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-01 13:49:09 +00:00
mentor 65868884d2 Do not modify source packet in ieee80211_input_monitor if the headroom is not sufficient. Instead, make sure the copied skb is allocated with enough headroom.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3586 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-30 22:11:27 +00:00
mentor bbcacb393a Correct terminology in ieee80211_input skb_copy comment
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3585 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-30 22:04:38 +00:00
mentor ef6d84125b Convert as many things as possible to use kzalloc
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3573 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-24 14:10:42 +00:00
mtaylor dc1f1c8425 Fix non-debug compilation warnings about unused functions/variables
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3532 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 23:48:41 +00:00
mtaylor fd66cd648f Revert remaining portions of r3405 that broke wpa_supplicant compatibility.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3525 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 09:18:50 +00:00
mtaylor 71fd5b074a Add ssid matching to station lookup. Based on a patch from radiodriver.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3520 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 06:24:32 +00:00
mtaylor 7c6997619e This commit fixes problems with skbuff cloning and reference counting in input handling. The biggest problem with this code was corruption of memory.
ieee80211_input can receive cloned skb from the bridge layer, and thus makes copies to modify and use.  The original was being freed immediately upon copying.  The problem is that when you issue ANY response other than NETDEV_TX_OK the skb is returned to the kernel queue.  So, basically there were wild pointers to skb in the skb queue, and these skb were being re-used by other applications and drivers - resulting in crashes all over the place.

With this new logic, we keep the original around until we know whether or not we will requeue it NETDEV_TX_BUSY or consume it NETDEV_TX_OK and we correctly free the skb only when appropriate.

We also get rid of the net80211_input_all function which was doing a bunch of unnecessary (and broken) copies and noe updates.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3501 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:34:44 +00:00
mtaylor 366cfd8d28 Enable roaming. Fix another jiffies comparison bug.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3500 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:25:04 +00:00
mtaylor 017c006628 Improved debug tracing and support for cleaning up stalled CABQ.
When CABQ transfer finishes, HAL reports the queue as inactive.  Thus, if
we switch modes or change state the CABQ can be left with some ath_buf 
referenced by it.  The changes in this patch cause the CABQ to be checked
at DTIM even when no multicast is pending for the VAP and if "stalled"
then the queue is drained.  

A subsequent patch will fix the tx tasklet logic for CABQ.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3499 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:17:18 +00:00
mtaylor 43de3ce1a0 Debugging updates:
*  Updated register dump based on ath5k database (refresh the list)
*  Added a generic debug iwpriv delegation method to if_ath
*  Added some functions to help diagnose lost ath_buf pointers
	[resultant fixes will be checked in subsequent commits]



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3497 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 22:25:51 +00:00
mtaylor eaa447863a More SKB_NI
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3496 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 22:03:18 +00:00
mtaylor 44dfbc1d20 Another SKB_NI
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3494 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:24:26 +00:00
mtaylor e507ef4964 Another SKB_NI
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3493 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:23:40 +00:00
mtaylor 253f7e4d52 Add opmode names table. to be used in subsequent checkin
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3492 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:21:31 +00:00
mtaylor 2d91c1cb57 When power save queue overflows, we have to return NETDEV_TX_OK and free the SKB.
The convention for this function ieee80211_pwrsave is to consume the SKB and either
queue it or free it.  Also switch some SKB_CB(...)->ni to SKB_NI(...)



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3491 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:15:32 +00:00
mtaylor 54a9675cf9 Set subtype for re-association requests
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3490 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:03:43 +00:00
mtaylor 5b79921c17 Use long unsigned int for jiffies
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3489 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:03:08 +00:00
mtaylor 7c7c41a5e3 Updated roaming thresholds, for when automatic roaming is re-enabled.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3488 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:02:19 +00:00
mtaylor bd5f871a85 Switch to easier to read SKB_NI macros
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3487 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:01:03 +00:00
mtaylor 62bf94d5e6 Fix address used for find node for RTS frames, which also have only one address. Fix another jiffies time comparison to use rollover safe macro.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3486 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:00:17 +00:00
mtaylor 4957e2ea41 Additional macros to cleanup SKB CB data access, minor corrections to style of a couple of macros, and some additional missed locking macros.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3485 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 20:49:53 +00:00
mtaylor 3f17ff7335 Additional null check on iv_auth
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3484 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 20:48:50 +00:00
mtaylor a78d83bb0d Debugging function cleanup:
1) Move all debug preprocessor flags out into make files
2) Add support for remaining preprocessor flags to be set by ENV variables
3) Add support for HAL tracing to include device name



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3481 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 19:55:49 +00:00
mtaylor a48f3a9bdb if IFMEDIA_DEBUG is defined, also set ifmedia_debug as it is pointless otherwise.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3477 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 04:02:10 +00:00
mtaylor 80c58504d7 This patch cleans up the VAP creation API.
The need to use software instead of hardware for beacon timers in AP+STA mode (aka nosbeacon) is now just determined in software, as we always knew whether or not to enable this.

The confusing bssid and -bssid parameters are now deprecated.

The "uniquebssid" flag is equivalent to "bssid" and can be used to force IEEE80211_CLONE_BSSID flag.  If this is not specified, then the BSSID used will be the next unused BSSID in the sequence, which could very well be the parent device's MAC address.

"uniquebssid" equates directly to IEEE80211_CLONE_BSSID" flag therefore.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3476 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 03:24:05 +00:00
mentor 4be10b5ba8 Some cleaning. Mostly cosmetic, but:
* Restructure one set of control blocks into a more readable form
 * Add some additional debug output


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3456 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-06 03:02:25 +00:00
mentor 0a246c936d Similarly to r3315
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3412 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-30 00:08:36 +00:00
proski 131d17a1f1 Fix compilation on kernels prior to Linux 2.6.11
Copy Linux implementation of sort() into ieee80211_scan_ap.c


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3407 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-27 22:32:08 +00:00
mentor c6a1e81673 Change all broadcast address/SSID checks in ieee80211_wireless.c to use the same method.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3406 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-26 01:25:12 +00:00
mentor 5cbfbae447 Unify association request interface by having the madwifi private IOCTL translate to the wireless extensions interface.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3405 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-26 00:02:26 +00:00
mentor 3252f8852e Merge -dfs to trunk - r3366
This commit should have been in trunk all along. Also, make one codepath sligthly less verbose.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3367 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-01 07:59:04 +00:00
mentor 101b902062 Arbitrary whitespace cleanups
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3365 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-25 15:51:38 +00:00
nbd 39f4007bdd fix a merge bug that broke ap channel scanning for different modes
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3360 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-21 01:47:52 +00:00
mentor 3f4e3ddb40 Only have the Station PS handling routine run when we are actually in Station mode. This probably only affects IBSS.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3341 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-06 21:29:06 +00:00
mentor c9cc0e7dee Correct pointer arithmetic in the SKB CB.
With thanks (but not copyright ;) to Alessandro Erta


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3337 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-05 06:22:32 +00:00
mentor ebc79fce38 Cleanup up de-MIC failure (in hardware) handling. Apparently, HW sometimes gets this wrong and spuriusly fails valid packets. In all cases, the packets are dropped, but we do extra processing to record statistics correctly.
This changeset adds a node statistic. If this is not liked, I encourage it to be fixed; I might learn something.
Thanks nbd.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3334 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-04 00:16:24 +00:00
mentor e906bf12da CCMP/AES Crypto module
So, ccmp_attach is called for each new key. Hence, only try to allocate a software context if IEEE80211_KEY_SWCRYPT is specified. Also, if we need a software context and fail, fail immediately; thus, the check in ccmp_setkey can be eleminated, as it is not actually a separate condition.

I think that when I touched this last, I was confused about the purpose of ccmp_attach.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3322 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-02 20:07:01 +00:00
mentor 877b7727d1 I think howmany(roundup()) should just be howmany() as roundup(x, y) is howmany(x, y) * y
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3315 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-31 03:42:51 +00:00
mtaylor 4d5de4b5a2 This patch adds iwpriv values for setting the
time in ms, or the number of beacons for the
beacon miss alarm.  If we haven't had a beacon
in this period, the alarm is sounded and 
action (i.e. roaming) is taken.

This patch changes the storage of the beacon
miss threshold to integral beacon count but 
corrects the previous intent.

The default beacon miss alarm is going to be
850ms which is half way between the two hard
coded limits that were there before.

The old hard coded limits assumed that the
beacon interval was 100ms and set the limit to
10 (1000ms) for software beacon miss timer 
and 7 for hardware beacon miss timer.

The new default is 850ms (the midpoint between
the two previous defaults).  This value is rounded
up to the next nearest beacon interval.

There is no upper bound on the beacon miss
threshold specified, since it may need to be
wildly inflated with 25ms beacon interval, or
wildly reduced with 1000ms beacon interval.

The minimum is still 2 beacons, regardless of
the beacon interval.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3314 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-30 23:50:16 +00:00
mentor 0ad2c8981a Linux 2.4 series compatibility fixes
* Based on patches from nbd
 * av_beacon_alloc code has been reimplemented using atomic bit operations; I think this is safe for SMP


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3310 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-30 20:23:49 +00:00
mtaylor 874abd03ab Reduce the maximum message length for node
messages from 1000 to 192 and drop the length
needed to display the [atomic] node count.

Slamming this much data on the stack can cause
stack overflows with 4k stacks quite easily,
especially when hard interrupts occur and 
extend a stack that is already almost full.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3307 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-30 19:26:13 +00:00
mentor b8e6b99d2c De-FAIL previous revisions
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3305 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 17:46:15 +00:00
mentor b0f92899f4 Formatting - calming...
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3304 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 11:18:15 +00:00
mentor 3202c2a0de Change reset_bss semantics so that the node reference is passed to iv_bss, and then use the iv_bss reference.
I believe that this is semantically correct, and so have removed the comment.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3303 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 11:17:57 +00:00
mtaylor 2411a87efc During reset_bss we were incrementing the ref
count of the new bss node.  The allocation 
function gives us a reference.  With this extra
reference, every invocation of reset_bss was
causing a leak of one node ~4kb every time the
interface was brought back up (or the BSS was reset
for other reasons).

This fixes ticket #1682.  I can run ifconfig down/up
cycle for a long time.  I'll run it overnight next
to be sure.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3301 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 07:08:29 +00:00
mtaylor 602be360fc Move the node reference up that pins the WDS peer
node in the node table.  The node reference was
being taken in any path where the wds node was found
and not just when the wds node was first added.

This would have caused wds nodes to get inflated
reference counts, and be leaked on bss reset when
nodes were flushed from the node tables.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3300 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 07:00:09 +00:00
mtaylor dead14502d Fix a few more leaked node references when a
copy of the bss node is used to send a message
we need to make sure all code paths release
it when done.  This bug combined with repeated
auth failures would cause node references to 
grow with every failure.  Then, if you were 
taking down the interface and bringing it back
up you would leak one page (4kb) every time the
the node table was flushed on transition to UP.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3299 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 06:58:22 +00:00
mentor 8e8ba8882b Some extra SKB operation return code checks. This deviates from nbd's original patch, because I don't think that if the aligning operation fails that we should return the unaligned one.
Thanks nbd


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3297 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 23:49:26 +00:00
mentor 521e00a7c6 Turn on long pre-amble in ERP IE if we have non-ERP stations
Thanks NBD


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3296 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 23:40:44 +00:00
mentor 32b36e8f10 Fix compilation when there is no debugging
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3295 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 23:35:29 +00:00
mtaylor f0a1f3d537 Null protection for skb1 in multicast node fix
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3285 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 20:05:31 +00:00
mtaylor 43f0aa1604 Undo regression from madwifi-dfs merge
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3282 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 19:34:03 +00:00
mentor d136b9b1f9 Edit token names for clarity, consistency and length.
This changes some iwpriv names, because I believe they will be more readily usable and understandable


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3279 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 01:36:25 +00:00
mentor 70be1ef404 Edit token names for clarity, consistency, and to remove EXTREME length TO THE MAX
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3278 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 01:21:19 +00:00
mentor b165b8b28c Typo
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3277 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 20:00:41 +00:00
mentor 4a60ebccec 'Context:' is used to denote the kernel context that the process is running in (i.e., hard IRQ, soft IRQ, process, preemption disabled, etc.)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3276 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 19:50:09 +00:00
mentor c4952a9d3d Make CHANNEL_FOREACH slightly more readable
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3275 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 06:49:24 +00:00
mentor cf6e609462 Formatting
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3274 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 05:48:23 +00:00
mentor 28cf53aa95 Fix merge failures - pass one
mdtaylor: bad merging like this really must not continue any longer


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3272 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 04:26:38 +00:00
mtaylor e00f351af1 Restore the evil printf macro I accidentally damaged
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3269 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 20:56:20 +00:00
mtaylor c2bce77197 Merge madwifi-dfs branch to trunk.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3268 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 20:48:11 +00:00
mentor 0b74c2ebe0 More cases to use ieee80211_skb_copy_noderef
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3262 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 17:46:36 +00:00
mentor c14fa8bf98 Merge -dfs to trunk - r3246:r3254
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3260 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 02:47:27 +00:00
mentor d05f18eef2 Have internal bridged packets belong to the BSS node
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3259 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 02:30:35 +00:00
mtaylor e479155497 Eliminate ether_sprintf in favor of new MAC_FMT and MAC_ADDR macros (which are faster and thread safe).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3254 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-25 22:49:48 +00:00
mtaylor 77d9f966c0 - Add a iwpriv function that dumps a mapping of nasty obfuscated
symbol names to their corresponding HAL function names (ah.h) 
- Add a script to generate a SED script from the current HAL (ah.h)
    that will replace instances of obfuscated names with the correct names.
- Add the SED script for cleaning up text containing obfuscated function names for the current HAL


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3244 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-25 00:29:30 +00:00
mtaylor 8f5e980418 From madwifi-dfs. If ieee80211_find_channel is passed 0 for flags, then omit flag comparisons from the search criteria.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3235 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-23 18:53:34 +00:00
br1 2bfb48c560 frame injection: let IEEE80211_RADIOTAP_DATA_RETRIES specify the number of
retries instead of the total number of tries.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3233 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-22 07:11:13 +00:00
mtaylor e04d68cce7 ieee80211_dev_kfree_skb will NULL ni_rxfrag.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3226 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-21 23:19:39 +00:00
mentor 52319f4d34 Remove humourous typo
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3223 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-20 03:34:45 +00:00
mtaylor 278c57c4e7 Move channel non-occupancy limits out of ieee80211_channel structure to
avoid hitting the size limitations of wireless extensions.  wext is a real pain.
Now the values are stored in ic_chan_non_occupy[] instead.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3207 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-18 21:25:05 +00:00
mentor a27f996ac4 Comment cleanup. No tagging in comments
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3205 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-18 17:28:43 +00:00
mentor 249e5b919b Bad merge from r3161; see r3123 for rationale
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3204 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-18 17:26:28 +00:00
mentor ac2124cce3 Another pass on r3156:r3200:
* Lots of coding style and formatting, tedious and annoying
 * Quite a few bad merges as far as I can tell; at least one of which was serious - reintroduced a leak


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3202 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-18 01:28:43 +00:00
mentor 981463bb22 Minor formatting
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3200 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-17 23:31:09 +00:00
mentor bd7108a853 Do not try and find a device from a non-existent SKB
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3199 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-17 23:22:51 +00:00
mentor 888266fa0e Revert some r3164 - was only meant ot have one file in it
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3167 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:11:38 +00:00
mtaylor c55568ef0d DFS and FCC requirements pretty much make the madwifi-specific 'CSA PROTECTION PERIOD' violate compliance with the regulations. This is being commented out in preparation for merging the DFS compliant code into the trunk
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3166 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:11:27 +00:00
mentor 63ccd5bbe2 Remove unneccessary node unreference - it is handled in ieee80211_dev_kfree_skb
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3164 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:09:34 +00:00
mentor 5f4816e17e Add ieee80211_skb_copy_noderef, which hopefully does what it says on the tin (i.e., copies a node reference, not a pointer, from one skb to another).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3163 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:07:34 +00:00
mtaylor 92c62d977e More changes from madwifi-dfs that are either definitions or missed changes that should not have been on the feature branch.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3162 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:01:39 +00:00
mtaylor 909dc70af4 More changes merged over from madwifi-dfs that seem to have been missed
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3161 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 19:45:36 +00:00
proski d01fbe3c85 Annotate len in struct l2_update_frame as big-endian
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3156 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 04:08:40 +00:00
mentor fa8be6633f Fromatting cleanup for r3152. To deal with a maximal 80C line length some clearly very silly things have had to be done; I think this is proabbly a goo dindication that code needs to be refactored or split out into seperate functions.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3155 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 01:41:39 +00:00
mtaylor ec46fcf728 Merge from madwifi-dfs r3150. Fixes for AP+STA mode state machine logic
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3152 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 01:04:01 +00:00
mtaylor e3d16ecc8f More stuff that should have been in r3140. Sorry, teasing apart a rather long diff.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3148 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:40:11 +00:00
mtaylor 132f01bad9 Fix for bridging. We modify the packet's contents. Linux bridging code assumes it can clone the packet and send it to multiple interfaces without having it changed out from under it. Therefore, we need to clone each skb prior to modifying the copy. This fixes some very nasty bugs with bridged VAPs (esp with multiple VAPs in a bridge and multicast/broadcast traffic).
The symptom would be fragments of 802.11 header showing up in the ethernet header because of skb header offsets being corrupted by MadWifi devices on lower ports which then get forwarded as-is to wired ports.

Sorry for the lame explanation, but the short end of the story is that you have to copy the skb before you modify it if you are going to play nice with bridging.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3146 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:21:23 +00:00
mtaylor d246553128 Switch from clone to copy. Contents may be changed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3144 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:16:07 +00:00
mtaylor a5f8c2e99b I missed part of r3140. Pinning the node with an extra refcount that is released on cleanup.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3142 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:14:02 +00:00
mtaylor 56d4a86372 Fix for a defect where WDS nodes were expired. Never time them out.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3140 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:08:14 +00:00
mtaylor 050d239b51 Log an error when node allocation fails
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3138 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:06:30 +00:00
mtaylor e43eb9472d Fix for NULL dereference in skb tracking code
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3136 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:02:50 +00:00
mtaylor e6a0fd9b49 This patch refactors the layer 2 update frame sending logic into two routines. Both RNR and XID frames are sent to update bridges. The RNR is probably not the best way to update L2 bridges. It's basically telling the bridges and switches that the MAC is not able to receive traffic (i.e. congested or down) and we never send any other L2 packets to counteract any side effects of this. I also found that it didn't seem to be updating every MAC table on every bridge. XID, however, is the correct way, according to my research and we send XID to inform the bridges of the new location of the MAC as dictated by the standards. I left the RNR in there for good measure, since it doesn't appear to have any ill effects for anyone. (Hostapd ALSO sends XID when you are using hostapd... the redundancy is harmless and allows madwifi to operate correctly when using open or WEP protected modes without hostapd).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3134 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:01:06 +00:00
mtaylor e7ccdf6be3 When IFF_MULTICAST was not enabled on the vap, we used to skip some filtering that prevents reception of your own multicast traffic. Then we would procede to ignore the fact that IFF_MULTICAST flag was disabled and send anyway.
I've fixed the logic so that multicast is dropped, with an error when disabled.  I don't think this is a valid configuration.  Also, we don't skip the filtering logic so that our own multicast traffic doesn't come back to us (looking like a bridging loop). 


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3132 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-15 23:54:34 +00:00
mtaylor f2bbcd9fa2 Use clone instead of copy because the contents of the frame may be modified.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3130 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-15 23:46:22 +00:00
benoit 56f411f3c0 Fixed a kernel panic due to incorrect linux API use
hard_start_xmit() functions must either return NETDEV_TX_OK or 
NETDEV_TX_BUSY (they might also return negative errno values as well, 
like -ENETDOWN)
Correct a small missing static reported by sparse
This revert part of r3075


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3123 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-10 20:10:41 +00:00
mentor 48c02dc865 Update comments and value handling for key indexes to make clear which values should /never/ be used (as per discussion with benoit).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3111 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-02 23:43:23 +00:00
benoit b7051ec95d Merge madwifi-dfs to trunk : r3109
Revert to the same API/ABI for crypto (used by hostapd/wpa_supplicant)
as used in 0.9.3.3. Tested with hostapd & wpa_supplicant.
Fixed a minor error in athkey usage display


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3110 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-02 21:48:29 +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 62274c42c9 fixup r3013: remove duplicate line
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3081 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-25 03:17:23 +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 6d28f9cb8e Have net80211 hard_start functions return NETDEV_TX_* codes; tidy some headers in the process.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3075 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-23 20:11:05 +00:00
mentor 987156394d Remove some conditional SKB/reference handling.
* packets dropped in ath_hardstart are cleaned up there, so cleaning up in parent_queue_xmit is an error
* packets in ieee80211_pwrsave must always have a reference in the cb, so it is better that is fails noisily otherwise


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3074 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-23 20:03:13 +00:00
mentor 2de63dd9d2 Update dev->trans_start in ieee80211_hardstart. This helps with bonding and ARP monitoring.
Signed-Off-By: Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
Ticket: http://madwifi.org/ticket/1700


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3073 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-23 02:57:45 +00:00
mentor 972e313a8e Whitespace near r3071
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3072 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-22 23:39:14 +00:00
nbd 806f7b46e7 fix a double-free bug
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3071 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-22 17:16:06 +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
mentor efd52870b7 Change delete key IOCTL request structure to use ieee80211_keyix_t.
Ticket: http://madwifi.org/ticket/1702

WARNING: This changes userspace ABI - hostapd WILL need to be recompiled


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3068 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-21 17:46:02 +00:00
mentor 78670fc260 Remove long lingering references to wlan_auth and wlan_radius.
Ticket: #467


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3067 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-19 23:46:41 +00:00
mentor 86b3543c14 Use standard boolean normalisation in r3062
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3065 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-17 01:16:06 +00:00
scottr e7f80f68cf Remove the use of a bitwise XOR operation which wrongly assumes its
arguments are boolean.

Originally the arguments were converted to booleans, but r2345 removed
this conversion. I've added the conversion to booleans back again and
removed the use of XOR as it's confusing and unnecessary. 



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3062 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-14 08:24:27 +00:00
proski 0de09d5a5a Remove separate versions for ath_pci and wlan modules
They are of no use, because they are not updated as the developmnet
continues.  It's better to have a single version for MadWifi.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3039 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-13 02:00:00 +00:00
br1 9055c25cc8 fix two more instances of using the wrong bssid in IBSS mode. there are more
places where we could use vap->iv_bss->ni_bssid instead of ni->ni_bssid but i'm
not sure about the other ones.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3036 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-12 11:29:19 +00:00
br1 13e0b924cc fixing up r3013: can't use IEEE80211_VERIFY_ELEMENT on extended rates since that discards beacons which dont contain that element.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3035 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-12 11:04:17 +00:00
scottr 91fcb5214d Stop writing a bogus IEEE80211_RADIOTAP_DBM_TX_POWER field.
We were setting this field to 0 as we had no easy way of determining
what TX power was used to transmit a frame. However, by including this
field and setting it to 0dBm we are saying that each frame is being
transmitted at 1mW, which is incorrect. Better to simply not write the
field at all, however this introduces the need for padding in the TX
header to ensure that the TX_FLAGS field is aligned to a 16-bit
boundary.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3014 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-10 23:13:33 +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
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
br1 07bd310cd3 always use the configured bssid (vap->iv_bss->ni_bssid) as the bssid for
beacons and management frames.

this includes benoits r2993 (from dfs branch) and the patch i sent to the list
for review a couple of days ago.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3002 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-12-03 08:52:34 +00:00
br1 b76a3ed537 allow the use of the ratiotap field IEEE80211_RADIOTAP_DATA_RETRIES to specify
the number of retries for injected frames



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2992 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-29 01:41:21 +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
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
mtaylor 369b43180b Make skb_destructor debug conditional, even within IEEE80211_DEBUG_REFCNT you need IEEE80211_DEBUG_REFCNT_SKBDEST now... until I figure it out. Reports of problems with aircrack-ng injection.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2972 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-26 07:58:30 +00:00
mtaylor 573cc60660 Uninstall skb debug destructor when skb is passed up
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2970 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-26 06:38:21 +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 4a2fbe421e Only install debug destructor if destructor is not already used by the kernel,
otherwise we can interfere with normal cleanup.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2955 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-25 07:39:48 +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 e3a6ae05f5 Add linefeeds to block warnings
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2947 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-24 08:40:15 +00:00
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 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
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
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 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
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