GitHub/moto-9609/android_kernel_motorola_exynos9610.git
13 years agoiwlwifi: set default aggregation frame limit to 63
Daniel Halperin [Mon, 21 Mar 2011 22:27:34 +0000 (15:27 -0700)]
iwlwifi: set default aggregation frame limit to 63

This gives much better performance at fast 3x3 rates (up to ~160 Mbps).
The scheduler will still make most decisions about batch size based on
available packets and RX parameters.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: add RATE_MCS_RATE_MSK
Daniel Halperin [Sat, 19 Mar 2011 01:48:55 +0000 (18:48 -0700)]
iwlwifi: add RATE_MCS_RATE_MSK

Throughout the code we use rate_n_flags & 0xff to extract the lower byte
of the rate_n_flags u32 that contains the information about the rate.
Add a #define and remove the use of the magic number.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: cleanup and bugfix tx aggregation code
Daniel Halperin [Thu, 17 Mar 2011 00:17:36 +0000 (17:17 -0700)]
iwlwifi: cleanup and bugfix tx aggregation code

Since the driver split, there's no need for no_agg_framecnt_info since
all devices have this set to false. Secondly, the compressed block ack
handling code was broken. Fix this.

(1) A shift less than zero simply implies that the buffer wrapped, this
is expected. Remove the incorrect comment.

(2) The (agg->frame_count > (64-sh)) condition can happen if the last
frame is dropped. E.g., if I send 7 frames and the 6th is received but
the 7th is lost, the other side may only shift the window 6, not 7
frames since the last bit is a 0. This is perfectly fine behavior and
doesn't invalidate the feedback.

(3) Store the feedback from a Compressed BA in the first newly received
frame, rather than the start of the window. This way it will get
processed by the rate selection code. Feedback stored in a non-received
frame is likely to get overwritten by the retransmission.
    This is based on the approach taken by minstrel_ht.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: limit number of attempts for highest HT rate
Daniel Halperin [Thu, 17 Mar 2011 02:16:36 +0000 (19:16 -0700)]
iwlwifi: limit number of attempts for highest HT rate

When filling out its rate scale table, iwlwifi repeats the first HT rate
IWL_HT_NUMBER_TRY times. The hardware scheduler will stop using
aggregation for any frame that fails LINK_QUAL_AGG_DISABLE_START_DEF
times. Currently, both these constants equal 3.

If iwlwifi probes a faster rate than the link supports, all frames in a
(potentially tens of frames large) batch will fail IWL_HT_NUMBER_TRY
times. Because this happens to be as large as
LINK_QUAL_AGG_DISABLE_START_DEF, all frames will then be sent
individually. This leads to a short, but performance-degrading window
where the legacy stop-and-wait MAC takes over.

Bounding the initial rate by (LINK_QUAL_AGG_DISABLE_START_DEF-1)
attempts makes the third try use a lower rate and hence more be likely
to succeed. This somewhat mitigates the above described behavior.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: fix aggregation queue scheduler setup
Johannes Berg [Tue, 15 Mar 2011 18:33:03 +0000 (11:33 -0700)]
iwlagn: fix aggregation queue scheduler setup

iwlagn's hardware scheduler needs to be set up
with the right aggregation frame limit and
buffer sizes. To achieve this, we need to move
the hardware queue setup to when the session
becomes operational.

Tested-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: clean up TX aggregation code
Johannes Berg [Tue, 15 Mar 2011 11:59:10 +0000 (04:59 -0700)]
iwlagn: clean up TX aggregation code

Since the driver split, there's no need for
function pointers any more for aggregation
queue setup and teardown as all devices now
share the same code. Simplify this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: use 6030 configuration for 6035 series
Wey-Yi Guy [Thu, 10 Mar 2011 11:17:16 +0000 (03:17 -0800)]
iwlagn: use 6030 configuration for 6035 series

6035 series of devices should use the same uCode as 6030 series,
change it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlegacy: MAINTAINERS
Wey-Yi Guy [Wed, 23 Feb 2011 00:43:05 +0000 (16:43 -0800)]
iwlegacy: MAINTAINERS

Add iwlegacy driver to MAINTAINERS file and mark as 'Orphan'

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoath9k: fix aggregation related interoperability issues
Felix Fietkau [Sat, 12 Mar 2011 00:11:28 +0000 (01:11 +0100)]
ath9k: fix aggregation related interoperability issues

Some clients seems to keep track of their reorder window even after an
aggregation session has been disabled. This causes issues if there are
still retried but not completed frames pending for the TID.
To ensure that rx does not stall in such situations, set sendbar to 1
for any frame purged from the TID queue on teardown.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix channel type recalculation with HT and non-HT interfaces
Felix Fietkau [Fri, 11 Mar 2011 20:45:51 +0000 (21:45 +0100)]
mac80211: fix channel type recalculation with HT and non-HT interfaces

When running an AP interface along with the cooked monitor interface created
by hostapd, adding an interface and deleting it again triggers a channel type
recalculation during which the (non-HT) monitor interface takes precedence
over the HT AP interface, thus causing the channel type to be set to non-HT.
Fix this by ensuring that a more wide channel type will not be overwritten
by a less wide channel type.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: improve reliability of beacon transmission and stuck beacon handling
Felix Fietkau [Fri, 11 Mar 2011 20:38:20 +0000 (21:38 +0100)]
ath9k: improve reliability of beacon transmission and stuck beacon handling

ath9k calls ath9k_hw_stoptxdma every time it sends a beacon, however there
is not much point in doing that if the previous beacon and mcast traffic
went out properly. On AR9380, calling that function too often can result
in an increase of stuck beacons due to differences in the handling of the
queue enable/disable functionality.

With this patch, the queue will only be explicitly stopped if the previous
data frames were not sent successfully. With the beacon code being the
only remaining user of ath9k_hw_stoptxdma, this function can be simplified
in order to remove the now pointless attempts at waiting for transmission
completion, which would never happen at this point due to the different
method of tx scheduling of the beacon queue.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix the .flush driver op implementation
Felix Fietkau [Fri, 11 Mar 2011 20:38:19 +0000 (21:38 +0100)]
ath9k: fix the .flush driver op implementation

This patch simplifies the flush op and reuses ath_drain_all_txq for
flushing out pending frames if necessary. It also uses a global timeout
of 200ms instead of the per-queue 60ms timeout.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix stopping tx dma on reset
Felix Fietkau [Fri, 11 Mar 2011 20:38:18 +0000 (21:38 +0100)]
ath9k: fix stopping tx dma on reset

In some situations, stopping Tx DMA frequently fails, leading to messages
like this:

ath: Failed to stop TX DMA in 100 msec after killing last frame
ath: Failed to stop TX DMA!

This patch uses a few MAC features to abort DMA globally instead of iterating
over all hardware queues and attempting to stop them individually.
Not only is that faster and works with a shorter timeout, it also makes the
process much more reliable.

With this change, I can no longer trigger these messages on AR9380,
and on AR9280 they become much more rare.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix REG_SET_BIT and REG_CLR_BIT for multiple bits
Felix Fietkau [Fri, 11 Mar 2011 20:38:17 +0000 (21:38 +0100)]
ath9k_hw: fix REG_SET_BIT and REG_CLR_BIT for multiple bits

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Shortcut minstrel_ht rate setup for non-MRR capable devices
Helmut Schaa [Wed, 9 Mar 2011 09:02:38 +0000 (10:02 +0100)]
mac80211: Shortcut minstrel_ht rate setup for non-MRR capable devices

Devices without multi rate retry support won't be able to use all rates
as specified by mintrel_ht. Hence, we can simply skip setting up further
rates as the devices will only use the first one.

Also add a special case for devices with only two possible tx rates. We
use sample_rate -> max_prob_rate for sampling and max_tp_rate ->
max_prob_rate by default.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: implement ieee80211_ops->{get,set}_ringparam
John W. Linville [Mon, 7 Mar 2011 21:32:59 +0000 (16:32 -0500)]
ath5k: implement ieee80211_ops->{get,set}_ringparam

set_ringparam only allows changes to tx ring at this time.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: implement support for cfg80211_ops->{get,set}_ringparam
John W. Linville [Mon, 7 Mar 2011 21:19:18 +0000 (16:19 -0500)]
mac80211: implement support for cfg80211_ops->{get,set}_ringparam

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless: add support for ethtool_ops->{get,set}_ringparam
John W. Linville [Mon, 7 Mar 2011 21:17:59 +0000 (16:17 -0500)]
wireless: add support for ethtool_ops->{get,set}_ringparam

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: support off-channel TX
Johannes Berg [Fri, 11 Mar 2011 04:13:26 +0000 (20:13 -0800)]
iwlagn: support off-channel TX

Add support to iwlagn for off-channel TX. The
microcode API for this is a bit strange in that
it uses a hacked-up scan command, so the scan
code needs to change quite a bit to accomodate
that and be able to send it out.

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 agomac80211: do not enable ps if 802.1x controlled port is unblocked
Jason Young [Fri, 11 Mar 2011 00:43:19 +0000 (16:43 -0800)]
mac80211: do not enable ps if 802.1x controlled port is unblocked

If dynamic_ps is disabled, enabling power save before the 4-way
handshake completes may delay the station from being authorized to
send/receive traffic, i.e. increase roaming times. It also may result in
a failed 4-way handshake depending on the AP's timing requirements and
beacon interval, and the station's listen interval.

To fix this, prevent power save from being enabled while the station
isn't authorized and recalculate power save whenever the station's
authorized state changes.

Signed-off-by: Jason Young <a.young.jason@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: fix write past end of array in mesh_id_get()
Dan Carpenter [Thu, 10 Mar 2011 15:23:26 +0000 (18:23 +0300)]
libertas: fix write past end of array in mesh_id_get()

defs.meshie.val.mesh_id is 32 chars long.  It's not supposed to be NUL
terminated.  This code puts a terminator on the end to make it easier to
print to sysfs.  The problem is that if the mesh_id fills the entire
buffer the original code puts the terminator one spot past the end.

The way the original code was written, there was a check to make sure
that maxlen was less than PAGE_SIZE.  Since we know that maxlen is at
most 34 chars, I just removed the check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Increase the wait count for nf load.
Vivek Natarajan [Thu, 10 Mar 2011 05:35:43 +0000 (11:05 +0530)]
ath9k_hw: Increase the wait count for nf load.

Increasing the wait count makes the nf load pass in
most of the cases.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix PLL initialization for AR9485.
Vivek Natarajan [Thu, 10 Mar 2011 05:35:42 +0000 (11:05 +0530)]
ath9k_hw: Fix PLL initialization for AR9485.

Increase the delay to make sure the initialization of pll
passes.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Improve idle power consumption for AR9485.
Vivek Natarajan [Thu, 10 Mar 2011 05:35:41 +0000 (11:05 +0530)]
ath9k_hw: Improve idle power consumption for AR9485.

Set some GPIO pins to Pull-down mode to save power.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove support for the FIF_PROMISC_IN_BSS filter flag
Felix Fietkau [Wed, 9 Mar 2011 00:48:12 +0000 (01:48 +0100)]
ath9k: remove support for the FIF_PROMISC_IN_BSS filter flag

The hardware rx filter flag triggered by FIF_PROMISC_IN_BSS is overly broad
and covers even frames with PHY errors. When this flag is enabled, this message
shows up frequently during scanning or hardware resets:

ath: Could not stop RX, we could be confusing the DMA engine when we start RX up

Since promiscuous mode is usually not particularly useful, yet enabled by
default by bridging (either used normally in 4-addr mode, or with hacks
for various virtualization software), we should sacrifice it for better
reliability during normal operation.

This patch leaves it enabled if there are active monitor mode interfaces, since
it's very useful for debugging.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: fix elp_work race condition
Grazvydas Ignotas [Sun, 6 Mar 2011 17:23:37 +0000 (19:23 +0200)]
wl1251: fix elp_work race condition

While working on PS I've noticed elp_work is kicking rather often, and
sometimes the chip is put to sleep before 5ms delay expires. This
seems to happen because by the time wl1251_ps_elp_wakeup is called
elp_work might still be pending. After wakeup is done, the processing
may take some time, during which 5ms might expire and elp_work might
get scheduled. In this case, ss soon as 1st thread finishes work and
releases the mutex, elp_work will then put the device to sleep without
5ms delay. In addition 1st thread will queue additional elp_work
needlessly.

Fix this by cancelling work in wl1251_ps_elp_wakeup instead.

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: remove wl1251_ps_set_elp function
Grazvydas Ignotas [Sun, 6 Mar 2011 17:23:36 +0000 (19:23 +0200)]
wl1251: remove wl1251_ps_set_elp function

wl1251_ps_set_elp() only does acx_sleep_auth call and takes the chip
from/to ELP, however all callers of wl1251_ps_set_mode() have already
taken the chip out of ELP and puts it back to ELP when they finish.
This makes ELP calls (and register writes they result in) superfluous.

So remove wl1251_ps_set_elp function and call acx_sleep_auth directly.

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 agomac80211: update minstrel_ht sample rate when probe is set
Daniel Halperin [Wed, 9 Mar 2011 11:10:18 +0000 (03:10 -0800)]
mac80211: update minstrel_ht sample rate when probe is set

Waiting until the status is received can cause the same rate to be
probed multiple times consecutively.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: restrict AR5K_TX_QUEUE_ID_DATA_MAX to reflect the [0,3] range
John W. Linville [Tue, 8 Mar 2011 21:36:00 +0000 (16:36 -0500)]
ath5k: restrict AR5K_TX_QUEUE_ID_DATA_MAX to reflect the [0,3] range

This just matches reality...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
13 years agonet/wireless: add COUNTRY to to regulatory device uevent
Scott James Remnant [Tue, 8 Mar 2011 18:45:30 +0000 (10:45 -0800)]
net/wireless: add COUNTRY to to regulatory device uevent

Regulatory devices issue change uevents to inform userspace of a need
to call the crda tool; however these can often be sent before udevd is
running, and were not previously included in the results of
udevadm trigger (which requests a new change event using the /uevent
attribute of the sysfs object).

Add a uevent function to the device type which includes the COUNTRY
information from the last request if it has yet to be processed, the
case of multiple requests is already handled in the code by checking
whether an unprocessed one is queued in the same manner and refusing
to queue a new one.

The existing udev rule continues to work as before.

Signed-off-by: Scott James Remnant <keybuk@google.com>
Acked-By: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoieee80211: add IEEE80211_COUNTRY_STRING_LEN definition
Bing Zhao [Mon, 7 Mar 2011 19:14:23 +0000 (11:14 -0800)]
ieee80211: add IEEE80211_COUNTRY_STRING_LEN definition

and make use of it in wireless drivers

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: use kcalloc instead of kmalloc & memset
Shan Wei [Tue, 8 Mar 2011 03:02:03 +0000 (11:02 +0800)]
mwl8k: use kcalloc instead of kmalloc & memset

Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

Thanks coccicheck for detecting this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix scan race, simplify code
Johannes Berg [Mon, 7 Mar 2011 14:48:41 +0000 (15:48 +0100)]
mac80211: fix scan race, simplify code

The scan code has a race that Michael reported
he ran into, but it's easy to fix while at the
same time simplifying the code.

The race resulted in the following warning:

------------[ cut here ]------------
WARNING: at net/mac80211/scan.c:310 ieee80211_rx_bss_free+0x20c/0x4b8 [mac80211]()
Modules linked in: [...]
[<c0033edc>] (unwind_backtrace+0x0/0xe0) from [<c004f2a4>] (warn_slowpath_common+0x4c/0x64)
[... backtrace wasn't useful ...]

Reported-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: trivial: update B43_PHY_N description (PHY support)
Rafał Miłecki [Mon, 7 Mar 2011 14:09:19 +0000 (15:09 +0100)]
b43: trivial: update B43_PHY_N description (PHY support)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54spi: Update kconfig help text
Michael Buesch [Mon, 7 Mar 2011 12:31:24 +0000 (13:31 +0100)]
p54spi: Update kconfig help text

This updates the p54spi Kconfig help text.
The driver works well on n8x0, so remove the words "experimental" and "untested".

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Add log message to ieee80211_restart_hw()
Michael Buesch [Mon, 7 Mar 2011 12:09:12 +0000 (13:09 +0100)]
mac80211: Add log message to ieee80211_restart_hw()

Add a log message to ieee80211_restart_hw() to highlight
that special codepath in the logs. This helps debugging
bugs in the rarely tested restart code.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix iwl-rx.c compilation
Stanislaw Gruszka [Mon, 7 Mar 2011 08:22:24 +0000 (09:22 +0100)]
iwlwifi: fix iwl-rx.c compilation

My commit 466a19a003f3b45a755bc85f967c21da947f9a00 "iwlwifi: move rx
handlers code to iwl-rx.c" breaks compilation on 32 bits. Fix that.

Reported-by: Guy, Wey-Yi <wey-yi.w.guy@intel.com>
Reported-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless:ath: use resource_size() help function
Shan Wei [Mon, 7 Mar 2011 07:18:11 +0000 (15:18 +0800)]
wireless:ath: use resource_size() help function

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove unused macros
Shan Wei [Fri, 4 Mar 2011 07:14:16 +0000 (15:14 +0800)]
mac80211: remove unused macros

Compile test only.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Put hardware in PROMISC mode if there is more than 1 stations.
Ben Greear [Thu, 3 Mar 2011 22:39:05 +0000 (14:39 -0800)]
ath5k: Put hardware in PROMISC mode if there is more than 1 stations.

It seems ath5k has issues receiving broadcast packets (ARPs) when
using multiple STA interfaces associated with multiple APs.
This patch ensures the NIC is always in PROMISC mode if there
are more than 1 stations associated.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: avoid too frequent recover from statistics
Stanislaw Gruszka [Fri, 4 Mar 2011 16:51:51 +0000 (17:51 +0100)]
iwlwifi: avoid too frequent recover from statistics

Usually H/W generate statistics notify once per about 100ms, but
sometimes we can receive notify in shorter time, even 2 ms.

This can be problem for plcp health and ack health checking.

I.e. with 2 plcp errors happens randomly in 2 ms duration, we
exceed plcp delta threshold equal to 100 (2*100/2).

Also checking ack's in short time, can results not necessary false
positive and firmware reset, for example when channel is noised and
we do not receive ACKs frames or when remote device does not send
ACKs at the moment.

Patch change code to do statistic check and possible recovery only
if 99ms elapsed from last check. Forced delay should assure we have
good statistic data to estimate hardware state.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: cleanup iwl_good_plcp_health
Stanislaw Gruszka [Fri, 4 Mar 2011 16:51:50 +0000 (17:51 +0100)]
iwlwifi: cleanup iwl_good_plcp_health

Make iwl_good_plcp_health code easiest to read.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: move rx handlers code to iwl-rx.c
Stanislaw Gruszka [Fri, 4 Mar 2011 16:51:49 +0000 (17:51 +0100)]
iwlwifi: move rx handlers code to iwl-rx.c

Put generic rx_handlers (except iwlagn_rx_reply_compressed_ba) to
iwl-rx.c . Make functions static and change prefix from iwlagn_ to
iwl_ . Beautify iwl_setup_rx_handlers and do some other minor coding
style changes.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Remove redundant preamble and RTS flag setup in minstrel_ht
Helmut Schaa [Fri, 4 Mar 2011 12:31:31 +0000 (13:31 +0100)]
mac80211: Remove redundant preamble and RTS flag setup in minstrel_ht

mac80211 does the same afterwards anyway. Hence, just drop
this redundant code.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix txq memory address printing in debugfs.
Ben Greear [Fri, 4 Mar 2011 00:25:59 +0000 (16:25 -0800)]
ath9k: Fix txq memory address printing in debugfs.

No use printing addresses of pointers, just print the
pointers themselves.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Remove unused rt2x00queue_get_queue function.
Gertjan van Wingerde [Thu, 3 Mar 2011 18:47:21 +0000 (19:47 +0100)]
rt2x00: Remove unused rt2x00queue_get_queue function.

Now that all accesses to the data_queue structures is done via the specialized
rt2x00queue_get_tx_queue function or via direct accesses, there is no
need for the rt2x00queue_get_queue function anymore, so remove it.

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>
13 years agort2x00: Optimize getting the beacon queue structure.
Gertjan van Wingerde [Thu, 3 Mar 2011 18:46:55 +0000 (19:46 +0100)]
rt2x00: Optimize getting the beacon queue structure.

In the spirit of optimizing the code to get the queue structure of TX queues,
also optimize the code to get beacon queues. We can simply use the bcn queue
field of the rt2x00_dev structure instead of using the rt2x00queue_get_queue
function.

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>
13 years agort2x00: Include ATIM queue support in rt2x00queue_get_tx_queue.
Gertjan van Wingerde [Thu, 3 Mar 2011 18:46:29 +0000 (19:46 +0100)]
rt2x00: Include ATIM queue support in rt2x00queue_get_tx_queue.

The ATIM queue is considered to be a TX queue by the drivers that support
the queue. Therefore include support for the ATIM queue to the
rt2x00queue_get_tx_queue function so that the drivers that support the ATIM
queue can also use that function.

Add the support in such a way that drivers that do not support the ATIM
queue are not penalized in their efficiency.

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>
13 years agort2x00: Don't treat ATIM queue as second beacon queue.
Gertjan van Wingerde [Thu, 3 Mar 2011 18:46:09 +0000 (19:46 +0100)]
rt2x00: Don't treat ATIM queue as second beacon queue.

Current code for the atim queue is strange, as it is considered in the
rt2x00_dev structure as a second beacon queue.
Normalize this by letting the atim queue have its own struct data_queue
pointer in the rt2x00_dev structure.

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>
13 years agort2x00: Fix comment in rt2800pci
Helmut Schaa [Thu, 3 Mar 2011 18:45:39 +0000 (19:45 +0100)]
rt2x00: Fix comment in rt2800pci

We don't use interrupt threads anymore. Fix the comment.

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: Revise irqmask locking for PCI devices
Helmut Schaa [Thu, 3 Mar 2011 18:45:16 +0000 (19:45 +0100)]
rt2x00: Revise irqmask locking for PCI devices

The PCI device irqmask is locked by a spin_lock. Currently
spin_lock_irqsave is used everywhere. To reduce the locking overhead
replace spin_lock_irqsave in hard irq context with spin_lock and in
soft irq context with spin_lock_irq.

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: Remove now unused crypto.aid field
Helmut Schaa [Thu, 3 Mar 2011 18:44:53 +0000 (19:44 +0100)]
rt2x00: Remove now unused crypto.aid field

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 rt2800 key assignment in multi bssid setups
Helmut Schaa [Thu, 3 Mar 2011 18:44:33 +0000 (19:44 +0100)]
rt2x00: Fix rt2800 key assignment in multi bssid setups

When setting up multiple BSSIDs in AP mode on an rt2800pci device we
previously used the STAs AID to select an appropriate key slot. But
since the AID is per VIF we can end up with two STAs having the same AID
and thus using the same key index. This resulted in one STA overwriting
the key information of another STA.

Fix this by simply searching for the next unused entry in the pairwise
key table.

Also bring the key table init in sync with deleting keys by initializing
the key table entries to 0 instead of 1.

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: Use an enum instead of u16 for the rate_mode TX descriptor field
Helmut Schaa [Thu, 3 Mar 2011 18:44:10 +0000 (19:44 +0100)]
rt2x00: Use an enum instead of u16 for the rate_mode TX descriptor field

This makes the code less error-prone.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.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: Don't call ieee80211_get_tx_rate for MCS rates
Helmut Schaa [Thu, 3 Mar 2011 18:43:49 +0000 (19:43 +0100)]
rt2x00: Don't call ieee80211_get_tx_rate for MCS rates

ieee80211_get_tx_rate is not valid for HT rates. Hence, restructure the
TX desciptor creation to be aware of MCS rates. The generic TX desciptor
creation now cares about the rate_mode (CCK, OFDM, MCS, GF).

As a result, ieee80211_get_tx_rate gets only called for legacy rates.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.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: Move TX descriptor field "ifs" into plcp substruct
Helmut Schaa [Thu, 3 Mar 2011 18:43:25 +0000 (19:43 +0100)]
rt2x00: Move TX descriptor field "ifs" into plcp substruct

"ifs" is only used by no-HT devices. Move it into the plcp substruct and
fill in the value only for no-HT devices.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-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>
13 years agort2x00: Optimize TX descriptor memory layout
Ivo van Doorn [Thu, 3 Mar 2011 18:42:58 +0000 (19:42 +0100)]
rt2x00: Optimize TX descriptor memory layout

Some fields only need to be u8 and for ifs and txop we can use the
already available enums.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.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: Optimize TX descriptor handling
Helmut Schaa [Thu, 3 Mar 2011 18:42:35 +0000 (19:42 +0100)]
rt2x00: Optimize TX descriptor handling

HT and no-HT rt2x00 devices use a partly different TX descriptor.
Optimize the tx desciptor memory layout by putting the PLCP and HT
substructs into a union and introduce a new driver flag to decide which
TX desciptor format is used by the device.

This saves us the expensive PLCP calculation fOr HT devices and the HT
descriptor setup on no-HT devices.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.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: Generate sw sequence numbers only for devices that need it
Helmut Schaa [Thu, 3 Mar 2011 18:42:01 +0000 (19:42 +0100)]
rt2x00: Generate sw sequence numbers only for devices that need it

Newer devices like rt2800* own a hardware sequence counter and thus
don't need to use a software sequence counter at all. Add a new driver
flag to shortcut the software sequence number generation on devices that
don't need it.

rt61pci, rt73usb and rt2800* seem to make use of a hw sequence counter
while rt2400pci and rt2500* need to do it in software.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-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>
13 years agort2x00: Use unlikely for unexpected error condition in rt2x00_mac_tx
Helmut Schaa [Thu, 3 Mar 2011 18:41:03 +0000 (19:41 +0100)]
rt2x00: Use unlikely for unexpected error condition in rt2x00_mac_tx

rt2x00queue_write_tx_frame is unlikely to fail. Tell the compiler.

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 unlikely macro to special case tx status handling
Helmut Schaa [Thu, 3 Mar 2011 18:40:33 +0000 (19:40 +0100)]
rt2x00: Add unlikely macro to special case tx status handling

This special case shouldn't happen very often. Only if a frame that
is not intended to be aggregated ends up in an AMPDU _and_ was intended
to be sent at a different MCS rate as the aggregate. Hence, using
unlikely is justified.

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: Remove useless NULL check
Helmut Schaa [Thu, 3 Mar 2011 18:39:56 +0000 (19:39 +0100)]
rt2x00: Remove useless NULL check

Since tx_info->control.vif was already accessed before it cant't be NULL
here.

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: Make use of unlikely during tx status processing
Helmut Schaa [Thu, 3 Mar 2011 18:39:27 +0000 (19:39 +0100)]
rt2x00: Make use of unlikely during tx status processing

These conditions are unlikely to happen, tell the compiler.

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: Optimize calls to rt2x00queue_get_queue
Helmut Schaa [Thu, 3 Mar 2011 18:38:55 +0000 (19:38 +0100)]
rt2x00: Optimize calls to rt2x00queue_get_queue

In some cases (tx path for example) we don't need to check for non-tx
queues in rt2x00queue_get_queue. Hence, introduce a new method
rt2x00queue_get_tx_queue that is only valid for tx queues and use it in
places where only tx queues are valid.

Furthermore, this new method is quite short and as such can be inlined
to avoid the function call overhead.

This only converts the txdone functions of drivers that don't use an ATIM
queue and the generic tx path.

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 whitespace damage in the rt2800 specific code
Gabor Juhos [Thu, 3 Mar 2011 10:46:45 +0000 (11:46 +0100)]
rt2x00: fix whitespace damage in the rt2800 specific code

The rt2800 specific code contains a lots of whitespace damage caused by
the commit 'rt2x00: Add support for RT5390 chip'.

This patch fixes those whitespace errors.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: rev3+: implement gain ctl workarounds
Rafał Miłecki [Tue, 1 Mar 2011 20:40:41 +0000 (21:40 +0100)]
b43: N-PHY: rev3+: implement gain ctl workarounds

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: rev3+: add tables with gain ctl workarounds
Rafał Miłecki [Tue, 1 Mar 2011 20:40:40 +0000 (21:40 +0100)]
b43: N-PHY: rev3+: add tables with gain ctl workarounds

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: rev3+: correct switching analog core
Rafał Miłecki [Tue, 1 Mar 2011 20:40:39 +0000 (21:40 +0100)]
b43: N-PHY: rev3+: correct switching analog core

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolib-average: Make config option selectable
Michael Buesch [Tue, 1 Mar 2011 19:03:05 +0000 (20:03 +0100)]
lib-average: Make config option selectable

Make CONFIG_AVERAGE selectable for out-of-tree users
such as compat-wireless.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Read noise floor only for available chains for AR9003
Vasanthakumar Thiagarajan [Tue, 1 Mar 2011 16:59:36 +0000 (08:59 -0800)]
ath9k_hw: Read noise floor only for available chains for AR9003

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Add a debugfs interface to dump chip registers
Vasanthakumar Thiagarajan [Tue, 1 Mar 2011 13:30:55 +0000 (05:30 -0800)]
ath9k: Add a debugfs interface to dump chip registers

/<debugfs_root>/ieee80211/phyX/ath9k/regdump is the interface
to dump the registers.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: Change rate-control feedback
Larry Finger [Tue, 1 Mar 2011 05:36:09 +0000 (23:36 -0600)]
rtl8187: Change rate-control feedback

The driver for the RTL8187L chips returns IEEE80211_TX_STAT_ACK for all
packets, even if the maximum number of retries was exhausted. In addition
it fails to setup max_rates in the ieee80211_hw struct, This behavior
may be responsible for the problems noted in Bug 14168. As the bug is very
old, testers have not been found, and I do not have the case where the
indicated signal is less than -70 dBm.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Stable <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: usb parts should depend on CONFIG_USB
John W. Linville [Tue, 1 Mar 2011 18:53:02 +0000 (13:53 -0500)]
rtlwifi: usb parts should depend on CONFIG_USB

ERROR: "usb_unanchor_urb" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_control_msg" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_submit_urb" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_get_dev" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_kill_anchored_urbs" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_put_dev" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_free_urb" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_anchor_urb" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
ERROR: "usb_alloc_urb" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make: *** [sub-make] Error 2

The USB-part of rtlwifi should depend on CONFIG_USB.  This also
corrects the existing check for CONFIG_PCI to build pci.o.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
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 [Fri, 4 Mar 2011 19:01:20 +0000 (14:01 -0500)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Fri, 4 Mar 2011 19:00:29 +0000 (14:00 -0500)]
Merge branch 'for-linville' of git://git./linux/kernel/git/luca/wl12xx

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
John W. Linville [Fri, 4 Mar 2011 18:59:44 +0000 (13:59 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-next-2.6

13 years agoiwlagn: report correct temperature for WiFi/BT devices.
Fry, Donald H [Fri, 25 Feb 2011 17:44:48 +0000 (09:44 -0800)]
iwlagn: report correct temperature for WiFi/BT devices.

The temperature reported by 'cat /sys/class/net/wlan?/device/temperature'
is incorrect for devices with BT capability.  Report the value from the
correct statistics structure.  Tested with 130, 100, 6205 and 5300.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agowl12xx: Correctly set up protection if non-GF STAs are present
Helmut Schaa [Wed, 2 Mar 2011 09:46:46 +0000 (10:46 +0100)]
wl12xx: Correctly set up protection if non-GF STAs are present

Set the gf_protection bit when calling ACX_HT_BSS_OPERATION according
to the GF bit passed by mac80211 in ht_operation_mode.

[Added a proper commit message -- Luca]

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: wakeup chip from ELP during scan
Arik Nemtsov [Tue, 1 Mar 2011 10:27:26 +0000 (12:27 +0200)]
wl12xx: wakeup chip from ELP during scan

Commands are sometimes sent to FW on scan completion. Make sure the chip
is awake to receive them. Sending commands while the chip is in ELP
can cause SDIO read errors and/or crash the FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Modify requested number of memory blocks
Ido Yariv [Tue, 1 Mar 2011 13:14:44 +0000 (15:14 +0200)]
wl12xx: Modify requested number of memory blocks

Tests have shown that the requested number of memory blocks is
sub-optimal. Slightly modify the requested number of memory blocks for
TX.

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Avoid redundant TX work
Ido Yariv [Tue, 1 Mar 2011 13:14:43 +0000 (15:14 +0200)]
wl12xx: Avoid redundant TX work

TX might be handled in the threaded IRQ handler, in which case, TX work
might be scheduled just to discover it has nothing to do.

Save a few context switches by cancelling redundant TX work in case TX
is about to be handled in the threaded IRQ handler. Also, avoid
scheduling TX work from wl1271_op_tx if not needed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Switch to level trigger interrupts
Ido Yariv [Tue, 1 Mar 2011 13:14:42 +0000 (15:14 +0200)]
wl12xx: Switch to level trigger interrupts

The interrupt of the wl12xx is a level interrupt in nature, since the
interrupt line is not auto-reset. However, since resetting the interrupt
requires bus transactions, this cannot be done from an interrupt
context. Thus, requesting a level interrupt would require to disable the
irq and re-enable it after the HW is acknowledged. Since we now request
a threaded irq, this can also be done by specifying the IRQF_ONESHOT
flag.

Triggering on an edge can be problematic in some platforms, if the
sampling frequency is not sufficient for detecting very frequent
interrupts. In case an interrupt is missed, the driver will hang as the
interrupt line will stay high until it is acknowledged by the driver,
which will never happen.

Fix this by requesting a level triggered interrupt, with the
IRQF_ONESHOT flag.

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Switch to a threaded interrupt handler
Ido Yariv [Tue, 1 Mar 2011 13:14:41 +0000 (15:14 +0200)]
wl12xx: Switch to a threaded interrupt handler

To achieve maximal throughput, it is very important to react to
interrupts as soon as possible. Currently the interrupt handler wakes up
a worker for handling interrupts in process context. A cleaner and more
efficient design would be to request a threaded interrupt handler.  This
handler's priority is very high, and can do blocking operations such as
SDIO/SPI transactions.

Some work can be deferred, mostly calls to mac80211 APIs
(ieee80211_rx_ni and ieee80211_tx_status). By deferring such work to a
different worker, we can keep the irq handler thread more I/O
responsive. In addition, on multi-core systems the two threads can be
scheduled on different cores, which will improve overall performance.

The use of WL1271_FLAG_IRQ_PENDING & WL1271_FLAG_IRQ_RUNNING was
changed. For simplicity, always query the FW for more pending
interrupts. Since there are relatively long bursts of interrupts, the
extra FW status read overhead is negligible. In addition, this enables
registering the IRQ handler with the ONESHOT option.

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Change claiming of the SDIO bus
Ido Yariv [Tue, 1 Mar 2011 13:14:40 +0000 (15:14 +0200)]
wl12xx: Change claiming of the SDIO bus

The SDIO bus is claimed and released for each SDIO transaction. In
addition to the few CPU cycles it takes to claim and release the bus, it
may also cause undesired side effects such as the MMC host stopping its
internal clocks.

Since only the wl12xx_sdio driver drives this SDIO card, it is safe to
claim the SDIO host once (on power on), and release it only when turning
the power off.

This patch was inspired by Juuso Oikarinen's (juuso.oikarinen@nokia.com)
patch "wl12xx: Change claiming of the (SDIO) bus".

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Do end-of-transactions transfers only if needed
Ido Yariv [Tue, 1 Mar 2011 13:14:39 +0000 (15:14 +0200)]
wl12xx: Do end-of-transactions transfers only if needed

On newer hardware revisions, there is no need to write the host's
counter at the end of a RX transaction. The same applies to writing the
number of packets at the end of a TX transaction.

It is generally a good idea to avoid unnecessary SDIO/SPI transfers.
Throughput and CPU usage are improved when avoiding these.

Send the host's RX counter and the TX packet count only if needed, based
on the hardware revision.

[Changed WL12XX_QUIRK_END_OF_TRANSACTION to use BIT(0) -- Luca]

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Reorder data handling in irq_work
Ido Yariv [Tue, 1 Mar 2011 13:14:38 +0000 (15:14 +0200)]
wl12xx: Reorder data handling in irq_work

The FW has a limited amount of memory for holding frames. In case it
runs out of memory reserved for RX frames, it'll have no other choice
but to drop packets received from the AP. Thus, it is important to
handle RX data interrupts as soon as possible, before handling anything
else.

In addition, since there are enough TX descriptors to go around, it is
better to first send TX frames, and only then handle TX completions.

Fix this by changing the order of function calls in wl1271_irq_work.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Remove private headers in wl1271_tx_reset
Ido Yariv [Sun, 27 Feb 2011 22:16:13 +0000 (00:16 +0200)]
wl12xx: Remove private headers in wl1271_tx_reset

Frames in the tx_frames array include extra private headers, which must
be removed before passing the skbs to ieee80211_tx_status.

Fix this by removing any private headers in wl1271_tx_reset, similar to
how this is done in wl1271_tx_complete_packet.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Don't rely on runtime PM for toggling power
Ido Yariv [Sun, 27 Feb 2011 22:13:58 +0000 (00:13 +0200)]
wl12xx: Don't rely on runtime PM for toggling power

Runtime PM might not always be enabled. Even if it is enabled in the
running kernel, it can still be temporarily disabled, for instance
during suspend. Runtime PM is opportunistic in nature, and should not be
relied on for toggling power.

In case the interface is removed and re-added while runtime PM is
disabled, the FW will fail to boot, as it is mandatory to toggle power
between boots. For instance, this can happen during suspend in case one
of the devices fails to suspend before the MMC host suspends, but after
mac80211 was suspended. The interface will be removed and reactivated
without toggling the power.

Fix this by calling mmc_power_save_host/mmc_power_restore_host in
wl1271_sdio_power_on/off functions. It will toggle the power to the chip
even if runtime PM is disabled. The runtime PM functions should still be
called to make sure runtime PM does not opportunistically power the chip
off (e.g. after resuming from system suspend).

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: fix the path to the wl12xx firmwares
Sebastien Jan [Wed, 23 Feb 2011 13:25:16 +0000 (14:25 +0100)]
wl12xx: fix the path to the wl12xx firmwares

In the linux-firmware git tree, the firmwares and the NVS are inside
the ti-connectivity directory.  Fix the filenames that the driver
looks for accordingly.

[Fixed commit message and merged with the latest changes. -- Luca]

Signed-off-by: Sebastien Jan <s-jan@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agoBluetooth: Fix some small code style issues in mgmt.c
Szymon Janc [Tue, 1 Mar 2011 15:55:34 +0000 (16:55 +0100)]
Bluetooth: Fix some small code style issues in mgmt.c

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Use variable name instead of type in sizeof()
Szymon Janc [Tue, 1 Mar 2011 15:55:33 +0000 (16:55 +0100)]
Bluetooth: Use variable name instead of type in sizeof()

As written in the CodingStyle doc.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Remove unused code from get_connections
Szymon Janc [Tue, 1 Mar 2011 15:55:32 +0000 (16:55 +0100)]
Bluetooth: Remove unused code from get_connections

Command pointer was a leftover after moving controller index to
mgmt_hdr.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Log all parameters in cmd_status for easier debugging
Szymon Janc [Mon, 28 Feb 2011 13:10:08 +0000 (14:10 +0100)]
Bluetooth: Log all parameters in cmd_status for easier debugging

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Fix possible NULL pointer dereference in cmd_complete
Szymon Janc [Mon, 28 Feb 2011 13:09:50 +0000 (14:09 +0100)]
Bluetooth: Fix possible NULL pointer dereference in cmd_complete

It is now possible to create command complete event without specific
reply data by passing NULL as reply with len 0. Check pointer before
calling memcpy to avoid undefined behaviour.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agomac80211: make rate control Kconfig warning depend on mac80211
Johannes Berg [Tue, 1 Mar 2011 16:18:26 +0000 (17:18 +0100)]
mac80211: make rate control Kconfig warning depend on mac80211

... Otherwise it is displayed when mac80211 isn't
even turned on, which is completely pointless.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: rev3+: add static tables
Rafał Miłecki [Tue, 1 Mar 2011 12:28:36 +0000 (13:28 +0100)]
b43: N-PHY: rev3+: add static tables

This finally makes TX on OFDM rates possible on my dev with PHY rev 4.
We still have lower performance than wl, but at least speeds around 15M
become possible.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Fix error registering rate-control
Chaoming Li [Mon, 28 Feb 2011 22:40:28 +0000 (16:40 -0600)]
rtlwifi: Fix error registering rate-control

When a second module such as rtl8192ce or rtl8192cu links to rtlwifi, the attempt
to register a rate-control mechanism fails with the warning shown below. The fix is to
select the RC mechanism when rtlwifi is initialized.

WARNING: at net/mac80211/rate.c:42 ieee80211_rate_control_register+0xc9/0x100 [mac80211]()
Hardware name: HP Pavilion dv2700 Notebook PC
Modules linked in: arc4 ecb rtl8192ce rtl8192cu(+) rtl8192c_common rtlwifi snd_hda_codec_conexant amd74xx(+) ide_core sg mac80211 snd_hda_intel snd_hda_codec i2c_nforce2 snd_pcm snd_timer cfg80211 snd k8temp hwmon serio_raw joydev i2c_core soundcore snd_page_alloc rfkill forcedeth video ac battery button ext3 jbd mbcache sd_mod ohci_hcd ahci libahci libata scsi_mod ehci_hcd usbcore fan processor thermal
Pid: 2227, comm: modprobe Not tainted 2.6.38-rc6-wl+ #468
Call Trace:
 [<ffffffff8104a3da>] ? warn_slowpath_common+0x7a/0xb0
 [<ffffffff8104a425>] ? warn_slowpath_null+0x15/0x20
 [<ffffffffa02de409>] ? ieee80211_rate_control_register+0xc9/0x100 [mac80211]
 [<ffffffffa03b3790>] ? rtl_rate_control_register+0x10/0x20 [rtlwifi]
 [<ffffffffa03ab9c9>] ? rtl_init_core+0x189/0x620 [rtlwifi]
 [<ffffffff811cfff8>] ? __raw_spin_lock_init+0x38/0x70
 [<ffffffffa03b9dea>] ? rtl_usb_probe+0x709/0x82e [rtlwifi]
 [<ffffffffa002a7fd>] ? usb_match_one_id+0x3d/0xc0 [usbcore]
 [<ffffffffa002aae9>] ? usb_probe_interface+0xb9/0x160 [usbcore]
 [<ffffffff8126ed19>] ? driver_probe_device+0x89/0x1a0
 [<ffffffff8126eed3>] ? __driver_attach+0xa3/0xb0
 [<ffffffff8126ee30>] ? __driver_attach+0x0/0xb0
 [<ffffffff8126dd4e>] ? bus_for_each_dev+0x5e/0x90
 [<ffffffff8126e9d9>] ? driver_attach+0x19/0x20
 [<ffffffff8126e5e8>] ? bus_add_driver+0x158/0x290
 [<ffffffff8126f151>] ? driver_register+0x71/0x140
 [<ffffffff811cfff8>] ? __raw_spin_lock_init+0x38/0x70
 [<ffffffffa002a2cc>] ? usb_register_driver+0xdc/0x190 [usbcore]
 [<ffffffffa0013000>] ? rtl8192cu_init+0x0/0x20 [rtl8192cu]
 [<ffffffffa001301e>] ? rtl8192cu_init+0x1e/0x20 [rtl8192cu]
 [<ffffffff810002cf>] ? do_one_initcall+0x3f/0x180
 [<ffffffff8108fd4b>] ? sys_init_module+0xbb/0x200
 [<ffffffff81002c7b>] ? system_call_fastpath+0x16/0x1b
 ---[ end trace 726271c07a47439e ]---
rtlwifi:rtl_init_core():<0-0> rtl: Unable to register rtl_rc,use default RC !!
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'

Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add support for showing the last rx bitrate
Felix Fietkau [Sun, 27 Feb 2011 21:08:01 +0000 (22:08 +0100)]
mac80211: add support for showing the last rx bitrate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: add a field for the bitrate of the last rx data packet from a station
Felix Fietkau [Sun, 27 Feb 2011 21:08:00 +0000 (22:08 +0100)]
cfg80211: add a field for the bitrate of the last rx data packet from a station

Also fix a typo in the STATION_INFO_TX_BITRATE description

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Handle BSSID/AID for multiple interfaces
Sujith Manoharan [Sun, 27 Feb 2011 03:50:40 +0000 (09:20 +0530)]
ath9k_htc: Handle BSSID/AID for multiple interfaces

The AID and BSSID should be set in the HW only for the
first station interface or adhoc interface. Also, cancel
the ANI timer in stop() for multi-STA scenario. And finally
configure the HW beacon timers only for the first station
interface.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>