GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
13 years agowl12xx: support FW TX inactivity triggers
Arik Nemtsov [Tue, 26 Apr 2011 20:21:51 +0000 (23:21 +0300)]
wl12xx: support FW TX inactivity triggers

In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.

In STA mode we register only for the MAX_TX_RETRY event. A TX failure is
interpreted as a loss of connection.

Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid
the inherent race condition of a mac80211 TX failure counter in addition
to the FW counter.

This patch depends on "mac80211: allow low level driver to report packet
loss"

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Use ps wrappers for btcoex logic.
Vivek Natarajan [Tue, 26 Apr 2011 05:09:55 +0000 (10:39 +0530)]
ath9k: Use ps wrappers for btcoex logic.

Use ps wrappers before accessing hw registers in btcoex.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Enable generic timer interrupt.
Vivek Natarajan [Tue, 26 Apr 2011 05:09:54 +0000 (10:39 +0530)]
ath9k_hw: Enable generic timer interrupt.

Generic timer interrupt was not triggered unless autosleep was
disabled. Since autosleep is enabled in the newer chipsets,
enable generic timer for using with bt coex logic.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Add support for btcoexistence in AR9300.
Vivek Natarajan [Tue, 26 Apr 2011 05:09:53 +0000 (10:39 +0530)]
ath9k_hw: Add support for btcoexistence in AR9300.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Move bt_stomp to hw from common.
Vivek Natarajan [Tue, 26 Apr 2011 05:09:52 +0000 (10:39 +0530)]
ath9k_hw: Move bt_stomp to hw from common.

Move bt_stomp to ath9k_hw and add its support for latest chipsets.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow low level drivers to report packet loss
Arik Nemtsov [Mon, 18 Apr 2011 11:22:28 +0000 (14:22 +0300)]
mac80211: allow low level drivers to report packet loss

Add API that allows low level drivers to notify mac80211 about TX
packet loss. This is useful when there are FW triggers to notify the
low level driver about these events.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: fix regresion on reg user timeout
Luis R. Rodriguez [Tue, 26 Apr 2011 01:35:48 +0000 (18:35 -0700)]
cfg80211: fix regresion on reg user timeout

The patch "cfg80211: add a timer for invalid user reg hints"
introduced a regression for the case where a secondary identical
regulatory hint from a user is sent. What would happen is the
second hint would schedule delayed work in to catch a timeout
but since we are never processing it given that the hint was already
applied we'd always hit the timeout and and restore regulatory
settings back to world regulatory domain. This is fixed by simply
avoiding sheduling work if the hint was already applied.

Tested-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: rtl8192cu: Fix most sparse warnings
Larry Finger [Mon, 25 Apr 2011 18:23:20 +0000 (13:23 -0500)]
rtlwifi: rtl8192ce: rtl8192cu: Fix most sparse warnings

Fix most sparse warnings in rtlwifi, rtl8192ce and rtl8192cu drivers.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: Change rtl8192ce routines phy and trx and modify rtl8192cu for...
Chaoming_Li [Mon, 25 Apr 2011 17:54:05 +0000 (12:54 -0500)]
rtlwifi: rtl8192ce: Change rtl8192ce routines phy and trx and modify rtl8192cu for addition of rtl8192se and rtl8192de

Change rtl8192ce routines phy and trx for addition of RTL8192SE and RTL8192DE.
In addition, make necessary modifications to rtl8192cu. This patch also
removes the temporary patches needed to enable intermediate steps to build
without error.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: Change phy and rc routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:54:00 +0000 (12:54 -0500)]
rtlwifi: rtl8192ce: Change phy and rc routines for addition of rtl8192se and rtl8192de

Change rtl8192ce routines phy and rc for addition of RTL8192SE and
RTL8192DE.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: Change sw and LED routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:55 +0000 (12:53 -0500)]
rtlwifi: rtl8192ce: Change sw and LED routines for addition of rtl8192se and rtl8192de

Change rtl8192ce sw and LED routines for addition of RTL8192SE and
RTL8192DE.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: Change hw routine for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:50 +0000 (12:53 -0500)]
rtlwifi: rtl8192ce: Change hw routine for addition of rtl8192se and rtl8192de

Change rtl8192ce hw routine for addition of RTL8192SE and RTL8192DE.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192c-common: Change common PHY routines for addition of rtl8192se and...
Chaoming_Li [Mon, 25 Apr 2011 17:53:45 +0000 (12:53 -0500)]
rtlwifi: rtl8192c-common: Change common PHY routines for addition of rtl8192se and rtl8192de

Change common PHY routines for addition of RTL8192SE and RTL8192DE code.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192c-common: Change common firmware routines for addition of rtl8192se...
Chaoming_Li [Mon, 25 Apr 2011 17:53:40 +0000 (12:53 -0500)]
rtlwifi: rtl8192c-common: Change common firmware routines for addition of rtl8192se and rtl8192de

Change common firmware routines for addition of RTL8192SE and
RTL8192DE code.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192c-common: Convert common dynamic management routines for addition...
Chaoming_Li [Mon, 25 Apr 2011 17:53:35 +0000 (12:53 -0500)]
rtlwifi: rtl8192c-common: Convert common dynamic management routines for addition of rtl8192se and rtl8192de

Convert common dynamic management routines for addition of RTL8192SE
and RTL8192DE code.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert usb routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:29 +0000 (12:53 -0500)]
rtlwifi: Convert usb routines for addition of rtl8192se and rtl8192de

Convert usb routines for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert regulatory domain routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:24 +0000 (12:53 -0500)]
rtlwifi: Convert regulatory domain routines for addition of rtl8192se and rtl8192de

Convert regulatory domain  routines for addition of RTL8192SE and
RTL8192DE code.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert rc routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:19 +0000 (12:53 -0500)]
rtlwifi: Convert rc routines for addition of rtl8192se and rtl8192de

Convert rc routines for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert ps routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:53:14 +0000 (12:53 -0500)]
rtlwifi: Convert ps routines for addition of rtl8192se and rtl8192de

Convert ps routines for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert pci routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 18:23:15 +0000 (13:23 -0500)]
rtlwifi: Convert pci routines for addition of rtl8192se and rtl8192de

Convert pci routines for addition of RTL8192SE and RTL8192DE code
These changes allow the upper-level driver to specify the BAR to be
used as it is different for rtl8192se than for the others.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Convert core routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 18:23:10 +0000 (13:23 -0500)]
rtlwifi: Convert core routines for addition of rtl8192se and rtl8192de

Convert core routines for addition of RTL8192SE and RTL8192DE code.

Additional files are changed to allow compilation.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Change cam routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 18:23:05 +0000 (13:23 -0500)]
rtlwifi: Change cam routines for addition of rtl8192se and rtl8192de

Change cam routines for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Change base routines for addition of rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:52:54 +0000 (12:52 -0500)]
rtlwifi: Change base routines for addition of rtl8192se and rtl8192de

Change base routines for addition of RTL8192SE and RTL8192DE code.

Additional files are modified to allow compilation.

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Change wifi.h for rtl8192se and rtl8192de
Chaoming_Li [Mon, 25 Apr 2011 17:52:49 +0000 (12:52 -0500)]
rtlwifi: Change wifi.h for rtl8192se and rtl8192de

Change wifi.h for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Change efuse routines addition of RTL8192SE and RTL8192DE
Chaoming_Li [Mon, 25 Apr 2011 17:52:44 +0000 (12:52 -0500)]
rtlwifi: Change efuse routines addition of RTL8192SE and RTL8192DE

Change efuse routines for addition of RTL8192SE and RTL8192DE code

Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Fix warnings due to -Wunused-but-set-variable
Rajkumar Manoharan [Mon, 25 Apr 2011 10:26:17 +0000 (15:56 +0530)]
mac80211: Fix warnings due to -Wunused-but-set-variable

These warnings are exposed by gcc 4.6.
net/mac80211/sta_info.c: In function 'sta_info_cleanup_expire_buffered':
net/mac80211/sta_info.c:590:32: warning: variable 'sdata' set but not used
net/mac80211/ibss.c: In function 'ieee80211_rx_mgmt_auth_ibss':
net/mac80211/ibss.c:43:34: warning: variable 'status_code' set but not used
net/mac80211/work.c: In function 'ieee80211_send_assoc':
net/mac80211/work.c:203:9: warning: variable 'len' set but not used
net/mac80211/tx.c: In function '__ieee80211_parse_tx_radiotap':
net/mac80211/tx.c:1039:35: warning: variable 'sband' set but not used
net/mac80211/mesh.c: In function 'ieee80211_mesh_rx_queued_mgmt':
net/mac80211/mesh.c:616:28: warning: variable 'ifmsh' set but not used
 ...

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix too early reorder release timer
Christian Lamparter [Sun, 24 Apr 2011 18:41:16 +0000 (20:41 +0200)]
mac80211: fix too early reorder release timer

The release timer has to expire "just" after a
frame is up for release. Currently, if the timer
callback starts on time, the "!time_after" check
above will start a new timer instead of
releasing the frames.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: improve unicast PS buffering
Christian Lamparter [Sun, 24 Apr 2011 15:44:19 +0000 (17:44 +0200)]
carl9170: improve unicast PS buffering

Using the ieee80211_sta_block allows the PS code
to handle awake->doze->awake transitions of our
clients in a race-free manner.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54: implement multicast filter
Christian Lamparter [Sun, 24 Apr 2011 15:22:59 +0000 (17:22 +0200)]
p54: implement multicast filter

"For best CPU usage and power consumption, having as few
frames as possible percolate through the stack is
desirable. Hence, the hardware should filter as much
as possible."

Note: Not all firmwares include the multicast filter
feature and the stack does not filter them either.
The ARP filter on the other hand was dropped from the
patch since it does not work correctly:

Quote from: Max Filippov <jcmvbkbc@gmail.com>
<http://www.spinics.net/lists/linux-wireless/msg67466.html>
"In the ARP case, when there's no other traffic on p54spi,
all ARP requests are dropped. But if there's some egress
traffic from p54spi, filter seems to work correctly:
only ARP requests that match filter pass through.

In the multicast case filter seems to work correctly, but
it treats broadcast as subject to that filtering too. By
default only 01:00:5e:00:00:01 gets into priv->mc_maclist,
so we miss all broadcasts.

These two filters seem to interfere:
- if we set ARP filter and multicast filter without bc
=>  we miss all ARPs if there's no egress traffic;
- if we set ARP filter and multicast filter with bc or
don't set mc filter at all => we get all ARPs.

This effect does not depend on filter setup order."

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agossb: update reject bit for Target State Low
Rafał Miłecki [Sat, 23 Apr 2011 17:30:29 +0000 (19:30 +0200)]
ssb: update reject bit for Target State Low

My 14e4:4315 is SSB_IDLOW_SSBREV_26:
read32 0xfaafcff8 -> 0x600422d5
My 14e4:4328 is SSB_IDLOW_SSBREV_24:
read32 0xfaafcff8 -> 0x400422c5
My 14e4:432b is SSB_IDLOW_SSBREV_26 again:
read32 0xfaafcff8 -> 0x600422d5

For all of them wl driver is using 0x2 reject bit:
write32(0xf98) <- 0x00010002
So it seems SSB 2.3 is the exception using another bit.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agossb: mark bus as powered up earlier
Rafał Miłecki [Sat, 23 Apr 2011 17:30:28 +0000 (19:30 +0200)]
ssb: mark bus as powered up earlier

ssb_chipco_set_clockmode may want to touch CC registers to control power of the
bus. However touching registers without powered_up set causes warnings.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix AR9160 xpaBiasLvlFreq endianness handling
Adrian Chadd [Sat, 23 Apr 2011 04:48:53 +0000 (12:48 +0800)]
ath9k: fix AR9160 xpaBiasLvlFreq endianness handling

The xpaBiasLvlFreq parameter array is made up of 16 bit words which
aren't byte-swapped like the other 16-bit eeprom parameters are.
It's only used by the AR9160.

Signed-off-by: Adrian Chadd <adrian@freebsd.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: set beacon related ps flags on bss_info change
Rajkumar Manoharan [Fri, 22 Apr 2011 09:20:39 +0000 (14:50 +0530)]
ath9k: set beacon related ps flags on bss_info change

Requesting beacon sync up to configure beacon timers properly
in hw, has be done after doing beacon config with default values.
Setting the flags in beacon config is causing the device to not
enter into network sleep on idle state.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix Tx IQ Calibration hang issue in AR9003 chips
Rajkumar Manoharan [Sun, 24 Apr 2011 16:04:39 +0000 (21:34 +0530)]
ath9k_hw: Fix Tx IQ Calibration hang issue in AR9003 chips

On AR9003 chips, doing three IQ calibrations will possibly cause chip
in stuck state. In noisy environment, chip could receive
a packet during the middle of three calibrations and it causes
the conflict of HW access and the eventual failure. It also
causes IQ calibration outliers which results in poor Tx EVM.

The IQ Cal procedure is after resetting the chip, run IQ cal 3 times
per each cal cycle and find the two closest readings and average of two.
The advantage of running Tx IQ cal more than once is that we can compare
calibration results for the same gain setting over multiple iterations.
Most of the cases the IQ failures were observed after first pass.

For the AR9485 and later chips, Tx IQ Calibration is performed along
with AGC cal. But for pre-AR9485 chips, Tx IQ cal HW has to be separated
from the rest of calibration HW to avoid chip hang. After all
calibrations are done in HW, we can start SW post-processing.
By doing this way, we minimize the SW difference among all chips.

The order of calibration (run IQ cal before other calibration) is also
needed to avoid chip hang for chips before AR9485. This issue was
originally observed with AR9382.

During the issue kernel log was filled with following message
ath: timeout (100000 us) on reg 0xa640: 0x00000001 & 0x00000001 != 0x00000000
ath: timeout (100000 us) on reg 0xa2c4: 0x00158dd9 & 0x00000001 != 0x00000000
ath: Unable to reset channel (2412 MHz), reset status -5
ath: Unable to set channel

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Tue, 26 Apr 2011 19:39:10 +0000 (15:39 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agossb: cc: clear GPIOPULL registers on init
Rafał Miłecki [Sun, 24 Apr 2011 09:04:19 +0000 (11:04 +0200)]
ssb: cc: clear GPIOPULL registers on init

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Add TSFOOR interrupt stats in debug info
Mohammed Shafi Shajakhan [Fri, 22 Apr 2011 11:57:01 +0000 (17:27 +0530)]
ath9k: Add TSFOOR interrupt stats in debug info

This helped the developers to fix an issue of chip not entering network
sleep during idle state, previously this was only available as a debug
message

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove the unlikely check for autosleep
Mohammed Shafi Shajakhan [Fri, 22 Apr 2011 07:42:23 +0000 (13:12 +0530)]
ath9k: remove the unlikely check for autosleep

newer chipsets support auto sleep feature, so remove the
unlikely check which does not seems to help anything

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Add power save wrappers and modularize hw_pll handler
Senthil Balasubramanian [Fri, 22 Apr 2011 06:02:12 +0000 (11:32 +0530)]
ath9k: Add power save wrappers and modularize hw_pll handler

We should protect hw_pll handler with power save wrappers and
also modularize hw_pll handler properly for better readability.

Also add a debug message to track chip resets on pll hang condition.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: cleanup hw pll work handler
Senthil Balasubramanian [Fri, 22 Apr 2011 06:02:11 +0000 (11:32 +0530)]
ath9k: cleanup hw pll work handler

There is no reason why pll work handler should be part of xmit
file. move it to main.c so that reading hw check routines are
all in the same place.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: optimize the usage of power save wrappers.
Senthil Balasubramanian [Fri, 22 Apr 2011 06:02:10 +0000 (11:32 +0530)]
ath9k: optimize the usage of power save wrappers.

We need not wake up the chip even before mutex lock is acquired and also
that it is required only if we are going to drain the txq. So place the
wrappers accordingly and this change is also useful when there are no
pending frames in the txq as we do not wake up the chip unnecessarily.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix incorrect baseband PLL phase shift for AR9485
Senthil Balasubramanian [Fri, 22 Apr 2011 06:02:09 +0000 (11:32 +0530)]
ath9k_hw: Fix incorrect baseband PLL phase shift for AR9485

we should program the AR9485 baseband PLL phase shift to 6 and
a redundant setting overwrites the correct value. Remove the
incorrect and unwnated register setting.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix LED gpio for AR93xx chipsets.
Senthil Balasubramanian [Fri, 22 Apr 2011 06:02:08 +0000 (11:32 +0530)]
ath9k: Fix LED gpio for AR93xx chipsets.

The LED gpio is incorrectly programmed for AR9300 and so the led
is not working propelry. AR93xx uses gpio 10 for LED and not the
default.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: module_param to disable HT40 in 2.4GHz band
Amitkumar Karwar [Thu, 21 Apr 2011 21:10:27 +0000 (14:10 -0700)]
cfg80211: module_param to disable HT40 in 2.4GHz band

Currently mac80211 uses ieee80211_disable_40mhz_24ghz module
parameter to allow disabling 40MHz operation in the 2.4GHz band.
Move this handling from mac80211 to cfg80211 so that the feature
will be more generic.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix warning: symbol 'ath9k_platform_id_table' was not declared. Should it...
Vasanthakumar Thiagarajan [Thu, 21 Apr 2011 13:03:28 +0000 (18:33 +0530)]
ath9k: Fix warning: symbol 'ath9k_platform_id_table' was not declared. Should it be static?

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix bug in configuring hw timer
Vasanthakumar Thiagarajan [Thu, 21 Apr 2011 13:03:27 +0000 (18:33 +0530)]
ath9k: Fix bug in configuring hw timer

Hw next tigger time is configured as current_tsf + (timer_period * 10) which
is wrong, it should be current_tsf + timer_period. The wrong hw timer configuration
would cause btcoex related issues.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: tear down BA sessions properly on suspend
Johannes Berg [Thu, 21 Apr 2011 11:38:00 +0000 (13:38 +0200)]
mac80211: tear down BA sessions properly on suspend

Currently, the code to tear down BA sessions will
execute after queues are stopped, but attempt to
send frames, so those frames will just get queued,
which isn't intended. Move this code to before to
tear down the sessions properly.

Additionally, after stopping queues, flush the TX
queues in the driver driver to make sure all the
frames went out.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: Enable life time expiry for tx packets in the hardware
Nishant Sarmukadam [Thu, 21 Apr 2011 11:04:59 +0000 (16:34 +0530)]
mwl8k: Enable life time expiry for tx packets in the hardware

Tell the firmware to enable the life time expiry of tx packets
in the hardware. The hardware will now refer to the timestamp
in every tx packet and decide whether the packet needs to be
dropped or transmitted.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: Reserve buffers for tx management frames
Nishant Sarmukadam [Thu, 21 Apr 2011 11:04:58 +0000 (16:34 +0530)]
mwl8k: Reserve buffers for tx management frames

Since queues are not stopped anymore, management frames would be
dropped if the corresponding tx queue is full.
This can cause issues say when we want to setup an ampdu stream and
action frames i.e addba requests keep getting dropped frequently.
Fix this by reserving some buffers to allow management frames to
go through in queue full conditions.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: Add timestamp information for tx packets
Pradeep Nemavat [Thu, 21 Apr 2011 11:04:57 +0000 (16:34 +0530)]
mwl8k: Add timestamp information for tx packets

Timestamp tx packets using a HW micro-second timer.
This timestamp will be compared to the current timestamp
in the hardware and if the difference is greater than 500ms,
the packet will be dropped.

Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: Do not stop tx queues
Pradeep Nemavat [Thu, 21 Apr 2011 11:04:56 +0000 (16:34 +0530)]
mwl8k: Do not stop tx queues

This is in preparation to support life time expiry of packets in the
hardware to avoid head-of-line blocking where a slow client can
hog a tx queue and affect the traffic to a faster client from the same
queue. Time stamp the packets in driver to allow dropping them in the
hardware if they are queued for more than 500ms.

If queues are stopped, packets will be queued up outside the driver.
Since we will be able to timestamp the packets only after they hit the
driver, the timestamp will be less accurate since we cannot consider
the time the packets spent in queues outside the driver. With this commit,
to achieve accurate timestamping, the tx queues will not be stopped in
normal conditions. The only scenarios where the queues will be stopped are
when firmware commands are executing or if the interface is brought down.
Now, we need to be prepared for a situation where packets hit the driver
even after the tx queues are full. Drop all such packets in the driver itself.

Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix possible data overwrite in hcmd callback
Stanislaw Gruszka [Wed, 20 Apr 2011 14:02:58 +0000 (16:02 +0200)]
iwlwifi: fix possible data overwrite in hcmd callback

My commit 3598e1774c94e55c71b585340e7dc4538f310e3f
"iwlwifi: fix enqueue hcmd race conditions" move hcmd callback after
command queue reclaim, to avoid call it with hcmd_lock. But since
queue read index was updated, cmd data can be overwritten. Fix problem
by calling callback before taking hcmd_lock and queue reclaim.

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>
13 years agossb: cc: add & fix defines
Rafał Miłecki [Wed, 20 Apr 2011 09:12:30 +0000 (11:12 +0200)]
ssb: cc: add & fix defines

We probably got false positive results for checking PLL being down.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Remove unused macros and structures
Sujith Manoharan [Wed, 20 Apr 2011 05:31:25 +0000 (11:01 +0530)]
ath9k_htc: Remove unused macros and structures

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Use power save wrappers when accessing HW
Sujith Manoharan [Wed, 20 Apr 2011 05:31:10 +0000 (11:01 +0530)]
ath9k_htc: Use power save wrappers when accessing HW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix max A-MPDU size handling
Sujith Manoharan [Wed, 20 Apr 2011 05:31:00 +0000 (11:01 +0530)]
ath9k_htc: Fix max A-MPDU size handling

Set the maximum ampdu size of a station correctly
in the target by using the ampdu_factor.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix AMPDU subframe handling
Sujith Manoharan [Wed, 20 Apr 2011 09:03:28 +0000 (14:33 +0530)]
ath9k_htc: Fix AMPDU subframe handling

* Register the driver's maximum ampdu subframe limit to mac80211.
* Cleanup the target capabilities structure and fix an endian issue.
* Fix BTCOEX by sending a command to the target when the BT priority
  changes.
* Bump the required firmware version to 1.1

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix warnings from -Wunused-but-set-variable
Sujith Manoharan [Wed, 20 Apr 2011 05:30:34 +0000 (11:00 +0530)]
ath9k: Fix warnings from -Wunused-but-set-variable

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agossb: cc: use correct min_msk for 0x4312
Rafał Miłecki [Tue, 19 Apr 2011 20:40:23 +0000 (22:40 +0200)]
ssb: cc: use correct min_msk for 0x4312

Default min_msk on my 0x4312 is 0x80000CBB, not 0xCBB. Now we follow
specs and wl (noticed in MMIO dumps).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agossb: pci: trivial: correct amount of maximum retries
Rafał Miłecki [Tue, 19 Apr 2011 20:40:22 +0000 (22:40 +0200)]
ssb: pci: trivial: correct amount of maximum retries

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Enable AR9340 support
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:20 +0000 (19:29 +0530)]
ath9k_hw: Enable AR9340 support

AR9340 is a AR9003 family built-in 2x2 wmac of ar934x SOCs. It is single band
in ar9341 SOC and dual band in ar9344/ar9342 SOCs.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Disable INTR_HOST1_FATAL to avoid interrupt strom with ar9430
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:19 +0000 (19:29 +0530)]
ath9k_hw: Disable INTR_HOST1_FATAL to avoid interrupt strom with ar9430

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Assign macversion based on devid for built-in wmac
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:18 +0000 (19:29 +0530)]
ath9k_hw: Assign macversion based on devid for built-in wmac

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Add AR9340 platform id to id table
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:17 +0000 (19:29 +0530)]
ath9k: Add AR9340 platform id to id table

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Read iq calibration data only for active chains
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:16 +0000 (19:29 +0530)]
ath9k_hw: Read iq calibration data only for active chains

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Configure chain switch table and attenuation control only for active chains
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:15 +0000 (19:29 +0530)]
ath9k_hw: Configure chain switch table and attenuation control only for active chains

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Enable byte Tx/Rx data swap for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:14 +0000 (19:29 +0530)]
ath9k_hw: Enable byte Tx/Rx data swap for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Configure tuning capacitance value for AR9340 as well
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:13 +0000 (19:29 +0530)]
ath9k_hw: Configure tuning capacitance value for AR9340 as well

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Skip internal regulator configuration for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:12 +0000 (19:29 +0530)]
ath9k_hw: Skip internal regulator configuration for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Don't configure AR_CH0_THERM for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:11 +0000 (19:29 +0530)]
ath9k_hw: Don't configure AR_CH0_THERM for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix register offset AR_PHY_65NM_CH0_THERM for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:10 +0000 (19:29 +0530)]
ath9k_hw: Fix register offset AR_PHY_65NM_CH0_THERM for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Clean up rx/tx chain configuration before AGC/IQ cal
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:09 +0000 (19:29 +0530)]
ath9k_hw: Clean up rx/tx chain configuration before AGC/IQ cal

Use hw supported chains instead of hard coded values.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Configure RF channel freqency for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:08 +0000 (19:29 +0530)]
ath9k_hw: Configure RF channel freqency for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Read spur frequency information from eeprom for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:07 +0000 (19:29 +0530)]
ath9k_hw: Read spur frequency information from eeprom for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Initialize tx and rx gain table from initvals.h for ar9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:06 +0000 (19:29 +0530)]
ath9k_hw: Initialize tx and rx gain table from initvals.h for ar9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Don't do ani initialization for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:05 +0000 (19:29 +0530)]
ath9k_hw: Don't do ani initialization for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Initialize mode registers from initvals.h for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:04 +0000 (19:29 +0530)]
ath9k_hw: Initialize mode registers from initvals.h for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Add initvals.h for ar9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:03 +0000 (19:29 +0530)]
ath9k_hw: Add initvals.h for ar9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Configure pll control register accordingly for AR9340
Vasanthakumar Thiagarajan [Wed, 20 Apr 2011 04:56:15 +0000 (10:26 +0530)]
ath9k_hw: Configure pll control register accordingly for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Get AHB clock information from ath9k_platform_data
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:01 +0000 (19:29 +0530)]
ath9k_hw: Get AHB clock information from ath9k_platform_data

Add a bool in ath9k_platform_data to pass AHB clock speed information.
Driver needs this to configure PLL on some SOCs.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Take care of few host interface register changes for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:59:00 +0000 (19:29 +0530)]
ath9k_hw: Take care of few host interface register changes for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Define devid and mac version for AR9340
Vasanthakumar Thiagarajan [Tue, 19 Apr 2011 13:58:59 +0000 (19:28 +0530)]
ath9k_hw: Define devid and mac version for AR9340

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Mon, 25 Apr 2011 18:42:51 +0000 (14:42 -0400)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Mon, 25 Apr 2011 18:36:35 +0000 (14:36 -0400)]
Merge branch 'for-linville' of git://git./linux/kernel/git/luca/wl12xx

13 years agoiwlagn: remove hw_ready variable
Johannes Berg [Wed, 13 Apr 2011 10:14:52 +0000 (03:14 -0700)]
iwlagn: remove hw_ready variable

This variable is only ever checked right after
the function that sets it, but the same function
will also return the status, so we can pass it
through instead of checking hw_ready later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: combine firmware code/data
Johannes Berg [Sat, 16 Apr 2011 15:29:24 +0000 (08:29 -0700)]
iwlagn: combine firmware code/data

On new hardware, ucode images always come in
pairs: code and data. Therefore, combine the
variables into an appropriate struct and use
that when both code and data are needed.

Also, combine allocation and copying so that
we have less code in total.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: implement synchronous firmware load
Johannes Berg [Fri, 22 Apr 2011 17:15:23 +0000 (10:15 -0700)]
iwlagn: implement synchronous firmware load

The current firmware loading mechanism in
iwlwifi is very hard to follow, and thus
hard to maintain. To make it easier, make
the firmware loading synchronous.

For now, as a side effect, this removes a
number of retry possibilities we had. It
isn't typical for this to fail, but if it
does happen we restart from scratch which
this also makes easier to do should it be
necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: leave notification waits on firmware errors
Johannes Berg [Wed, 13 Apr 2011 10:14:49 +0000 (03:14 -0700)]
iwlagn: leave notification waits on firmware errors

When the firmware encounters an error while the
driver is waiting for a notification, it will
never get that notification. Therefore, instead
of timing out, bail out on errors when waiting
for notifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: make iwlagn_wait_notification return error code
Johannes Berg [Wed, 13 Apr 2011 10:14:48 +0000 (03:14 -0700)]
iwlagn: make iwlagn_wait_notification return error code

We're unlikely to care about the actual time spent
waiting, so make the function return an error code
which is less error prone in coding new uses.

Also, while at it, mark __must_check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: extend notification wait function
Johannes Berg [Wed, 13 Apr 2011 10:14:47 +0000 (03:14 -0700)]
iwlagn: extend notification wait function

A notification wait function is called with the
command, but currently has no way of passing
data back to the caller -- fix that by adding a
void pointer to the function that can be used
between the caller and the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: refactor up path
Johannes Berg [Wed, 13 Apr 2011 10:14:46 +0000 (03:14 -0700)]
iwlagn: refactor up path

Starting the device consists of many things,
refactor out enabling the hardware and also
return -ERFKILL when the rfkill signal is
found to be asserted (which makes more sense
anyway, but is also required now to make the
__iwl_up function return right away.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: refactor down path
Johannes Berg [Wed, 13 Apr 2011 10:14:45 +0000 (03:14 -0700)]
iwlagn: refactor down path

The iwl_down path really consists of multiple things,
refactor out the hardware resetting (including, of
course, related software state like irqs).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: clean up some exit code
Johannes Berg [Wed, 13 Apr 2011 10:14:44 +0000 (03:14 -0700)]
iwlagn: clean up some exit code

There's no point in running through iwl_down()
when we never registered with mac80211, as it
just cleans up internal structures that were
never initialised in this case. Therefore we
can also remove the special handling for this
case from __iwl_down().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: simplify error table reading
Johannes Berg [Wed, 13 Apr 2011 10:14:43 +0000 (03:14 -0700)]
iwlagn: simplify error table reading

The current code to read the error table header
just hardcodes all the offsets, which is a bit
hard to understand. We can read in the entire
header (as much as we need) into a structure,
and then take the data from there, which makes
it easier to understand. To read a bigger blob
we also don't need to grab NIC access for each
word read, making the code more efficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwl4965: fix skb usage after free
Stanislaw Gruszka [Wed, 20 Apr 2011 14:01:46 +0000 (16:01 +0200)]
iwl4965: fix skb usage after free

Since

commit a120e912eb51e347f36c71b60a1d13af74d30e83
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Fri Feb 19 15:47:33 2010 -0800

    iwlwifi: sanity check before counting number of tfds can be free

we use skb->data after calling ieee80211_tx_status_irqsafe(), which
could free skb instantly.

On current kernels I do not observe practical problems related with
bug, but on 2.6.35.y it cause random system hangs when stressing
wireless link, making bisection of other problems impossible.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix skb usage after free
Stanislaw Gruszka [Wed, 20 Apr 2011 13:57:14 +0000 (15:57 +0200)]
iwlwifi: fix skb usage after free

Since

commit a120e912eb51e347f36c71b60a1d13af74d30e83
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Fri Feb 19 15:47:33 2010 -0800

    iwlwifi: sanity check before counting number of tfds can be free

we use skb->data after calling ieee80211_tx_status_irqsafe(), which
could free skb instantly.

On current kernels I do not observe practical problems related with
bug, but on 2.6.35.y it cause random system hangs when stressing
wireless link.

Cc: stable@kernel.org # 2.6.32+
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>
13 years agomac80211: fix SMPS debugfs locking
Johannes Berg [Tue, 19 Apr 2011 18:44:04 +0000 (20:44 +0200)]
mac80211: fix SMPS debugfs locking

The locking with SMPS requests means that the
debugs file should lock the mgd mutex, not the
iflist mutex. Calls to __ieee80211_request_smps()
need to hold that mutex, so add an assertion.

This has always been wrong, but for some reason
never been noticed, probably because the locking
error only happens while unassociated.

Cc: stable@kernel.org [2.6.34+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
John W. Linville [Wed, 20 Apr 2011 19:56:44 +0000 (15:56 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-2.6

13 years agomac80211: explain padding in place of rate field
Johannes Berg [Mon, 18 Apr 2011 15:05:21 +0000 (17:05 +0200)]
mac80211: explain padding in place of rate field

Apparently this was confusing still ... add a
note that the byte is needed as padding.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Implement get_antenna and set_antenna callback functions
Ivo van Doorn [Mon, 18 Apr 2011 13:35:12 +0000 (15:35 +0200)]
rt2x00: Implement get_antenna and set_antenna callback functions

Implement the get_antenna and set_antenna callback functions, which will
allow clients to control the antenna for all non-11n hardware (Antenna handling
in rt2800 is still a bit magical, so we can't use the set_antenna for those drivers
yet).

To best support the set_antenna callback some modifications are needed in the
diversity handling. We should never look at the default antenna settings to determine
if software diversity is enabled. Instead we should set the diversity flag when
possible, which will allow the link_tuner to automatically pick up the tuning.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>