* Convert last SKB_CB()->ni to SKB_NI
* Lots of comments
* Refactor various pieces of code for consistency, readability, and removal of goto
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3666 0192ed92-7a03-0410-a25b-9323aeb14dbd
similar code was removed in r3503, but it was wrong before as well, because
the packet needs to be dropped instead of requeued to actually achieve
prioritization between different packet types (WME classes). if we allow
one queue to consume all TX buffers then there is no buffer left to service
packets on higher priority queues.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3648 0192ed92-7a03-0410-a25b-9323aeb14dbd
The register defines were taken from ath5k.
This patch has been only lightly tested, I'm afraid - trying for more coverage.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3641 0192ed92-7a03-0410-a25b-9323aeb14dbd
* More pedanting of comments
* Update sysctl to return early if no change is made and OPNOTSUPP if !sc_hasintmit
* Tidy call to set HAL int. mit. status. Remove chatty printf as it is known that this does not work.
* Preprocessor out HAL call as the int. mit. status is unconditionally set manually.
* Misc. churn.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3639 0192ed92-7a03-0410-a25b-9323aeb14dbd
process discarded frames in ath_recv_mgmt(). this reduces the number of times
we attempt to merge IBSS to invalid beacons.
this patch is based on the work of Derek Smithies
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3634 0192ed92-7a03-0410-a25b-9323aeb14dbd
The last descriptor is now implicit in the structure and meta-data of the buffers; axq_link does not need to be maintained separately.
Add macros to to return the last buffer, descriptor, and link them as necessary.
Make the queue moving macro implicitly link descriptors, and remove the explicit descriptor linking in this case.
ath_node_move_data is still desperately in need of a review; it is used in XR.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3620 0192ed92-7a03-0410-a25b-9323aeb14dbd
Move txqactive() implementation before it's used. Let the compiler
decide whether to inline that function.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3606 0192ed92-7a03-0410-a25b-9323aeb14dbd
During the second stage of the module build, Linux 2.6.26 does not
define $(obj). Try using $(SUBDIRS) as $(obj) before falling back to
the current directory.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3603 0192ed92-7a03-0410-a25b-9323aeb14dbd
* Formatting
* Add a function to remove SKB from ath_buf.
* Call aforementioned function early if we are accepting a frame, so that there's not chance the data can get stomped on by DMA. We should probably do this for ignored frames as well, but I got fed up trying to sort out the stack of goto.
* Remove some KASSERT for skb users, as the SKB are always copied.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3594 0192ed92-7a03-0410-a25b-9323aeb14dbd
to see those debug message).
Fixed a bug where we removed TX descriptors too early. This should fix NETDEV
WATCHDOG error messages. Apparently, TX descriptor status is updated by the
hardware before TXDP.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3552 0192ed92-7a03-0410-a25b-9323aeb14dbd
The rx overruns should dissapear with the previous performance improvements and a little bit more runway here. The 100 more to tx should only help in cases where large numbers of small packets are set and you are going for maximum throughput. Even then, I haven't proven you will ever need this many tx buffers. I've also bumped the reserve pool for management frames from 5 to 20.
These settings tested well in the lab with multiple station links running bandwidth tests.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3521 0192ed92-7a03-0410-a25b-9323aeb14dbd
* Only hold the RX queue lock while removing and while re-inserting a buffer -
allowing pre-emption to work properly while the tasklet is reaping and
recycling rx buffers.
* All skb and bus handling is managed in the ath_rxbuf_init function now.
* Do not stop processing when ath_rxbuf_init fails, because that means low
free skb but does NOT mean the queue is fully processed. Since we also keep
our skbuff except during a very brief period when we free one and reallocate
one - unless pre-emption or SMP steals it, chances are very good we can keep
processing the queue even under low memory conditions -- and avoid dreaded
rx overruns.
* Add missing locks around code blocks that iterate over rx buffer list in
flush/drain/init/cleanup/etc helper functions.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3519 0192ed92-7a03-0410-a25b-9323aeb14dbd
I've simplified the buffer initialization code so that it
always allocates things as if there were one or more monitor VAPs. This is
defensive since monitor VAPs can are created and/or destroyed while the radio is
up.
The old logic was basically changing the behavior of the initialization function
dynamically based on the presence of a monitor VAP but could lead to a mixed set
of buffers.
The revised code keeps all the buffers the same and make sure there is room for a radiotap
or prism header if necessary in advance.
Without this change, even after adding a monitor VAP you are going to pull SKBs that are too small for a while.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3518 0192ed92-7a03-0410-a25b-9323aeb14dbd
* Fix a bug where we would copy any cloned skb received in ath_hardstart,
and free the original... before returning the original to the queue!
The result of this would be memory corruption at best, randomly placed panic
at worst.
* In one case we returned -ENETDOWN from hard start, which in current kernels
is NOT NETDEV_TX_OK so it would therefore requeue the packet which we just
released.
* Fixes the logic for both requeue and drop in hardstart fail so that we never
leak, never double-free, and never leave the kernel with an invalid pointer
to an SKB we just freed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3517 0192ed92-7a03-0410-a25b-9323aeb14dbd
* Replace an_halstats it with an_avgrssi (EWMA)
* Only update stats in ath_softc* when we are on-channel and acting as a station,
as there is no meaning to these stats as an AP.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3515 0192ed92-7a03-0410-a25b-9323aeb14dbd
this is what it does.
* Rename ATH_BUFSTATUS_DONE to ATH_BUFSTATUS_RXDESC_DONE since this is what
we mean - has the descriptor been processed.
* Eliminate a case where we were processing each descriptor twice and
double-counting the statistics.
* Delegate decision on whether to schedule the rx queue to
ath_intr_process_rx_descriptors so we do not schedule it when there is no work.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3514 0192ed92-7a03-0410-a25b-9323aeb14dbd
* Beacon calibration interval needs to be per-radio, not global because
each radio is going to have it's IQ gain calibration reached at different
times. With multi-radio systems, you could have one radio calibrated and one
in sorry shape and the calibration interval would be dropped back to the
longer intervals for both. This also necessitated removal of the sysctl var
for "calibrate" since it was the wrong thing.
* Fix for jiffies rollover bugs - use macros and mod_timer calls rather than
hacking timer structures directly.
* Always process noise floor before retrieving it. That is to say, the process
noise floor call and the get channel noise call should always be one after the
other, owing to things like channel changes and scanning.
ath_hal_process_noisefloor(sc->sc_ah);
ic->ic_channoise = ath_hal_get_channel_noise(sc->sc_ah, &(sc->sc_curchan));
* Calculate noise floor and read noise level at more opportune times/places.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3513 0192ed92-7a03-0410-a25b-9323aeb14dbd
This makes sure that the post-hw-reset stuff we do is done consistently in all cases for improved stability and predictability everywhere hardware reset is necessary.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3509 0192ed92-7a03-0410-a25b-9323aeb14dbd
You can override:
- slottime
- ctstimeout
- acktimeout
acktimeout and ctstimeout will be selected from the first available of:
1) the explicitly specified override value [if present]
2) a value derived from an explicitly specified slottime [if present]
3) the HALs default behavior / standard settings for the PHY mode
Setting the distance is shorthand for updating the slottime, and both cts and ack timeout values based upon the usual equations for air propagation, speed of light, etc..etc..
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3508 0192ed92-7a03-0410-a25b-9323aeb14dbd
Further, the tpc module parameter was based upon a misunderstanding of what the HAL really supports and has been re-characterized.
Originally I believed that the HAL implemented per-node power level tuning but they apparently felt the specifications were too complicated and instead they implemented the minimum requirement for ETSI aggregate power limit compliance.
In short, "tpc" really uses a fixed power level for all packets of the regulatory maximum less 3dBm. It also defeats the fine-grained control (per descriptor) we have over the power levels of transmitted packets.
Therefore, I have renamed this to "hal_tpc" and updated the comments to reflect that this really is ETSI-style TPC hack for aggregate power. Since the user can set the power level to max -3dBm just as easily, I don't see the point of it after all, but it's still supported just in case someone finds value in it.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3506 0192ed92-7a03-0410-a25b-9323aeb14dbd
A module parameter and sysctl parameter are provided for changing whether interference mitigation is enabled or disabled.
When interference mitigation is disabled, we work around a HAL defect where the interference mitigation auto-tuning algorithm still starts and/or sets some initially high mitigation levels.
With this fix, disabling interference mitigation with the current HAL behaves like it did in prior HALs.
Far greater receive sensitivity and increased range is supported with this disabled. This is especially useful for long distance point-to-point links.
As a part of this fix, a severe bug that was originally a workaround for the HAL issue has been corrected. When interference mitigation is enabled, we NEVER want to eat or throttle the MIB interrupts as the hardware counter callbacks to the HAL are what drives the interference mitigation calibration state machine. Conversely, if interferference mitigation is being blocked by our driver but the hAL may still be enabling the HAL_INT_MIB in the IMR, then we want to force the interrupt OFF in the mask and eat the interrupt.
The failure case was where the interrupt would fire continually and never get properly handled because the HAL wasn't configured to handle interfernece mitigation - now we mask the interrupt OFF. With the 'throttling' hack, we didn't fix hte problem but made it worse - when interfernce mitigation was enabled we just blocked the necessary signals to get the counters updated and stop the interrupt from continuing to fire.
The timer to re-enable the MIB interrupt after it fired was also wrong cause it would make sure the interrupt could never be disabled by the HAL or the driver.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3505 0192ed92-7a03-0410-a25b-9323aeb14dbd
This pointer is entirely redundant with the pointer already in the SKB. This eliminates an unnecessary source of possible node reference leaks. In all cases this variable was being populated from the SKB's node pointer and was never referenced outside of the context of processing an skb, for obvious reasons.
Use BF_NI(bf) or SKB_NI(skb) macros to obtain the node of a buffer or skb.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3504 0192ed92-7a03-0410-a25b-9323aeb14dbd
We had a local flag that was being used inconsistently to mirror the queue state, but was really brain dead. sc_devstopped could be off even when the queue was stopped and no matter how many buffers were freed, we would never restart the queue. This could lead to liveness issues (mostly after a buffer leak caused excessive buffers to be used).
The kernel has an easy call to find out if the queue is stopped or not, so this checkin uses that.
We will re-awaken the queue if:
1) we have some buffers we are willing to use for data
2) the channel is available (as opposed to being in DFS CAC)
3) the queue is stopped
This is what we were originally going for with reap counters and sc_dev_stopped and all this other nonsense. The new logic is much simpler and cleaner.
This also fixes a performance problem where the queue was being re-awakened when no buffers were available resulting in a constant ping-pong of buffers between the kernel and madwifi and a very very heavy CPU utilization at exactly the wrong time.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3503 0192ed92-7a03-0410-a25b-9323aeb14dbd
HAL will say the CABQ is not active if the trigger has fired and the CABQ has been serviced. Therefore, the conditions under which we were skipping CABQ are EXACTLY when we need to check it.
This was leading to large numbers of rx buffers consumed in the CABQ (multicast, etc) and thus the RX queue would deteriorate over time until RX overruns would eventually start to be a big problem.
I also include better diagnostics.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3502 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
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
before the allocation and initial configuration. Since there shouldn't be any dturbo switches at this point, some null checks prevent the problem. I'm not sure where the code should be moved to, but probably further down in the function.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3498 0192ed92-7a03-0410-a25b-9323aeb14dbd
* 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
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
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
* 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
PCI resource addresses are 64-bit on i386 with PAE, so they won't fit
unsigned long. Provide compatibility for older kernels. Reported by
Diego Dujovne.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3399 0192ed92-7a03-0410-a25b-9323aeb14dbd
Remove the old SIOCGATHDIAG ioctl (return -EOPNOTSUPP), and add a new ioctl (SIOCGATHHALDIAG) that passes the struct through ifr_data. Also, return -EOPNOTSUPP for unknown IOCTL numbers.
Incidently, I can't find anything that actually uses the old IOCTL.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3389 0192ed92-7a03-0410-a25b-9323aeb14dbd
This patch differs from the original in that beacon synchronised calibration is not condifured during CAC as no beacons are sent.
Thanks to nbd.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3358 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
With 0.9.30.13 ANI control appears to be broken. ANI is designed only for client (STA/AHDEMO) only mode. This function updates the data used for ANI, so we will only call it for client only mode. This may will not affect ANI problems in client only mode.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3321 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
Section mismatch checker in the forthcoming Linux 2.6.25 complains about
ath_pci_drv_id and recommends to rename it. Rename ath_pci_drv_id to
ath_pci_driver, which is consistent with other PCI drivers.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3312 0192ed92-7a03-0410-a25b-9323aeb14dbd
* 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
dropped frames a little more consistent and
fixes an issue in hardstart where I was being
too aggressive about requeing.
I thought the slab allocator would stop handing
out skbuff instances before the system was out
of free memory based upon some kind of limit on
the number of buffers, but this was nonsense.
Therefore, it is NOT a good idea to requeue
when skb allocation fails because this pretty
much basically means we are out of free memory.
Keeping the packets we do not have the RAM to
send and then stopping the transmit queue has
very bad side effects under low/zero memory
conditions.
Symptoms may include OOM killer and panics,
among other things.
It's better to drop tx packets when there's no
more RAM than to lock all the tx packets up
in the transmit queue. Even if more skb
become freed up in the slab cache due to
transmissions already in progress, evil things
still happen.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3308 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
HAL_INT_RX, HAL_INT_RXPHY, or HAL_INT_SWBA. In
such cases, we will collect the earliest hw tsf
sample we can get and this is passed into send_beacon
and the trigger processing helper functions.
This cuts the number of hardware TSF reads by a
factor of three per interrupt. We should be reading
the hardware TSF now once on interrupt entry, and
once in the second part of trigger processing when
we correct for hardware TSF rollover.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3271 0192ed92-7a03-0410-a25b-9323aeb14dbd
Move one hw tsf read into a conditional block as it is only used in a debug printout.
Replace one hw tsf read with a reference to the existing hw tsf in the buffer (which is more accurate anyway).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3270 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
in "11.1.2.2 Beacon generation in an IBSS" the IEEE802.11 standard says, each
STA should...
"b) Calculate a random delay uniformly distributed in the range between zero
and twice aCWmin × aSlotTime,"
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3232 0192ed92-7a03-0410-a25b-9323aeb14dbd
Since r3076 ath_tx_capture no longer exists, and ath_capture no longer frees the SKB because it was a confusing place to do that. The reverted changeset has been tested to cause leaks, and once reverted the code operates correctly.i
*fwap*
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3222 0192ed92-7a03-0410-a25b-9323aeb14dbd
ath_tx_capture, for each frame in the list we have already freed the skb but the original pointer to
the list of skbs is still in bf->bf_skb. So when bf is returned with ath_return_txbuf it tries to
double-free, resuilting a spew of backtraces/warnings when reference debugging is enabled.
Not to mention the fact that the skb is double-freed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3220 0192ed92-7a03-0410-a25b-9323aeb14dbd
whether or not beacons were going to be reconfigured. Add logic so that
any time a STA on an AP mode radio comes back to RUN state we will
reconfigure beacons. Also reconfigure beacons on AP return to RUN state
in a AP+STA configuration. In this AP+STA mode, we need to be careful to update the beacons any time a STA or AP comes online to make sure the APs start beaconing. This fixes issues where beacons are not restarted correctly after the station returns from SCAN/ASSOC/AUTH/INIT to RUN state while APs are pending completation of the STAs activity.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3213 0192ed92-7a03-0410-a25b-9323aeb14dbd
On requeue, stop the kernel queue and flag the fact that we stopped it in sc_dev_stopped so that it can be restarted automatically when resources become available. This is already done in the case of taking a txbuf, but can/should be done for every code path leading to requeuing.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3208 0192ed92-7a03-0410-a25b-9323aeb14dbd
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
* 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