summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
Commit message (Collapse)AuthorAgeFilesLines
* ath9k_hw: clean up per-channel calibration dataFelix Fietkau2010-08-041-6/+12
| | | | | | | | | | | | | | | | | | | | | | | The noise floor history buffer is currently not kept per channel, which can lead to problems when changing channels from a clean channel to a noisy one. Also when switching from HT20 to HT40, the noise floor history buffer is full of measurements, but none of them contain data for the extension channel, which it needs quite a bit of time to recover from. This patch puts all the per-channel calibration data into a single data structure, and gives the the driver control over whether that is used per-channel or even not used for some channels. For ath9k_htc, I decided to keep this per-channel in order to avoid creating regressions. For ath9k, the data is kept only for the operating channel, which saves some space. ath9k_hw takes care of wiping old data when the operating channel or its channel flags change. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: clean up and fix initial noise floor calibrationFelix Fietkau2010-08-041-5/+2
| | | | | | | | | | | | On AR9003 the initial noise floor calibration is currently triggered at the end of the reset without allowing the hardware to update the baseband settings. This could potentially make scans in noisy environments a bit more unreliable, so use the same calibration sequence that is used on AR9002. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: enable serialize_regmode for non-PCIE AR9160John W. Linville2010-07-291-1/+2
| | | | | | | | https://bugzilla.kernel.org/show_bug.cgi?id=16476 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Cc: stable@kernel.org
* ath9k_hw: prevent a fast channel change after a rx DMA stuck issueFelix Fietkau2010-07-121-1/+3
| | | | | | | | | | | | | | | If the receive path gets stuck, a full hardware reset is necessary to recover from it. If this happens during a scan, the whole scan might fail, as each channel change bypasses the full reset sequence. Fix this by resetting the fast channel change flag if stopping the receive path fails. This will reduce the number of error messages that look like this: ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x40000020 Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: sanitize noise floor values properly on all chipsFelix Fietkau2010-07-021-3/+0
| | | | | | | | This refactors the noise floor range checks to make them generic, and adds proper ranges for each supported chip type. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: Add LED support for AR7010Sujith2010-06-301-4/+30
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix TSF after reset on AR913xFelix Fietkau2010-06-301-2/+14
| | | | | | | | | | | | | | | | | | When issuing a reset, the TSF value is lost in the hardware because of the 913x specific cold reset. As with some AR9280 cards, the TSF needs to be preserved in software here. Additionally, there's an issue that frequently prevents a successful TSF write directly after the chip reset. In this case, repeating the TSF write after the initval-writes usually works. This patch detects failed TSF writes and recovers from them, taking into account the delay caused by the initval writes. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Björn Smedman <bjorn.smedman@venatech.se> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: make ath9k_hw_keysetmac staticJohn W. Linville2010-06-291-2/+1
| | | | | Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: remove unused function ath9k_hw_keyisvalidJohn W. Linville2010-06-291-11/+0
| | | | | Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: add an extra delay when reseting AR_RTC_RESETLuis R. Rodriguez2010-06-231-0/+1
| | | | | | | | | | | Without this we could start trying to work with the device without it being fully functional yet and loose some packets upon resume. Cc: Aeolus Yang <aeolus.yang@atheros.com> Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com> signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: add pcieSerDesWrite to disable SERDES ASPM tweaksLuis R. Rodriguez2010-06-231-0/+1
| | | | | | | | | | This can be useful during testing of new ASPM tweaks which often have to be done through the PCI Serializer-Deserializer (SERDES). Cc: Aeolus Yang <aeolus.yang@atheros.com> Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: move LowPower array writes to ar9003_hw_configpcipowersave()Luis R. Rodriguez2010-06-231-14/+0
| | | | | | | | | | | | The LowPower array writes disables the PLL when ASPM is enabled. The host driver makes quite a few calls to ath9k_hw_configpcipowersave() and these same calls also need to ensure the PLL is off when they issue it. Cc: Aeolus Yang <aeolus.yang@atheros.com> Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: fix ASPM setting for AR9003Luis R. Rodriguez2010-06-231-6/+39
| | | | | | | | | | | | | The AR_WA register should not be read when in sleep state so add a variable we can stash its value into for when we need to set it. Additionally the AR_WA_D3_TO_L1_DISABLE_REAL (bit 16) needs to be removed. Cc: Aeolus Yang <aeolus.yang@atheros.com> Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com> signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_DSFelix Fietkau2010-06-141-15/+0
| | | | | | | | This capability check is no longer used, so it can be removed along with the now-obsolete ath9k_hw_getcapability function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCHFelix Fietkau2010-06-141-30/+3
| | | | | | | | | The driver always sets this to enabled, but this can be simplified with a small change to ah->sta_id1_defaults instead. This change also removes the now-obsolete ath9k_hw_setcapability function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_TKIP_SPLITFelix Fietkau2010-06-141-3/+0
| | | | | | | This is only used as a workaround for an issue in one specific hw revision. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_TKIP_MICFelix Fietkau2010-06-141-17/+0
| | | | | | | TKIP MIC support is always enabled anyway. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_TXPOWFelix Fietkau2010-06-141-16/+0
| | | | | | | | replace calls that read this capability with accesses to ath9k_hw's regulatory data. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ATH9K_CAP_CIPHERFelix Fietkau2010-06-141-12/+0
| | | | | | | All of the ciphers that are tested for are always supported Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: add support for parsing PA predistortion related EEPROM fieldsFelix Fietkau2010-06-141-0/+2
| | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove a useless function for setting the mac addressFelix Fietkau2010-06-141-6/+0
| | | | | | | | | ath9k_hw_setmac() only copies the mac address it is called with into common->macaddr, yet in all call sites, the supplied mac address pointer is already common->macaddr. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix extending the rx timestamp with the hardware TSFFelix Fietkau2010-06-141-15/+0
| | | | | | | | | | | | | | | AR5416 and all newer chipsets use a 32 bit rx timestamp, so there is no need to keep the 15 bit timestamp extending logic around. This patch removes ath9k_hw_extend_tsf (replaced by a call to ath9k_hw_gettsf64), and reduces the frequency of TSF reads, which can improve performance in some cases. This change also has the side effect of making rx timestamps more accurate. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: enable ANI for AR9003Luis R. Rodriguez2010-06-141-7/+1
| | | | | | | | AR9003 has been tested with the new ANI implementation and so ANI can now be enabled for that family. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: add new ANI implementation for AR9003Luis R. Rodriguez2010-06-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for ANI for AR9003. The implementation for ANI for AR9003 is slightly different than the one used for the older chipset families. It can technically be used for the older families as well but this is not yet fully tested so we only enable the new ANI for the AR5008, AR9001 and AR9002 families with a module parameter, force_new_ani. The old ANI implementation is left intact. Details of the new ANI implemention: * ANI adjustment logic is now table driven so that each ANI level setting is parameterized. This makes adjustments much more deterministic than the old procedure based logic and allows adjustments to be made incrementally to several parameters per level. * ANI register settings are now relative to INI values; so ANI param zero level == INI value. Appropriate floor and ceiling values are obeyed when adjustments are combined with INI values. * ANI processing is done once per second rather that every 100ms. The poll interval is now a set upon hardware initialization and can be picked up by the core driver. * OFDM error and CCK error processing are made in a round robin fashion rather than allowing all OFDM adjustments to be made before CCK adjustments. * ANI adjusts MRC CCK off in the presence of high CCK errors * When adjusting spur immunity (SI) and OFDM weak signal detection, ANI now sets register values for the extension channel too * When adjusting FIR step (ST), ANI now sets register for FIR step low too * FIR step adjustments now allow for an extra level of immunity for extremely noisy environments * The old Noise immunity setting (NI), which changes coarse low, size desired, etc have been removed. Changing these settings could affect up RIFS RX as well. * CCK weak signal adjustment is no longer used * ANI no longer enables phy error interrupts; in all cases phy hw counting registers are used instead * The phy error count (overflow) interrupts are also no longer used for ANI adjustments. All ANI adjustments are made via the polling routine and no adjustments are possible in the ISR context anymore * A history settings buffer is now correctly used for each channel; channel settings are initialized with the defaults but later changes are restored when returning back to that channel * When scanning, ANI is disabled settings are returned to (INI) defaults. * OFDM phy error thresholds are now 400 & 1000 (errors/second units) for low/high water marks, providing increased stability/hysteresis when changing levels. * Similarly CCK phy error thresholds are now 300 & 600 (errors/second) Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: move clock definitions from hw.c to hw.hLuis R. Rodriguez2010-06-141-5/+0
| | | | | | | These will be used by the ANI code next. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Configure byte swap for non AR9271 chipsSujith2010-06-041-3/+7
| | | | | | | | | This patch fixes programming the byte swap registers for chipsets other than AR9271. This is needed for AR7010. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Fix async fifo for AR9287Sujith2010-06-031-1/+4
| | | | | | | | | Async fifo is now enabled only for versions 1.3 and above. Enable it in the appropriate place, in the reset routine, instead of process_ini(). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: add multicast key search supportFelix Fietkau2010-06-031-1/+12
| | | | | | | | | | | If a MAC address for a key table entry is flagged with the multicast bit (0x01), indicate to the hardware that multicast lookup instead of unicast lookup should be used. The multicast bit itself never makes it to the actual keytable entry register, as it is shifted out. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Enable TX IQ calibration on AR9003Luis R. Rodriguez2010-06-021-6/+0
| | | | | | | | To enable it we now disable and re-enable the PHY chips after TX IQ calibration. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Enable auto sleep for ar9003Vasanthakumar Thiagarajan2010-06-021-1/+1
| | | | | Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: Enable SGI in HT20 for AR9271Sujith2010-06-021-1/+1
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Enable Short GI in 20 Mhz for ar9287 and later chipsVasanthakumar Thiagarajan2010-06-021-0/+3
| | | | | | | | This patch enables short GI rx at all rates and tx at mcs15 for 20 Mhz channel width also. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: add support for the AR9003 baseband watchdogLuis R. Rodriguez2010-06-021-0/+2
| | | | | | | | | | | | | | The baseband watchdog will monitor blocks of the baseband through timers and will issue an interrupt when things are detected to be stalled. It is only available on the AR9003 family. Cc: Sam Ng <sam.ng@atheros.com> Cc: Paul Shaw <paul.shaw@atheros.com> Cc: Don Breslin <don.breslin@atheros.com> Cc: Cliff Holden <cliff.holden@atheros.com Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2010-05-111-0/+20
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/ath/ar9170/main.c
| * ath9k_hw: enable PCIe low power mode for AR9003Luis R. Rodriguez2010-05-101-0/+20
| | | | | | | | | | | | | | Cc: Paul Shaw <paul.shaw@atheros.com> Cc: Don Breslin <don.breslin@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' of ↵John W. Linville2010-05-051-7/+20
|\| | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/libertas_tf/cmd.c drivers/net/wireless/libertas_tf/main.c
| * ath9k_hw: fix fast clock handling for 5GHz channelsFelix Fietkau2010-04-271-2/+6
| | | | | | | | | | | | | | | | Combine multiple checks that were supposed to check for the same conditions, but didn't. Always enable fast PLL clock on AR9280 2.0 Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Fix usec to hw clock conversion in 5Ghz for ar9003Vasanthakumar Thiagarajan2010-04-271-2/+8
| | | | | | | | | | | | | | | | Fast clock operation (44Mhz) is enabled for 5Ghz in ar9003, so take care of the conversion from usec to hw clock. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: disable TX IQ calibration for AR9003Luis R. Rodriguez2010-04-271-0/+6
| | | | | | | | | | | | | | | | | | | | Disable TX IQ calibration, it was prematurely enabled in previous versions. Cc: Paul Shaw <Paul.Shaw@Atheros.com> Cc: Thomas Hammel <Thomas.Hammel@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Remove pointless ANI deinitSujith2010-04-261-3/+0
| | | | | | | | | | | | | | | | There is no reason to disable the PHY Error / MIB counters when the module is being unloaded. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' into for-davemJohn W. Linville2010-04-231-1399/+362
|\| | | | | | | | | | | | | Conflicts: drivers/net/wireless/ath/ath9k/phy.c drivers/net/wireless/iwlwifi/iwl-6000.c drivers/net/wireless/iwlwifi/iwl-debugfs.c
| * ath9k: check for specific rx stuck conditions and recover from themFelix Fietkau2010-04-201-0/+28
| | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Use buffered register writesSujith2010-04-161-0/+71
| | | | | | | | | | | | | | | | | | | | | | This patch adds macros at certain places which could be optimized for multiple register writes. The performance of ath9k_htc improves considerably, especially reducing the latency involved in a scan run. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Relocate Opmode initializationSujith2010-04-161-6/+2
| | | | | | | | | | | | | | | | | | | | Programming the opmode in the HW can be done before the assoc_id and STA_ID registers are setup. This helps ath9k_htc when multiple register writes are used. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath5k/ath9k: Fix 64 bits TSF readsBenoit Papillault2010-04-161-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to tests, both TSF lower and upper registers kept counting, so the higher part could have been updated after the lower part has been read, as shown in the following log where the upper part is read first and the lower part next. tsf = {00000003-fffffffd} tsf = {00000003-00000001} tsf = {00000004-0000000b} This patch corrects this by checking that the upper part has not been changed while the lower part was read. It has been tested in an IBSS network where artifical IBSS merges have been done in order to trigger hundreds of rollover for the TSF lower part. It follows the logic mentionned by Derek, with only 2 register reads needed at each additional steps instead of 3 (the minimum number of register reads is still 3). Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Abort rx if hw is not coming out of full sleep in resetVasanthakumar Thiagarajan2010-04-161-0/+7
| | | | | | | | | | Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: add LDPC support for AR9003Luis R. Rodriguez2010-04-161-1/+1
| | | | | | | | | | Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Initialize and configure tx status for EDMAVasanthakumar Thiagarajan2010-04-161-0/+1
| | | | | | | | | | | | | | Also add a function to clean up tx status ring. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: move AR9002 mac ops to its own fileLuis R. Rodriguez2010-04-161-0/+1
| | | | | | | | | | | | Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Add function to configure tx status ring bufferVasanthakumar Thiagarajan2010-04-161-0/+3
| | | | | | | | | | | | | | Also reset tx status ring suring chip reset. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>