Commit Graph

605 Commits

Author SHA1 Message Date
mtaylor
afadc9b41d Move slot-time, CTS/RTS, and ACK timeout calculations into the driver. Corrected logic for the relationships between slot time and cts timeout and ack timeout have been added and the athctrl now delegates to the driver instead.
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
2008-04-10 03:46:54 +00:00
mtaylor
cee1c3f7f9 Add init/destroy for locks to correct places, including the new beacon buffer and group poll buffer locks which will be used in a subsequent checkin.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3507 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:30:01 +00:00
mtaylor
449f6e1220 This commit updates the descriptions of the parameters to indicate default values, and makes those default values explicit in the global variables in the module.
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
2008-04-10 03:28:20 +00:00
mtaylor
0d6c6d0c6c This update uses the recently added HAL extensions for controlling noise immunity settings in order to correctly re-implement disabling of interference mitigation.
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
2008-04-10 03:21:59 +00:00
mtaylor
2477d20c5e Eliminate ath_buf's bf_node pointer.
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
2008-04-10 00:07:55 +00:00
mtaylor
3a132792ff Simplification of kernel queue start/stop logic.
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
2008-04-09 23:58:06 +00:00
mtaylor
9148c7a79a The RX tasklet must process the CABQ when it is setup and non-empty, even if the HAL says it is not "active".
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
2008-04-09 23:41:07 +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
a388f3a80c if iwpriv turbo is set before first beacon update it will segfault because the update for dturbo comes
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
2008-04-09 23:10:05 +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
534e25b569 These extensions are for interference/noise immunity control and will be used in a subsequent commit
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3495 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 21:51:36 +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
85119ae227 Some cleanup for jiffies rollover problems. Use of time_before/time_after macros and correct units for storing jiffies. On some distributions Jiffies rollover after 5m.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3483 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 20:30:34 +00:00
mtaylor
24f048e954 Make sure radar is not enabled if disabled by iwpriv, flag IEEE80211_F_DOTH is unset
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3482 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 20:02:37 +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
8d91a54cea More complete set of locking macros.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3480 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 04:11:35 +00:00
mtaylor
dcdcf975c2 DOC updates for wlanconfig nosbeacon
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3479 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 04:11:08 +00:00
mtaylor
f68be532ea Script updates for unmangling hashed function names, and updates for some of the functions
I could find from dumping hal pointers.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3478 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 04:04:18 +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
proski
80a9627d1f Move ath_info manual page to the ath_info repository
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3434 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 22:23:49 +00:00
proski
e82418de9d Move ath_info.c to a separate repository
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3433 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 22:22:20 +00:00
proski
b9553d96cb Remove all references to ath_info, it's about to be moved away
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3432 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 22:21:16 +00:00
proski
6d6c1f9464 First step for power calibration reading support. This is still work in
progress and only works for eeprom versions < 5.

Reference: r3234

Merged from madwifi-trace and replaced with the exact version from
madwifi-trace to fix minor differences caused by previous merges.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3429 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 22:10:02 +00:00
proski
47002fcc6a Merge r2998:3007 from madwifi-trace
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3428 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 22:04:52 +00:00
proski
67f7dd0140 ath_info: add support to read (-R ADDR) and write (-W ADDR VALUE) registers
Reference: madwifi-trace@3398


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3425 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 21:14:05 +00:00
proski
b9e098b4f7 Dump EEPROM starting with 0, not 1
Reference: madwifi-trace@3088, madwifi-trace@3422


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3423 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 21:04:52 +00:00
proski
7006778174 Accept 64-bit addresses on the command line
Define _FILE_OFFSET_BITS to 64, so that even 32-bit systems would accept
64-bit addresses and pass then to mmap() correctly.  It could be useful
on systems with a 64-bit kernel and 32-bit userspace.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3421 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 03:39:24 +00:00
proski
c17eb8e386 Warning fix for 64-bit systems: u_int64_t is not unsigned long long
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3420 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 03:30:40 +00:00
proski
92a8a6b166 Merge from dfs branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3419 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-03 02:53:50 +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
proski
545cf26ad4 Don't rely on the compiler optimizing out iowrite32be and ioread32be
Use a separate set of _OS_REG_WRITE and _OS_REG_READ macros for
little-endian systems.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3402 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-22 06:13:08 +00:00
mentor
ce589c7ae3 Add node and SKB pointers to ath_buf in ath_mgtstart, so they are managed by the ath_buf logic. Also, remove unnecessary(?) comment.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3401 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-20 03:27:24 +00:00