Commit graph

4517 commits

Author SHA1 Message Date
John W. Linville e08fd975bf Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	drivers/net/wireless/brcm80211/Kconfig
	net/mac80211/util.c
2013-12-06 09:50:45 -05:00
Luis R. Rodriguez 251c9ba191 ath: fix dynamic user regulatory domain support
As it stands dynamic user regulatory domain support is
only possible for a few programmed regulatory domains as
a few countries do not allow for this.

The existing code however only would take advantage of
the feature if a custom world regulatory domain is used
though as that's when we clear beconing flags. We need
to lift this restriction as otherwise this feature is
pointless.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:45:51 -05:00
Luis R. Rodriguez ba94c049e5 ath: dynamic user allow check helper to the top
This will be used later.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:45:37 -05:00
Luis R. Rodriguez a44ea6ffbb ath: move dynamic_country_user_possible() to the top
This will be used later.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:45:24 -05:00
Luis R. Rodriguez 62452a99d0 ath: fix usage of freq_reg_info()
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.

@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@

-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));

Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:44:59 -05:00
Luis R. Rodriguez 07782d94d9 ath: move the channel for ath_reg_apply_beaconing_flags() into helper
While at it convert this into a switch statement, this
makes it easier and manage.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:44:54 -05:00
Luis R. Rodriguez 6c3af5888e ath: simplify ath_reg_apply_beaconing_flags()
Simplify ath_reg_apply_beaconing_flags() by making use of
thew new no-ir helper.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:42:21 -05:00
Luis R. Rodriguez f33cbc4f43 ath: rename ath_reg_apply_active_scan_flags() to ath_reg_apply_ir_flags()
This also applies the no-ibss flag to the channels or clears it.
The idea here is to clarify no initiated radiation should be
allowed on these channels.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:42:16 -05:00
Luis R. Rodriguez bc0aa06918 ath: clean up ath_reg_apply_active_scan_flags()
The routine ath_reg_apply_active_scan_flags() can be a bit
hard to read, this cleans it up by adding helpers for the
two cases of clearing IR flags or adding them. This approach
also makes no assumptions on the index of channels 12 and 13
so it should be portable accross different drivers.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:40:10 -05:00
Luis R. Rodriguez d44040de6a ath: fix logic on ath_reg_apply_active_scan_flags()
The existing logic removes the passive scan flag from
channels 12 and 13 when a regulatory hint coming from
something other than a country IE has been passed. This
is incorrect, the original intention was to ensure we
always have passive scan enabled for these two channels
for a specific set of custom world regulatory domains.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 15:09:56 -05:00
Chun-Yeow Yeoh cddc604639 wcn36xx: fix typo error
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:56:42 -05:00
Lorenzo Bianconi fc70ff7207 ath9k: fix retry chain initialization in tx99 code
Initialize first chain attempt counter to 1 in ath9k_build_tx99_skb().
Otherwise multi-retry chain is initialized to {idx,count} = {-1, 0} in
rate_control_fill_sta_table() and tx99 transmission rate is not configured in
rate_control_apply_mask() since first chain idx is set to -1

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:56:28 -05:00
Chun-Yeow Yeoh 42bc702e76 wcn36xx: set self STA default HT parameters
These default HT parameters are required for self STA entry.
In example, set the HT capable of self STA entry for bss
configuration in mesh allows the MCS rate to be used. Otherwise,
only legacy rate will be used.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:56:26 -05:00
Eugene Krasnikov 684e55f53e wcn36xx: Fix logging macro with unnecessary semicolon
The wcn36xx_err macro should not end in a semicolon as
there are 2 consecutive semicolons in the preprocessed
output.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:54:57 -05:00
Chun-Yeow Yeoh b3e3f87160 wcn36xx: enable beacon change using BSS_CHANGED_BEACON
Enable the beacon changed using BSS_CHANGED_BEACON. This is
especially useful for mesh mode.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:54:55 -05:00
John W. Linville 4b074b0762 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2013-12-02 14:25:38 -05:00
Sujith Manoharan 2c8672c13a ath9k: Fix initvals for freq 2484
This is missing for AR9300, AR9580 and AR9340.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:04 -05:00
Sujith Manoharan 40cc87de93 ath9k: Update AR9340 initvals
* Baseband updates
* Remove ar9340Common_rx_gain_table_1p0 since it is a duplicate.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:04 -05:00
Sujith Manoharan 2d9507c899 ath9k: Update initvals for AR9580 v1.0
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:03 -05:00
Sujith Manoharan 879fb289ef ath9k: Update initvals for AR9300 v2.2
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:03 -05:00
Sujith Manoharan dbb3e2fb4a ath9k: Remove duplicate initvals for AR9462 v2.1
The initvals for AR9462 v2.1 are very similar to v2.0.
Identify duplicate arrays and reuse the values from v2.0
to reduce module size.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:02 -05:00
Sujith Manoharan 3777f7d121 ath9k: Attach INI arrays for AR9565 v1.1
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:02 -05:00
Sujith Manoharan 8af4596593 ath9k: Add version macros for AR9565 1.1
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:02 -05:00
Sujith Manoharan ae4a9a1062 ath9k: Add initvals for AR9565 1.1
The initialization arrays for v1.1 AR9565
are mostly the same as v1.0/v1.0.1 except for
radio_postamble.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:01 -05:00
Sujith Manoharan ffaa02fc1e ath9k: Cleanup IQ calibration for PCOEM chips
Since IQ calibration is done as part of AGC calibration for
AR9485 and above, remove the seperate IQ calibration code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:01 -05:00
Felix Fietkau af02efb32e ath9k_hw: allow fast channel change when only CHANNEL_HT changes
The CHANNEL_HT flag is insignificant for fast channel change conditions,
since it does not affect any important part of the hardware reset /
channel setup.
Scanning usually runs with HT disabled, so this change will slightly
improve scan time on many chipsets.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:00 -05:00
Felix Fietkau 09d8e315d9 ath9k_hw: fix TSF save/restore around chip reset
A cold reset can be triggered because of DMA stop issues, and this leads
to TSF being cleared on all chipsets. To properly deal with this, always
save the TSF.
Additionally, account for the time it takes to do the actual chip reset,
which can be quite significant. On AR9344 it takes around 4.5 ms.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:00 -05:00
Felix Fietkau 10e2318103 ath9k: optimize ath9k_flush
Instead of checking the queues in a loop with hardcoded sleep times
inbetween, use a wait queue to trigger queue checks after the tx
processing tasklet has run.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:25:00 -05:00
Felix Fietkau 10ffb6a77e ath9k: optimize ath_drain_all_txq
If the software has processed all packets, checking the hardware queue
is unnecessary.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:59 -05:00
Felix Fietkau bf3dac5a6f ath9k: use a timer to put hardware into full sleep
When operating in client mode, the short period of time between scanning
and associating is often enough to put the hardware through several
FULL-SLEEP <-> AWAKE transitions, each wakeup requiring a reset to fully
recover the hardware.
This is completely unnecessary and can easily be avoided by deferring
the switch to full sleep.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:59 -05:00
Sujith Manoharan f28c785f37 ath9k: Fix TX IQ calibration for SoC chips
Since calibration data reuse is not enabled in
SoC chips, simplify the IQ calibration code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:58 -05:00
Sujith Manoharan 34d9b68934 ath9k: Fix Carrier Leak calibration for SoC chips
CL calibration is applicable for all chips and the
enable/disable knob comes via the INI file. For PCOEM
chips, the calibration data is reused when Fast Channel Change
is used. Caldata reuse is not enabled for SoC chips, so remove
the CL post processing code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:58 -05:00
Sujith Manoharan c20a2c5912 ath9k: Remove unnecessary check
TX IQ calibration is always enabled for SoC chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:58 -05:00
Sujith Manoharan a3640781d9 ath9k: Remove RTT/MCI code from SoC calibration
RTT is enabled only for AR9462 and MCI for AR9462/AR9565.
Also, manual peak calibration is not done for any of the
SoC chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:57 -05:00
Sujith Manoharan 3b06c1d7af ath9k: Separate routines for PCOEM and SoC calibration
Though there is some overlap between the calibration mechanisms
of PC-OEM cards and SoC chip families, dumping both of them
into a single function makes things hard to understand.

ar9003_hw_init_cal() is unreadable with chip-specific segments
scattered around. To make the logic understandable, use
different functions for client cards and SoC chips. Some
code is duplicated, but in the long run, it makes the code
more maintanable.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:57 -05:00
Dan Carpenter 26f2a64abd ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()
SC_OP_INVALID is zero so the test is always false.  We're supposed to be
testing the lowest bit instead.

Fixes: 89f927af7f ('ath9k: add TX99 support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:57 -05:00
Sujith Manoharan 8fd007ac7c ath9k: Apply CUS227 specific TX gain values
CUS227, which is an AR9340 based card used in Qualcomm's
Allplay platforms requires a custom TX gain array, based
on the index 7. Add suport for this.

Cc: Michael Larson <mlarson@qce.qualcomm.com>
Cc: Stephen Collmeyer <scollmey@qce.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:56 -05:00
Sujith Manoharan c6fc7e64e1 ath9k: Remove pcieSerDesWrite
This HW config option is always set to true and is not needed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:55 -05:00
Sujith Manoharan 28148db74d ath9k: Remove unused AR9462 2.0 initvals
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:55 -05:00
Sujith Manoharan f51ecd770c ath9k: Add SERDES initvals for AR9462 2.1
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:55 -05:00
Sujith Manoharan babaa80ac5 ath9k: Add an initialization routine for WoW
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:54 -05:00
Sujith Manoharan e60001e716 ath9k: Use CONFIG_ATH9K_WOW
Move the WoW code to wow.c and compile it conditionally
based on CONFIG_ATH9K_WOW.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:54 -05:00
Sujith Manoharan bb00b1f786 ath9k: Add a config option for WoW
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:53 -05:00
Sujith Manoharan 9c9cb10fcb ath9k: Fix wow.c compilation
The HW routines to set various WoW registers are present
in wow.c. For some reason, it has been compiled as part
of the main ath9k.ko module all this time, when it should
really be part of ath9k_hw.ko. This patch renames the file to
ar9003_wow.ko and adds it to ath9k_hw.ko.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:53 -05:00
Sujith Manoharan ef6b19e40f ath9k: Fix TX99 config option usage
Use CONFIG_ATH9K_TX99 to properly enclose the tx99 code
and make sure that it is not compiled as part of the driver
when it is not selected. Move the tx99 code to a new file tx99.c
and also add ATH9K_DEBUGFS as a dependency in Kconfig.

This reduces the module size on platforms like OpenWrt where
ATH9K_DEBUGFS is selected, but TX99 might be disabled.

Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:53 -05:00
Sujith Manoharan 4dd3564030 ath9k: Identify Killer Wireless cards
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:52 -05:00
Sujith Manoharan 9658113242 ath9k: Add WB335 PCI IDs
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 14:24:52 -05:00
Michal Nazarewicz 3469adb36c net: wireless: wcn36xx: fix potential NULL pointer dereference
If kmalloc fails wcn36xx_smd_rsp_process will attempt to dereference
a NULL pointer.  There might be a better error recovery then just
printing an error, but printing an error message is better then the
current behaviour.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 13:11:52 -05:00
Michal Nazarewicz beae416b1f net: wireless: ath9k: avoid possible NULL pointer dereference
Code in ath9k_hw_set_clockrate function indicates that ah->curchan
(and thus chan local variable) may be NULL.  If that is indeed the
case, IS_CHAN_HT40(chan) check has to be performed only in branch
where chan is not NULL.  Moving the code under already existing
if condition fixes this issue.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 13:11:51 -05:00
Sujith Manoharan a1783a7b08 ath9k: Fix XLNA bias strength
The EEPROM parameter to determine whether the bias
strength values for XLNA have to be applied is part
of the miscConfiguration field and not featureEnable.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02 13:11:51 -05:00