pandora-kernel.git
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Fri, 28 Jan 2011 21:23:14 +0000 (16:23 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

Conflicts:
drivers/net/wireless/ath/ath9k/init.c

13 years agoath9k: fix compile error in non-debug ath_debug_stat_tx() stub
Felix Fietkau [Fri, 28 Jan 2011 16:52:49 +0000 (17:52 +0100)]
ath9k: fix compile error in non-debug ath_debug_stat_tx() stub

"ath9k: fix tx queue index confusion in debugfs code" changed the debug
function but not the stub.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: introduce iwl_bt_statistics
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:51 +0000 (16:47 +0100)]
iwlwifi: introduce iwl_bt_statistics

We use priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics
conditional in few places, merge it into one function.

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: remove unneeded disable_hw_scan check
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:48 +0000 (16:47 +0100)]
iwlwifi: remove unneeded disable_hw_scan check

We never set STATUS_SCANNING in softwre scanning mode, disable_hw_scan
check is unneeded. Correct debug message while at it.

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: introduce iwl_advanced_bt_coexist()
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:47 +0000 (16:47 +0100)]
iwlwifi: introduce iwl_advanced_bt_coexist()

We use priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist
conditional in few places, merge it into one function.

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: remove unneeded __packed
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:46 +0000 (16:47 +0100)]
iwlwifi: remove unneeded __packed

struct iwl_queue is not part of firmware interface, so __packed is not
needed. Remove it since is may affect performance.

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 agoiwl3945: set STATUS_READY before commit_rxon
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:45 +0000 (16:47 +0100)]
iwl3945: set STATUS_READY before commit_rxon

Similar change as we already do for agn, need to avoid
"Error setting Tx power (-5)" message when loading module.

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: do not set tx power when channel is changing
Stanislaw Gruszka [Fri, 28 Jan 2011 15:47:44 +0000 (16:47 +0100)]
iwlwifi: do not set tx power when channel is changing

Mac80211 can request for tx power and channel change in one ->config
call. If that happens, *_send_tx_power functions will try to setup tx
power for old channel, what can be not correct because we already change
the band. I.e  error  "Failed to get channel info for channel 140 [0]",
can be printed frequently when operating in software scanning mode.

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 agonet/wireless/nl80211.c: Avoid call to genlmsg_cancel
Julia Lawall [Fri, 28 Jan 2011 14:17:11 +0000 (15:17 +0100)]
net/wireless/nl80211.c: Avoid call to genlmsg_cancel

genlmsg_cancel subtracts some constants from its second argument before
calling nlmsg_cancel.  nlmsg_cancel then calls nlmsg_trim on the same
arguments.  nlmsg_trim tests for NULL before doing any computation, but a
NULL second argument to genlmsg_cancel is no longer NULL due to the initial
subtraction.  Nothing else happens in this execution, so the call to
genlmsg_cancel is simply unnecessary in this case.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression data;
@@

if (data == NULL) { ...
* genlmsg_cancel(..., data);
  ...
  return ...;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Fix short and long retry configuration
Bruno Randolf [Fri, 28 Jan 2011 07:52:11 +0000 (16:52 +0900)]
ath5k: Fix short and long retry configuration

The register definition for retry configuration on AR5212 was wrong, and simply
copied over from AR5210. Update the register definitions from the documentation.

Let the short and long retries be configured from mac80211 and use the standard
values of 7 and 4 by default. Also we need to make sure we don't export more
retries than we are configured for to mac80211 (and the rate module) in
hw->max_rate_tries.

Also clean up the code by removing unused defines and variables and drop the
different values for "station retries" - if these need to be different it can
be handled tru ah_retry_long/short.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Add sdata state and flags to debugfs.
Ben Greear [Fri, 28 Jan 2011 06:09:34 +0000 (22:09 -0800)]
mac80211: Add sdata state and flags to debugfs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: use common API to avoid code duplication
Rajkumar Manoharan [Fri, 28 Jan 2011 06:05:43 +0000 (11:35 +0530)]
ath9k: use common API to avoid code duplication

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add MCS information to radiotap
Johannes Berg [Thu, 27 Jan 2011 13:13:17 +0000 (14:13 +0100)]
mac80211: add MCS information to radiotap

This adds the MCS information we currently get
from the drivers into radiotap.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Update PMU setting to improve ripple issue for AR9485.
Vivek Natarajan [Thu, 27 Jan 2011 09:15:11 +0000 (14:45 +0530)]
ath9k_hw: Update PMU setting to improve ripple issue for AR9485.

Change from the systems team to update PMU setting for AR9485
version of chipsets.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix a locking related issue.
Vivek Natarajan [Thu, 27 Jan 2011 09:15:10 +0000 (14:45 +0530)]
ath9k: Fix a locking related issue.

Spin_lock has been tried to be acquired twice from ath9k_tasklet
to ath_reset which resulted in a machine freeze.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: DDR_PLL and BB_PLL need correct setting.
Vivek Natarajan [Thu, 27 Jan 2011 09:15:09 +0000 (14:45 +0530)]
ath9k_hw: DDR_PLL and BB_PLL need correct setting.

Updates from the analog team for AR9485 chipsets to set
DDR_PLL2 and DDR_PLL3. Also program the BB_PLL ki
and kd value.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix a PLL hang issue observed with AR9485.
Vivek Natarajan [Thu, 27 Jan 2011 09:15:08 +0000 (14:45 +0530)]
ath9k: Fix a PLL hang issue observed with AR9485.

When this PLL hang issue is seen, both Rx and Tx fail to work.
The sqsum_dvc needs to be below 2000 for a good chip. During
this issue the sqsum_dvc value is beyond 80000 and only a
full reset can solve this problem.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Add a function to read sqsum_dvc.
Vivek Natarajan [Thu, 27 Jan 2011 09:15:07 +0000 (14:45 +0530)]
ath9k_hw: Add a function to read sqsum_dvc.

Add a function to observe the delta VC of BB_PLL.
For a good chip, the sqsum_dvc is below 2000.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Add RX filters
Sujith Manoharan [Wed, 26 Jan 2011 18:19:06 +0000 (23:49 +0530)]
ath9k_hw: Add RX filters

The HW has separate filter masks for compressed/uncompressed
BlockAcks and BlockAckRequests. Add them.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: use split rx buffers to get rid of order-1 skb allocations
Felix Fietkau [Wed, 26 Jan 2011 17:23:27 +0000 (18:23 +0100)]
ath9k: use split rx buffers to get rid of order-1 skb allocations

With this change, less CPU time is spent trying to look for consecutive
pages for rx skbs. This also reduces the socket memory required for IP/UDP
reassembly.
Only two buffers per frame are supported. Frames spanning more buffers
will be dropped, but the buffer size is enough to handle the required
AMSDU size.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix INI fixup
Sujith Manoharan [Wed, 26 Jan 2011 16:29:18 +0000 (21:59 +0530)]
ath9k_hw: Fix INI fixup

Commit "ath9k_hw: move AR9280 PCI EEPROM fix to eeprom_def.c"
changed the behavior of INI overriding which is needed only
for PCI cards. Revert to the original check.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix opmode initialization
Sujith Manoharan [Wed, 26 Jan 2011 16:29:05 +0000 (21:59 +0530)]
ath9k_hw: Fix opmode initialization

Commit "ath9k_hw: Relocate Opmode initialization"
moved the opmode initialization before the STA_ID1 register
was programmed with defaults. This changed the original
behaviour because the re-programming code doesn't take into
account the existing value in the register. Both ath9k and ath9k_htc
were not affected by this change because the opmode is
re-initialized after every reset, when RX is started.

Revert to the original behavior, except keep it outside the
REGWRITE block. This would help remove extraneous opmode calls
in the driver core.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: Allow non-zero indexes for device specific pair-wise ciphers
Juuso Oikarinen [Tue, 25 Jan 2011 10:21:22 +0000 (12:21 +0200)]
cfg80211: Allow non-zero indexes for device specific pair-wise ciphers

Some vendor specific cipher suites require non-zero key indexes for pairwise
keys, but as of currently, the cfg80211 does not allow it.

As validating they cipher parameters for vendor specific cipher suites is the
job of the driver or hardware/firmware, change the cfg80211 to allow also
non-zero pairwise key indexes for vendor specific ciphers.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove debug_dump_skb() functions
Bob Copeland [Tue, 25 Jan 2011 04:32:56 +0000 (23:32 -0500)]
ath5k: remove debug_dump_skb() functions

Now that rx and tx dumps go through the tracing infrastructure,
we no longer need to keep these routines around.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: use tracing for packet tx/rx dump
Bob Copeland [Tue, 25 Jan 2011 04:32:55 +0000 (23:32 -0500)]
ath5k: use tracing for packet tx/rx dump

This adds a few tracepoints to ath5k driver transmit and
receive callbacks in order to record packet traffic.
We record the entire packet in the trace buffer so that
the data can be extracted with trace-cmd and external
plugins.

Compared to the previous debugging calls, this approach
removes an out-of-line function call from the tx and rx
paths in the compiled-in-but-disabled case, while
improving the ability to process the logged data.

A new option, CONFIG_ATH5K_TRACER, is added so that one
may disable the tracepoints completely.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Remove unused IEEE80211_WEP_NKID
Bruno Randolf [Tue, 25 Jan 2011 04:15:43 +0000 (13:15 +0900)]
ath9k: Remove unused IEEE80211_WEP_NKID

IEEE80211_WEP_NKID is not used in ath9k any more since the key handling code
has been moved to ath/.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Enable 802.11j 4.9GHz frequencies
Bruno Randolf [Tue, 25 Jan 2011 04:15:38 +0000 (13:15 +0900)]
ath5k: Enable 802.11j 4.9GHz frequencies

This enables 4.9GHz frequencies in ath5k if they are allowed as indicated by
the regulatory domain code. Currently this is MKK9_MKKC (0xfe).

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath: Add function to check if 4.9GHz channels are allowed
Bruno Randolf [Tue, 25 Jan 2011 04:15:33 +0000 (13:15 +0900)]
ath: Add function to check if 4.9GHz channels are allowed

This adds a helper function to ath/regd.c which can be asked if 4.9GHz channels
are allowed for a given regulatory domain code. This keeps the knowledge of
regdomains and defines like MKK9_MKKC in one place. I'm passing the regdomain
code instead of the ath_regulatory structure because this needs to be called
quite early in the driver inititalization where ath_regulatory is not available
yet in ath5k.

I'm using MKK9_MKKC only because this is the regdomain in the 802.11j enabled
sample cards we got from our vendor. I found some hints in HAL code that this
is used by Atheros to indicate 4.9GHz channels support and that there might be
other domain codes as well, but as I don't have any documentation I'm just
putting in what I need right now. It can be extended later.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use local variable for capabilities
Bruno Randolf [Tue, 25 Jan 2011 04:15:28 +0000 (13:15 +0900)]
ath5k: Use local variable for capabilities

Shorten some lines and make code more readable.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix tx queue index confusion in debugfs code
Felix Fietkau [Mon, 24 Jan 2011 20:29:25 +0000 (21:29 +0100)]
ath9k: fix tx queue index confusion in debugfs code

Various places printing tx queue information used various different ways to
get a tx queue index for printing statistics. Most of these ways were wrong.

ATH_TXQ_AC_* cannot be used as an index for sc->tx.txq, because it is only
used internally for queue assignment.

One place used WME_AC_* as a queue index for sc->debug.stats.txstats, however
this array uses the ath9k_hw queue number as well.

Fix all of this by always using the ath9k_hw queue number as an index, and
always looking it up by going through sc->tx.txq_map.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fold struct ath_wiphy into struct ath_softc
Felix Fietkau [Mon, 24 Jan 2011 18:23:18 +0000 (19:23 +0100)]
ath9k: fold struct ath_wiphy into struct ath_softc

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove the bf->aphy field
Felix Fietkau [Mon, 24 Jan 2011 18:23:17 +0000 (19:23 +0100)]
ath9k: remove the bf->aphy field

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove support for virtual wiphys
Felix Fietkau [Mon, 24 Jan 2011 18:23:16 +0000 (19:23 +0100)]
ath9k: remove support for virtual wiphys

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove the virtual wiphy debugfs interface
Felix Fietkau [Mon, 24 Jan 2011 18:23:15 +0000 (19:23 +0100)]
ath9k: remove the virtual wiphy debugfs interface

It does not make much sense to keep the current virtual wiphy implementation
any longer - it adds significant complexity, has very few users and is still
very experimental. At some point in time, it will be replaced by a proper
implementation in mac80211.

By making the code easier to read and maintain, removing virtual wiphy support
helps with fixing the remaining driver issues and adding further improvements.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: clean up the code that wakes the mac80211 queues
Felix Fietkau [Mon, 24 Jan 2011 18:23:14 +0000 (19:23 +0100)]
ath9k: clean up the code that wakes the mac80211 queues

Instead of spreading ath_wake_mac80211_queue() calls over multiple places
in the tx path that process the tx queue for completion, call it only
where the pending frames counter gets decremented, eliminating some
redundant checks.
To prevent queue draining from waking the queues prematurely (e.g. during
a hardware reset), reset the queue stop state when draining all queues,
as the caller in main.c will run ieee80211_wake_queues(hw) anyway.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Fri, 28 Jan 2011 20:33:16 +0000 (15:33 -0500)]
Merge branch 'for-linville' of git://git./linux/kernel/git/luca/wl12xx

13 years agoath9k: Fix power save usage count imbalance on deinit
Rajkumar Manoharan [Thu, 27 Jan 2011 13:09:38 +0000 (18:39 +0530)]
ath9k: Fix power save usage count imbalance on deinit

While unloading the driver, the ps_usecount is incremented
before configuring gpio registers in deinit_device.
But it is failed to restore the ps_usecount after that.
The problem is that the chip is forcibly moved to FULL SLEEP
by radio_disable when mac80211 is reporting as idle
though ps_usecount is not zero.

This patch retores ps_usecount properly and ensures that
the chip is always moved to full sleep only if ps usage
count is zero which also helps in debugging deadbeef on
multivif case. And also fixes the following warning.

ath: DMA failed to stop in 10 ms AR_CR=0xdeadbeef AR_DIAG_SW=0xdeadbeef
ath: Could not stop RX, we could be confusing the DMA engine when we
start RX up
------------[ cut here ]------------
WARNING: at drivers/net/wireless/ath/ath9k/recv.c:536
ath_stoprecv+0xf4/0x100 [ath9k]()

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix system hang when resuming from S3/S4
Rajkumar Manoharan [Thu, 27 Jan 2011 13:09:37 +0000 (18:39 +0530)]
ath9k_hw: Fix system hang when resuming from S3/S4

The bit 6 & 7 of AR_WA (0x4004) should be enabled only
for the chips that are supporting L0s functionality
while resuming back from S3/S4.

Enabling these bits for AR9280 is causing system hang
within a few S3/S4-resume cycles.

Cc: stable@kernel.org
Cc: Jack Lee <jlee@atheros.com>
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: update information for the wl12xx driver
Luciano Coelho [Wed, 26 Jan 2011 19:46:29 +0000 (21:46 +0200)]
MAINTAINERS: update information for the wl12xx driver

Update maintainer's email address, webpage and align with renaming of
files.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: fix race conditions when stop device
Stanislaw Gruszka [Tue, 25 Jan 2011 13:15:12 +0000 (14:15 +0100)]
ath9k_htc: fix race conditions when stop device

We do not kill any scheduled tasklets when stopping device, that may
cause usage of resources after free. Disable interrupts, kill tasklets
and then works in correct order.

Cc: stable@kernel.org
Tested-by: Sujith <m.sujith@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix race conditions when stop device
Stanislaw Gruszka [Tue, 25 Jan 2011 13:08:40 +0000 (14:08 +0100)]
ath9k: fix race conditions when stop device

We do not kill any scheduled tasklets when stopping device, that may
cause usage of resources after free. Moreover we enable interrupts
in tasklet function, so we could potentially end with interrupts
enabled when driver is not ready to receive them.

I think patch should fix Ben's kernel crash from:
http://marc.info/?l=linux-wireless&m=129438358921501&w=2

Cc: stable@kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: correct endianness of frame duration
Bob Copeland [Tue, 25 Jan 2011 04:31:44 +0000 (23:31 -0500)]
ath5k: correct endianness of frame duration

The ath5k version of ieee80211_generic_frame_duration() returns
an __le16 for standard modes but a cpu-endian int for turbo/half/
quarter rates.  Make it always return cpu-endian values.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: fix error handling in ath5k_hw_dma_stop
Bob Copeland [Tue, 25 Jan 2011 04:31:43 +0000 (23:31 -0500)]
ath5k: fix error handling in ath5k_hw_dma_stop

Review spotted a problem with the error handling in ath5k_hw_dma_stop:
a successful return from ath5k_hw_stop_tx_dma will be treated as
an error, so we always bail out of the loop after processing a single
active queue.  As a result, we may not actually stop some queues during
reset.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Fix firmware upload errors
Chaoming Li [Fri, 21 Jan 2011 19:57:37 +0000 (13:57 -0600)]
rtlwifi: Fix firmware upload errors

When the source code from Realtek was prepared for kernel inclusion,
some routines were refactored to reduce the level of indentation. This
patch repairs errors introduced in that process.

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 agoath9k: fix misplaced debug code
Felix Fietkau [Mon, 24 Jan 2011 18:11:54 +0000 (19:11 +0100)]
ath9k: fix misplaced debug code

The commit 'ath9k: Add more information to debugfs xmit file.' added more
debug counters to ath9k and also added some lines of code to ath9k_hw.

Since ath9k_hw is also used by ath9k_htc, its code must not depend on ath9k
data structures. In this case it was not fatal, but it's still wrong, so
the code needs to be moved back to ath9k.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: utilize fw seq counter for mgmt/non-QoS data frames
Christian Lamparter [Sat, 22 Jan 2011 23:18:28 +0000 (00:18 +0100)]
carl9170: utilize fw seq counter for mgmt/non-QoS data frames

"mac80211 will properly assign sequence numbers to QoS-data
frames but cannot do so correctly for non-QoS-data and
management frames because beacons need them from that counter
as well and mac80211 cannot guarantee proper sequencing."

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: enable wake-on-lan feature testing
Christian Lamparter [Sat, 22 Jan 2011 23:10:01 +0000 (00:10 +0100)]
carl9170: enable wake-on-lan feature testing

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: update fw/hw headers
Christian Lamparter [Sat, 22 Jan 2011 21:46:49 +0000 (22:46 +0100)]
carl9170: update fw/hw headers

This patch syncs up the header files with
the project's main firmware carl9170fw.git.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: clean up enums and unused macros
Mohammed Shafi Shajakhan [Fri, 21 Jan 2011 08:33:24 +0000 (14:03 +0530)]
ath9k: clean up enums and unused macros

Remove unused macros and cleanup buffer_type enumeration

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use DECLARE_EVENT_CLASS
Johannes Berg [Wed, 26 Jan 2011 08:22:15 +0000 (09:22 +0100)]
mac80211: use DECLARE_EVENT_CLASS

For events that include only the local struct as
their parameter, we can use DECLARE_EVENT_CLASS
and save quite some binary size across segments
as well lines of code.

   text    data     bss     dec     hex filename
 375745   19296     916  395957   60ab5 mac80211.ko.before
 367473   17888     916  386277   5e4e5 mac80211.ko.after
  -8272   -1408       0   -9680   -25d0 delta

Some more tracepoints with identical arguments
could be combined like this but for now this is
the one that benefits most.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Wed, 26 Jan 2011 21:12:47 +0000 (16:12 -0500)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agoath5k: ath5k_setup_channels cleanup and whitespace
Bruno Randolf [Wed, 19 Jan 2011 09:20:52 +0000 (18:20 +0900)]
ath5k: ath5k_setup_channels cleanup and whitespace

Remove useless test_bit - it's not going to happen because of the way this
function is called only when that bit is set.

And fix some whitespace.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: read and backup AR_WA register value even before chip reset on.
Senthil Balasubramanian [Wed, 22 Dec 2010 13:47:18 +0000 (19:17 +0530)]
ath9k_hw: read and backup AR_WA register value even before chip reset on.

We need to read and backup AR_WA register value permanently and reading
this after the chip is awakened results in this register being zeroed out.

This seems to fix the ASPM with L1 enabled issue that we have observed.
The laptop becomes very slow and hangs mostly with ASPM L1 enabled without
this fix.

Cc: Stable Kernel <stable@kernel.org>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix incorrect macversion and macrev checks
Senthil Balasubramanian [Wed, 22 Dec 2010 15:44:20 +0000 (21:14 +0530)]
ath9k_hw: Fix incorrect macversion and macrev checks

There are few places where we are checking for macversion and revsions
before RTC is powered ON. However we are reading the macversion and
revisions only after RTC is powered ON and so both macversion and
revisions are actully zero and this leads to incorrect srev checks

Incorrect srev checks can cause registers to be configured wrongly and can
cause unexpected behavior. Fixing this seems to address the ASPM issue that
we have observed. The laptop becomes very slow and hangs mostly with ASPM L1
enabled without this fix.

fix this by reading the macversion and revisisons even before we start
using them. There is no reason why should we delay reading this info
until RTC is powered on as this is just a register information.

Cc: Stable Kernel <stable@kernel.org>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: remove Reinette Chatre as iwlwifi maintainer
Reinette Chatre [Tue, 25 Jan 2011 16:38:06 +0000 (08:38 -0800)]
MAINTAINERS: remove Reinette Chatre as iwlwifi maintainer

Signed-off-by: Reinette Chatre <reinette.chatre@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 agort2x00: add device id for windy31 usb device
Greg Kroah-Hartman [Tue, 25 Jan 2011 09:42:29 +0000 (17:42 +0800)]
rt2x00: add device id for windy31 usb device

This patch adds the device id for the windy31 USB device to the rt73usb
driver.

Thanks to Ralf Flaxa for reporting this and providing testing and a
sample device.

Reported-by: Ralf Flaxa <rf@suse.de>
Tested-by: Ralf Flaxa <rf@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix a crash in ieee80211_beacon_get_tim on change_interface
Felix Fietkau [Mon, 24 Jan 2011 18:28:49 +0000 (19:28 +0100)]
mac80211: fix a crash in ieee80211_beacon_get_tim on change_interface

Some drivers (e.g. ath9k) do not always disable beacons when they're
supposed to. When an interface is changed using the change_interface op,
the mode specific sdata part is in an undefined state and trying to
get a beacon at this point can produce weird crashes.

To fix this, add a check for ieee80211_sdata_running before using
anything from the sdata.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: disable auto-arp
Eliad Peller [Mon, 24 Jan 2011 18:19:03 +0000 (19:19 +0100)]
wl12xx: disable auto-arp

The auto-arp feature sometimes has unexpected side effects (e.g. firmware
crashes, no ARP replies, etc.)
disable it until it will be solved.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Increase scan channel dwell time for passive scans
Juuso Oikarinen [Mon, 24 Jan 2011 06:01:54 +0000 (07:01 +0100)]
wl12xx: Increase scan channel dwell time for passive scans

The passive scan channel dwell time currently used is 30-60TU. A typical
beacon interval for AP's is 100TU. This leads to a ~30% worst-case probability
of finding an AP via passive scanning.

For 5GHz bands for DFS frequencies passive scanning is the only scanning
option. Hence for these, the probability of finding an AP is very low.

To fix this, increase the passive channel scan dwell times (also the early
leave value, as 5GHz channels are still typically very silent.) Use a value
of 100TU, because that covers most typical AP configurations.

Based on testing the probability of finding an AP (100TU beacon interval) on
a single scan round are as follows (based on 100 iterations):

dwell min/max (TU)   | probability
---------------------+------------
30/60                | 35%
60/60                | 56%
80/80                | 77%
100/100              | 100%

Total scan times now and after the change:

Region | Before (s) | After (s)
-------+------------+----------
00     | 0.77       | 1.48
FI     | 0.95       | 2.01
US     | 0.91       | 1.76

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: wrong values are returned in gpio_power_write()
Eliad Peller [Sun, 23 Jan 2011 10:25:27 +0000 (11:25 +0100)]
wl12xx: wrong values are returned in gpio_power_write()

Return values were assigned to incorrect var / weren't assigned.
fix it, and defer mutex_lock after the sanity checks.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: BA receiver support
Levi, Shahar [Sun, 23 Jan 2011 06:27:23 +0000 (07:27 +0100)]
wl12xx: BA receiver support

Add new ampdu_action ops to support receiver BA.
The BA initiator session management in FW independently.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: BA initiator support
Levi, Shahar [Sun, 23 Jan 2011 06:27:22 +0000 (07:27 +0100)]
wl12xx: BA initiator support

Add 80211n BA initiator session support wl1271 driver.
Include BA supported FW version auto detection mechanism.
BA initiator session management included in FW independently.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Add channel 14 to list of supported 2ghz channels
Arik Nemtsov [Tue, 18 Jan 2011 19:39:52 +0000 (20:39 +0100)]
wl12xx: Add channel 14 to list of supported 2ghz channels

Channel 14 is only supported in Japan (JP country code in regdb).  The
FW limits tranmissions to CCK only on this channel.

Tested in both STA and AP modes to work correctly.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add missing MODULE_FIRMWARE statment for AP-mode FW
Arik Nemtsov [Mon, 17 Jan 2011 09:16:00 +0000 (10:16 +0100)]
wl12xx: add missing MODULE_FIRMWARE statment for AP-mode FW

In wl12xx cards AP-mode requires a separate FW file. Add this file to
the module info.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Cleanup PLT mode when module is removed
Juuso Oikarinen [Fri, 14 Jan 2011 11:48:46 +0000 (12:48 +0100)]
wl12xx: Cleanup PLT mode when module is removed

PLT mode start/stop is controlled from userspace. When removing module, the
PLT mode state is however not checked, and not cleared. There is the possibility
of some unwanted state to left linger and there is even the possiblity of a
kernel crash if for instance IRQ work is running when the module is removed.

Fix this by stopping PLT mode on module removal, if still running.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: fix some endianess bugs
Eliad Peller [Sun, 16 Jan 2011 09:07:10 +0000 (10:07 +0100)]
wl12xx: fix some endianess bugs

pointed out by sparse warnings:

  CHECK   drivers/net/wireless/wl12xx/cmd.c
drivers/net/wireless/wl12xx/cmd.c:987:20: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:987:20:    expected restricted __le16 [usertype] aging_period
drivers/net/wireless/wl12xx/cmd.c:987:20:    got int
  CHECK   drivers/net/wireless/wl12xx/tx.c
drivers/net/wireless/wl12xx/tx.c:197:2: warning: cast from restricted __le16
drivers/net/wireless/wl12xx/tx.c:197:2: warning: cast from restricted __le16
drivers/net/wireless/wl12xx/tx.c:197:2: warning: cast from restricted __le16
  CHECK   drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/acx.c:816:23: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/acx.c:816:23:    expected restricted __le32 [usertype] rate_policy_idx
drivers/net/wireless/wl12xx/acx.c:816:23:    got unsigned char [unsigned] [usertype] idx

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add hw configuration for max supported AMDPU size
Luciano Coelho [Wed, 12 Jan 2011 13:27:03 +0000 (14:27 +0100)]
wl12xx: add hw configuration for max supported AMDPU size

The wl12xx chips do the AMDPU aggregation work in the firmware, but it
supports a maximum of 8 frames per block.  Configure the mac80211 hw
structure accordingly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Tested-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
13 years agowl12xx: change debug_level module param sysfs permissions
Guy Eilam [Wed, 12 Jan 2011 09:33:29 +0000 (10:33 +0100)]
wl12xx: change debug_level module param sysfs permissions

changed the visibility of the debug_level module parameter
in the filesystem to be readable and writable to the root user.
It is now accessible under /sys/module/wl12xx/parameters

removed the debug_level debugfs file that was created under
/sys/kernel/debug/...

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: lock the RCU when accessing sta via ieee80211_find_sta()
Luciano Coelho [Tue, 11 Jan 2011 18:07:21 +0000 (19:07 +0100)]
wl12xx: lock the RCU when accessing sta via ieee80211_find_sta()

We were calling ieee80211_find_sta() and the sta returned by it
without locking the RCU, which is required by mac80211.

Fix this and reorganize slightly the area of the code where the sta is
used.

Reported-by: Jonathan DE CESCO <jonathanc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: don't modify the global supported band structures
Luciano Coelho [Tue, 11 Jan 2011 17:25:18 +0000 (18:25 +0100)]
wl12xx: don't modify the global supported band structures

When 11a is not supported, we were modifying the global structure that
contains the bands supported by the driver.  This causes problems when
having more one wl12xx device in the same system because they all use
the same global.  This also causes problems when the wl12xx_sdio
module is removed and the wl12xx module remains.

Fix this problem by copying the band structure into the wl12xx
instance.

Reported-by: Arik Nemtsov <arik@wizery.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: don't join upon disassociation
Eliad Peller [Sun, 26 Dec 2010 08:27:50 +0000 (09:27 +0100)]
wl12xx: don't join upon disassociation

wl12xx "rejoins" upon every BSS_CHANGED_BSSID notification.
However, there is no need to rejoin after disassociation, so just
filter out the case when the new bssid is 00:00:00:00:00:00.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agoMAINTAINERS: update information for the wl12xx driver
Luciano Coelho [Mon, 10 Jan 2011 15:59:44 +0000 (17:59 +0200)]
MAINTAINERS: update information for the wl12xx driver

Update maintainer's email address, webpage and align with renaming of
files.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Enable AP-mode
Arik Nemtsov [Sat, 16 Oct 2010 19:53:24 +0000 (21:53 +0200)]
wl12xx: Enable AP-mode

Indicate support for the NL80211_IFTYPE_AP interface mode to enable AP
mode operation.

Disable 11a when operating in AP-mode (unsupported for now).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Read MAC address from NVS file on HW startup
Arik Nemtsov [Sat, 16 Oct 2010 19:49:52 +0000 (21:49 +0200)]
wl12xx: Read MAC address from NVS file on HW startup

Try to read the MAC address from the on-disk NVS file.
A non-zero MAC address is required to add an AP interface.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - fetch appropriate firmware for AP
Arik Nemtsov [Sat, 16 Oct 2010 19:44:57 +0000 (21:44 +0200)]
wl12xx: AP mode - fetch appropriate firmware for AP

AP and STA modes use different firmwares.

Differentiate the firmware files by name and fetch the appropriate one
when add_interface is called by mac80211. The STA firmware is chosen for
PLT mode.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - encryption support
Arik Nemtsov [Sat, 16 Oct 2010 19:39:06 +0000 (21:39 +0200)]
wl12xx: AP mode - encryption support

Encryption key configuration is different for AP/STA modes.

AP encryption keys are recorded when the BSS is not started. On BSS
start they are propagated to the AP (in wl1271_ap_init_hwenc).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - record TX configuration settings
Arik Nemtsov [Sat, 16 Oct 2010 18:33:45 +0000 (20:33 +0200)]
wl12xx: AP mode - record TX configuration settings

Record TX configuration settings in the "conf" member of our global
structure (struct wl1271) if conf_tx is called when the firmware is
not loaded.

Later on when the firmware is loaded, we apply the tx conf as part of
the init sequence.

Important for AP mode since conf_tx is called before add_interface
(where the firmware is initialized).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - changes in TX path
Arik Nemtsov [Sat, 16 Oct 2010 18:27:53 +0000 (20:27 +0200)]
wl12xx: AP mode - changes in TX path

When in AP mode set appropriate HLID and rate policy for each skb.
Respond to supported-rates related changes in op_tx only when acting
as STA.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - add STA add/remove ops
Arik Nemtsov [Sat, 16 Oct 2010 18:21:23 +0000 (20:21 +0200)]
wl12xx: AP mode - add STA add/remove ops

Allocate and free host link IDs (HLIDs) for each link. A per-STA
data structure keeps the HLID of each STA.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - change filter config
Arik Nemtsov [Sat, 16 Oct 2010 17:25:35 +0000 (19:25 +0200)]
wl12xx: AP mode - change filter config

Do not configure a group address table in AP mode

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode config in ieee80211_ops.config
Arik Nemtsov [Sat, 16 Oct 2010 17:17:02 +0000 (19:17 +0200)]
wl12xx: AP mode config in ieee80211_ops.config

Separate configuration according to mode. AP has different rate
set configuration and no handling of idle-state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Configure AP on BSS info change
Arik Nemtsov [Sat, 16 Oct 2010 17:07:21 +0000 (19:07 +0200)]
wl12xx: Configure AP on BSS info change

Configure AP-specific beacon and probe response templates.
Start the AP when beaconing is enabled.

The wl1271_bss_info_changed() function has been split into AP/STA
specific handlers.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Add AP related definitions to HOST-FW interface
Arik Nemtsov [Sat, 16 Oct 2010 16:53:48 +0000 (18:53 +0200)]
wl12xx: Add AP related definitions to HOST-FW interface

Change structures in a non-destructive manner. This means no
changes in size or location of existing members used by STA.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP specific RX filter configuration
Arik Nemtsov [Sat, 16 Oct 2010 16:45:07 +0000 (18:45 +0200)]
wl12xx: AP specific RX filter configuration

Set filters according to the mode of operation.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - init sequence
Arik Nemtsov [Sat, 16 Oct 2010 16:19:53 +0000 (18:19 +0200)]
wl12xx: AP mode - init sequence

Split HW init sequence into AP/STA specific parts

The AP specific init sequence includes configuration of templates, rate
classes, power mode, etc. Also unmask AP specific events in the event mbox.

Separate the differences between AP and STA init into mode
specific functions called from wl1271_hw_init. The first is called after
radio configuration and the second after memory configuration.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - workaround for FW bug on station remove
Arik Nemtsov [Fri, 12 Nov 2010 15:15:03 +0000 (17:15 +0200)]
wl12xx: AP mode - workaround for FW bug on station remove

Sometimes an event indicating station removal is not sent up by
firmware. We work around this by always indicating success in when
a wait for the event timeouts.

Temporary workaround until a FW fix is introduced.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP-mode high level commands
Arik Nemtsov [Sat, 16 Oct 2010 16:08:58 +0000 (18:08 +0200)]
wl12xx: AP-mode high level commands

Add commands to start/stop BSS, add/remove STA and configure encryption
keys. Split the encryption commands "set key" and "set default key" into
AP and STA specific versions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - add AP specific event
Arik Nemtsov [Mon, 25 Oct 2010 09:17:44 +0000 (11:17 +0200)]
wl12xx: AP mode - add AP specific event

Add STA-remove completion event. Unmask it during boot if operating in
AP-mode.
Ignore unrelated events in AP-mode.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: AP mode - AP specific CMD_CONFIGURE sub-commands
Arik Nemtsov [Sat, 16 Oct 2010 15:52:59 +0000 (17:52 +0200)]
wl12xx: AP mode - AP specific CMD_CONFIGURE sub-commands

Add AP max retries and rate policy configuration.
Rename STA rate policy configuration function.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Add AP related configuration to conf_drv_settings
Arik Nemtsov [Sat, 16 Oct 2010 15:44:51 +0000 (17:44 +0200)]
wl12xx: Add AP related configuration to conf_drv_settings

Rate class configuration has been split up for AP and STA modes.
Template related configuration likewise separated.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: fix some sparse warnings
Eliad Peller [Wed, 22 Dec 2010 11:38:52 +0000 (12:38 +0100)]
wl12xx: fix some sparse warnings

Note that wl1271_write32() calls cpu_to_le32() by itself, so calling
wl1271_write32(addr, cpu_to_le32(val)) is in fact a bug on BE systems.

Fix the following sparse warnings:

drivers/net/wireless/wl12xx/cmd.c:662:16: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:662:16:    expected unsigned short [unsigned] [addressable] [usertype] llc_type
drivers/net/wireless/wl12xx/cmd.c:662:16:    got restricted __be16 [usertype] <noident>
drivers/net/wireless/wl12xx/cmd.c:674:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:674:17:    expected unsigned int [unsigned] [addressable] [usertype] sender_ip
drivers/net/wireless/wl12xx/cmd.c:674:17:    got restricted __be32 [usertype] ip_addr
drivers/net/wireless/wl12xx/rx.c:202:4: warning: incorrect type in argument 3 (different base types)
drivers/net/wireless/wl12xx/rx.c:202:4:    expected unsigned int [unsigned] [usertype] val
drivers/net/wireless/wl12xx/rx.c:202:4:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/acx.c:1247:23: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/acx.c:1247:23:    expected restricted __le32 [usertype] ht_capabilites
drivers/net/wireless/wl12xx/acx.c:1247:23:    got unsigned long
drivers/net/wireless/wl12xx/acx.c:1250:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1250:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1250:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1253:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1253:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1253:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1256:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1256:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1256:24:    right side has type unsigned long

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: use after free in debug code
Dan Carpenter [Tue, 21 Dec 2010 04:00:13 +0000 (07:00 +0300)]
wl12xx: use after free in debug code

If debugging is turned on, then wl1271_dump() dereferences a freed
variable.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agowl12xx: remove redundant debugfs_remove_recursive() call
Eliad Peller [Wed, 15 Dec 2010 09:47:54 +0000 (11:47 +0200)]
wl12xx: remove redundant debugfs_remove_recursive() call

Upon rmmod, the <debugfs>/ieee80211/phyX dir is being removed.
later, we try to remove <debugfs>/ieee80211/phyX/wl12xx, which
might result in NULL dereference.

Remove the excessive debugfs_remove_recursive() call.
(consequently, there is no more need to save wl->rootdir)

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
13 years agoiwlwifi: initial P2P support
Wey-Yi Guy [Fri, 14 Jan 2011 01:09:29 +0000 (17:09 -0800)]
iwlwifi: initial P2P support

If PAN functionality is present, advertise
P2P interface type support and thus support
for P2P. However, the support is currently
somewhat incomplete -- NoA schedule isn't
added to probe responses, and 11b bitrates
may be used still, etc. Therefore, make it
all optional with a Kconfig option.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: replace minimum slot time constant
Johannes Berg [Thu, 6 Jan 2011 16:07:11 +0000 (08:07 -0800)]
iwlwifi: replace minimum slot time constant

There are a number of places where the minimum
slot time is hardcoded to 20 TU, add a new
constant for that and use it everywhere.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: implement remain-on-channel
Johannes Berg [Thu, 6 Jan 2011 16:07:10 +0000 (08:07 -0800)]
iwlwifi: implement remain-on-channel

For device supporting PAN/P2P, use the PAN
context to implement the remain-on-channel
operation using device offloads so that the
filters in the device will be programmed
correctly -- otherwise we cannot receive
any probe request frames during off-channel
periods.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 years agoiwlagn: Enable idle powersave mode in 1000 series
Meenakshi Venkataraman [Thu, 13 Jan 2011 19:35:26 +0000 (11:35 -0800)]
iwlagn: Enable idle powersave mode in 1000 series

The iwlagn powersave algorithm uses the supports_idle parameter
to tell the device to save power when it is not associated with
an AP and is idle.

Enable this feature for the 1000 series of devices.

Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: correct debugfs data dumped from sram
Jay Sternberg [Tue, 11 Jan 2011 23:41:00 +0000 (15:41 -0800)]
iwlwifi: correct debugfs data dumped from sram

the sram data dumped through the debugfs interface would only work properly
when dumping data on even u32 boundaries and swap bytes based on endianness
on that boundary making byte arrays impossible to read.

now addresses are displayed at the start of every line and the data is
displayed consistently if dumping 1 byte or 20 and regardless of what is the
starting address.

if no lenght given, address displayed is u32 in device format

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: add hw rev for 2000 series devices
Wey-Yi Guy [Mon, 10 Jan 2011 22:34:38 +0000 (14:34 -0800)]
iwlwifi: add hw rev for 2000 series devices

2000 series device has different HW rev, add it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: remove g2 from csr hw rev
Wey-Yi Guy [Mon, 10 Jan 2011 22:24:28 +0000 (14:24 -0800)]
iwlwifi: remove g2 from csr hw rev

Remove refernce of g2 and use offical number for hw rev.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>