]> git.openfabrics.org - ~shefty/rdma-dev.git/log
~shefty/rdma-dev.git
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 years agomwl8k: choose proper firmware image as directed by user
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:50 +0000 (17:23 -0800)]
mwl8k: choose proper firmware image as directed by user

The mwl8k can operate in AP or STA mode, depending on the
firmware image that is loaded.  By default, STA firmware is
loaded.  Allow the user to override this default mode at
module load time.  This saves an unnecessary firmware reload
for users only interested in AP mode.

Also, the firmware image can be swapped to meet the user's
add_interface request.  For example, suppose the STA
firmware is loaded, no STA interface has been added, and the
user adds an AP interface.  In this case, the AP firmware
will be loaded to meet the request.

Based on contributions from Pradeep Nemavat <pnemavat@marvell.com>,
Yogesh Powar <yogeshp@marvell.com>, and
Lennert Buytenhek <buytenh@wantstofly.org>.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: factor out firmware loading and hw init code
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:49 +0000 (17:23 -0800)]
mwl8k: factor out firmware loading and hw init code

This is in preparation for supporting different fw images for
different interface types, and for supporting asynchronous
firmware loading.

Based on a patch from Pradeep Nemavat <pnemavat@marvell.com>
and Yogesh Powar <yogeshp@marvell.com>

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: rf_tx_power cmd not supported by AP firmware APIv1
Nishant Sarmukadam [Sat, 13 Nov 2010 01:23:48 +0000 (17:23 -0800)]
mwl8k: rf_tx_power cmd not supported by AP firmware APIv1

APIv1 AP firmware does not support the RF_TX_POWER command.  It
supports the similar TX_POWER command.

Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: revert unnecessary modification of tx descriptor
Brian Cavagnolo [Sat, 13 Nov 2010 01:23:47 +0000 (17:23 -0800)]
mwl8k: revert unnecessary modification of tx descriptor

This reverts change 783391c443728febc669e40597193308460e7b4f.
The stabilized AP v1 firmware uses the same tx descriptor as
the STA firmware.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: EHS_REMOVE_WAKEUP is not always supported
Deepak Saxena [Sun, 31 Oct 2010 13:40:33 +0000 (13:40 +0000)]
libertas: EHS_REMOVE_WAKEUP is not always supported

Certain firmware versions, particularly the 8388 found on the XO-1,
do not support the EHS_REMOVE_WAKEUP command that is used to disable
WOL. Sending this command to the card will return a failure that
would get propagated up the stack and cause suspend to fail.

Instead, fall back to an all-zero wakeup mask.

This fixes http://dev.laptop.org/ticket/9967

Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
[includes fixups by Paul Fox]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: don't block usb8388 suspend if no wakeup conditions are set
Daniel Drake [Sun, 31 Oct 2010 13:40:12 +0000 (13:40 +0000)]
libertas: don't block usb8388 suspend if no wakeup conditions are set

This hunk added by commit 66fceb69b72f seems erroneous. We don't want to
prevent suspend of the whole system if no wakeup params are set.

In the case of the usb8388 we do want to keep the card powered up even
if there are no wakeup params. This is because it will continue acting
as a mesh node.

If the mesh is disabled, it would indeed make more sense to power down
the card during suspend, as the equivalent hunk does for the SD interface.
But that's a separate task; for now just restore the previous behaviour.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: use generic sign_extend32
Christian Lamparter [Fri, 29 Oct 2010 21:11:23 +0000 (23:11 +0200)]
carl9170: use generic sign_extend32

This patch replaces the handcrafted
sign extension cruft with a generic
bitop function.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobitops: Provide generic sign_extend32 function
Andreas Herrmann [Mon, 30 Aug 2010 19:04:01 +0000 (19:04 +0000)]
bitops: Provide generic sign_extend32 function

This patch moves code out from wireless drivers where two different
functions are defined in three code locations for the same purpose and
provides a common function to sign extend a 32-bit value.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: use wl12xx_platform_data to pass data
Grazvydas Ignotas [Wed, 3 Nov 2010 22:13:49 +0000 (00:13 +0200)]
wl1251: use wl12xx_platform_data to pass data

Make use the newly added method to pass platform data for wl1251 too.
This allows to eliminate some redundant code.

Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: add runtime PM support for SDIO
Grazvydas Ignotas [Mon, 8 Nov 2010 13:29:36 +0000 (15:29 +0200)]
wl1251: add runtime PM support for SDIO

Add runtime PM support, similar to how it's done for wl1271.
This allows to power down the card when the driver is loaded but
network is not in use.

Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: add power callback to wl1251_if_operations
Grazvydas Ignotas [Wed, 3 Nov 2010 22:13:47 +0000 (00:13 +0200)]
wl1251: add power callback to wl1251_if_operations

Call interface specific power callback before calling board specific
one. Also allow that callback to fail. This is how it's done for
wl1271 and will be used for runtime_pm support.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: enable shadow register
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:50 +0000 (09:56 -0800)]
iwlagn: enable shadow register

For 6000 series devices and up, enable automatic update MAC's register
for better power usage in PSP mode

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: disable disconnected antenna for advanced bt coex
Shanyu Zhao [Wed, 10 Nov 2010 17:56:49 +0000 (09:56 -0800)]
iwlwifi: disable disconnected antenna for advanced bt coex

Disconnected antenna algorithm is used to find out which antennas are
disconnected. It should be disabled for devices that support advanced
bluetooth coexist.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: seperate disconnected antenna function
Shanyu Zhao [Wed, 10 Nov 2010 17:56:48 +0000 (09:56 -0800)]
iwlwifi: seperate disconnected antenna function

Disconnected antenna algorithm is seperated into its own function from chain noise
calibration routine for better code management.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: fix RXON HT
Johannes Berg [Wed, 10 Nov 2010 17:56:47 +0000 (09:56 -0800)]
iwlagn: fix RXON HT

When the HT information is changed due to
BSS changes (like legacy stations joining)
we need to recalculate HT RXON parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: re-enable calibration
Johannes Berg [Wed, 10 Nov 2010 17:56:46 +0000 (09:56 -0800)]
iwlagn: re-enable calibration

During the RXON rewrite, this code got lost.
When we've just associated, we need to enable
all calibrations and see if some were already
finished. Add back the missing code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: fix RXON issues
Johannes Berg [Wed, 10 Nov 2010 17:56:45 +0000 (09:56 -0800)]
iwlagn: fix RXON issues

The RXON rework resulted in a massive loss of
throughput because we weren't programming the
device completely correctly -- the BSSID has
to be programmed into the device before the
AP station is uploaded. To fix this, simply
always send the unassoc RXON, i.e. even when
it was already unassoc so that the BSSID and
some other parameters are updated properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: fix needed chains calculation
Johannes Berg [Wed, 10 Nov 2010 17:56:44 +0000 (09:56 -0800)]
iwlagn: fix needed chains calculation

Garen noticed that this was wrong. Fix
the calibration -- default to multiple
chains and fall back to single where
possible.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: resending QoS command when HT changes
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:43 +0000 (09:56 -0800)]
iwlwifi: resending QoS command when HT changes

"mac80211: Fix WMM driver queue configuration"
inadvertedly broke iwlwifi, because now mac80211
configures the QoS settings before assoc, and
therefore before HT. Thus, iwlwifi no longer told
the device about the HT setting, which it needs
to -- and thus throughput went down a lot. Fix
this by resending the QoS command to the device
not only when QoS/WMM settings change, but also
when HT changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwlifi: update rx write pointer w/o request mac access in the CAM mode
Winkler, Tomas [Wed, 10 Nov 2010 17:56:42 +0000 (09:56 -0800)]
iwlwlifi: update rx write pointer w/o request mac access in the CAM mode

In iwl_rx_queue_update_write_ptr function
replace iwl_write_direct32 with iwl_write32 when not in power save mode.
We don't have to go through grab nic access as the NIC is already awake.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: legacy tx_cmd_protection function
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:41 +0000 (09:56 -0800)]
iwlwifi: legacy tx_cmd_protection function

Legacy (4965 and 3945) devices has different tx_cmd_protection routine.
Move to iwl-legacy.c

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: put all the isr related function under ops
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:40 +0000 (09:56 -0800)]
iwlwifi: put all the isr related function under ops

There were two type of isr supported by iwlwifi devices.
  legacy isr - only used by legacy devices (3945 & 4965)
  ict isr - used by all new generation of iwlwifi devices

Move all the isr related functions into ops, the ict type of isr
supports only needed for newer devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: Legacy isr only used by legacy devices
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:39 +0000 (09:56 -0800)]
iwlwifi: Legacy isr only used by legacy devices

Move iwl_isr_legacy function to iwl_legacy.c since it only used
by legacy devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: fix non-5000+ build
Johannes Berg [Wed, 10 Nov 2010 17:56:38 +0000 (09:56 -0800)]
iwlagn: fix non-5000+ build

When building 4965 without 5000+ there were a
lot of build errors due to functions being used
that weren't even compiled in. To fix this move
some code around and only compile the HCMD code
for 5000+ series as it's not used for 4965.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: update PCI ID for 100 series devices
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:37 +0000 (09:56 -0800)]
iwlagn: update PCI ID for 100 series devices

Update the supported PCI ID list for 100 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: update PCI ID for 6000g2a series devices
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:36 +0000 (09:56 -0800)]
iwlagn: update PCI ID for 6000g2a series devices

Update the supported PCI ID list for 6000g2a series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: update PCI ID for 6000g2b series devices
Wey-Yi Guy [Wed, 10 Nov 2010 17:56:35 +0000 (09:56 -0800)]
iwlagn: update PCI ID for 6000g2b series devices

Update the supported PCI ID list for 6000g2b series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Print stats as unsigned ints.
Ben Greear [Mon, 8 Nov 2010 18:50:03 +0000 (10:50 -0800)]
ath5k: Print stats as unsigned ints.

The debugfs code for ath5k was printing some unsigned int
stats with %d instead of %u.  This meant that you could see
negative numbers instead of a clean wrap.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Add watchdog functions for HW queue
Ivo van Doorn [Sat, 6 Nov 2010 14:49:01 +0000 (15:49 +0100)]
rt2x00: Add watchdog functions for HW queue

Add watchdog functions for managing the Queues inside the hardware.
Normally the driver doesn't have much to do with these queues
directly, but the Ralink drivers did implement watchdog functions
for these. These watchdog functions are not triggered that often,
compared to the other watchdog functions, but I have at least
seen them trigger once or twice during a long stresstest run.

v2: Add extra documentation for register fields

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>
13 years agort2x00: Remove rt2x00lib_toggle_rx
Ivo van Doorn [Sat, 6 Nov 2010 14:48:43 +0000 (15:48 +0100)]
rt2x00: Remove rt2x00lib_toggle_rx

As part of the queue refactoring, the rt2x00lib_toggle_rx
can be removed and replaced with the call directly to
the set_device_state callback function.

We can remove the STATE_RADIO_RX_ON_LINK and
STATE_RADIO_RX_OFF_LINK, as it was only used for
special behavior inside rt2x00lib rather then the
drivers.

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>
13 years agort2x00: Fix rt2x00queue_kick_tx_queue arguments
Ivo van Doorn [Sat, 6 Nov 2010 14:48:23 +0000 (15:48 +0100)]
rt2x00: Fix rt2x00queue_kick_tx_queue arguments

The queue_entry argument to rt2x00queue_kick_tx_queue,
doesn't make sense due to the function name (it is called
kick QUEUE)... But neither do we need the queue_entry, since
we need the data_queue.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Rename queue->lock to queue->index_lock
Ivo van Doorn [Sat, 6 Nov 2010 14:48:05 +0000 (15:48 +0100)]
rt2x00: Rename queue->lock to queue->index_lock

The queue->lock is only used to protect the index
numbers. Rename the lock accordingly.

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>
13 years agort2x00: checkpatch.pl error fixes for rt73usb.c
Mark Einon [Sat, 6 Nov 2010 14:47:46 +0000 (15:47 +0100)]
rt2x00: checkpatch.pl error fixes for rt73usb.c

rt73usb.c:43: ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2x00queue.c
Mark Einon [Sat, 6 Nov 2010 14:47:25 +0000 (15:47 +0100)]
rt2x00: checkpatch.pl error fixes for rt2x00queue.c

rt2x00queue.c:804: ERROR: space prohibited after that open parenthesis '('
rt2x00queue.c:805: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2x00link.c
Mark Einon [Sat, 6 Nov 2010 14:47:09 +0000 (15:47 +0100)]
rt2x00: checkpatch.pl error fixes for rt2x00link.c

rt2x00link.c:70: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2x00lib.h
Mark Einon [Sat, 6 Nov 2010 14:46:53 +0000 (15:46 +0100)]
rt2x00: checkpatch.pl error fixes for rt2x00lib.h

rt2x00lib.h:60: ERROR: space prohibited after that open parenthesis '('
rt2x00lib.h:60: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2x00dev.c
Mark Einon [Sat, 6 Nov 2010 14:46:36 +0000 (15:46 +0100)]
rt2x00: checkpatch.pl error fixes for rt2x00dev.c

rt2x00dev.c:689: ERROR: spaces required around that '=' (ctx:WxV)

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2x00config.c
Mark Einon [Sat, 6 Nov 2010 14:46:17 +0000 (15:46 +0100)]
rt2x00: checkpatch.pl error fixes for rt2x00config.c

rt2x00config.c:136: ERROR: space required before the open parenthesis '('

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2800usb.h
Mark Einon [Sat, 6 Nov 2010 14:45:58 +0000 (15:45 +0100)]
rt2x00: checkpatch.pl error fixes for rt2800usb.h

rt2800usb.h:43: ERROR: space prohibited after that open parenthesis '('
rt2800usb.h:43: ERROR: space prohibited before that close parenthesis ')'
rt2800usb.h:44: ERROR: space prohibited after that open parenthesis '('
rt2800usb.h:44: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2800usb.c
Mark Einon [Sat, 6 Nov 2010 14:45:41 +0000 (15:45 +0100)]
rt2x00: checkpatch.pl error fixes for rt2800usb.c

 rt2800usb.c:48: ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2800pci.h
Mark Einon [Sat, 6 Nov 2010 14:45:22 +0000 (15:45 +0100)]
rt2x00: checkpatch.pl error fixes for rt2800pci.h

rt2800pci.h:41: ERROR: Macros with complex values should be enclosed in parenthesis
rt2800pci.h:42: ERROR: Macros with complex values should be enclosed in parenthesis
rt2800pci.h:43: ERROR: Macros with complex values should be enclosed in parenthesis
rt2800pci.h:44: ERROR: Macros with complex values should be enclosed in parenthesis
rt2800pci.h:55: ERROR: space prohibited after that open parenthesis '('
rt2800pci.h:55: ERROR: space prohibited before that close parenthesis ')'
rt2800pci.h:56: ERROR: space prohibited after that open parenthesis '('
rt2800pci.h:56: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2800lib.c
Mark Einon [Sat, 6 Nov 2010 14:45:06 +0000 (15:45 +0100)]
rt2x00: checkpatch.pl error fixes for rt2800lib.c

rt2800lib.c:831: ERROR: inline keyword should sit between storage class and type

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2800.h
Mark Einon [Sat, 6 Nov 2010 14:44:52 +0000 (15:44 +0100)]
rt2x00: checkpatch.pl error fixes for rt2800.h

rt2800.h:1511: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1511: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1513: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1513: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1515: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1515: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1517: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1517: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1519: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1519: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1521: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1521: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1661: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1661: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1662: ERROR: space prohibited after that open parenthesis '('
rt2800.h:1662: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:1663: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:2013: ERROR: space prohibited after that open parenthesis '('
rt2800.h:2013: ERROR: space prohibited before that close parenthesis ')'
rt2800.h:2014: ERROR: space prohibited after that open parenthesis '('
rt2800.h:2014: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2500usb.c
Mark Einon [Sat, 6 Nov 2010 14:44:33 +0000 (15:44 +0100)]
rt2x00: checkpatch.pl error fixes for rt2500usb.c

rt2500usb.c:42: ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2500pci.h
Mark Einon [Sat, 6 Nov 2010 14:44:15 +0000 (15:44 +0100)]
rt2x00: checkpatch.pl error fixes for rt2500pci.h

rt2500pci.h:1091: ERROR: space prohibited after that open parenthesis '('
rt2500pci.h:1091: ERROR: space prohibited before that close parenthesis ')'
rt2500pci.h:1092: ERROR: space prohibited after that open parenthesis '('
rt2500pci.h:1092: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: checkpatch.pl error fixes for rt2400pci.h
Mark Einon [Sat, 6 Nov 2010 14:44:00 +0000 (15:44 +0100)]
rt2x00: checkpatch.pl error fixes for rt2400pci.h

rt2400pci.h:812: ERROR: space prohibited after that open parenthesis '('
rt2400pci.h:812: ERROR: space prohibited before that close parenthesis ')'
rt2400pci.h:813: ERROR: space prohibited after that open parenthesis '('
rt2400pci.h:813: ERROR: space prohibited before that close parenthesis ')'
rt2400pci.h:950: ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: tx path review
Christian Lamparter [Sat, 6 Nov 2010 13:07:10 +0000 (14:07 +0100)]
carl9170: tx path review

This patch fixes a few shortcomings in the tx path.

 * move temp. ampdu_[ack]_len out of txinfo->pad.

 * fix WARN_ON from tx.c:line 300 when tx_ampdu_queue
   fails to queue the frame.

 * In tx_prepare, we already have a local pointer
   to the station's ieee80211_sta struct.

 * remove a second !sta check, tx_prepare already takes
   care of that.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Remove redundant checks for NULL before calls to crypto_free_cipher()
Jesper Juhl [Thu, 4 Nov 2010 21:59:56 +0000 (22:59 +0100)]
mac80211: Remove redundant checks for NULL before calls to crypto_free_cipher()

crypto_free_cipher() is a wrapper around crypto_free_tfm() which is a
wrapper around crypto_destroy_tfm() and the latter can handle being passed
a NULL pointer, so checking for NULL in the
ieee80211_aes_key_free()/ieee80211_aes_cmac_key_free() wrappers around
crypto_free_cipher() is pointless and just increase object code size
needlesly and makes us execute extra test/branch instructions that we
don't need.
Btw; don't we have to many wrappers around wrappers ad nauseam here?
Anyway, this patch removes the redundant conditionals.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix comments in rt73usb.h and rt61pci.h
Lalith Suresh [Thu, 4 Nov 2010 19:43:16 +0000 (20:43 +0100)]
rt2x00: Fix comments in rt73usb.h and rt61pci.h

This patch fixes a few comments in rt73usb.h and rt61pci.h.

Signed-off-by: Lalith Suresh <suresh.lalith@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix hw crypto in AP mode for some devices
Helmut Schaa [Thu, 4 Nov 2010 19:42:36 +0000 (20:42 +0100)]
rt2x00: Fix hw crypto in AP mode for some devices

The BSSID register shouldn't be set in AP mode on some older devices (like
rt73usb) as it breaks hw crypto on these. However, rt2800 devices explicitly
need the BSSID register set to the same value as our own MAC address (only
in AP mode).

Hence, don't set the BSSID from rt2x00lib but move it down into rt2800 to
avoid problems on older devices.

This fixes a regression (at least for rt73usb) and avoids a new regression
for rt2800 devices in 2.6.36.

Reported-by: Johannes Stezenbach <js@sig21.net>
Reported-by: Lee <lee-in-berlin@web.de>
Signed-off-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>
13 years agort2x00: Fix crash on USB unplug
Ivo van Doorn [Thu, 4 Nov 2010 19:41:05 +0000 (20:41 +0100)]
rt2x00: Fix crash on USB unplug

By not scheduling the TX/RX completion worker threads
when Radio is disabled, or hardware has been unplugged,
the queues cannot be completely cleaned.

This causes crashes when the hardware has been unplugged while
the radio is still enabled.

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>
13 years agort2x00: Fix MCU_SLEEP arguments
Ivo van Doorn [Thu, 4 Nov 2010 19:40:46 +0000 (20:40 +0100)]
rt2x00: Fix MCU_SLEEP arguments

Legacy driver uses 0xff as the second argument for the MCU_SLEEP
command. It is still unknown what the values actually mean, but
this will at least keep the command in-sync with the original
driver.

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>
13 years agort2x00: Implement flush callback
Ivo van Doorn [Thu, 4 Nov 2010 19:40:11 +0000 (20:40 +0100)]
rt2x00: Implement flush callback

Implement a basic flush callback function, which simply loops
over all TX queues and waits until all frames have been transmitted
and the status reports have been gathered.

At this moment we don't support dropping any frames during the
flush, but mac80211 will only send 'false' for this argument anyway,
so this is not important at this time.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Remove failsave from rt2x00usb_watchdog_tx_dma
Ivo van Doorn [Thu, 4 Nov 2010 19:39:48 +0000 (20:39 +0100)]
rt2x00: Remove failsave from rt2x00usb_watchdog_tx_dma

When the TX status handler failed to clear the queue
in rt2x00usb_watchdog_tx_dma() we shouldn't use a failsave
to use the rt2x00usb txdone handler.

If a driver has overriden the txdone handler it must make
sure the txdone handler is capable of cleaning up the queue itself.

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>
13 years agort2x00: Rename rt2x00queue_timeout
Ivo van Doorn [Thu, 4 Nov 2010 19:39:23 +0000 (20:39 +0100)]
rt2x00: Rename rt2x00queue_timeout

Rename rt2x00queue_timeout to rt2x00queue_status_timeout to
better describe what is actually timing out (note that
we already have a rt2x00queue_dma_timeout).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Optimize rt2x00debug_dump_frame when frame dumping is not active
Helmut Schaa [Thu, 4 Nov 2010 19:38:56 +0000 (20:38 +0100)]
rt2x00: Optimize rt2x00debug_dump_frame when frame dumping is not active

When rt2x00 is compiled with debugging but frame dumping is currently
not active we can avoid the call to do_gettimeofday. Furthermore,
frame dumping is not the default case, mark it as unlikely.

Signed-off-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>
13 years agort2x00: Reduce tx descriptor size
Helmut Schaa [Thu, 4 Nov 2010 19:38:15 +0000 (20:38 +0100)]
rt2x00: Reduce tx descriptor size

The tx descriptor values qid, cw_min, cw_max and aifs are directly
accessible through the tx entry struct. So there's no need to copy
them into the tx descriptor and passing them to the indiviual drivers.
Instead we can just get the correct value from the tx entry.

Signed-off-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>
13 years agort2x00: Wait up to one second on rt2800 for WPDMA to be ready
Helmut Schaa [Thu, 4 Nov 2010 19:37:47 +0000 (20:37 +0100)]
rt2x00: Wait up to one second on rt2800 for WPDMA to be ready

At least some devices need such a long time to inititalize WPDMA. This
only increases the maximum wait time and shouldn't affect devices that
have been working before.

Reported-by: Joshua Smith <jesmith@kaon.com>
Signed-off-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>
13 years agort2x00: Sync Tx and RX ring sizes with legacy drivers
Helmut Schaa [Thu, 4 Nov 2010 19:37:22 +0000 (20:37 +0100)]
rt2x00: Sync Tx and RX ring sizes with legacy drivers

All rt2x00 devices used the same Tx and Rx ring size (24 entries) till
now. Newer devices (like rt2800) can however make use of a larger TX and
RX ring due to 11n capabilities (AMPDUs of size 64 for example).

Hence, bring rt2x00 in sync with the legacy drivers and use the same TX
and RX ring sizes. Also remove the global defines RX_ENTRIES, TX_ENTRIES,
BEACON_ENTRIES and ATIM_ENTRIES and use per driver values.

That is 24 entries for rt2400pci, 32 entries for rt2500pci, rt2500usb,
rt61pci and rt73usb and 128 (RX) and 64 (TX) for rt2800pci and rt2800usb.

Signed-off-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>
13 years agort2x00: Add TXOP_CTRL_CFG register definition
Helmut Schaa [Thu, 4 Nov 2010 19:36:59 +0000 (20:36 +0100)]
rt2x00: Add TXOP_CTRL_CFG register definition

Remove the magic value initialisation of the TXOP_CTRL_CFG register by
defining its fields and using them during intialisation. The field
RESERVED_TRUN_EN is referred to as reserved, however it is set to 1 by
the legacy drivers. Hence, do the same.

Signed-off-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>
13 years agoath9k: rework tx queue selection and fix queue stopping/waking
Felix Fietkau [Sun, 7 Nov 2010 13:59:39 +0000 (14:59 +0100)]
ath9k: rework tx queue selection and fix queue stopping/waking

The current ath9k tx queue handling code showed a few issues that could
lead to locking issues, tx stalls due to stopped queues, and maybe even
DMA issues.

The main source of these issues is that in some places the queue is
selected via skb queue mapping in places where this mapping may no
longer be valid. One such place is when data frames are transmitted via
the CAB queue (for powersave buffered frames). This is made even worse
by a lookup WMM AC values from the assigned tx queue (which is
undefined for the CAB queue).

This messed up the pending frame counting, which in turn caused issues
with queues getting stopped, but not woken again.

To fix these issues, this patch removes an unnecessary abstraction
separating a driver internal queue number from the skb queue number
(not to be confused with the hardware queue number).

It seems that this abstraction may have been necessary because of tx
queue preinitialization from the initvals. This patch avoids breakage
here by pushing the software <-> hardware queue mapping to the function
that assigns the tx queues and redefining the WMM AC definitions to
match the numbers used by mac80211 (also affects ath9k_htc).

To ensure consistency wrt. pending frame count tracking, these counters
are moved to the ath_txq struct, updated with the txq lock held, but
only where the tx queue selected by the skb queue map actually matches
the tx queue used by the driver for the frame.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Björn Smedman <bjorn.smedman@venatech.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43legacy: rfkill: use status register based on core revision (not PHY's)
Rafał Miłecki [Wed, 3 Nov 2010 20:36:12 +0000 (21:36 +0100)]
b43legacy: rfkill: use status register based on core revision (not PHY's)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agozd1201: Add missing id
maximilian attems [Tue, 2 Nov 2010 22:39:12 +0000 (23:39 +0100)]
zd1201: Add missing id

The Mandriva patch seems to stem from 2.6.14, so much for their
upstreaming effort.

Didn't find another Linux reference of it, just an omnious
"USB\VID_1044&PID_8004" from GigabyteZD1201U.INF for
Gigabyte GN-WLBZ101 802.11b USB Adapter, which matches the
Mandriva patch comment.

Aboves file also lists an "USB\VID_1044&PID_8006", which I have
kept appart as this "Gigabyte GN-WBZB-M 802.11b USB Adapter"
didn't show up in googling.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agozd1211rw: add 2 missing usb id's
maximilian attems [Tue, 2 Nov 2010 22:10:12 +0000 (23:10 +0100)]
zd1211rw: add 2 missing usb id's

"These USB ID came from Palnex <http://www.planex.co.jp/>
Worked fine." says Mandriva patch for their 2.6.32 and earlier.

Web has evidence for both id's to work, so just add them upstream:
http://www.mail-archive.com/zd1211-devs@lists.sourceforge.net/msg00507.html
http://ubuntuforums.org/showthread.php?t=473046

Signed-off-by: Go Taniguchi <go@turbolinux.co.jp>
Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: restore anaparam registers after reset with 8187B
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:39 +0000 (22:59 -0200)]
rtl8187: restore anaparam registers after reset with 8187B

Current 8187B initialization misses anaparam registers restore after
8187 reset. This causes ANAPARAM register to stay zeroed out (ANAPARAM2
kept its value on my tests). To avoid this, call rtl8187_set_anaparam
right after chip reset (to be on the safe side, as it makes sure we
restore all ANAPARAM registers).

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: seno <senada@t-online.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: remove uneeded setting of anaparam write
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:38 +0000 (22:59 -0200)]
rtl8187: remove uneeded setting of anaparam write

Usually you set RTL818X_CONFIG3_ANAPARAM_WRITE when you are going to
change/write ANAPARAM registers. But in current initialization of
RTL8187B there is a place where ANAPARAM_WRITE bit is set without any
ANAPARAM register being written, without reason, so remove it.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: seno <senada@t-online.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: consolidate anaparam on/off write sequences
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:37 +0000 (22:59 -0200)]
rtl8187: consolidate anaparam on/off write sequences

There are repeated calls for anaparam on/off sequence in the code.
Consolidate the common code in rtl8187_set_anaparam and use it where
needed.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: don't set RTL818X_CONFIG3_GNT_SELECT flag on 8187B
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:36 +0000 (22:59 -0200)]
rtl8187: don't set RTL818X_CONFIG3_GNT_SELECT flag on 8187B

The GNTSel bit should only concern pci devices by looking at RTL8180
spec, which is not the case of 8187B. Also testing shows that trying to
set this bit fails, a subsequent read from the register after trying to
set it shows that the bit isn't set, seems the hardware ignores it,
which makes sense. This setting was a left over from Realtek sources.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: move pll reset at start out of ANAPARAM write
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:35 +0000 (22:59 -0200)]
rtl8187: move pll reset at start out of ANAPARAM write

On 8187B start, comment about pll reset, and move it out of ANAPARAM
write sequence, so that code is more readable.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: avoid redundant write to register FF72 (RFSW_CTRL)
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:34 +0000 (22:59 -0200)]
rtl8187: avoid redundant write to register FF72 (RFSW_CTRL)

The table with misc register initialization was setting it, and later
on we would set it again with a explicity call to rtl818x_iowrite16_idx.

Remove duplicate initialization from the register table.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: fix wrong register initialization in 8187B
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:33 +0000 (22:59 -0200)]
rtl8187: fix wrong register initialization in 8187B

We were using wrong address for BRSR (Basic Rate Set Register) while
initializing its value, comparing with Realtek sources, for 8187B case.

Also, the same register is initialized in rtl8187b_reg_table, so remove
the duplicate initialization from the table.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: remove setting of beacon/atim registers from initialization
Herton Ronaldo Krzesinski [Tue, 2 Nov 2010 00:59:32 +0000 (22:59 -0200)]
rtl8187: remove setting of beacon/atim registers from initialization

On 8187B path, we set a initial value for beacon interval and atim
window on initialization. But this isn't needed, since same setup is
done on rtl8187_config.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>