Commit graph

18976 commits

Author SHA1 Message Date
Sujith Manoharan
709c19b22a ath9k: Add QCA953x initvals
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Sujith Manoharan
e6b1e46eb2 ath9k: Assign macVersion for QCA9531
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Sujith Manoharan
f5ee2b18e4 ath9k: Add version/revision macros for QCA9531
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Julia Lawall
1283ac10e9 carl9170: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h,
ieee80211_bar defined in include/linux/ieee80211.h and
ath_common defined in drivers/net/wireless/ath/ath.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Julia Lawall
631c527373 at76c50x-usb: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
at76_priv defined in drivers/net/wireless/at76c50x-usb.h and
ieee80211_mgmt defined in include/linux/ieee80211.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Julia Lawall
103671f4d9 ipw2x00: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structure involved is
libipw_network defined in drivers/net/wireless/ipw2x00/libipw.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Julia Lawall
36ddf203d7 ath9k: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h
ath_common defined in drivers/net/wireless/ath/ath.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:37:00 -05:00
Julia Lawall
ccbac29055 iwlegacy: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h,
il_priv defined in drivers/net/wireless/iwlegacy/common.h and
il_rxon_cmd defined in drivers/net/wireless/iwlegacy/commands.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Julia Lawall
90908e1cd1 rtlwifi: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h and
rtl_mac defined in drivers/net/wireless/rtlwifi/wifi.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Julia Lawall
3f9a79b5bb mwl8k: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h and
mwl8k_priv defined in drivers/net/wireless/mwl8k.c

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Julia Lawall
4d2a33e121 p54: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h and
p54_common defined in drivers/net/wireless/p54/p54.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Julia Lawall
f90e29f32b ath5k: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_mgmt defined in include/linux/ieee80211.h and
ath_common defined in drivers/net/wireless/ath/ath.h

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Julia Lawall
f012f7588f rt2x00: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The structures involved are:
ieee80211_bar defined in include/linux/ieee80211.h and
rt2x00_bar_list_entry defined in drivers/net/wireless/rt2x00/rt2x00.h.

This was done using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Sujith Manoharan
78c8a950f8 ath9k: Fix interrupt statistics
Initialize "sync_cause" to zero since commit
"ath9k: move ath9k_debug_sync_cause out of ath9k_hw"
fills it conditionally based on ISR status.
Not doing this results in garbage values in debugfs.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Sujith Manoharan
ff47f9320e ath9k: Remove unused config option ack_6mb
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:59 -05:00
Sujith Manoharan
04575f21d9 ath9k: Fix AR9100 chip power-on
AR9100 requires a larger delay after waking up
the RTC.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
f57cf939f0 ath9k: Cleanup __ath9k_hw_init()
* Move initialization of config variables to
  ath9k_hw_init_config().

* Move initialization of defaults to ath9k_hw_init_defaults().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
de82582b9a ath9k: Handle unsupported MAC versions early
There is no point in trying to bring up the chip when
the MAC version is not present in the supported list.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
e4ef276303 ath9k: Move private HW callbacks to hw-ops.h
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
1dd9619a21 ath9k: Remove unused functions
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
b7cc9b972d ath9k: Fix "cc_lock" usage
IRQ save/restore is not required for the cycle counters
since they are accessed only from softirq and process context.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
0c75997758 ath9k: Process BB watchdog events in the tasklet
Move the BB processing code to the tasklet and avoid
doing it in the ISR, there is no real benefit and this
makes the ISR less heavy.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
415ec61b66 ath9k: Remove RX Poll
This patch removes the convoluted and hacky method of
monitoring for connectivity. We rely on mac80211's connection
loss logic and doing it in the driver is not necessary.

The HW check for MAC/BB hangs is also simplified, there
is no need to have a separate work instance for it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:58 -05:00
Sujith Manoharan
6549a8606d ath9k: Fix baseband watchdog reset
Do a HW reset only for required signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
d88527d3d3 ath9k: Identify baseband watchdog signatures
A full HW reset is not required for all baseband watchdog
signatures. Some BB watchdog updates are benign and can
be discarded, some require re-programming of certain registers
and others require a chip reset.

This patch adds a routine to identify such signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
a6bb860be4 ath9k: Fix baseband watchdog interrupts
Program the required baseband watchdog interrupt
mask to ensure that the correct watchdog interrupts
are raised when the BB is hung for some reason.

Also, use the capability HW_BB_WATCHDOG instead of
relying on other flags.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
a7abaf7da9 ath9k: Fix PHY restart workaround
The PHY restart workaround that handles baseband hangs
for packets with unsupported rates is required only
for a HW bug in AR9300 v2.2. All the subsequent chips in
the AR9003 family do not require this driver fix since
it has been addressed in the HW.

Since the value of the AR_PHY_RESTART register is written
with the default initvals, make sure that PHY restart is
always disabled once this particular BB hang signaure has
been encountered.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
222e04830f ath9k: Fix MAC HW hang check for AR9003
The current method of identifying MAC hangs is
convoluted and also, the signatures are wrong and
don't apply to all the chips in the AR9003 family.
Fix this by cleaning up the code and checking for
the correct hang signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
990de2b2e4 ath9k: Add HW callbacks for MAC/BB hang checks
This is required for adding separate hang check
routines for AR9002 and AR9003.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
4598702d1b ath9k: Register supported HW hang checks
HW hang checks have to be done on a per-chip basis.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Sujith Manoharan
5b502c8671 ath9k: Fix max AMPDU size calculation
The maximum A-MPDU size is calculated in ath_tx_aggr_start(),
so there is no need to do it in node_attach() too. Also, make
sure that the correct size is calculated as described in
8.4.2.58.3.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:57 -05:00
Josh Triplett
4ad77ac92d net: wireless: brcm80211: Drop debug version with build date/time
The kernel already has this information, and individual drivers
shouldn't duplicate that.  This also eliminates the use of __DATE__ and
__TIME__, which make the build non-deterministic.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
Felix Fietkau
cca213fd6b ath9k_hw: fix TSF offset calculation
Since the unit is microseconds and not milliseconds, tv_sec needs to be
multiplied by 1000000, not 1000.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
Felix Fietkau
a6a172b292 ath9k_hw: fix gentimer callback without overflow handler
If a gentimer has both the trigger and the overflow bits set, only
mask out the trigger bit if an overflow handler is present.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
Wei Yongjun
f84d1b49c9 ath9k: fix sparse non static symbol warning
Fixes the following sparse warning:

drivers/net/wireless/ath/ath9k/spectral.c:500:24: warning:
 symbol 'rfs_spec_scan_cb' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
Wenliang Fan
1558efd0d4 drivers/net/wireless/hostap: Integer overflow
The local variable 'value' comes from 'extra', a parameter of function
'prism2_ioctl_priv_prism2_param'. If a large number passed to 'value',
there would be an integer overflow in the following line:
	local->passive_scan_timer.expires = jiffies +
		local->passive_scan_interval * HZ

Signed-off-by: Wenliang Fan <fanwlexca@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
John W. Linville
c3c5bb31ea Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2014-01-03 15:34:41 -05:00
John W. Linville
55d1cad2ef Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2014-01-03 15:25:15 -05:00
John W. Linville
ad86c55bac Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-01-01 15:39:56 -05:00
Fengguang Wu
14648d6534 iwlwifi: mvm: fix coccinelle warnings
drivers/net/wireless/iwlwifi/mvm/led.c:106:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:53 +02:00
Emmanuel Grumbach
51368bf792 iwlwifi: Update Copyright to 2014
Happy new year!

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:53 +02:00
Eyal Shapira
80e9e5cd26 iwlwifi: mvm: rs: fix a potential NULL deref
Found by klocwork analysis.
mvm could be NULL which may cause a NULL dereference
in a theoretical call flow

rs_fill_lq_cmd(mvm = NULL, ...)
rs_build_rates_table
rs_fill_rates_for_column
ucode_rate_from_rs_rate
IWL_ERR(mvm,...)

No real reason for passing NULL to rs_fill_lq_cmd so fix that.

Reported-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:52 +02:00
Ilan Peer
6e97b0d298 iwlwifi: mvm: dynamically update tsf_id
Currently, the MAC context tsf_id assignment and the master/slave
relations are determined only when a new vif is added, as part
of the MAC context resource allocation. However, at this stage, the
beacon interval is not known, and thus could not be taken into account
in the master-slave algorithm.

To fix this, recalculate the MAC context tsf_id assignment,
just before the MAC context is activated, i.e., just before
a station VMAC is configured to associated and before an AP
VMAC is started.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:51 +02:00
Ilan Peer
9f8f8ca580 iwlwifi: mvm: change the parameters for calculating an AP TBTT
Change the parameters for calculating an AP TBTT to 64/36 instead of
80/20, to increase the interval between a station vif and an AP
vif TBTT events.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:50 +02:00
Eran Harary
ce836c76da iwlwifi: pcie: Fix CSR_RESET operation access type
The access to the CSR_RESET reg should be done as a complete
DWORD and not by setting a bit. This is the right way to reset
the device.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:50 +02:00
Ilan Peer
12d423e816 iwlwifi: mvm: Add a missed beacons threshold
Instead of always calling ieee80211_beacon_loss() on every missed
beacons notification, call this function only if the number of
consecutive missed beacons from last rx is higher than a predefined
threshold.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:49 +02:00
Arik Nemtsov
2dceedaed6 iwlwifi: mvm: squash a spurious warning on chnctx change
If the channel min-width changes, we can update the PHY ctx, even if
it has multiple references.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:48 +02:00
Emmanuel Grumbach
d510342fee iwlwifi: mvm: dump to debugfs the SRAM as binary
This allows to format it at will using external tools.
Since different teams want it in different formats, dump
the raw data and everyone can play with the data the way
they want.

While at it - make this code slightly more robust by making
the required verification on the offsets / length in the
write handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:48 +02:00
Emmanuel Grumbach
d2ccc902da iwlwifi: mvm: BT Coex - update channel inihibition for channel 14
This channel inhibition for channel 14 was wrong. Fix it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:47 +02:00
Emmanuel Grumbach
9e898f1bd4 iwlwifi: mvm: fix harmless smatch / coccinelle warnings
Don't check if mvm->fw->cs is NULL since it can't be.
cs is an array member of iwl_fw, it can't be NULL.

Use memset(ptr, 0, sizeof(*ptr)); instead of
memset(ptr, 0, sizeof(struct ptr_type));

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:46 +02:00
Emmanuel Grumbach
aaa4e74110 iwlwifi: mvm: disable the device as soon as RFKILL fires
The firmware needs to be stopped quickly (100ms) after the
RFKILL interrupt fired. Failing to do so would allow the
firmware to access the radio registers which would lead to
a hardware error.

Before this change, we would kill the firmware only when
mac80211 stops the device which can take a fair amount of
time. Take a shortcut by stopping the device right away
in the interrupt.

This is not relevant if the current firmware is INIT
firmware since that firmware can run while in RFKILL.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:46 +02:00
Emmanuel Grumbach
fba1c62766 iwlwifi: pcie: allow the op_mode to call stop_device whenever it wants
Calling stop_device when start_fw wasn't called would issue:
Stopping tx queues that aren't allocated...

Also allow the op_mode to call stop_device and then to
disable the Tx queues - in that case just silently ignore
the disabling on the Tx queues, since the PRPH registers
aren't reachable any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:45 +02:00
Emmanuel Grumbach
3dc3374fce iwlwifi: pcie: don't update the op_mode if rfkill hasn't changed
This is useless and introduces a dependency between rfkill
and stop_device - the op_mode can't call stop_device from
the rfkill notification since it would lead to an endless
recursion.
Next patches will need to do so.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:44 +02:00
Emmanuel Grumbach
b943949105 iwlwifi: pcie: keep the NIC awake when commands are in flight
Under very specific circumstances, the firmware might
ignore a host command. This was debugged and we ended up
seeing that the power management hardware was faulty.
In order to workaround this issue, we keep the NIC awake
as long as we have host commands in flight. This will avoid
to put the hardware into buggy condition.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:43 +02:00
Eytan Lifshitz
a4a1247847 iwlwifi: mvm: fix possible memory leak
In case of invalid section_id, the function returns after
it aleready allocated memory. Fixed by change the order of actions.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:43 +02:00
Emmanuel Grumbach
3dd94794a9 iwlwifi: mvm: fix AC / FIFO mapping
The AC / fifo mapping was wrong - BE packets landed in VO
FIFO. The iwl_mvm_tx_fifo enumeration isn't in the same
order as ieee80211_ac_numbers enumeration.
Since the firmware relies on fifo / ac mapping - this led
to wrong behavior. E.g. the firmware sends beacon with the
same QoS parameters as VO, and it actually took the
parameters of BK. There are probably more severe issues.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 19:03:42 +02:00
Oren Givon
efc5520c42 iwlwifi: add new devices for 7265 series
Add new device / subdevice ID for 7265 series.
Fix 2 mistakes on the way.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-31 17:32:20 +02:00
dingtianhong
692e5167b4 wireless: slight optimization of addr compare
Use possibly more efficient ether_addr_equal or
ether_addr_equal_unaligned instead of memcmp.

Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
4f29739bb0 rtlwifi: slight optimization of addr compare
Use possibly more efficient ether_addr_equal_unaligned
instead of memcmp.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
fcad7668fb mwifiex: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Bing Zhao <bzhao@marvell.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
36325f3a9f ipw2x00: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
35df5388ac cw1200: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Solomon Peachy <pizza@shaftnet.org>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
d22fbd70c2 hostap: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Jouni Malinen <j@w1.fi>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
dingtianhong
c15975ac60 zd1211rw: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Daniel Drake <dsd@gentoo.org>
Cc: Ulrich Kunitz <kune@deine-taler.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:33 -05:00
Emmanuel Grumbach
51232f7e60 iwlwifi: pcie: use don't disable interrupt when rxq->lock is taken
This lock was never acquired in the primary interrupt
handler, but since it was acquired along with irq_lock
which had to disable interrupts, rxq->lock had to disable
interrupts too.
Now that trans_pcie->irq_lock isn't acquired in the primary
interrupt handler, rxq->lock can let interrupt enabled.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-21 21:23:06 +02:00
Emmanuel Grumbach
7b70bd63c6 iwlwifi: pcie: use don't disable interrupt when irq_lock is taken
Since we don't take this lock in the primary interrupt
handler, there is no pointin disabling the interrupt
in the critical section protected by trans_pcie->irq_lock.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-21 21:23:03 +02:00
Emmanuel Grumbach
7ba1faa45f iwlwifi: pcie: move interrupt prints to the common handler
Handling interrupt with no cause and printing logs doesn't
need to be ICT / non-ICT specific move this to the common
code.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-21 21:21:26 +02:00
Emmanuel Grumbach
fe523dc9e9 iwlwifi: pcie: no need to save inta in trans_pcie
This was useful when the handling was not in the same
context as the interrupt cause retrieval: we could have
several hard interrupts until the handler gets called.
Since we retrieve the interrupt cause in the handler itself,
there is no need to OR the interrupt causes.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-21 21:21:25 +02:00
Emmanuel Grumbach
7117c000c8 iwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict
These functions are meant to return an interrupt cause and
not an irqreturn_t.
We still return IRQ_HANDLED if we had an error and IRQ_NONE
if our device hasn't fired any interrupt.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-12-21 21:21:21 +02:00
Rashika Kheria
c503681355 drivers: net: Mark functions as static in debug.c
This patch marks the function il_clear_traffic_stats() in debug.c as
static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/debug.c:

drivers/net/wireless/iwlegacy/debug.c:35:1: warning: no previous prototype for ‘il_clear_traffic_stats’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-19 18:51:21 -05:00
Rashika Kheria
44468f5b97 drivers: net: Mark functions as static in 4965-debug.c
This patch marks the function il4965_ucode_rx_stats_read(),
il4965_ucode_tx_stats_read() and il4965_ucode_general_stats_read() in
4965-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/4965-debug.c:

drivers/net/wireless/iwlegacy/4965-debug.c:59:1: warning: no previous prototype for ‘il4965_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:471:1: warning: no previous prototype for ‘il4965_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:637:1: warning: no previous prototype for ‘il4965_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-19 18:51:21 -05:00
Rashika Kheria
9b0124d815 drivers: net: Mark functions as static in 3945-debug.c
This patch marks the function il3945_ucode_rx_stats_read(),
il3945_ucode_tx_stats_read() and il3945_ucode_general_stats_read() in
3945-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/3945-debug.c:

drivers/net/wireless/iwlegacy/3945-debug.c:52:1: warning: no previous prototype for ‘il3945_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:317:1: warning: no previous prototype for ‘il3945_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:407:1: warning: no previous prototype for ‘il3945_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-19 18:51:21 -05:00
Felix Fietkau
39731b78b4 ath9k: simplify/fix tx packet TID handling
mac80211 guarantees that skb->priority is set to the TID, so use it
instead of trying to parse the QoS header manually.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19 14:41:57 -05:00
Felix Fietkau
63ded3f059 ath9k: fix TSF offset precision issue
Dividing the beacon interval by ATH_BCBUF (8) truncates the result for
the default beacon interval of 100.
Fix the calculation by moving the division after conversion from TU to
microseconds.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19 14:41:56 -05:00
Felix Fietkau
c32e4e518f ath9k: call ath9k_set_tsfadjust from ath9k_beacon_config
Make that function and ath9k_allow_beacon_config static

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19 14:41:56 -05:00
Felix Fietkau
6a4d05dc0c ath9k: move ath9k_debug_sync_cause out of ath9k_hw
ath9k_hw should not depend on any ath9k data structures like ath_softc

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19 14:41:56 -05:00
Kyeyoon Park
fa9ffc7456 cfg80211: Add support for QoS mapping
This allows QoS mapping from external networks to be implemented as
defined in IEEE Std 802.11-2012, 10.24.9. APs can use this to advertise
DSCP ranges and exceptions for mapping frames to a specific UP over
Wi-Fi.

The payload of the QoS Map Set element (IEEE Std 802.11-2012, 8.4.2.97)
is sent to the driver through the new NL80211_ATTR_QOS_MAP attribute to
configure the local behavior either on the AP (based on local
configuration) or on a station (based on information received from the
AP).

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-12-19 16:29:22 +01:00
David S. Miller
143c905494 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/ethernet/intel/i40e/i40e_main.c
	drivers/net/macvtap.c

Both minor merge hassles, simple overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-18 16:42:06 -05:00
Sujith Manoharan
d7df7a55cb ath9k: Use a subroutine for the AR9330 reset WAR
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:51 -05:00
Sujith Manoharan
4dc78c437a ath9k: Fix RTC reset delay
The delay that is required after issuing a RTC reset
varies for each chip. Handle this properly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:49 -05:00
Sujith Manoharan
afe36533c1 ath9k: Add a delay between RTC reset/clear for AR9003
The small delay that is present between a RTC reset/clear
operation is required for the chip to settle and this is
needed for all chips, not just the AR9002 family.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:48 -05:00
Sujith Manoharan
3533bf6b15 ath9k: Fix regulatory compliance
To comply with ETSI regulations, make sure that
the CCA registers are programmed with the threshold
values from the EEPROM/Caldata. A new field is used
to indicate if the card has been calibrated with the
required threshold information.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:46 -05:00
Sujith Manoharan
ee65b38890 ath9k: Update BaseExtension_1 eeprom structure
* Add a new field "misc_enable"
* Use int_8 for tempslopextension.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:44 -05:00
Sujith Manoharan
66a80a3a3e ath9k: Initialize "switchcomspdt" eeprom field explicitly
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:42 -05:00
Sujith Manoharan
f5bf30db01 ath9k: Remove unneeded ref. count initialization
The interrupt reference counter is always initialized
in ath9k_start().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:41 -05:00
Sujith Manoharan
7b6ef9982d ath9k: Cleanup ath9k.h
* Remove unused macros.
* Move definitions to appropriate sections.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:39 -05:00
Sujith Manoharan
f65c082551 ath9k: Cleanup spectral scan code
* Move definitions to spectral.h
* Move processing/debug code to spectral.c

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:37 -05:00
Felix Fietkau
a35051ce17 ath9k: properly preserve TSF across reset
The beacon code previously reset TSF on every configuration call, as
some of the code was not prepared to properly calculate nexttbtt based
on current TSF.

This patch adds a common function for calculating nexttbtt and moves the
TSF reset to driver start.

This should improve AP mode compatibility with various stations that
expect the TSF to not randomly jump due to hardware resets.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:34 -05:00
Felix Fietkau
4ed15762dc ath9k_hw: clean up station beacon timer API
Remove unused fields, pass timer info in usec instead of TU.
Preparation for fixing nexttbtt calculation

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:32 -05:00
Felix Fietkau
c57b182b9f ath9k_hw: remove spur related unused defines
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:31 -05:00
Felix Fietkau
49685634c6 ath9k_hw: remove additional_swba_backoff
It is unused

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:29 -05:00
Felix Fietkau
ae0c40314a ath9k_hw: simplify spur channel handling
Remove ah->config.spurmode and ah->config.spurchans, always use EEPROM
data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:27 -05:00
Felix Fietkau
787e05360b ath9k_hw: remove ah->config.pcie_clock_req
It is unused

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:26 -05:00
Felix Fietkau
60c4bf2974 ath9k_hw: remove defunct ad-hoc mode ATIM window handling code
The hardware does not have support for ATIM processing, and the driver
does not set up ah->atim_window anywhere. Additionally, the code can
clobber the timer used by P2P powersave.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:24 -05:00
Felix Fietkau
c67ce33919 ath9k_hw: clean up generic timer code
- Use generic bitops instead of custom hackery
- Move interrupt enable/disable logic from ath9k to ath9k_hw
- Decouple ISR call from btcoex
- Make the overflow callback optional (to prevent IRQ storms)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:22 -05:00
Felix Fietkau
168c6f89a2 ath9k_hw: use a software timer for btcoex no_stomp_timer
TSF accuracy is not needed here, and there is only one usable generic
timer that is supported by all chips and uses the primary TSF counter.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:21 -05:00
Felix Fietkau
e45e91d881 ath9k: add support for reporting per-chain signal strength
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:19 -05:00
Felix Fietkau
f40c460827 ath9k_common: get rid of an unnecessary variable
There's no need to truncate curchan->hw_value to u8

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:17 -05:00
Rashika Kheria
c8aa5ab7d5 drivers: net: Mark functions as static in debug.c
This patch marks the function il_clear_traffic_stats() in debug.c as
static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/debug.c:

drivers/net/wireless/iwlegacy/debug.c:35:1: warning: no previous prototype for ‘il_clear_traffic_stats’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:16 -05:00
Rashika Kheria
0e06b090ff drivers: net: Mark functions as static in 4965-debug.c
This patch marks the function il4965_ucode_rx_stats_read(),
il4965_ucode_tx_stats_read() and il4965_ucode_general_stats_read() in
4965-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/4965-debug.c:

drivers/net/wireless/iwlegacy/4965-debug.c:59:1: warning: no previous prototype for ‘il4965_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:471:1: warning: no previous prototype for ‘il4965_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:637:1: warning: no previous prototype for ‘il4965_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:14 -05:00