GitHub/moto-9609/android_kernel_motorola_exynos9610.git
13 years agoray_cs: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:59 +0000 (18:38 -0800)]
ray_cs: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
  42607    3581    8536   54724    d5c4 drivers/net/wireless/ray_cs.o.new
  42603    3585    8536   54724    d5c4 drivers/net/wireless/ray_cs.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:58 +0000 (18:38 -0800)]
libertas: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
   3650      56     704    4410    113a drivers/net/wireless/libertas/rx.o.new
   3695      56     704    4455    1167 drivers/net/wireless/libertas/rx.o.old
  27328     964    5240   33532    82fc drivers/net/wireless/libertas/cfg.o.new
  27328     964    5240   33532    82fc drivers/net/wireless/libertas/cfg.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:57 +0000 (18:38 -0800)]
iwlwifi: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
  48644      57   12120   60821    ed95 drivers/net/wireless/b43/phy_n.o.new
  48661      57   12120   60838    eda6 drivers/net/wireless/b43/phy_n.o.old
  37906      86    7904   45896    b348 drivers/net/wireless/iwlwifi/iwl-agn-lib.o.new
  37937      86    7904   45927    b367 drivers/net/wireless/iwlwifi/iwl-agn-lib.o.old
  37781     523    6752   45056    b000 drivers/net/wireless/iwlwifi/iwl-3945.o.new
  37781     523    6752   45056    b000 drivers/net/wireless/iwlwifi/iwl-3945.o.old

Changed b43_nphy_write_clip_detection to take a const u16 *

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:56 +0000 (18:38 -0800)]
b43: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
   5502      56    1336    6894    1aee drivers/net/wireless/b43/phy_common.o.new
   5511      56    1336    6903    1af7 drivers/net/wireless/b43/phy_common.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoatmel: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:55 +0000 (18:38 -0800)]
atmel: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
  42578     720    8528   51826    ca72 drivers/net/wireless/atmel.o.old
  42578     720    8528   51826    ca72 drivers/net/wireless/atmel.o.new

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:54 +0000 (18:38 -0800)]
carl9170: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
   1897      56     672    2625     a41 drivers/net/wireless/ath/carl9170/cmd.o.new
   1897      56     672    2625     a41 drivers/net/wireless/ath/carl9170/cmd.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:53 +0000 (18:38 -0800)]
ath9k: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
  11161      56    2136   13353    3429 drivers/net/wireless/ath/ath9k/ar9003_paprd.o.new
  11167      56    2136   13359    342f drivers/net/wireless/ath/ath9k/ar9003_paprd.o.old
  15428      56    3056   18540    486c drivers/net/wireless/ath/ath9k/eeprom_4k.o.old
  15451      56    3056   18563    4883 drivers/net/wireless/ath/ath9k/eeprom_4k.o.new
  14087      56    2560   16703    413f drivers/net/wireless/ath/ath9k/eeprom_9287.o.old
  14036      56    2560   16652    410c drivers/net/wireless/ath/ath9k/eeprom_9287.o.new
  10041      56    2384   12481    30c1 drivers/net/wireless/ath/ath9k/ani.o.new
  10088      56    2384   12528    30f0 drivers/net/wireless/ath/ath9k/ani.o.old
   9316    1580    2304   13200    3390 drivers/net/wireless/ath/ath9k/htc_drv_init.o.new
   9316    1580    2304   13200    3390 drivers/net/wireless/ath/ath9k/htc_drv_init.o.old
  16483      56    3432   19971    4e03 drivers/net/wireless/ath/ath9k/ar9003_phy.o.new
  16517      56    3432   20005    4e25 drivers/net/wireless/ath/ath9k/ar9003_phy.o.old
  18221     104    2960   21285    5325 drivers/net/wireless/ath/ath9k/rc.o.old
  18203     104    2960   21267    5313 drivers/net/wireless/ath/ath9k/rc.o.new
  19985      56    4288   24329    5f09 drivers/net/wireless/ath/ath9k/eeprom_def.o.new
  20040      56    4288   24384    5f40 drivers/net/wireless/ath/ath9k/eeprom_def.o.old
  23997      56    4984   29037    716d drivers/net/wireless/ath/ath9k/ar5008_phy.o.old
  23846      56    4984   28886    70d6 drivers/net/wireless/ath/ath9k/ar5008_phy.o.new
  24285      56    3184   27525    6b85 drivers/net/wireless/ath/ath9k/ar9003_eeprom.o.old
  24101      56    3184   27341    6acd drivers/net/wireless/ath/ath9k/ar9003_eeprom.o.new
   6834      56    1032    7922    1ef2 drivers/net/wireless/ath/ath9k/ar9002_phy.o.old
   6780      56    1032    7868    1ebc drivers/net/wireless/ath/ath9k/ar9002_phy.o.new
  36211      64    8624   44899    af63 drivers/net/wireless/ath/ath9k/hw.o.new
  36401      64    8624   45089    b021 drivers/net/wireless/ath/ath9k/hw.o.old
   9281      56    1496   10833    2a51 drivers/net/wireless/ath/ath9k/ar9003_calib.o.old
   9150      56    1496   10702    29ce drivers/net/wireless/ath/ath9k/ar9003_calib.o.new

Use ARRAY_SIZE instead of a magic number.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use static const
Joe Perches [Sun, 21 Nov 2010 02:38:52 +0000 (18:38 -0800)]
ath5k: Use static const

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text    data     bss     dec     hex filename
  11266      56    2464   13786    35da drivers/net/wireless/ath/ath5k/ani.o.old
  11181      56    2464   13701    3585 drivers/net/wireless/ath/ath5k/ani.o.new

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoar9170: Use const
Joe Perches [Sun, 21 Nov 2010 02:38:51 +0000 (18:38 -0800)]
ar9170: Use const

Mark an array const.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: fix init-self regression
Christian Lamparter [Sat, 20 Nov 2010 15:53:26 +0000 (16:53 +0100)]
carl9170: fix init-self regression

The commit: "carl9170: tx path review" introduced a regression.

gcc (with -Winit-self):
tx.c:1264: warning: ‘super’ is used uninitialized in this function

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: remove duplicated #include
Huang Weiyi [Sat, 20 Nov 2010 12:06:02 +0000 (20:06 +0800)]
libertas: remove duplicated #include

Remove duplicated #include('s) in
  drivers/net/wireless/libertas/cfg.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix recursive locking in the tx flush path
Felix Fietkau [Sat, 20 Nov 2010 02:08:46 +0000 (03:08 +0100)]
ath9k: fix recursive locking in the tx flush path

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix modular 3945 only build
Johannes Berg [Thu, 18 Nov 2010 20:08:10 +0000 (12:08 -0800)]
iwlwifi: fix modular 3945 only build

If only 3945 is selected, and is a module, build
fails because iwl-legacy.c won't be compiled. Fix
this by adding it to the build correctly.

This doesn't happen for 4965 because it is a bool
option, not tristate, since it's built into the
AGN module.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Disable hw crypto for GTKs on AP VLAN interfaces
Helmut Schaa [Fri, 19 Nov 2010 07:11:01 +0000 (08:11 +0100)]
mac80211: Disable hw crypto for GTKs on AP VLAN interfaces

When using AP VLAN interfaces, each VLAN interface should be in its own
broadcast domain. Hostapd achieves this by assigning different GTKs to
different AP VLAN interfaces.

However, mac80211 drivers are not aware of AP VLAN interfaces and as
such mac80211 sends the GTK to the driver in the context of the base AP
mode interface. This causes problems when multiple AP VLAN interfaces
are used since the driver will use the same key slot for the different
GTKs (there's no way for the driver to distinguish the different GTKs
from different AP VLAN interfaces). Thus, only the clients associated
to one AP VLAN interface (the one that was created last) can actually
use broadcast traffic.

Fix this by not programming any GTKs for AP VLAN interfaces into the hw
but fall back to using software crypto. The GTK for the underlying AP
interface is still sent to the driver.

That means, broadcast traffic to stations associated to an AP VLAN
interface is encrypted in software whereas broadcast traffic to
stations associated to the non-VLAN AP interface is encrypted in
hardware.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: Fix regulatory bug with multiple cards and delays
Luis R. Rodriguez [Thu, 18 Nov 2010 05:46:09 +0000 (21:46 -0800)]
cfg80211: Fix regulatory bug with multiple cards and delays

When two cards are connected with the same regulatory domain
if CRDA had a delayed response then cfg80211's own set regulatory
domain would still be the world regulatory domain. There was a bug
on cfg80211's logic such that it assumed that once you pegged a
request as the last request it was already the currently set
regulatory domain. This would mean we would race setting a stale
regulatory domain to secondary cards which had the same regulatory
domain since the alpha2 would match.

We fix this by processing each regulatory request atomically,
and only move on to the next one once we get it fully processed.
In the case CRDA is not present we will simply world roam.

This issue is only present when you have a slow system and the
CRDA processing is delayed. Because of this it is not a known
regression.

Without this fix when a delay is present with CRDA the second card
would end up with an intersected regulatory domain and not allow it
to use the channels it really is designed for. When two cards with
two different regulatory domains were inserted you'd end up
rejecting the second card's regulatory domain request.
This fails with mac80211_hswim's regtest=2 (two requests, same alpha2)
and regtest=3 (two requests, different alpha2) module parameter
options.

This was reproduced and tested against mac80211_hwsim using this
CRDA delayer:

       #!/bin/bash
       echo $COUNTRY >> /tmp/log
       sleep 2
       /sbin/crda.orig

And these regulatory tests:

       modprobe mac80211_hwsim regtest=2
       modprobe mac80211_hwsim regtest=3

Reported-by: Mark Mentovai <mark@moxienet.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: move mutex locking to reg_process_pending_hints()
Luis R. Rodriguez [Thu, 18 Nov 2010 05:46:08 +0000 (21:46 -0800)]
cfg80211: move mutex locking to reg_process_pending_hints()

This will be required in the next patch and it makes the
next patch easier to review.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: move reg_work and reg_todo above
Luis R. Rodriguez [Thu, 18 Nov 2010 05:46:07 +0000 (21:46 -0800)]
cfg80211: move reg_work and reg_todo above

These will be used earlier in the next few patches.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: put core regulatory request into queue
Luis R. Rodriguez [Thu, 18 Nov 2010 05:46:06 +0000 (21:46 -0800)]
cfg80211: put core regulatory request into queue

This will simplify the synchronization for pending requests.
Without this we have a race between the core and when we
restore regulatory settings, although this is unlikely
its best to just avoid that race altogether.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: rfkill: use HI enabled bit for all devices
Rafał Miłecki [Wed, 17 Nov 2010 21:14:37 +0000 (22:14 +0100)]
b43: rfkill: use HI enabled bit for all devices

Devices which use LO enabled bit are covered by b43legacy

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: add 2056 radio channels tables
Rafał Miłecki [Thu, 14 Oct 2010 20:58:58 +0000 (22:58 +0200)]
b43: N-PHY: add 2056 radio channels tables

Signed-off-by: Rafał Miłecki <zajec5@gmail.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, 22 Nov 2010 20:28:30 +0000 (15:28 -0500)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agowl12xx: Unset bssid filter, ssid and bssid from firmware on disassoc
Juuso Oikarinen [Mon, 22 Nov 2010 10:59:08 +0000 (12:59 +0200)]
wl12xx: Unset bssid filter, ssid and bssid from firmware on disassoc

On the disassociation event from the mac80211, the wl12xx driver does not
clear the chipset configuration related to the AP - i.e. it does not perform
a DISCONNECT and then a JOIN with zero SSID and dummy BSSID. Also, it does not
unset the BSSID filter.

Often this is not a problem, as the above is performed upon entering idle
state. But if a scenario arises where a new association is attempted without
cycling through idle state, the new association will fail.

Fix this by resetting the firmware state on disassociation.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agowl1271: add support for HW TX fragmentation
Arik Nemtsov [Mon, 8 Nov 2010 09:51:07 +0000 (10:51 +0100)]
wl1271: add support for HW TX fragmentation

Indicate to mac80211 we support HW fragmentation.
Support updates of the fragmentation threshold via the
set_frag_threshold callback.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agoRevert "wl1271: Change supported channel order for a more optimal scan"
Juuso Oikarinen [Wed, 10 Nov 2010 10:27:20 +0000 (11:27 +0100)]
Revert "wl1271: Change supported channel order for a more optimal scan"

This reverts commit fa21c7a9e4be439e217fe72edbd39b643b643791.

The reverted patch caused more harm than benefit.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Tested-by: Tuomas Katila <ext-tuomas.2.katila@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agowl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies
Juuso Oikarinen [Wed, 10 Nov 2010 10:27:19 +0000 (11:27 +0100)]
wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies

The wl1271 does not support radar detection. Hence, prevent ad-hoc and
active scanning on frequencies requiring DFS.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Tested-by: Tuomas Katila <ext-tuomas.2.katila@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agowl1271: cleanup unused code of calibration structures
Gery Kahn [Sun, 7 Nov 2010 09:04:20 +0000 (10:04 +0100)]
wl1271: cleanup unused code of calibration structures

The cleanup unused code for calibration procedures.

Signed-off-by: Gery Kahn <geryk@ti.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agowl1271: Change wl12xx Files Names
Shahar Levi [Mon, 8 Nov 2010 11:20:10 +0000 (11:20 +0000)]
wl1271: Change wl12xx Files Names

All files name prefix removed due to the fact that wl12xx driver supports
wl1271 and wl1273.
Also the definition in Kconfig and header files changed respectively.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agossb: drop BCM4328 hack for SPROM revision
Rafał Miłecki [Wed, 17 Nov 2010 18:52:13 +0000 (19:52 +0100)]
ssb: drop BCM4328 hack for SPROM revision

This hacks leads to incorrect SPROM parsing for me and reading for example MAC
as: 00:00:00:54:00:00. Michael G. who introduced this confirmed it is not
needed anymore.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Michael Gerdau <mgd@qata.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: support reading calibration data from flash on AR9003
Felix Fietkau [Wed, 17 Nov 2010 03:19:47 +0000 (04:19 +0100)]
ath9k_hw: support reading calibration data from flash on AR9003

Embedded boards do not have compressed EEPROM data, they use the
struct ar9003_eeprom layout, with little endian fields, so copying
the raw data to the eeprom buffer is enough.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: add support for reading eeprom from platform data on PCI devices
Felix Fietkau [Wed, 17 Nov 2010 03:25:33 +0000 (04:25 +0100)]
ath9k: add support for reading eeprom from platform data on PCI devices

Some embedded boards store platform data for connected PCIe AR92xx
chips in the system flash instead of a separate EEPROM chip.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agorndis_wlan: avoid uninitialized var warning in rndis_wlan_craft_connected_bss
John W. Linville [Tue, 16 Nov 2010 21:49:08 +0000 (16:49 -0500)]
rndis_wlan: avoid uninitialized var warning in rndis_wlan_craft_connected_bss

  CC [M]  drivers/net/wireless/rndis_wlan.o
drivers/net/wireless/rndis_wlan.c: In function ‘rndis_wlan_craft_connected_bss’:
drivers/net/wireless/rndis_wlan.c:2542:2: warning: ‘ret’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
13 years agoiwmc3200wifi: clarify potentially undefined operation in iwm_scan_ssids
John W. Linville [Tue, 16 Nov 2010 21:08:56 +0000 (16:08 -0500)]
iwmc3200wifi: clarify potentially undefined operation in iwm_scan_ssids

  CC [M]  drivers/net/wireless/iwmc3200wifi/commands.o
drivers/net/wireless/iwmc3200wifi/commands.c: In function ‘iwm_scan_ssids’:
drivers/net/wireless/iwmc3200wifi/commands.c:911:15: warning: operation on ‘iwm->scan_id’ may be undefined

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211/mac80211: Report signal average
Bruno Randolf [Tue, 16 Nov 2010 01:58:48 +0000 (10:58 +0900)]
nl80211/mac80211: Report signal average

Extend nl80211 to report an exponential weighted moving average (EWMA) of the
signal value. Since the signal value usually fluctuates between different
packets, an average can be more useful than the value of the last packet.

This uses the recently added generic EWMA library function.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use generic EWMA library
Bruno Randolf [Tue, 16 Nov 2010 01:58:43 +0000 (10:58 +0900)]
ath5k: Use generic EWMA library

Remove ath5k's private moving average implementation in favour of the generic
library version.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolib: Add generic exponentially weighted moving average (EWMA) function
Bruno Randolf [Tue, 16 Nov 2010 01:58:37 +0000 (10:58 +0900)]
lib: Add generic exponentially weighted moving average (EWMA) function

This adds generic functions for calculating Exponentially Weighted Moving
Averages (EWMA). This implementation makes use of a structure which keeps the
EWMA parameters and a scaled up internal representation to reduce rounding
errors.

The original idea for this implementation came from the rt2x00 driver
(rt2x00link.c). I would like to use it in several places in the mac80211 and
ath5k code and I hope it can be useful in many other places in the kernel code.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix powersaving clients races
Johannes Berg [Tue, 16 Nov 2010 19:50:28 +0000 (11:50 -0800)]
mac80211: fix powersaving clients races

The code to handle powersaving stations has a race:
when the powersave flag is lifted from a station,
we could transmit a packet that is being processed
for TX at the same time right away, even if there
are other frames queued for it. This would cause
frame reordering. To fix this, lift the flag only
under the appropriate lock that blocks TX.

Additionally, the code to allow drivers to block a
station while frames for it are on the HW queue is
never re-enabled the station, so traffic would get
stuck indefinitely. Fix this by clearing the flag
for this appropriately.

Finally, as an optimisation, don't do anything if
the driver unblocks an already unblocked station.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: defines for AC numbers
Johannes Berg [Tue, 16 Nov 2010 19:49:58 +0000 (11:49 -0800)]
mac80211: defines for AC numbers

In many places we've just hardcoded the
AC numbers -- which is a relic from the
original mac80211 (d80211). Add constants
for them so we know what we're talking
about.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add support for reading EEPROM data from the internal OTP ROM
Felix Fietkau [Tue, 16 Nov 2010 18:20:28 +0000 (19:20 +0100)]
ath9k_hw: add support for reading EEPROM data from the internal OTP ROM

Some of the new AR9003 cards do not come with an external EEPROM chip
anymore. Calibration data on these cards is stored in the OTP ROM on
the chip.
This patch adds support for reading this data, and also adds support
for different EEPROM chip sizes (512 bytes instead of 1K).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: store frame information used by aggregation inside the skb tx info
Felix Fietkau [Sun, 14 Nov 2010 14:20:13 +0000 (15:20 +0100)]
ath9k: store frame information used by aggregation inside the skb tx info

Since the pointers after the rates in the tx info cannot be used anymore
after frames have been queued, this area can be used to store information
that was previously stored in the ath_buf. With these changes, we can delay
the ath_buf assignment in the aggregation code until aggregates are formed.

That will not only make it possible to simplify DMA descriptor setup to
do less rewriting of uncached memory, but will also make it easier to
move aggregation out of the core of the ath9k tx path.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: more tx setup cleanups
Felix Fietkau [Sun, 14 Nov 2010 14:20:12 +0000 (15:20 +0100)]
ath9k: more tx setup cleanups

- remove the BUF_HT flag, and instead check for IEEE80211_TX_CTL_AMPDU
  before calling ath_tx_send_ampdu.
- remove a few unused variables
- calculate frame length before adding the frame padding
- merge the misnamed ath_tx_start_dma function into ath_tx_start
- remove an unused argument for assign_aggr_tid_seqno

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: block new AMPDU sessions if SC_OP_TXAGGR is not set
Felix Fietkau [Sun, 14 Nov 2010 14:20:11 +0000 (15:20 +0100)]
ath9k: block new AMPDU sessions if SC_OP_TXAGGR is not set

This makes further tx path cleanups easier

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: clean up code duplication around ath_tx_start
Felix Fietkau [Sun, 14 Nov 2010 14:20:10 +0000 (15:20 +0100)]
ath9k: clean up code duplication around ath_tx_start

Merge initial processing for the CAB queue and regular tx.
Also move ath_tx_cabq() to beacon.c and make it static.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bf_tx_aborted from struct ath_buf
Felix Fietkau [Sun, 14 Nov 2010 14:20:09 +0000 (15:20 +0100)]
ath9k: remove bf_tx_aborted from struct ath_buf

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_frmlen from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:08 +0000 (15:20 +0100)]
ath9k: remove bfs_frmlen from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_nframes from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:07 +0000 (15:20 +0100)]
ath9k: remove bfs_nframes from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_al from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:06 +0000 (15:20 +0100)]
ath9k: remove bfs_al from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_keyix from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:05 +0000 (15:20 +0100)]
ath9k: remove bfs_keyix from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_paprd_timestamp from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:04 +0000 (15:20 +0100)]
ath9k: remove bfs_paprd_timestamp from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_keytype from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:03 +0000 (15:20 +0100)]
ath9k: remove bfs_keytype from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_tidno from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:02 +0000 (15:20 +0100)]
ath9k: remove bfs_tidno from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove bfs_seqno from struct ath_buf_state
Felix Fietkau [Sun, 14 Nov 2010 14:20:01 +0000 (15:20 +0100)]
ath9k: remove bfs_seqno from struct ath_buf_state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix PA predistortion training frame setup
Felix Fietkau [Sat, 13 Nov 2010 23:03:01 +0000 (00:03 +0100)]
ath9k: fix PA predistortion training frame setup

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: set default values for radar pulse detection
Felix Fietkau [Sat, 13 Nov 2010 19:22:41 +0000 (20:22 +0100)]
ath9k_hw: set default values for radar pulse detection

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Modify rt2x00queue_remove_l2pad to make skb->data two-byte alignment
RA-Jay Hung [Sat, 13 Nov 2010 18:13:53 +0000 (19:13 +0100)]
rt2x00: Modify rt2x00queue_remove_l2pad to make skb->data two-byte alignment

When send out skb data to mac80211, orignal code will cause mac80211
unaligned access, so modify code to make mac80211 can natural access.

Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix header_length in rt2x00lib_txdone
RA-Jay Hung [Sat, 13 Nov 2010 18:12:54 +0000 (19:12 +0100)]
rt2x00: Fix header_length in rt2x00lib_txdone

Put the assignment of header_length after pull out extra tx headroom

Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix rt2800 USB TX Path DMA issue
RA-Jay Hung [Sat, 13 Nov 2010 18:11:46 +0000 (19:11 +0100)]
rt2x00: Fix rt2800 USB TX Path DMA issue

rt2800usb chips need to add 1~3 bytes zero padding after each 802.11 header & payload,
and at the end need to add 4 bytes zero padding whether doing TX bulk aggregation or not,

TXINFO_W0_USB_DMA_TX_PKT_LEN in TXINFO must include 1-3 bytes padding after 802.11 header & payload
but do not include 4 bytes end zero padding.

In rt2800usb_get_tx_data_len do not consider multiple of the USB packet size case, sometimes this will
cause USB DMA problem.

Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Use ioremap for SoC devices instead of KSEG1ADDR.
Gertjan van Wingerde [Sat, 13 Nov 2010 18:11:22 +0000 (19:11 +0100)]
rt2x00: Use ioremap for SoC devices instead of KSEG1ADDR.

Make the code a bit more portable to architectures that do not support
KSEG1ADDR.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Tested-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Remove unneccessary internal Kconfig symbols.
Gertjan van Wingerde [Sat, 13 Nov 2010 18:10:54 +0000 (19:10 +0100)]
rt2x00: Remove unneccessary internal Kconfig symbols.

CONFIG_RT2800PCI_PCI and CONFIG_RT2800PCI_SOC are strictly not needed
as we can check the dependent symbols directly in the rest of Kconfig
and the code, so clean up the Kconfig namespace a bit.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Remove RT30XX Kconfig variables.
Gertjan van Wingerde [Sat, 13 Nov 2010 18:10:31 +0000 (19:10 +0100)]
rt2x00: Remove RT30XX Kconfig variables.

Enabling of RT30xx devices via Kconfig variables was introduced when these
devices weren't properly supported yet.
Now that that they are properly supported and functional, we can remove these
Kconfig variables for RT30xx devices and simply enable them whenever rt2800pci
and/or rt2800usb is enabled.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Clean up Kconfig for RT2800 devices.
Gertjan van Wingerde [Sat, 13 Nov 2010 18:10:10 +0000 (19:10 +0100)]
rt2x00: Clean up Kconfig for RT2800 devices.

General clean up of the Kconfig part for RT28XX devices.
Also remove the indications of non functional support for rt27xx/rt28xx/rt30xx
devices, as this is no longer true. They just work fine.
Finally, remove the experimental indications for rt27xx/rt28xx/rt30xx devices
as that is no longer true. Keep the experimental indications for rt33xx/rt35xx
devices, though.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Add initial support for RT3370/RT3390 devices.
Gertjan van Wingerde [Sat, 13 Nov 2010 18:09:50 +0000 (19:09 +0100)]
rt2x00: Add initial support for RT3370/RT3390 devices.

Modified from Eddy's patch by adding the RT3370 USB support as well.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Eddy Tsai <Eddy_Tsai@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Increase REGISTER_BUSY_COUNT
Ivo van Doorn [Sat, 13 Nov 2010 18:08:14 +0000 (19:08 +0100)]
rt2x00: Increase REGISTER_BUSY_COUNT

For some hardware the REGISTER_BUSY_COUNT isn't sufficient,
increase the REGISTER_BUSY_COUNT to 100 to catch most
devices which have more problems with accessing the registers.

For normal operating devices nothing would change as they will
exit the loop early anyway.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Use macro for caldata array size
Mohammed Shafi Shajakhan [Sat, 13 Nov 2010 15:28:27 +0000 (20:58 +0530)]
ath9k_htc: Use macro for caldata array size

The calibration data variable size is based on the number of
channels available in the ath9k driver.

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: kill elapsed_jiffies
Stanislaw Gruszka [Fri, 12 Nov 2010 07:47:07 +0000 (08:47 +0100)]
iwlwifi: kill elapsed_jiffies

Subtract of jiffies is fine even if one variable overwrap.

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>
14 years agoiwlagn: simplify iwlagn_tx_skb
Stanislaw Gruszka [Fri, 12 Nov 2010 07:47:06 +0000 (08:47 +0100)]
iwlagn: simplify iwlagn_tx_skb

We can simplify length calculation in iwlagn_tx_skb, that function
is enough complex, without fuzz it more than necessary.

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>
14 years agoiwl3945: remove unused len_org variable
Stanislaw Gruszka [Fri, 12 Nov 2010 07:47:05 +0000 (08:47 +0100)]
iwl3945: remove unused len_org variable

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>
14 years agomac80211: add support for setting the ad-hoc multicast rate
Felix Fietkau [Thu, 11 Nov 2010 14:07:23 +0000 (15:07 +0100)]
mac80211: add support for setting the ad-hoc multicast rate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: add support for setting the ad-hoc multicast rate
Felix Fietkau [Thu, 11 Nov 2010 14:07:22 +0000 (15:07 +0100)]
cfg80211: add support for setting the ad-hoc multicast rate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Add function to get probe request template for current AP
Juuso Oikarinen [Thu, 11 Nov 2010 06:50:18 +0000 (08:50 +0200)]
mac80211: Add function to get probe request template for current AP

Chipsets with hardware based connection monitoring need to autonomically
send directed probe-request frames to the AP (in the event of beacon loss,
for example.)

For the hardware to be able to do this, it requires a template for the frame
to transmit to the AP, filled in with the BSSID and SSID of the AP, but also
the supported rate IE's.

This patch adds a function to mac80211, which allows the hardware driver to
fetch this template after association, so it can be configured to the hardware.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add a private op for configuring radar pulse detection
Felix Fietkau [Thu, 11 Nov 2010 02:18:38 +0000 (03:18 +0100)]
ath9k_hw: add a private op for configuring radar pulse detection

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: clean up tx buffer setup
Felix Fietkau [Thu, 11 Nov 2010 02:18:37 +0000 (03:18 +0100)]
ath9k: clean up tx buffer setup

Merge ath_tx_send_normal and ath_tx_send_ht_normal.
Move the paprd state initialization and sequence number assignment
to reduce the number of redundant checks.

This not only simplifies buffer allocation error handling, but also
removes a small inconsistency in the buffer HT flag.
This flag should only be set if the frame is also a QoS data frame.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove the tx info padding byte abuse
Felix Fietkau [Thu, 11 Nov 2010 02:18:36 +0000 (03:18 +0100)]
ath9k: remove the tx info padding byte abuse

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: handle tx underrun in the driver instead of rate control
Felix Fietkau [Thu, 11 Nov 2010 02:18:35 +0000 (03:18 +0100)]
ath9k: handle tx underrun in the driver instead of rate control

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove the unnecessary private xretry tx flag
Felix Fietkau [Thu, 11 Nov 2010 02:18:34 +0000 (03:18 +0100)]
ath9k: remove the unnecessary private xretry tx flag

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: Cleanup opmode setting logic.
Ben Greear [Wed, 10 Nov 2010 19:43:51 +0000 (11:43 -0800)]
ath5k: Cleanup opmode setting logic.

An earlier review suggested moving the code in a small
method that was only called once inline.  This patch
accomplishes that.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fix low throughput issue with AR93xx
Senthil Balasubramanian [Wed, 10 Nov 2010 13:03:16 +0000 (05:03 -0800)]
ath9k_hw: Fix low throughput issue with AR93xx

TX underruns were noticed when RTS/CTS preceded aggregates.
This issue was noticed in ar93xx family of chipsets only.
The workaround involves padding the RTS or CTS length up
to the min packet length of 256 bytes required by the
hardware by adding delimiters to the fist descriptor of
the aggregate.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix bug in delimiter padding computation
Vasanthakumar Thiagarajan [Wed, 10 Nov 2010 13:03:15 +0000 (05:03 -0800)]
ath9k: Fix bug in delimiter padding computation

There is a roundng error in delimiter padding computation
which causes severe throughput drop with some of AR9003.

signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Cc:stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Add helper function for interpolation
Vasanthakumar Thiagarajan [Wed, 10 Nov 2010 13:03:14 +0000 (05:03 -0800)]
ath9k_hw: Add helper function for interpolation

Also round off interpolated values this would improve power
accuracy by 0.5dB in some cases.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Improve power control accuracy for AR9003
Vasanthakumar Thiagarajan [Wed, 10 Nov 2010 13:03:13 +0000 (05:03 -0800)]
ath9k_hw: Improve power control accuracy for AR9003

It is done for 5Ghz by adding three temperature slopes.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Enable strong signal detection for AR9003
Vasanthakumar Thiagarajan [Wed, 10 Nov 2010 13:03:12 +0000 (05:03 -0800)]
ath9k_hw: Enable strong signal detection for AR9003

Attenuation from eeprom is configured into attenuator control
register.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fix XPABIAS level configuration for AR9003
Vasanthakumar Thiagarajan [Wed, 10 Nov 2010 13:03:11 +0000 (05:03 -0800)]
ath9k_hw: Fix XPABIAS level configuration for AR9003

Improper configuration of 0x16288 and 0x16290 would affect transmission.

Cc:stable@kernel.org
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add eeprom templates for ar9003 family chipsets
Senthil Balasubramanian [Wed, 10 Nov 2010 13:03:10 +0000 (05:03 -0800)]
ath9k_hw: add eeprom templates for ar9003 family chipsets

We are currently using the default eeprom default and it doesn't
work properly for all ar9003 family chipsets. So add eeprom
templates for different versisons and select the eeprom table
based on the template version programmed in the eeprom.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fix paprd training frame failure.
Senthil Balasubramanian [Wed, 10 Nov 2010 13:03:09 +0000 (05:03 -0800)]
ath9k_hw: Fix paprd training frame failure.

paprd training frame fails in some rates. Fix the rate mask.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Initialize 2GHz CTL properly.
Senthil Balasubramanian [Wed, 10 Nov 2010 13:03:08 +0000 (05:03 -0800)]
ath9k_hw: Initialize 2GHz CTL properly.

The last 2GHz CTL was not being initialized, so power was being
set to 0 instead of 30dbm. Initialize to 30 like other CTLs.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Add new member into the eeprom structure.
Senthil Balasubramanian [Wed, 10 Nov 2010 13:03:07 +0000 (05:03 -0800)]
ath9k_hw: Add new member into the eeprom structure.

Add eeprom base extension structures which are needed for
AR938x caliberation changes and gain calculation.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fix a reset failure on AR9382 (2x2).
Senthil Balasubramanian [Thu, 11 Nov 2010 08:40:33 +0000 (00:40 -0800)]
ath9k_hw: Fix a reset failure on AR9382 (2x2).

AR9382 needs to be configured for the correct chain mask before
running AGC/TxIQ caliberation. Otherwise reset would fail.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: Add support for antenna configuration
Bruno Randolf [Wed, 10 Nov 2010 03:51:01 +0000 (12:51 +0900)]
ath5k: Add support for antenna configuration

Support setting the antenna configuration via cfg/mac80211. At the moment only
allow the simple pre-defined configurations we already have (fixed antenna A/B
or diversity), but more advanced settings are possible to implement.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Add antenna configuration
Bruno Randolf [Wed, 10 Nov 2010 03:50:56 +0000 (12:50 +0900)]
mac80211: Add antenna configuration

Allow antenna configuration by calling driver's function for it.

We disallow antenna configuration if the wiphy is already running, mainly to
make life easier for 802.11n drivers which need to recalculate HT capabilites.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: Add nl80211 antenna configuration
Bruno Randolf [Wed, 10 Nov 2010 03:50:50 +0000 (12:50 +0900)]
cfg80211: Add nl80211 antenna configuration

Allow setting of TX and RX antennas configuration via nl80211.

The antenna configuration is defined as a bitmap of allowed antennas to use.
This API can be used to mask out antennas which are not attached or should not
be used for other reasons like regulatory concerns or special setups.

Separate bitmaps are used for RX and TX to allow configuring different antennas
for receiving and transmitting. Each bitmap is 32 bit long, each bit
representing one antenna, starting with antenna 1 at the first bit. If an
antenna bit is set, this means the driver is allowed to use this antenna for RX
or TX respectively; if the bit is not set the hardware is not allowed to use
this antenna.

Using bitmaps has the benefit of allowing for a flexible configuration
interface which can support many different configurations and which can be used
for 802.11n as well as non-802.11n devices. Instead of relying on some hardware
specific assumptions, drivers can use this information to know which antennas
are actually attached to the system and derive their capabilities based on
that.

802.11n devices should enable or disable chains, based on which antennas are
present (If all antennas belonging to a particular chain are disabled, the
entire chain should be disabled). HT capabilities (like STBC, TX Beamforming,
Antenna selection) should be calculated based on the available chains after
applying the antenna masks. Should a 802.11n device have diversity antennas
attached to one of their chains, diversity can be enabled or disabled based on
the antenna information.

Non-802.11n drivers can use the antenna masks to select RX and TX antennas and
to enable or disable antenna diversity.

While covering chainmasks for 802.11n and the standard "legacy" modes "fixed
antenna 1", "fixed antenna 2" and "diversity" this API also allows more rare,
but useful configurations as follows:

1) Send on antenna 1, receive on antenna 2 (or vice versa). This can be used to
have a low gain antenna for TX in order to keep within the regulatory
constraints and a high gain antenna for RX in order to receive weaker signals
("speak softly, but listen harder"). This can be useful for building long-shot
outdoor links. Another usage of this setup is having a low-noise pre-amplifier
on antenna 1 and a power amplifier on the other antenna. This way transmit
noise is mostly kept out of the low noise receive channel.
(This would be bitmaps: tx 1 rx 2).

2) Another similar setup is: Use RX diversity on both antennas, but always send
on antenna 1. Again that would allow us to benefit from a higher gain RX
antenna, while staying within the legal limits.
(This would be: tx 0 rx 3).

3) And finally there can be special experimental setups in research and
development even with pre 802.11n hardware where more than 2 antennas are
available. It's good to keep the API simple, yet flexible.

Signed-off-by: Bruno Randolf <br1@einfach.org>
--
v7: Made bitmasks 32 bit wide and rebased to latest wireless-testing.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/b43legacy/main.c: Use printf extension %pV
Joe Perches [Wed, 10 Nov 2010 00:35:19 +0000 (16:35 -0800)]
drivers/net/wireless/b43legacy/main.c: Use printf extension %pV

Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/b43/main.c: Use printf extension %pV
Joe Perches [Wed, 10 Nov 2010 00:35:18 +0000 (16:35 -0800)]
drivers/net/wireless/b43/main.c: Use printf extension %pV

Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/ath/debug.c: Use printf extension %pV
Joe Perches [Wed, 10 Nov 2010 00:35:17 +0000 (16:35 -0800)]
drivers/net/wireless/ath/debug.c: Use printf extension %pV

Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: workaround poor scanning with BCM4320a
Jussi Kivilinna [Tue, 9 Nov 2010 17:25:56 +0000 (19:25 +0200)]
rndis_wlan: workaround poor scanning with BCM4320a

BCM4320a devices seem to sometimes do scanning pretty poorly. This can be
workaround by issuing new scan every second, while not yet connected. By this
new scanning method device catches beacons much faster. Fixes bug #20822.

Reported-by: Luís Picciochi <Pitxyoki@gmail.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: workaround device not returning bss for currently connected AP
Jussi Kivilinna [Tue, 9 Nov 2010 17:25:47 +0000 (19:25 +0200)]
rndis_wlan: workaround device not returning bss for currently connected AP

BCM4320a devices do not return bss for currently connected AP in bss-list,
althought this is required by NDIS specs. Missing bss leads to warning at
net/wireless/sme.c:__cfg80211_connect_result(), WARN_ON(!bss).

Workaround this by crafting bss manually with information we can read from
device. Workaround is only used when device bss-list does not return current
bss, and so is only used with BCM4320a devices and not newer BCM4320b ones.

Fixes bug #20152.

Reported-by: Luís Picciochi <Pitxyoki@gmail.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: support hardware TX fragmentation offload
Arik Nemtsov [Mon, 8 Nov 2010 09:51:06 +0000 (11:51 +0200)]
mac80211: support hardware TX fragmentation offload

The lower driver is notified when the fragmentation threshold changes
and upon a reconfig of the interface.

If the driver supports hardware TX fragmentation, don't fragment
packets in the stack.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: return -ENOMEM on alloc fail (instead of CRC check's result)
Rafał Miłecki [Wed, 3 Nov 2010 22:28:45 +0000 (23:28 +0100)]
ssb: return -ENOMEM on alloc fail (instead of CRC check's result)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: workarounds: be verbose about hacking SPROM revision, don't duplicate code
Rafał Miłecki [Wed, 3 Nov 2010 21:06:26 +0000 (22:06 +0100)]
ssb: workarounds: be verbose about hacking SPROM revision, don't duplicate code

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomwl8k: use const struct fw pointers throughout
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:53 +0000 (17:23 -0800)]
mwl8k: use const struct fw pointers throughout

This eliminates compiler warnings by doing things how the
firmware class expects.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomwl8k: make initial firmware load asynchronous
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:52 +0000 (17:23 -0800)]
mwl8k: make initial firmware load asynchronous

Introduce a firmware loading state machine to manage the process
of loading firmware asynchronously and completing initialization
upon success.  The state machine attempts to load the preferred
firmware image.  If that fails, and if an alternative firmware
image is available, it will attempt to load that one.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomwl8k: add API version checking for AP firmware
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:51 +0000 (17:23 -0800)]
mwl8k: add API version checking for AP firmware

The AP firmware specifies an API version in the GET_HW_SPEC
command response.  Currently, the driver only supports AP
firmware for the 8366, and only supports API v1.  In the future,
if higher API version firmwares emerge (possibly for different
chips), different ops can be selected based on the reported API
version.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>