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
When hardware queue is full, stop the linux device queue.
This fix a bug where CPU was 100% in softirq context
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3122 0192ed92-7a03-0410-a25b-9323aeb14dbd
* 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@3099 0192ed92-7a03-0410-a25b-9323aeb14dbd
* 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
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
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
IRQF_SHARED appeared in Linux 2.6.18. Define it in compat.h for older
kernels. Stop using obsolete SA_SHIRQ in if_ath_ahb.c and if_ath_pci.c
This fixes compilation of if_ath_ahb.c for Linux 2.6.22 and newer.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3041 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
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
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
* 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
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
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
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
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
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
* 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
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
* Enhance readability of some functions WRT node referencing by putting blocks around areas where node references are held
* Various bits of consistency of the usage of node references; always unreference them at the point at which they are no longer used. Don't reuse variables implicitly.
* Significant overhaul of the usage of bf_node and ieee80211_cb.ni. Always hold a reference with aforementioned variable and always unreference it properly.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2839 0192ed92-7a03-0410-a25b-9323aeb14dbd
Linux 2.6.24 introduces a sysctl checker that disallows using arbitrary
ctl_name values for sysctl entries. The entries with non-standard
values should set ctl_name to CTL_UNNUMBERED.
On the other hand, using consistent non-zero ctl_name values is required
for older kernels (tested on Linux 2.4.33.3 from Slackware 11).
Thus the solution is to use CTL_UNNUMBERED on Linux 2.6.24+ and the
original values in the older kernels. Move CTL_AUTO and DEV_ATH to
include/compat.h and define them correspondingly.
When copying sysctl entries, check procname for being non-zero, since
ctl_name is zero (CTL_UNNUMBERED) on Linux 2.6.24 and newer.
For the same reason, don't use ctl_name to distinguish entries in
ath_sysctl_template, use extra2 instead.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2814 0192ed92-7a03-0410-a25b-9323aeb14dbd
Linux 2.6.24 has a sysctl table checker that rejects the tables
presented by the driver. Make the code survive this condition. Free
devname (or dev_name) before freeing the table. Don't do it at the
unregister time, it's too late.
The sysctl tables still need to be fixed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2795 0192ed92-7a03-0410-a25b-9323aeb14dbd
SET_MODULE_OWNER() is not defined in 2.6.24, but it's already a no-op in
2.6.23. Make sure that it will be a no-op in 2.6.23 and newer kernels.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2754 0192ed92-7a03-0410-a25b-9323aeb14dbd
This value is roughly around the value that other devices are setting. The previous value appeared to be stupidly high.
This may solve some interactivity problems and machine performance issues.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2732 0192ed92-7a03-0410-a25b-9323aeb14dbd