Commit Graph

90 Commits

Author SHA1 Message Date
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