Juuso Oikarinen [Thu, 18 Mar 2010 10:26:30 +0000 (12:26 +0200)]
wl1271: Add proper WLAN-BT co-ex configuration, and enable co-ex.
Add configuration values for the varous WLAN-BT co-ex configuration parameters,
and finally enable WLAN-BT co-ex. Based on preliminary measurements, it
appears the co-ex feature is not increasing WLAN power consumption, if BT
is not activated.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Juuso Oikarinen [Thu, 18 Mar 2010 10:26:29 +0000 (12:26 +0200)]
wl1271: Fix SG configuration message structures
The bluetooth coexistence (SG) configuration messages have changed and
were completely wrong. For instance, intending to enable the SG, it was
instead disabled.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Juuso Oikarinen [Thu, 18 Mar 2010 10:26:26 +0000 (12:26 +0200)]
wl1271: Fix configuration of the TX opportunity value
The per-queue TX opportunity value is configured by the mac80211 in units
of 32us. The firmware however wants it in us, so add the conversion.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:24 +0000 (14:25 +0530)]
ath9k_hw: fix hardware deinit
Without this you will get a panic if the device initialization
fails. Also, free ath_hw instance properly. ath9k_hw_deinit()
shouldn't do it.
Cc: stable@kernel.org Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:23 +0000 (14:25 +0530)]
ath9k_hw: add HTC init hardware call for special resets for AR9271
AR9271 needs a full reset only upon the first reset, add
a call for the driver to enable these special resets. We
can optimize this out later without an export.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:22 +0000 (14:25 +0530)]
ath9k_hw: always set the core clock for AR9271
When initializing the PLL on AR9271 we always need
to set the core clock to 117MHz. While at it remove
the baud rate settings for the serial device on the
AR9271, the default settings work well unless you
want to customize it.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:21 +0000 (14:25 +0530)]
ath9k_hw: use the skip count for PA calibration on AR9271
Periodic power amplifier offset calibration is skipped on ath9k
algorithmically, this is required on AR9271.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:20 +0000 (14:25 +0530)]
ath9k_hw: restrict valid nf readings for AR9271 to -114
Noisefloor values read on AR9271 are unreliable if they
are less than -114, set those statically to -116.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:19 +0000 (14:25 +0530)]
ath9k_hw: fix noisefloor history buffer usage on AR9271
Noisefloor calibration involves querying hardware for samples
and storing this information on a history buffer in hardware for
actual noisefloor calibration processing in hardware. The history
buffer supports collecting information for all Atheros hardware,
one history buffer slot for each chain on each channel used for
MIMO operation. For current hardware this means one history
buffer slot for each chain on both the control (or primary) channel
and the extension (or secondary) channel. We know which noisefloor
registers to poke for collecting noisefloor data through the
chainmask.
For AR9285 and AR9271 devices, both 1x1, the chaimmask is defined as
0x9 = 0b0001001. The first four bits represent each chain out of
a maximum of 4 chains [0-3] on the primary channel. The last four
bits represent each chain on the extension channel. A chainmask
of 0x9 therefore indicates chain 1 is active on both the primary
and the extension channel.
AR9271 only requires collecting and storing noisefloor history buffer
data for the first chain on both the control and extension channel
(nfarray[0] and nfarray[3]) so fix the code and avoid which reads
and writes to the history buffer for the other chains.
Since the noisefloor varies depending on the number of chains your
device supports also initialize the noisefloor history buffer with
reasonable values seen on 1x1 devices such as AR9285.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:18 +0000 (14:25 +0530)]
ath9k_hw: Fix full sleep setup for AR9271
After telling the AR9271 to go into full sleep we do not need
to clear the RTC reset signal.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:17 +0000 (14:25 +0530)]
ath9k_hw: fix TX descriptor setup for AR9271
The TX descriptors setup for AR971 requires the same
setup as AR9285, so use that.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:16 +0000 (14:25 +0530)]
ath9k_hw: skip chip tests for AR9271
The chip test is not required for AR9271 on the host driver
code as the firmware will do the test internally on its own.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:15 +0000 (14:25 +0530)]
ath9k_hw: add GPIO setup code for AR9271
Assign the proper number of GPIO pins for AR9271.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Wed, 17 Mar 2010 08:55:14 +0000 (14:25 +0530)]
ath9k_hw: update initialization values for AR9271
Update the register initialization values for AR9271.
This is based on our last review from our systems team.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ming Lei [Mon, 1 Mar 2010 15:13:29 +0000 (23:13 +0800)]
ath9k: decrease size of ath9k.ko
From e74b075cdb143d45be9b371ee8a8e2dcfc15ab34 Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@gmail.com>
Date: Sat, 27 Feb 2010 23:50:54 +0800
Subject: [PATCH] ath9k: decrease size of ath9k.ko
The patch defines the fields of 'valid_single_stream' and 'valid' in
struct ath_rate_table as char type, so decrease the size of ath9k.ko
about 2KB.
old ath9k.ko
[tom@tom-lei ath9k]$ size ath9k.ko
text data bss dec hex filename
69344 3080 168 72592 11b90 ath9k.ko
new ath9k.ko
[tom@tom-lei ath9k]$ size ath9k.ko
text data bss dec hex filename
67304 3080 168 70552 11398 ath9k.ko
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 5 Mar 2010 22:22:46 +0000 (14:22 -0800)]
iwlwifi: code cleanup for connectivity recovery
Split the connectivity check and recovery routine into separated
functions based on the types
1. iwl_good_ack_health() - check for ack count
2. iwl_good_plcp_health() - check for plcp error
Based on the type of errors being detected, different recovery methods
will be used to bring the system back to normal operational state.
Because different NIC has different HW and uCode, the behavior is also
different; these functions thus now form part of the ops infrastructure,
so we can have more control on how to monitor and recover from error condition
case per device.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Wey-Yi Guy [Thu, 4 Mar 2010 21:38:59 +0000 (13:38 -0800)]
iwlwifi: Recover TX flow failure
Monitors the tx statistics to detect the drop in throughput.
When the throughput drops, the ratio of the actual_ack_count and the
expected_ack_count also drops. At the same time, the aggregated
ba_timeout (the number of ba timeout retries) also rises. If the
actual_ack_count/expected_ack_count ratio is 0 and the number of ba
timeout retries rises to BA_TIMEOUT_MAX, no tx packets can be delivered.
Reloading the uCode and bring the system back to normal operational
state.
Wey-Yi Guy [Tue, 2 Mar 2010 01:23:50 +0000 (17:23 -0800)]
iwlwifi: Recover TX flow stall due to stuck queue
Monitors the internal TX queues periodically. When a queue is stuck
for some unknown conditions causing the throughput to drop and the
transfer is stop, the driver will force firmware reload and bring the
system back to normal operational state.
The iwlwifi devices behave differently in this regard so this feature is
made part of the ops infrastructure so we can have more control on how to
monitor and recover from tx queue stall case per device.
Shanyu Zhao [Sat, 6 Mar 2010 01:05:20 +0000 (17:05 -0800)]
iwlwifi: clean up driver names for 1000/5000/6000
Align the driver names with official product names for 1000/5000/6000
series. This change mainly affects the debug messages show up in system
log. No functional changes.
Reinette Chatre [Tue, 23 Feb 2010 00:24:47 +0000 (16:24 -0800)]
iwlwifi: implement new mac80211 station add/remove calls
mac80211 recently implemented two new callbacks that are used to request
station add/remove from the driver. The benefot from these new callbacks
are that they enable the driver to sleep while performing this work.
This is a big patch since a few things need to be coordinated in this move.
First we need to decouple station management from rate scaling, which
caused a lot of code to be moved and/or deleted. Next we needed to tie in
with mac80211's station management callback and let it direct our station
management as well as trigger the rate scaling initialization.
Reinette Chatre [Fri, 19 Feb 2010 06:58:32 +0000 (22:58 -0800)]
iwlwifi: only add broadcast station once
Currently the broadcast station is added after every RXON command. Change
this to only add the broadcast station when interface is added by mac80211.
With this we need some extra work to ensure broadcast station is always
present since station table is cleared when RXON without ASSOC bit set is
sent. To deal with this we re-add all driver known stations to uCode after
such an RXON command is sent.
We also do some cleanup and remove the various calls to clear the station
table. We now only clear the station table in two scenarios:
- only clear uCode portion of station table when RXON command without ASSOC
bit is sent
- clear uCode and driver portion when interface goes down or is removed.
We need to do this clearing when interface goes down to deal with the
device restart/reconfigure routines which do not remove the interface, but
do add the interface during reconfiguration.
Previously the keys were also cleared when station table in driver is
cleared, this is not done anymore since mac80211 will take care that keys
are set and cleared correctly.
There is a known issue with this change. Associating with different AP
without bringing interface down fails with a firmware error. This is
because of the lack of full station notification support and the later
patches in this series that complete the station notification support will
fix this.
This patch renames the (never officially released) sysfs-knobs
"blocked_hw" and "blocked_sw" to "hard" and "soft", as the hardware vs
software conotation is misleading.
It also gets rid of not needed locks around u32-read-access.
Signed-off-by: Florian Mickler <florian@mickler.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Wed, 3 Mar 2010 09:45:42 +0000 (18:45 +0900)]
mac80211: (really) fix rates setup on IBSS merge
when an IBSS merge happened, the supported rates for the newly added station
were left empty, causing the rate control module to be initialized with only
the basic rates.
the section of the ibss code which deals with updating supported rates for
an already existing station failed to inform the rate control module about the
new rates. as both minstrel and pid don't have an update function i just use
the init function.
also remove unnecessary (unsigned long long) casts and edit debug message.
Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Alban Browaeys [Sun, 28 Feb 2010 16:14:40 +0000 (17:14 +0100)]
rt2x00: Fix TX status reporting for rt2800pci.
After testing, we found that TX_STA_FIFO_MCS is the last MCS value
tried. If the transmission failed, 8 frames have been transmitted. If the
transmission succeed, we can easily compute the number of retry. This patch fix
the way status is reported to mac80211 rate control. It has 2 bugs :
1. mcs can contain the short preamble flag and it will lead to wrong
computations.
2. minstrel nearly always say that 54 Mbits is the best rate, even if we are
very far from the AP
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: Alban Browaeys <prahal@yahoo.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This is an implementation that support WCID being the encryption key.
Wireless Cli Id was set to be the encryption key in rt2800pci_write_tx_desc
and read (TX_STA_FIFO_WCID) as the current queue entry index.
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: Alban Browaeys <prahal@yahoo.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 15 Mar 2010 16:22:26 +0000 (17:22 +0100)]
rt2x00: fix warning when building rt2800pci with just soc support
Fix compile warning "rt2800pci.c:1248: warning: 'rt2800pci_device_table'
defined but not used" when building rt2800pci with only soc support
(without pci).
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Fri, 12 Mar 2010 05:01:22 +0000 (00:01 -0500)]
ipw2x00: replace "ieee80211" with "libipw" where appropriate
"ieee80211" was the old name of the common library for ipw2100 and
ipw2200. It was renamed to "libipw", but some occurrences of the old
name remained.
Rename alloc_ieee80211() to alloc_libipw() and free_ieee80211() to
free_libipw(). Adjust comments and label names. Change prefixes in
diagnostic messages.
Keep /proc/net/ieee80211 under the original name to avoid breaking user
interface.
Move the affected EXPORT_SYMBOL macros to their proper places.
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
4sec wait is way too pessimistic, TI driver uses 40ms here,
and testing shows that is ebough, so let's also use that.
While at it, add useful sounding comment from the TI driver.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
To fix this, add special IO functions for ELP_CTRL access that are
using sdio_readb/sdio_writeb. Similar handling is done in TI
reference driver from Android code drop.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Cc: Bob Copeland <me@bobcopeland.com> Acked-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Make local functions and data static, also constify
some structures. While at it, clean up unneeded includes.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Cc: Bob Copeland <me@bobcopeland.com> Acked-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 11 Mar 2010 15:28:24 +0000 (16:28 +0100)]
mac80211: optimize tx status processing
When a cooked monitor interface is active, ieee80211_tx_status()
generates a radiotap header for every single frame, even if it wasn't
injected and thus won't be sent to a monitor interface.
This patch reduces cpu utilization by moving the cooked monitor check a
bit earlier, before it generates the rtap header.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
matthieu castet [Sun, 28 Feb 2010 14:42:54 +0000 (15:42 +0100)]
airo : Print of firmware version
For the firmware version 5.30.17 the log file shows:
Firmware version 5.30.11
The variable softSubVer is binary.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr> Signed-off-by: Jose Alonso <joalonsof@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrew Blaich [Mon, 1 Mar 2010 15:30:40 +0000 (10:30 -0500)]
ath5k: fixing retries in ath5k_hw_setup_4word_tx_desc
The rate control algorithm, default is Minstrel for ath5k, determines
the number of retries to use for each rate. However, there exists in
ath5k_hw_setup_4word_tx_desc (which is called for AR5212 like devices)
a set number of retries defined by AR5K_TUNE_HWTXTRIES. The set
number of tries is added to the tx_tries0 variable setup by the rate
control algorithm. This changes the number of retries the rate
control algorithm considers necessary. By removing the
AR5K_TUNE_HWTXTRIES from the retry calculation the rate control
algorithm is given control over the number of retries.
Signed-off-by: Andrew Blaich <ablaich@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 1 Mar 2010 12:32:11 +0000 (13:32 +0100)]
ath9k: fix rate control tx status handling for A-MPDU
Currently the rate control tx status update gets called for every
subframe of an A-MPDU, and ath9k marks the frame with the relevant
status update with an internal flag. This not suitable for rate control
algorithms using the standard mac80211 rate control API, so fix this by
using IEEE80211_TX_STAT_AMPDU for marking the correct frames that
should be processed.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Teemu Paasikivi [Wed, 10 Mar 2010 11:22:31 +0000 (13:22 +0200)]
wl1271: Changed wl1271_sdio to be selectable only on ARM
As wl1271_sdio implementation depends on ARM GPIO impelementation it is
not directly usable on other architectures at the moment. Added
ARM dependency to kernel configuration option.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:56:15 +0000 (16:56 +0900)]
ath5k: IQ calibration for AR5211 is slightly different
according to the HAL sources the calculation of the Q value is slightly
different for AR5211 chips.
i couldn't test this since IQ calibration never finishes on older parts. this
is a different problem...
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:55 +0000 (16:55 +0900)]
ath5k: remove ah_gpio_npins
it's never used and we have a newer implementation in gpio.c.
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:49 +0000 (16:55 +0900)]
ath5k: remove ah_mac_revision
it's not used, and we have ah_mac_srev.
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:44 +0000 (16:55 +0900)]
ath5k: remove ah_magic
it's never used. probably a leftover from the old OpenHAL days...
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:38 +0000 (16:55 +0900)]
ath5k: remove double opmode definition
opmode (operating mode) was defined in struct ath5k_hw and struct ath5k_softc.
remove it from ath5k_hw and use only from ath5k_softc (sc->opmode).
(btw: what's the meaning of opmode when we have multiple interfaces?)
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:28 +0000 (16:55 +0900)]
ath5k: preserve antenna settings
save antenna settings and preserve across resets.
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Tue, 9 Mar 2010 07:55:17 +0000 (16:55 +0900)]
ath5k: add antenna statistics and debugfs file for antenna settings
keep statistics about which antenna was used for TX and RX. this is used only
for debugging right now, but might have other applications later.
add a new file 'antenna' in debugfs (/sys/kernel/debug/ath5k/phy0/antenna) to show
antenna use statistics and antenna diversity related register values. it can
also be used to set the antenna mode until we have proper support for that in
iw:
- echo diversity > antenna: use default antenna mode (RX and TX diversity)
- echo fixed-a > antenna: use fixed antenna A for RX and TX
- echo fixed-b > antenna: use fixed antenna B for RX and TX
- echo clear > antenna: reset antenna statistics
Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Thu, 4 Mar 2010 16:27:02 +0000 (18:27 +0200)]
rndis_wlan: copy only useful data from rndis_command respond
rndis_query_oid() uses full output buffer size to copy response buffer
from rndis_command()/device. This doesn't cause problems as response buffer
is sized based on output buffer but does copy extra unset bytes.
So change rndis_query_oid() so that only meaningful bytes are being copied.
Also in case of malfunctioning device/cable/etc returned data offset from
device might be wrong so bound check memory access correctly, so add
checks for this.
v2: fixed to use new netdev_dbg/warn/etc instead of old devdbg/warn/etc
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 1 Mar 2010 21:21:40 +0000 (22:21 +0100)]
minstrel: make the rate control ops reusable from another rc implementation
This patch makes it possible to reuse the minstrel rate control ops
from another rate control module. This is useful in preparing for the
new 802.11n implementation of minstrel, which will reuse the old code
for legacy stations.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 1 Mar 2010 21:17:38 +0000 (22:17 +0100)]
minstrel: simplify and fix debugfs code
This patch cleans up the debugfs read function for the statistics by
using simple_read_from_buffer instead of its own semi-broken hack.
Also removes a useless member of the minstrel debugfs info struct.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Currently, the padding position is based on
ieee80211_get_hdrlen_from_skb(). This is not correct since the HW does
padding on RX (and expect the same padding to be present on TX) at the
following position :
- management : 24 + 6 if 4-addr format
- control : 24 + 6 if 4-addr format
- data : 24 + 6 if 4-addr format + 2 if QoS
- invalid : 24 + 6 if 4-addr format
whereas ieee80211_get_hdrlen_from_skb() is :
- management : 24
- control : 16 except for ACK/CTS where it is 10
- data : 24 + 6 if 4-addr format + 2 if QoS + 2 if QoS & order
- invalid : 24
So, correct frames are not affected : management frames do not use
4-addr format, control frames have no body and invalid frames are ...
not valid by definition. However, in order to use monitor interface for
debugging purpose, one must be able to send/receive any frames, be it
correct or not. Such frames are affected by incorrect padding.
Moreover, since padding is added on TX, we need to remove it before
calling ieee80211_tx_status. This affect TX packets received by monitor
interfaces.
It has been tested between an ath5k based card (AR5212) and an ar9170usb
based card (netgear WNDA3100) using a frame generator and a monitor
interface for each card.
Andres Salomon [Fri, 26 Feb 2010 00:18:47 +0000 (19:18 -0500)]
mac80211: give warning if building w/out rate ctrl algorithm
I discovered that if EMBEDDED=y, one can accidentally build a mac80211 stack
and drivers w/ no rate control algorithm. For drivers like RTL8187 that don't
supply their own RC algorithms, this will cause ieee80211_register_hw to
fail (making the driver unusable).
This will tell kconfig to provide a warning if no rate control algorithms
have been selected. That'll at least warn the user; users that know that
their drivers supply a rate control algorithm can safely ignore the
warning, and those who don't know (or who expect to be using multiple
drivers) can select a default RC algorithm.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Thu, 25 Feb 2010 06:15:28 +0000 (14:15 +0800)]
iwmc3200wifi: protect rx_tickets and rx_packets[] lists
Protect rx_tickets and rx_packets[] lists with spinlocks to fix the
race condition for concurrent list operations. In iwmc3200wifi both
sdio_isr_worker and rx_worker workqueues can access the rx ticket
and packets lists at the same time under high rx load.
Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Thu, 25 Feb 2010 06:15:27 +0000 (14:15 +0800)]
iwmc3200wifi: add ftrace event tracing support
Add event tracer for iwmc3200wifi driver. When enabled, all the
commands and responses between the driver and firmware (also
including Tx/Rx frames) will be recorded in the ftrace ring buffer.
Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Thu, 25 Feb 2010 06:15:25 +0000 (14:15 +0800)]
iwmc3200wifi: refuse to associate on unallowed channels
We need to make sure we don't associate with APs on unallowed
channels (according to regulatory setting). This could happen
when the channel is not specified (auto-select) within the
connection request. In this case we get the AP's channel until
the firmware indicates the association succeeded later. We need
to verify the associated channel. If the channel is disabled by
regulatory, we have to disassociate with the AP.
Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Abhijeet Kolekar [Fri, 26 Feb 2010 23:17:01 +0000 (15:17 -0800)]
iwl3945: check ucode load error code
Check successful completion of BSM loading. Give a chance to
load BSM again. If BSM loading is unsuccessful we should exit
and not initilize NIC. Before this checking even if the BSM loading failed
driver tries to initilize the NIC which should not be the case.
Johannes Berg [Wed, 24 Feb 2010 09:57:19 +0000 (01:57 -0800)]
iwlwifi: clean up queue/fifo handling
4965 hardware has 7 queues reserved and the
remaining ones used for aggregation, 5000
and higher need to have 10 reserved. This
is not very clear in the code right now,
unfortunately.
Introduce a new IWL_TX_FIFO_UNUSED constant
and make the queue/FIFO mapping arrays able
to hold that value, and change the setup
code to reserve all queues in the arrays
(the queue number is the index) and use the
new unused constant to not map those queues
to any FIFO.
Additionally, clear up the AC/queue mapping
code to be more understandable. The mapping
is the identity mapping right now, but with
the mapping function I think it's easier to
understand what happens there.
Finally, HCCA isn't implemented at all and
I think newer microcode removed it, so let's
remove all mention of it in the code, some
comments remain for 4965.
Johannes Berg [Fri, 19 Feb 2010 19:42:32 +0000 (11:42 -0800)]
iwlwifi: change WEP key protection to use mutex
For later station notification support we would like WEP key setting to be
done synchronously always. Currently all places from which WEP key is set
can sleep, but the usage of sta_lock prevents it to do so. Modify the
locking to use priv->mutex instead and thus enable this call to sleep.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Thu, 18 Feb 2010 08:36:07 +0000 (00:36 -0800)]
iwlagn: move sysfs flags and filter_flags files to debugfs
These files are incompatible with some changes
I'm making, and don't really belong into sysfs
anyway as they can only be used for debugging.
Since writing them will probably crash the
firmware, keep only the reading part and move
them into debugfs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Wed, 17 Feb 2010 09:43:41 +0000 (01:43 -0800)]
iwlwifi: remove alive start adhoc restart
This code will never trigger, because when
we call this during interface start, neither
priv->vif nor priv->iw_mode conditions will
be true, and when it happens during reset
then priv->vif is also NULL. Also, in both
cases the same code will be executed as part
of iwl_bss_info_changed(), which contains a
copy of this code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Fri, 22 Jan 2010 12:06:41 +0000 (04:06 -0800)]
iwlwifi: clear up AC/FIFO debug output
Not all queues are mapped for frame transmission,
so saying "AC" is misleading. They are all mapped
to FIFOs, obviously, though, so use that term and
also say AC/CMD instead of just AC for the queue
type.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Thu, 21 Jan 2010 19:33:19 +0000 (11:33 -0800)]
iwlwifi: remove priv->active_rate_basic
This variable is assigned a default value,
but then assigned zero as soon as mac80211
calls a change channel (which will happen
right after the hw is started) and after
that it never changes again.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Thu, 18 Feb 2010 18:56:57 +0000 (10:56 -0800)]
iwlwifi: remove frame dropping
With some of the new code in mac80211, public action
frames can be exchanged as non-injected frames even
while not associated.
Aside from that, dropping frames here is pointless
since we do deal with arbitrary frames that were
injected already, so let mac80211 make the decision
about which frames to allow or not.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Thu, 21 Jan 2010 15:32:58 +0000 (07:32 -0800)]
iwlwifi: remove dead code from iwl_mac_reset_tsf
iwl_mac_reset_tsf will only ever be called in
IBSS mode, so checking for other modes is not
useful and the code that depends on that will
not be executed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg [Tue, 19 Jan 2010 18:04:28 +0000 (10:04 -0800)]
iwlagn: remove write-only variables
Updating the variables last_rx_rssi, last_tsf
and last_beacon_time needs a lot of code but
they are not actually used in iwlagn (only in
3945) so we can move them to the 3945 specific
data.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>