Commit Graph

23329 Commits (caabf2bf228cd6b1c6197dbb25bddb4682d30c9d)

Author SHA1 Message Date
Bruno Randolf 22d8d9f81b ath5k: Use capabilities information for the number of TX queues
One thing I missed in my WME series: Older hardware does not have enough
hardware queues to support WME. In this case we just set up one data queue. Use
the capability information to decide how many queues to set up.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 17:07:54 -05:00
Ben Greear d7fd1b50a5 ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.
This decreases spammage in the log.  A single line message
will still be printed, so users can be aware that problem
exists.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:24 -05:00
Vasanthakumar Thiagarajan 1435894dcd ath9k: Add device id of AR9485 to pci table
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:24 -05:00
Vasanthakumar Thiagarajan a95f160008 ath9k_hw: Disable MRC CCK for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:23 -05:00
Vasanthakumar Thiagarajan 11441fb8b7 ath9k_hw: Setup paprd only for supported chains
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:23 -05:00
Vasanthakumar Thiagarajan 7090ad1416 ath9k_hw: Program appropriate register for temperature compensation cal for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:22 -05:00
Vasanthakumar Thiagarajan 858b7e36e8 ath9k_hw: Add IQ cal changes for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:54:14 -05:00
Vasanthakumar Thiagarajan 31faff815b ath9k_hw: Define IQcal correction coefficient registers using index
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:35:00 -05:00
Vasanthakumar Thiagarajan 6559e83ebd ath9k_hw: Program appropriate chianmask for AR9485 before starting AGC/IQ cal
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:59 -05:00
Vasanthakumar Thiagarajan 5f139eba41 ath9k_hw: Configure power control only for the supported chains
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:59 -05:00
Vasanthakumar Thiagarajan dd040f76ce ath9k_hw: Read and configure turnning caps to regulate freq accuracy
Right now it is done for only AR9485, will be done for ar9003 also
after proper testing.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:58 -05:00
Vasanthakumar Thiagarajan ab09b5b4be ath9k_hw: Configure internal regulator for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:58 -05:00
Vasanthakumar Thiagarajan 47e84dfb41 ath9k_hw: Read and configure antenna diversity control for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:57 -05:00
Vasanthakumar Thiagarajan 9936e65fae ath9k_hw: Configure xpa bias level for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:56 -05:00
Vasanthakumar Thiagarajan d9a2545ac7 ath9k: Read spur channel information from eeprom for AR9485
Also spur channel count and range is different for AR9485.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:56 -05:00
Vasanthakumar Thiagarajan 272ceba892 ath9k_hw: Add a helper function to get spur channel pointer from cal data for AR9003 family
This helper function would be used for AR9485.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:55 -05:00
Vasanthakumar Thiagarajan 85dd0921e6 ath9k_hw: Find chansel of AR_PHY_65NM_CH0_SYNTH7 for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:55 -05:00
Vasanthakumar Thiagarajan d09b17f73f ath9k: Configure pll control for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:54 -05:00
Vasanthakumar Thiagarajan 47c80de62e ath9k_hw: Find the maximum number of chains that hw supports
Have it in ah->caps. This will be used during various
calibrations.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:54 -05:00
Vasanthakumar Thiagarajan 8060e169e0 ath9k: Enable extended synch for AR9485 to fix L0s recovery issue
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:53 -05:00
Vasanthakumar Thiagarajan 7f1c7a6ac5 ath9k: Disable TX STBC for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:53 -05:00
Vasanthakumar Thiagarajan 784ad50324 ath9k_hw: Disable LDPC for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:52 -05:00
Vasanthakumar Thiagarajan 60e0c3a782 ath9k_hw: Eeeprom changes for AR9485
Calibration data are stored at 4k address (0xfff). The cal data
for AR9485 is not compressed so its lengh can exceed 1024 limit,
take care of that.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:52 -05:00
Vasanthakumar Thiagarajan ff48ba464e ath9k_hw: Initialize tx/rx gain table from initvals.h for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:51 -05:00
Vasanthakumar Thiagarajan c88457eb83 ath9k_hw: Initialize mode registers for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:51 -05:00
Vasanthakumar Thiagarajan 3050c9146b ath9k_hw: Enable hw initialization for AR9485
Also make it a supported mac

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:50 -05:00
Vasanthakumar Thiagarajan d9c803e186 ath9k_hw: Add initvals.h for AR9485
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:50 -05:00
Vasanthakumar Thiagarajan 3bbb780cca ath9k_hw: Define hw version macros for AR9485
AR9485 is a single chain and single band (2.4 Ghz) chip.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:49 -05:00
John W. Linville b7555ec7c6 ath5k: remove MODULE_VERSION
Since this is updated manually and sporadically, it is fairly useless
anyway.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:49 -05:00
Joe Perches a1cbc7a889 ath: Fix ath_dbg access beyond array bound
ar9300RateSize is not necessarily a power of 4.

Change ar9003_hw_set_target_power_eeprom
to print the targetPowerValT2 array one per line.

ath9k_hw_ar9300_set_txpower repeated the output 4 times per line,
change it to print the targetPowerValT2 value one per line.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:48 -05:00
Joe Perches 226afe68fd ath: Convert ath_print to ath_dbg
Remove ath/debug.h and the includes of these files.
Coalesce long formats.
Correct a few misspellings and missing "\n"s from these logging messages.
Remove unnecessary trailing space before a newline.
Remove ARRAY_SIZE casts, use printf type %zu

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:48 -05:00
Joe Perches 3800276a40 ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err
So these errors are always emitted at KERN_ERR level.
Remove ARRAY_SIZE casts, use printf type %zu

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:47 -05:00
Joe Perches 21a99f9349 ath: Add and use ath_printk and ath_<level>
Add ath_printk and ath_<level> similar to
dev_printk and dev_<level> from device.h

This allows a more gradual rename of ath_print
to to ath_dbg or perhaps ath_debug.

This basically removes debug.h leaving
only an #define ath_printk ath_dbg
there and moving all the ATH_DBG_<foo>
enums to ath.h

I do not think there's much purpose for struct
ath_common * being passed to the ath_printk
functions, but perhaps there might be.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:34:39 -05:00
David Kilroy 329b32fedc orinoco: allow IW_AUTH_MFP to pass through
The card doesn't support MFP, so silently accept DISABLED and OPTIONAL
settings.

This avoids the following failure in wpa_supplicant logs:

State: SCANNING -> ASSOCIATING
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: linkmode=-1, operstate=5
wpa_driver_wext_associate
wpa_driver_wext_set_drop_unencrypted
wpa_driver_wext_set_psk
wpa_driver_wext_associate: assoc failed because set_auth_param(IW_AUTH_MFP) failed
Association request to the driver failed

Signed-off by: David Kilroy <kilroyd@googlemail.com>
Reported by: Giacomo Comes <comes@naic.edu>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 16:09:12 -05:00
Rajkumar Manoharan 884a963fa1 ath9k: fix beacon resource related race condition
The beacon tasklet is accesssing the bslot info for beacon generation.
Meanwhile the same slot can be freed on interface deletion.
Current the remove_interface disables the beacon alert after freeing the slot.
This may leads to null pointer access.

This patch disables SWBA and kills the beacon tasklet to prevent access
to the slot to be freed. After releasing the slot, swba will be enabled again
upon the availablity of beaconing interfaces.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 14:57:06 -05:00
Senthil Balasubramanian 38852b20c8 ath9k: Fix STA disconnect issue due to received MIC failed bcast frames
AR_RxKeyIdxValid will not be set for bcast/mcast frames and so relying
this status for MIC failed frames is buggy.

Due to this, MIC failure events for broadcast frames are not sent to
supplicant resulted in AP disconnecting the STA.

Able to pass Wifi Test case 5.2.18 with this fix.

Cc: Stable <stable@kernel.org> (2.6.36+)
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 14:57:05 -05:00
Felix Fietkau 080e1a259a ath9k: fix a DMA related race condition on reset
When ath_drain_all_txq fails to stop DMA, it issues a hw reset. This reset
happens at a very problematic point in time, when the hardware rx path has
not been stopped yet. This could lead to memory corruption, hardware hangs
or other issues.
To fix these issues, simply remove the reset entirely and check the tx DMA
stop status to prevent problems with fast channel changes.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 14:57:05 -05:00
Matteo Croce 841051602e ath9k: fix bug in tx power
The ath9k driver subtracts 3 dBm to the txpower as with two radios the
signal power is doubled.
The resulting value is assigned in an u16 which overflows and makes
the card work at full power.

Cc: stable@kernel.org
Signed-off-by: Matteo Croce <matteo@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07 14:57:05 -05:00
Stanislaw Gruszka 22de94de7d iwlwifi: jiffies based tx queues watchdog
This patch replace monitor/recover timer by watchdog based on time
stamp. New code allow to discover hangs more precisely.

Timeout values are currently doubled monitoring period values of
previous timer. This have to be tuned based of firmware timing
capabilities.

Tested on 3945, 4965, 5300, 6300.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:01:29 -05:00
Stanislaw Gruszka abc471dc31 iwl3945: prevent too frequent firmware resets
Similarly like on iwlagn, initialize reset duration on iwl3945 to prevent
too frequent firmware resets.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:01:29 -05:00
Nick Kossifidis b9e61f11f4 ath5k: Include tx ack reporting on hw flags
* Since we report tx acks to the protocol stack, add the needed
 flag to hw_flags. This way we'll also use the new AP probing mechanism.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:01:28 -05:00
Nick Kossifidis f0e134a53a ath5k: Fix reporting of RX dma stop failure
* Correctly report failure to stop RX DMA

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:01:27 -05:00
Nick Kossifidis 344b54b971 ath5k: Disable ANI during reset
* Stop ANI durring reset to prevent false PHY error reports

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:01:27 -05:00
Nick Kossifidis 19252ecb67 ath5k: Always free tx buffers before reset
* Always free tx buffers before reset, since we also empty hw queues.
 If we don't and a queue gets stuck, we'll never decrease txq_len and sw
 will keep thinking the queue is still stuck even after reset.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 16:00:23 -05:00
Nick Kossifidis d84938c9be ath5k: Always write tx powertable on hw
* By skipping tx power table calibration we also skip setting
 tx power table on hw. Make sure we always write tx power table
 on hw since it gets cleared on reset.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 15:58:44 -05:00
Bruno Randolf 5dcc03fe29 ath5k: Use EWMA factor of 1024 instead of 1000
This prepares the only place which uses the EWMA library so far for the
performance improved implementation coming up, which requires factor and
weight to be a power of two.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-06 15:58:43 -05:00
John W. Linville 5f79ed3b1a Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6 2010-12-06 15:52:27 -05:00
John W. Linville 09f921f83f Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
	drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
2010-12-02 15:46:37 -05:00
Felix Fietkau 4cebb34caa ath5k: Fix reset and interrupts for AHB type of devices.
On WiSoc we cannot access mac register before it is resetted.
It will crash hardware otherwise.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:51 -05:00
Felix Fietkau a0b907ee2a ath5k: Add AHB bus support.
AHB specific functions are now in ahb.c file. AHB bus is
compiled in when CONFIG_ATHEROS_AR231X is set in kernel.
All other platforms will use PCI bus.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:51 -05:00
Felix Fietkau c31b5c9c80 ath5k: Add initial registers values for radio RF2317 chip.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:51 -05:00
Felix Fietkau e7aecd327d ath5k: Add a function to read chipset's MAC revision
Add bus dependent revision read function which is used to
determine chipset's MAC before hardware is initialized.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:51 -05:00
Felix Fietkau 8efa5d7d6a ath5k: Check if pci pdev struct is initialized in common functions.
To be able to support other busses than PCI check if pci device
structure is initialized.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:50 -05:00
Felix Fietkau 4aa5d783c9 ath5k: Use generic eeprom read from common ath_bus_opts struct.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:50 -05:00
Felix Fietkau e5b046d86f ath5k: Move PCI bus functions to separate file.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:50 -05:00
Felix Fietkau 132b1c3ee3 ath5k: Introduce ath5k_init_softc function as in ath9k
Split pci initialization into hardware specific
functions and softc structure initialization.
Make function naming similar to ones ath9k.
Introduce ath_bus_opts in ath5k for later
AHB bus integration.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:50 -05:00
Felix Fietkau aeae4ac909 ath5k: Use Generic DMA for later support of AHB bus.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:50 -05:00
Andy Shevchenko 78b8595691 wireless: ray_cs: use '%pm' format option to print MAC
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:17:00 -05:00
Sujith Manoharan 6a0141175b ath9k_htc: Remove unused structures
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:48 -05:00
Joe Perches b276736319 wireless: Remove unnecessary casts of usb_get_intfdata
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:47 -05:00
Rafał Miłecki e7797bf2c0 b43: N-PHY: fix code path on PHY init
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:46 -05:00
Rafał Miłecki 76b002bd6d b43: N-PHY: use defines for RSSI types
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:45 -05:00
Rafał Miłecki 99f6c2ef1e b43: N-PHY: fix RSSI selection
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:44 -05:00
Joe Perches 44b23b488d ath9k: hif_usb: Reduce indent 1 column
Invert test and return early.
Move variable declarations to local scope.
Don't initialize variables to 0 unnecessarily.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:42 -05:00
Ben Greear eb272441fc ath9k: Move debugfs under ieee80211/[phyname]/ath9k/
This fixes debugfs problems when a phy is renamed,
and is able to remove a bit of code that is no longer
needed.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 15:16:41 -05:00
Rafał Miłecki 8cbe6e6688 b43: N-PHY: fix RSSI calibration
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:37:01 -05:00
Rafał Miłecki 8c1d5a7a22 b43: N-PHY: initialize perical variable, add missing call to CCA reset
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:37:01 -05:00
Rafał Miłecki 161d540c8e b43: N-PHY: implement very basic TX power control management
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:37:01 -05:00
Rafał Miłecki 40277cabfe b43: N-PHY: swap values for radio registers 0x3b and 0x3c
Specs were updated plus we become wl compatible.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:37:01 -05:00
John W. Linville d89197c7f3 Revert "ath9k: Fix STA disconnect issue due to received MIC failed bcast frames"
This reverts commit 916448e77f.

"As far as I can tell, either of these patches breaks multiple VIF
scenarios.  I'm not sure exactly why, but I had to revert this to
get any of my interfaces to associate."
  -- Ben Greear <greearb@candelatech.com>

http://marc.info/?l=linux-wireless&m=129123368719339&w=2

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:10:58 -05:00
Felix Fietkau f67e07eb3d ath9k_hw: fix more bitfield related endian issues
A few LNA control related flags were also specified as a bitfields, however
for some strange reason they were written in big-endian order this time.
Fix this by using flags instead.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:10:33 -05:00
Felix Fietkau e702ba18f2 ath9k_hw: fix endian issues with CTLs on AR9003
Parsing data using bitfields is messy, because it makes endian handling
much harder. AR9002 and earlier got it right, AR9003 got it wrong.
This might lead to either using too high or too low tx power values,
depending on frequency and eeprom settings.
Fix it by getting rid of the CTL related bitfields entirely and use
masks instead.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:10:33 -05:00
Vasanthakumar Thiagarajan 9306990a65 ath9k: Fix bug in reading input gpio state for ar9003
The register which gives input gpio state is 0x404c for ar9003,
currently 0x4048 is wrongly used. This will disable RF and make
it unusable on some of AR9003.

Cc:stable@kernel.org
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02 14:10:33 -05:00
Wey-Yi Guy 9f28ebc381 iwlagn: name change for bt_ch_announce module parameter
Change the module parameter name to bt_ch_inhibition from
bt_ch_announce to better describe the functionality

In order to allow Bluetooth to activate a smart AFH mechanism
and to maximize its available bandwidth the WiFi will request
BT Core to inhibit its activity in channels that interfere
with WiFi activity (and vice versa) if bt_ch_inhibition is enabled

Set module parameter "bt_ch_inhibition=0" will disable the channel
inhibition function

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:34 -08:00
Wey-Yi Guy adb90a0037 iwlwifi: check for STATUS_EXIT_PENDING when send RXON command
If driver is on the way down, there is no need to send
RXON to uCode, check the condition before continuous the process.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:23 -08:00
Wey-Yi Guy 8b3ee29626 iwlagn: remove structure name reference to gen2
Give the corresponding name for .cfg data structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:12 -08:00
Grumbach, Emmanuel e7cad69cda iwlagn: Enable PCI L1 ACTIVE state after uCode has been loaded
PCI L1 Active needs to be disabled while loading the uCode so that the bus
doesn't go to sleep. The enablement of L1 Active should be done after
the uCode has sent the ALIVE response. The enablement of L1 Active was
missing.
Enabling L1 Active allows to save power if the BIOS / bus driver allows
it.

I measured the power consumption while not associated and
idle/associated:
L1 Active disabled: 39 mA = 130mW
L1 Active enabled:   6 mA = 20 mW

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:02 -08:00
Wey-Yi Guy 40b97c2fe9 iwlagn: fix race condition when reprogram sta
During reprogram stations, do not send link quality command.
uCode will crash if receive link quality command for invalid station

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:34:54 -08:00
Stanislaw Gruszka 61790c5f3c iwlagn: fix microcode error on 4965
Commit dbbf1755b0 "iwlwifi: use
antenna information in EEPROM" caused 4965 device breakage with
"Microcode SW error detected.  Restarting 0x82000000." message.
This patch reverts 4965 part of that commit.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:58:18 -05:00
Johannes Stezenbach 20ed3166c8 mac80211/rt2x00: add ieee80211_tx_status_ni()
All rt2x00 drivers except rt2800pci call ieee80211_tx_status() from
a workqueue, which causes "NOHZ: local_softirq_pending 08" messages.

To fix it, add ieee80211_tx_status_ni() similar to ieee80211_rx_ni()
which can be called from process context, and call it from
rt2x00lib_txdone().  For the rt2800pci special case a driver
flag is introduced.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:46 -05:00
Nick Kossifidis 4352fab5c2 ath5k: Set turbo bit on rf bank 2
* A diff between rfbuffer settings of turbo and non-turbo
 modes indicates there is a bit on bank 2 related to turbo operation
 (it's set on turbo modes). This bit is present on all radios except
 RF5413 that seems to have a completely different bank 2. Also
 since 2317 has the same rf-registers locations with 2425 and
 since the bit exists on 2317 I assume it also exists on 2425/2417).
 So in case we use turbo mode (40MHz) enable it on bank modification.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:45 -05:00
Nick Kossifidis 8c2b418a07 ath5k: Clean up turbo mode initvals/rfregs
* Clean up what's left of turbo mode, since we handle all
 register modifications (rfbuffer comes next) on code there
 is no need to have duplicated arrays.

 * Rename change_channel to skip_pcu on initvals.c as we did
 on reset.c

 Signed-off-by: Nick Kossifidis <micklfemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:45 -05:00
Nick Kossifidis acb091d67c ath5k: Cleanup turbo channel flags
* Clean up CHANNEL_T(URBO), use AR5K_BWMODE_40MHZ instead

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:45 -05:00
Nick Kossifidis 73a06a6834 ath5k: Use correct clock when setting ofdm timings
* Use correct clock value when setting OFDM timings on
 non-default bwmodes.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:44 -05:00
Nick Kossifidis 3bb1765460 ath5k: Skip tx power setting on AR5210 for now
* Don't return -EINVAL when trying to set tx power
 on RF5110 because AR5210 reset will fail. We need to
 add support for RF5110 and AR5210 eeprom in the future
 but for now just skip it.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:44 -05:00
Nick Kossifidis b02f5d1a17 ath5k: Tweak phy activate to rx start delay based on bwmode
* Tweak phy activation -> rx delay for different bwmodes

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:44 -05:00
Nick Kossifidis c2b0ebef26 ath5k: No need to save/restore staid flags on reset
* Since we set antenna flags on phy init and ack bitrate
 mode on pcu init, there is no need to save/restore sta_id
 flags on ath5k_hw_reset. Also we don't need to re-set our
 mac address because it's not affected by resets.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:43 -05:00
Nick Kossifidis 8aec7af99b ath5k: Support synth-only channel change for AR2413/AR5413
* Add synth-only channel change for AR2413/5413. When we call
 ath5k_reset with a channel ath5k_hw_reset will first try to
 set channel on PHY while PHY is running instead of doing a normal
 full reset. To do this phy_init has to change to implement this
 functionality.

 * Clean up change_channel flag, what it really did was skip PCU
 registers when setting initvals. This is done because on reset
 PCU registers are not affected (except the registers we set
 in pcu init and -due to hw problems- TSF). Use a new skip_pcu
 flag that's not misleading instead. In the future we might use
 that to also skip PCU reset and save us the TSF etc problems
 (needs testing because standard practice is to reset everything).

 * Use fast channel change only when setting channel, and set skip_pcu
 to false only on init. When we reset the card due to DMA or PHY
 problems skip pcu but never do a fast channel change.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:43 -05:00
Nick Kossifidis 4c57581d93 ath5k: Skip powertable setting when we are on the same channel
* Only set power table if we are changing channel/mode
 there is no need to recalculate and reset the power table
 all the time.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:24 -05:00
Nick Kossifidis f08fbf6cf4 ath5k: Update PLL programming for turbo/half/quarter
* Set correct PLL settings for each bwmode

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:23 -05:00
Nick Kossifidis a2677fe429 ath5k: Update spur mitigation filter for turbo/half/quarter
* Add spur mitigation filter support for half/quarter and turbo.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:23 -05:00
Nick Kossifidis b2b4c69f68 ath5k: Tweak power detector delays on RF5111/RF5112
* Tweak power detector delays on AR5111/AR5112 when
 using half/quarter modes.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:23 -05:00
Nick Kossifidis 71ba1c3085 ath5k: Always set IFS intervals on reset
* Make sure we always set IFS timings even if no
 coverage class is set. If we don't we'll miss the
 needed changes for different bwmodes.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:22 -05:00
Nick Kossifidis 473cae2762 ath5k: Use turbo flag on DCU
* Set AR5K_DCU_GBL_IFS_MISC_TURBO_MODE flag on DCU when operating
 on 40MHz

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:22 -05:00
Nick Kossifidis eeb8832b31 ath5k: Set all IFS intervals, not just slot time
* Replace set_slot_time with set_ifs_intervals that also sets
 the various inter-frame space intervals based on current bwmode.

 * Clean up AR5210 mess from reset_tx_queue, AR5210 only has one
 data queue and we set IFS intervals for that queue on set_ifs_intervals
 so there is nothing left to do for 5210 on reset_tx_queue.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:21 -05:00
Nick Kossifidis 61cde03723 ath5k: Extend rate_duration
* Extend ieee80211_generic_frame_duration to support the various
 bwmodes.

 * Better document what's going on with ack bitrates and update
 write_rate_duration to support the standard ack bitrates (when
 we don't set the high bit).

 * Get rid of set_ack_bitrate_high and introduce a flag on ath5k_hw
 for this (we only called the function on init anyway so there is no
 difference).

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:53:21 -05:00
Nick Kossifidis 3017fcab41 ath5k: Extend get_default_sifs/slot_time
* Extend get_default_sifs/slot_time to include timings for turbo
 half and quarter rate modes.

 * AR5210 code for now uses timings already on core clock units
 instead of usecs so rename them (we 'll clean it up later).

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:52:35 -05:00
Nick Kossifidis 25ddfa1957 ath5k: Move tx retries setting outside reset_tx_queue
* Move setting of tx retry limits on a separate function
 (we 'll clean up this AR5210 mess later)

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:52:35 -05:00
Nick Kossifidis b405086ba4 ath5k: Increase PHY settling parameters for turo mode
* On turbo mode increase PHY settling times, note that
 we only increase switch settling time on AR5212 as indicated
 by initvals.

 * A few cleanups: Move frame control settings for AR5210 from
 reset_tx_queue to tweak_initvals and remove phy_scal settings
 from tweak_initvals (we tweak them alread on set_sleep_clock).

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:52:34 -05:00
Nick Kossifidis 325089ab58 ath5k: Small cleanup on tweak_initvals
* Now that we properly set rx/tx latencies for AR5311 remove
 that old buggy part of code left inside ath5k_hw_tweak_initval_settings
 that was never executed (you can't have an RF5112 radio on a mac older
 than AR5212). Also use a magic value for 5311 PHY_SCAL value.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30 13:52:34 -05:00