]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
12 years agowlcore: add module param to prevent HW recovery
Arik Nemtsov [Thu, 8 Dec 2011 11:06:45 +0000 (13:06 +0200)]
wlcore: add module param to prevent HW recovery

Allow preventing HW recovery from a module param. The driver/FW will
remain stuck, to allow easier FW debugging.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move identify firmware function to a lower driver op
Luciano Coelho [Tue, 6 Dec 2011 20:24:57 +0000 (22:24 +0200)]
wlcore/wl12xx: move identify firmware function to a lower driver op

Different chip families have different firmware versions, so we need
to identify the firmware to enable quirks, reject the used version
etc. in the lower drivers.  This commit turns the fw_ver_quirks
function into an identify_fw operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: set max_rx_agg_subframes in mac80211 according to HT conf
Arik Nemtsov [Thu, 5 Jan 2012 22:05:51 +0000 (00:05 +0200)]
wlcore: set max_rx_agg_subframes in mac80211 according to HT conf

The max Rx aggregation subframes configured to FW must be the same
number given to the upper layers (mac80211). Derive both from the same
value, given in the conf struct.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: set HT capabilities per chip-family
Arik Nemtsov [Tue, 13 Dec 2011 11:20:44 +0000 (13:20 +0200)]
wlcore/wl12xx: set HT capabilities per chip-family

Set HT capabilities in the low-level HW driver. These are then used by
wlcore when registering with mac80211.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op to get rate-mask for AP-link in STA mode
Arik Nemtsov [Tue, 13 Dec 2011 11:18:17 +0000 (13:18 +0200)]
wlcore/wl12xx: add hw op to get rate-mask for AP-link in STA mode

In some chip-families, there are operating modes where we must mask-out
certain Tx rates, and/or tweak the rate-mask with special HW-specific
bits.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: use a single memory config and reset if using wl127x
Luciano Coelho [Mon, 5 Dec 2011 17:52:22 +0000 (19:52 +0200)]
wlcore/wl12xx: use a single memory config and reset if using wl127x

Instead of having two memory configuration sets, one for wl127x and
one for wl128x, we can use only one which should be correctly set by
the lower driver.

The wl12xx driver now uses the wl128x memory config by default but
changes it when if it identifies the wl127x chips.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move extended radio configuration parameters to wl12xx
Luciano Coelho [Mon, 5 Dec 2011 14:51:10 +0000 (16:51 +0200)]
wlcore/wl12xx: move extended radio configuration parameters to wl12xx

The extended radio configuration parameters are only used by the
wl127x chipsets, which are handled by the wl12xx driver.  Move the rf
configuration settings from wlcore to wl12xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move runtime configuration struct to the lower driver
Luciano Coelho [Mon, 5 Dec 2011 14:12:54 +0000 (16:12 +0200)]
wlcore/wl12xx: move runtime configuration struct to the lower driver

The configuration parameters vary with different chip families.  Some
of the parameters used only by some chip families, others should have
different value depending on the family.  Thus move the configuration
values from wlcore to wl12xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: expand functionality of cmd_trigger HW op
Arik Nemtsov [Tue, 13 Dec 2011 10:27:22 +0000 (12:27 +0200)]
wlcore/wl12xx: expand functionality of cmd_trigger HW op

Change the cmd_trigger op to include the write of the command buffer.

Also, instead of letting the lower driver access the cmd_box_addr element
directly, we now pass the address in the trigger_cmd operation, so it
doesn't have to be exported.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for vif init
Arik Nemtsov [Tue, 13 Dec 2011 10:15:09 +0000 (12:15 +0200)]
wlcore/wl12xx: add hw op for vif init

Add an op for family-specific vif initialization.  Currently unused,
but will be needed when wl18xx support is implemented.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw_init operation
Luciano Coelho [Thu, 1 Dec 2011 22:47:45 +0000 (00:47 +0200)]
wlcore/wl12xx: add hw_init operation

Move all the wl12xx-specific hw initialization procedures into a new
hw_init op.  Move some commands and ACX functions to wl12xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: turn no-Tx-align quirk into Tx-align
Arik Nemtsov [Tue, 13 Dec 2011 10:11:26 +0000 (12:11 +0200)]
wlcore/wl12xx: turn no-Tx-align quirk into Tx-align

Inverting the quirk flag to indicate Tx-alignment. This aligns it with
the similar Rx-side quirk.

The call to wl1271_set_block_size() decides whether SDIO block size
alignment can be used or not.  In case we're using SPI, we can't use
the block size alignment, so the function returns false.  So we set
the quirk when wl1271_set_block_size() returns true and let the wl12xx
lower driver unset the bit for wl127x (since it doesn't support this
quirk).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: split Tx completion to immediate/delayed
Arik Nemtsov [Mon, 12 Dec 2011 09:32:37 +0000 (11:32 +0200)]
wlcore/wl12xx: split Tx completion to immediate/delayed

One chip family employs immediate Tx completion, where knowledge of
completed packets is given as part of the FW status. Another is only
notified of Tx completion via the FW status, and has to read the
completion status of the packets from a different location.

Implement the wl12xx tx completion as a delayed Tx completion.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for getting rx packet data length
Arik Nemtsov [Mon, 12 Dec 2011 10:18:17 +0000 (12:18 +0200)]
wlcore/wl12xx: add hw op for getting rx packet data length

There is a difference in the way chip families report the length of data
in a single Rx packet. Abstract this into a HW op. Refactor the Rx data
handling function to allocate the correct size for the data, and avoid
trimming the skb.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add prepare_read hw op for Rx data
Luciano Coelho [Mon, 12 Dec 2011 10:15:08 +0000 (12:15 +0200)]
wlcore/wl12xx: add prepare_read hw op for Rx data

The only difference in the read_data operations is that some chips
need to prepare the data to be read before reading.  So instead of
having a mandatory read_data operation, we now have an option
prepare_data operation that only needs to be implemented for chips
that require it.

In the wl12xx lower driver, we only set the prepare_data operation for
wl127x chips.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for getting rx buffer data alignment
Arik Nemtsov [Mon, 12 Dec 2011 10:11:43 +0000 (12:11 +0200)]
wlcore/wl12xx: add hw op for getting rx buffer data alignment

An aligned data buffer is such where the Ethernet portion of the packet
starts on a 4-byte boundary. Some chip families support padding the Rx
data buffer to achieve such alignment, others rely on the host to perform
it.
Implement the HW op for getting alignment state in wl12xx. Add
support for HW-padded alignment in the Rx flow.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: introduce Rx block-size alignment HW quirk
Arik Nemtsov [Mon, 12 Dec 2011 10:09:12 +0000 (12:09 +0200)]
wlcore: introduce Rx block-size alignment HW quirk

For chip-families that support aligned buffers in the Rx side. The Rx
flow changes slightly for these chips.

Currently these modifications rely on a hard-coded block-size of 256.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add global elements to convert hw-rates to standard rates
Arik Nemtsov [Wed, 7 Dec 2011 22:43:48 +0000 (00:43 +0200)]
wlcore/wl12xx: add global elements to convert hw-rates to standard rates

Rates reported by HW can be different between chip families. Make the
rate-to-idx translation tables private per family and use them in a
common translation function. Add a global element to help determine
which rates are HW HT-rates.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for setting frame length in tx_hw_desc
Arik Nemtsov [Mon, 12 Dec 2011 09:47:09 +0000 (11:47 +0200)]
wlcore/wl12xx: add hw op for setting frame length in tx_hw_desc

Each chip family indicates the length of a frame to the HW differently.
This includes different padding, alignment and other fields in the HW Tx
descriptor.

Put all wl12xx specific code in a hw op.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for setting blocks in hw_tx_desc
Arik Nemtsov [Mon, 12 Dec 2011 09:44:27 +0000 (11:44 +0200)]
wlcore/wl12xx: add hw op for setting blocks in hw_tx_desc

Each chip family has a slightly different Tx descriptor. Set the
descriptor values according to family.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add hw op for calculating hw block count per packet
Arik Nemtsov [Mon, 12 Dec 2011 09:41:44 +0000 (11:41 +0200)]
wlcore/wl12xx: add hw op for calculating hw block count per packet

Each chip family has a different block size and calculates the total
number of HW blocks differently, with respect to alignment.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: change GEM Tx-spare blocks per-vif
Arik Nemtsov [Wed, 7 Dec 2011 21:38:47 +0000 (23:38 +0200)]
wlcore/wl12xx: change GEM Tx-spare blocks per-vif

The number of spare Tx blocks must be changed when the GEM cipher is
engaged. Track set_key() operations to see if this is the case and
change the Tx HW spare block count accordingly. Set the number of spare
blocks for each operating mode from the low level driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: set the number of Tx descriptors per chip family
Arik Nemtsov [Wed, 7 Dec 2011 19:21:51 +0000 (21:21 +0200)]
wlcore/wl12xx: set the number of Tx descriptors per chip family

Each chip family can have a different amount of Tx descriptors. These
are set on init.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: create per-chip-family private storage
Arik Nemtsov [Wed, 7 Dec 2011 19:09:03 +0000 (21:09 +0200)]
wlcore/wl12xx: create per-chip-family private storage

This storage is allocated in wlcore_alloc_hw and freed in free_hw. The
size of the storage is determined by the low-level driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: add quirk to disable ELP
Luciano Coelho [Wed, 30 Nov 2011 13:07:20 +0000 (15:07 +0200)]
wlcore: add quirk to disable ELP

ELP is a very complicated process in the firmware.  Due to its
complexity, in some early firmware revisions, the ELP feature is
disabled.  To support this cases, this patch adds a quirk that
disables ELP mode.

When ELP is not supported, do not attempt to enter ELP when requested by
the driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: remove some unnecessary event mailbox address reads
Luciano Coelho [Wed, 30 Nov 2011 13:02:47 +0000 (15:02 +0200)]
wlcore: remove some unnecessary event mailbox address reads

We were reading the even mailbox address three times, which was
completely unnecessary and complicated things regarding partition
selection.  Remove the unnecessry reads and set the address for
mailbox 1 and 2 after the first read.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add quirk for legacy NVS support
Luciano Coelho [Wed, 30 Nov 2011 10:30:01 +0000 (12:30 +0200)]
wlcore/wl12xx: add quirk for legacy NVS support

Instead of checking the chip ID directly in the wlcore code to decide
whether to use the new or the old NVS format, we now use a quirk that
should be set by the low level driver to say that it needs to use the
old format.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add command trigger and event ack operations
Luciano Coelho [Wed, 11 Apr 2012 07:15:46 +0000 (10:15 +0300)]
wlcore/wl12xx: add command trigger and event ack operations

Different chips may use different bits in the interrupt trigger
register.  Add operations to handle these differences.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move MAC address reading operation to lower driver
Luciano Coelho [Wed, 11 Apr 2012 08:07:28 +0000 (11:07 +0300)]
wlcore/wl12xx: move MAC address reading operation to lower driver

Different chip families have the factory MAC address written in
different places.  Add a new hardware operation to read the MAC
address, if available.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move top initialization to wl12xx
Luciano Coelho [Wed, 11 Apr 2012 08:03:14 +0000 (11:03 +0300)]
wlcore/wl12xx: move top initialization to wl12xx

The top registers initialization is very specific to the actual
hardware used, even the way in which we read from and write to the top
registers varies from chip to chip.  This patch moves all top
registers initialization to wl12xx.  Also add a boot op for the wlcore
module to call at the right time and a few callbacks with the common
called to be called from the lower drivers boot operations.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: move get_pg_ver to the lower driver
Luciano Coelho [Wed, 11 Apr 2012 07:54:52 +0000 (10:54 +0300)]
wlcore/wl12xx: move get_pg_ver to the lower driver

The PG version depends on the actual hardware.  This commit moves the
code used to read the PG version to the lower driver, by adding the
get_pg_ver hardware operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: add chip-specific identify chip operation
Luciano Coelho [Tue, 29 Nov 2011 14:27:31 +0000 (16:27 +0200)]
wlcore/wl12xx: add chip-specific identify chip operation

Move the code that identifies the chip ID and selects the appropriate
firmware to an operation implemented by the lower driver.  Also move
the quirks definitions into wlcore.h and rename to WLCORE_QUIRK_*.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: implement chip-specific register tables
Luciano Coelho [Tue, 29 Nov 2011 11:38:37 +0000 (13:38 +0200)]
wlcore/wl12xx: implement chip-specific register tables

Add register tables support in wlcore, add some new IO functions to
read and write to chip-specific register and data addresses.  Move
some common register values from wl12xx to wlcore and add the
registers table to wl12xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx: implement chip-specific partition tables
Luciano Coelho [Mon, 21 Nov 2011 18:37:14 +0000 (20:37 +0200)]
wlcore/wl12xx: implement chip-specific partition tables

Add partition tables to wlcore, move and reorganize partition setting
functions.  Move wl12xx partition table to use the wlcore partition
table instead.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: move wl1271 struct to wlcore and add ops
Luciano Coelho [Mon, 21 Nov 2011 17:25:24 +0000 (19:25 +0200)]
wl12xx/wlcore: move wl1271 struct to wlcore and add ops

In order to add chip-specific operations and prepare for future
elements that need to be set by the lower driver, move the wl1271
structure to the wlcore.h file and add an empty placeholder for the
operations structure.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: initial split of probe
Luciano Coelho [Mon, 21 Nov 2011 16:55:51 +0000 (18:55 +0200)]
wl12xx/wlcore: initial split of probe

We need to set some parameters (eg. partition and register tables)
during probe of the lower driver, so split the probe function, leaving
most of it in wlcore, but moving the hw struct allocation to the lower
driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: spin out the wl12xx probe from wlcore to a new wl12xx
Luciano Coelho [Sun, 20 Nov 2011 21:32:10 +0000 (23:32 +0200)]
wl12xx/wlcore: spin out the wl12xx probe from wlcore to a new wl12xx

Create a new small wl12xx module that only contains the probe
functions and depends entirely on wlcore otherwise.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: rename wl12xx to wlcore
Luciano Coelho [Fri, 2 Dec 2011 13:52:19 +0000 (15:52 +0200)]
wl12xx/wlcore: rename wl12xx to wlcore

Rename the wl12xx driver directory to wlcore as an initial step
towards the split of the driver into wlcore and wl12xx.  We just
rename the directory first to keep git blame happy.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowireless/wl12xx/wl1251: move TI WLAN modules to a common ti subdirectory
Luciano Coelho [Sun, 20 Nov 2011 19:40:41 +0000 (21:40 +0200)]
wireless/wl12xx/wl1251: move TI WLAN modules to a common ti subdirectory

Move wl12xx and wl1251 modules into a new drivers/net/wireless/ti
directory.  Add a TI WLAN Kconfig option and Makefile to support this
change.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Cc: John W. Linville <linville@tuxdriver.com>
12 years agowl12xx: increase scan timeout to 30s
Eyal Shapira [Mon, 19 Mar 2012 10:06:29 +0000 (12:06 +0200)]
wl12xx: increase scan timeout to 30s

In certain scenarios involving sched scan + normal scan + COEX
scan could take longer than 10s and this triggers a recovery
where it shouldn't. Increase the timeout to avoid that.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: adaptive sched scan dwell times
Eyal Shapira [Mon, 19 Mar 2012 10:06:28 +0000 (12:06 +0200)]
wl12xx: adaptive sched scan dwell times

Set the dwell times for sched scan according to the number
of probe requests which are going to be transmitted.
This should fix the too short dwell time problem which
prevented some of the probe requests from being transmitted
in cases of high number of SSIDs (10+) to be actively sched scanned.
However, in the common case of having up to 1-2 SSIDs that
require active scan, the dwell time would be kept to a minimum
which should conserve power. This is important as sched scan
also runs periodically while the host is suspended and there's
great importance to keep power consumption as low as possible.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
[fixed a couple of new strict checkpatch warnings]
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: fix a memory leak of probereq template upon recovery
Eyal Shapira [Mon, 19 Mar 2012 10:06:27 +0000 (12:06 +0200)]
wl12xx: fix a memory leak of probereq template upon recovery

wlvif->probereq is zeroed when adding an interface but
the skb pointed to isn't freed when the interface is removed.
This would lead to a mem leak on every recovery.
Fix it by freeing the skb when removing the interface.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: free ap keys only in ap mode
Eliad Peller [Mon, 19 Mar 2012 09:32:55 +0000 (11:32 +0200)]
wl12xx: free ap keys only in ap mode

The ap keys should be freed only when removing
ap role (otherwise, some arbitrary data might
get freed).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: fix DMA-API-related warnings
Mircea Gherzan [Sat, 17 Mar 2012 17:41:53 +0000 (18:41 +0100)]
wl12xx: fix DMA-API-related warnings

On the PandaBoard (omap_hsmmc + wl12xx_sdio) with DMA_API_DEBUG:

 WARNING: at lib/dma-debug.c:930 check_for_stack.part.8+0x7c/0xe0()
 omap_hsmmc omap_hsmmc.4: DMA-API: device driver maps memory fromstack

Signed-off-by: Mircea Gherzan <mgherzan@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: fix race between suspend/resume and recovery
Eyal Shapira [Tue, 13 Mar 2012 18:03:21 +0000 (20:03 +0200)]
wl12xx: fix race between suspend/resume and recovery

The iteration on the wlvif list in wl1271_op_resume/suspend was
perfomed before locking wl->mutex which would lead to a kernel
panic in case a recovery was queued at the same time
and would delete the wlvifs from the list.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: fix station channel switch
Victor Goldenshtein [Mon, 12 Mar 2012 14:36:48 +0000 (16:36 +0200)]
wl12xx: fix station channel switch

Channel switch complete event wasn't handled
properly in station mode, as we checked wrong
CS flag.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx: set do_join on BSS_CHANGED_ASSOC
Eliad Peller [Mon, 12 Mar 2012 12:53:04 +0000 (14:53 +0200)]
wl12xx: set do_join on BSS_CHANGED_ASSOC

wl12xx sets the do_join flag (which later starts the
sta role) when the bssid was changed and the sta is
associated. However, this no longer happens after
the "mac80211: remove spurious BSSID change flag"
patch.

Fix it by setting the do_join flag on BSS_CHANGED_ASSOC
(for IBSS, do_join is already set on BSS_CHANGED_IBSS)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoiwlwifi: split POWER_PMI status bit
Don Fry [Thu, 15 Mar 2012 20:27:06 +0000 (13:27 -0700)]
iwlwifi: split POWER_PMI status bit

Move the POWER_PMI to the op_mode where it is changed.  The trans needs
to check it frequently, so shadow the status in the trans and update it
in trans when it infrequently changes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move FW_ERROR to priv
Don Fry [Thu, 15 Mar 2012 20:27:05 +0000 (13:27 -0700)]
iwlwifi: move FW_ERROR to priv

The op_mode should check for FW_ERROR before calling send_cmd.  This
removes the need to test for FW_ERROR in the trans layer.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove firmware info from iwl_shared
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:04 +0000 (13:27 -0700)]
iwlwifi: remove firmware info from iwl_shared

With error logging now completely handled in
the op_mode, the transport layer does not
need to know information about the loaded
firmware.

Remove this state information from the
iwl_shared data structure.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_get_single_channel_number and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:03 +0000 (13:27 -0700)]
iwlwifi: move iwl_get_single_channel_number and mark it static

iwl_get_single_channel_number is used only in
iwl-scan.c, move it there and mark it static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_full_rxon_required and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:02 +0000 (13:27 -0700)]
iwlwifi: move iwl_full_rxon_required and mark it static

iwl_full_rxon_required is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_check_rxon_cmd and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:01 +0000 (13:27 -0700)]
iwlwifi: move iwl_check_rxon_cmd and mark it static

iwl_check_rxon_cmd is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_set_rxon_hwcrypto and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:00 +0000 (13:27 -0700)]
iwlwifi: move iwl_set_rxon_hwcrypto and mark it static

iwl_set_rxon_hwcrypto is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: Move iwl_send_rxon_timing and make it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:59 +0000 (13:26 -0700)]
iwlwifi: Move iwl_send_rxon_timing and make it static

iwl_send_rxon_timing is used only in
iwl-agn-rxon.c, move it there and mark it
static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_init_geos to iwl-agn.c
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:58 +0000 (13:26 -0700)]
iwlwifi: move iwl_init_geos to iwl-agn.c

This is used only in one file, move it there
and make it static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move ucode_type from shared to op_mode
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:57 +0000 (13:26 -0700)]
iwlwifi: move ucode_type from shared to op_mode

This variable holds the ucode currently
running on the device; which is determined by
op_mode, so move this parameter there.

Also, the name of the variable is a bit
misleading, so rename it to cur_ucode.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move ucode error log reporting to op_mode
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:56 +0000 (13:26 -0700)]
iwlwifi: move ucode error log reporting to op_mode

Error log reporting does not belong to the
transport layer, but to the op_mode loading
the ucode, as it is the entity which knows
about the ucode loaded, and what the error
information means.

Move device logging pointers from the
transport layer to op_mode.

With this change, transport layer only
reports an error to the op_mode, which will
figure out what to do with the error. This
causes the driver to now dump out error logs
when the command queue is stuck as well.

Also, move the debugfs entry for event logs
out of the transport layer and into op_mode.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make iwl_nic_error static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:55 +0000 (13:26 -0700)]
iwlwifi: make iwl_nic_error static

iwl_nic_error is used in iwl-agn.c only, move
it there and make it static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: use iwlagn_fw_error instead of iwl_nic_error
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:54 +0000 (13:26 -0700)]
iwlwifi: use iwlagn_fw_error instead of iwl_nic_error

In the process, make iwlagn_fw_error
a non-static function, as it is used
by more than one file.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move valid_contexts to priv
Johannes Berg [Thu, 15 Mar 2012 20:26:53 +0000 (13:26 -0700)]
iwlwifi: move valid_contexts to priv

No other component is accessing it any more,
so it can move to the correct place in priv.

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>
12 years agoiwlwifi: move queue mapping out of transport
Johannes Berg [Thu, 15 Mar 2012 20:26:52 +0000 (13:26 -0700)]
iwlwifi: move queue mapping out of transport

The queue mapping is not only dynamic, it
is also dependent on the uCode, as we can
already see today with the dual-mode and
non-dual-mode being different.

Move the queue mapping out of the transport
layer and let the higher layer manage it.
Part of the transport configuration is how
to set up the queues.

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>
12 years agoiwlwifi: use scan while idle
Johannes Berg [Thu, 15 Mar 2012 20:26:51 +0000 (13:26 -0700)]
iwlwifi: use scan while idle

As idle is just a deep powersave mode for
the device, it will easily scan while idle
since that turns off powersave.

This reduces the number of commands sent
to the device when scanning.

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>
12 years agoiwlwifi: remove scan_rx_antennas
Johannes Berg [Thu, 15 Mar 2012 20:26:50 +0000 (13:26 -0700)]
iwlwifi: remove scan_rx_antennas

This is not (no longer?) used by any device
so just remove it.

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>
12 years agoiwlwifi: remove iq_invert config param
Johannes Berg [Thu, 15 Mar 2012 20:26:49 +0000 (13:26 -0700)]
iwlwifi: remove iq_invert config param

This is used only by 2000 class devices, but
they all use it so remove the configuration
parameter and hard-code the programming.

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>
12 years agoiwlwifi: remove support_wimax_coexist
Johannes Berg [Thu, 15 Mar 2012 20:26:48 +0000 (13:26 -0700)]
iwlwifi: remove support_wimax_coexist

There's no device using this mechanism.

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>
12 years agoiwlwifi: clarify config struct comments
Johannes Berg [Thu, 15 Mar 2012 20:26:47 +0000 (13:26 -0700)]
iwlwifi: clarify config struct comments

It talks about treating different uCode APIs
as different pieces of hardware which really
isn't how we handle things.

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>
12 years agoiwlwifi: add trailing newline to various messages
Johannes Berg [Thu, 15 Mar 2012 20:26:46 +0000 (13:26 -0700)]
iwlwifi: add trailing newline to various messages

A whole bunch of messages, even some recent ones,
didn't include a trailing newline so add it.

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>
12 years agoiwlwifi: simplify calibration collection
Johannes Berg [Thu, 15 Mar 2012 20:26:45 +0000 (13:26 -0700)]
iwlwifi: simplify calibration collection

The calibration results all come in while we're
waiting for the calibration complete notification.
As a consequence, there's no need to install a
global RX handler for them, we can use the newly
extended notification wait framework for this and
make the code easier to follow.

It is now quite explicit that we are processing
the calibration results while waiting for the
complete notification, before this was implicit
and developers had to know this to understand why
we wait for the calibration complete notification
and what happens while we wait.

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>
12 years agoiwlwifi: extend notification wait
Johannes Berg [Thu, 15 Mar 2012 20:26:44 +0000 (13:26 -0700)]
iwlwifi: extend notification wait

Sometimes, for example when we ask the uCode
for calibration, we wait for the "complete"
response while we also need the results that
are sent in other, interim, notifications.

Currently we handle this by installing an RX
handler globally, but that isn't needed as
this is the only time we want to use these
notifications.

So in order to be able to simplify at least
future code that does the same, extend the
notification wait framework to allow you to
wait for multiple commands and decide based
on the command whether the wait finished.

While at it, also fix a race that can then
become relevant -- if the wait function has
returned true once it shouldn't be called
again, today this can happen due to races
between the triggering and the wakeup.

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>
12 years agoiwlwifi: process multiple frames per RXB
Johannes Berg [Thu, 15 Mar 2012 20:26:43 +0000 (13:26 -0700)]
iwlwifi: process multiple frames per RXB

The flow handler (hardware) can put multiple
frames into a single RX buffer. To handle
this, walk the RX buffer and check if there
are multiple valid packets in it.

To let the upper layer handle this correctly
introduce rxb_offset() which is needed when
we pass pages to mac80211 -- we need to know
the offset into the page there.

Also change the page handling scheme to use
refcounting. Anyone who needs a page will
"steal" it, which marks it as having been
used & refcounts it. The RX handler then has
to free its own reference and must not reuse
the page.

Finally, do not set the bit asking the FH to
give us each packet in a single buffer. This
really enables the feature.

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>
12 years agoiwlwifi: remove un-needed parameter
Wey-Yi Guy [Thu, 15 Mar 2012 20:26:42 +0000 (13:26 -0700)]
iwlwifi: remove un-needed parameter

get rid of un-needed parameter

Change-Id: I992741e7382a3dbced7f8413bf1d5f301029d576
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: phy_db structure
David Spinadel [Thu, 15 Mar 2012 20:26:41 +0000 (13:26 -0700)]
iwlwifi: phy_db structure

Add iwl_phy_db structure and API.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB
Luis R. Rodriguez [Fri, 23 Mar 2012 14:23:31 +0000 (07:23 -0700)]
cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB

It has happened twice now where elaborate troubleshooting has
undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0]
has been set but yet net/wireless/db.txt was not updated.

Despite the documentation on this it seems system integrators could
use some more help with this, so throw out a kernel warning at boot time
when their database is empty.

This does mean that the error-prone system integrator won't likely
realize the issue until they boot the machine but -- it does not seem
to make sense to enable a build bug breaking random build testing.

[0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Youngsin Lee <youngsin@qualcomm.com>
Cc: Raja Mani <rmani@qca.qualcomm.com>
Cc: Senthil Kumar Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Vipin Mehta <vipimeht@qca.qualcomm.com>
Cc: yahuan@qca.qualcomm.com
Cc: jjan@qca.qualcomm.com
Cc: vthiagar@qca.qualcomm.com
Cc: henrykim@qualcomm.com
Cc: jouni@qca.qualcomm.com
Cc: athiruve@qca.qualcomm.com
Cc: cjkim@qualcomm.com
Cc: philipk@qca.qualcomm.com
Cc: sunnykim@qualcomm.com
Cc: sskwak@qualcomm.com
Cc: kkim@qualcomm.com
Cc: mattbyun@qualcomm.com
Cc: ryanlee@qualcomm.com
Cc: simbap@qualcomm.com
Cc: krislee@qualcomm.com
Cc: conner@qualcomm.com
Cc: hojinkim@qualcomm.com
Cc: honglee@qualcomm.com
Cc: johnwkim@qualcomm.com
Cc: jinyong@qca.qualcomm.com
Cc: stable@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix the RANN propagation issues
Chun-Yeow Yeoh [Fri, 23 Mar 2012 10:48:51 +0000 (18:48 +0800)]
mac80211: fix the RANN propagation issues

This patch is intended to solve the follwing issues in RANN propagation:
[1] The interval in propagated RANN should be based on the interval of received RANN.
[2] The aggregated path metric for propagated RANN is as received plus own link metric
    towards the transmitting mesh STA (not root mesh STA).
[3] The comparison of path metric for RANN with same sequence number should be done
    before deciding whether to propagate or not.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Preallocate USB read buffers and eliminate kalloc in read routine
Larry Finger [Mon, 19 Mar 2012 20:44:31 +0000 (15:44 -0500)]
rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine

The current version of rtlwifi for USB operations uses kmalloc to
acquire a 32-bit buffer for each read of the device. When
_usb_read_sync() is called with the rcu_lock held, the result is
a "sleeping function called from invalid context" BUG. This is
reported for two cases in https://bugzilla.kernel.org/show_bug.cgi?id=42775.
The first case has the lock originating from within rtlwifi and could
be fixed by rearranging the locking; however, the second originates from
within mac80211. The kmalloc() call is removed from _usb_read_sync()
by creating a ring buffer pointer in the private area and
allocating the buffer data in the probe routine.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [This version good for 3.3+ - different patch for 3.2 - 2.6.39]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix the sparse warnings on endian handling in RANN propagation
Chun-Yeow Yeoh [Mon, 19 Mar 2012 13:38:46 +0000 (21:38 +0800)]
mac80211: fix the sparse warnings on endian handling in RANN propagation

The HWMP sequence number of received RANN element is compared to decide whether to be
propagated. The sequence number is required to covert from 32bit little endian data into
CPUs endianness for comparison. The same applies to the RANN metric.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: when receiving DTIM disable power-save mode only if it was enabled
Ronald Wahl [Mon, 19 Mar 2012 13:37:20 +0000 (14:37 +0100)]
mac80211: when receiving DTIM disable power-save mode only if it was enabled

When receiving DTIM we currently disable power save mode in the
hardware unconditionally, i.e. also when the hardware was not sleeping.
This causes trouble with at least one wireless chipset (Ralink RT3572).
When the hardware is not sleeping and we send a wakeup command (e.g.
this happens after a scan) then a significant decrease of the link
quality or a disconnect may occur.
Disabling power save mode only when it was enabled prevents this issue.

Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Reviewed-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: optimize aggregation session timeout handling
Felix Fietkau [Sun, 18 Mar 2012 21:58:06 +0000 (22:58 +0100)]
mac80211: optimize aggregation session timeout handling

Calling mod_timer from the rx/tx hotpath is somewhat expensive, and the
timeout doesn't need to be so precise.

Switch to a different strategy: Schedule the timer initially, store jiffies
of all last rx/tx activity which would previously modify the timer, and
let the timer re-arm itself after checking the last rx/tx timestamp.
Make the session timers deferrable to avoid causing extra wakeups on systems
running on battery.
This visibly reduces CPU load under high network load on small embedded
systems.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: reduce code duplication in debugfs code
Felix Fietkau [Sun, 18 Mar 2012 21:58:05 +0000 (22:58 +0100)]
mac80211: reduce code duplication in debugfs code

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: use compare_ether_addr on MAC addresses instead of memcmp
Felix Fietkau [Sun, 18 Mar 2012 21:58:04 +0000 (22:58 +0100)]
cfg80211: use compare_ether_addr on MAC addresses instead of memcmp

Because of the constant size and guaranteed 16 bit alignment, the inline
compare_ether_addr function is much cheaper than calling memcmp.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: increase led's name buffer length
Jakub Kicinski [Sat, 17 Mar 2012 23:16:52 +0000 (00:16 +0100)]
rt2x00: increase led's name buffer length

With 9-letter driver names phy's number was truncated
to two characters, which caused warnings when creating
sysfs entries for leds on systems with multiple devices.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Simplify rtl_get/set inline functions
Joe Perches [Sat, 17 Mar 2012 20:36:30 +0000 (13:36 -0700)]
rtlwifi: Simplify rtl_get/set inline functions

Use a temporary to make the code a bit neater.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Use is_zero_ether_addr, remove line continuation
Joe Perches [Sat, 17 Mar 2012 19:13:30 +0000 (12:13 -0700)]
rtlwifi: Use is_zero_ether_addr, remove line continuation

Use the normal kernel facilities and use %pM
to print the all zero mac address.

Remove unnecessary line continuation.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Larry.Finger@lwfinger.net
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agop54usb: Load firmware asynchronously
Larry Finger [Sat, 17 Mar 2012 20:16:06 +0000 (21:16 +0100)]
p54usb: Load firmware asynchronously

Drivers that load firmware from their probe routine have problems with
the latest versions of udev as they get timeouts while waiting for user
space to start. The problem is fixed by using request_firmware_nowait()
and delaying the start of mac80211 until the firmware is loaded.

To prevent the possibility of the driver being unloaded while the
firmware loading callback is still active, a completion queue entry
is used.

Also, to simplify the firmware loading procedure, this patch removes
the old, unofficial and confusing fallback firmware names. However,
they are still supported! So any user - who is still using them -
is hereby advised to link/rename their old firmware filenames:
isl3890usb to isl3886usb
isl3887usb_bare to isl3887usb

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agop54: only unregister ieee80211_hw when it has been registered
Christian Lamparter [Sat, 17 Mar 2012 13:10:02 +0000 (14:10 +0100)]
p54: only unregister ieee80211_hw when it has been registered

p54_unregister_common may now be called by the backend
driver's remove routine, even if the ieee80211_hw device
struct was never successfully registered.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: end service period only after sending last buffered frame
Marco Porsch [Fri, 16 Mar 2012 14:30:26 +0000 (15:30 +0100)]
mac80211: end service period only after sending last buffered frame

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: add set_cqm_rssi_config handler support
Amitkumar Karwar [Fri, 16 Mar 2012 03:51:51 +0000 (20:51 -0700)]
mwifiex: add set_cqm_rssi_config handler support

In this handler LOW_RSSI and HIGH_RSSI events are subscribed
to FW using provided threshold value so that FW will monitor
connection quality and trigger any of these events.

Driver will notify cfg80211 about connection quality based on
inputs from FW and provided hysteresis.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: support STATION_INFO_SIGNAL_AVG
Amitkumar Karwar [Fri, 16 Mar 2012 03:51:50 +0000 (20:51 -0700)]
mwifiex: support STATION_INFO_SIGNAL_AVG

This patch adds the support for updating average signal information
in dump_station().

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove redundant signal handling code
Amitkumar Karwar [Fri, 16 Mar 2012 03:51:49 +0000 (20:51 -0700)]
mwifiex: remove redundant signal handling code

1) The wrapper function mwifiex_get_signal_info() is unnecessary.
2) As noise and signal vaules in private structure already get
modified, we don't need to explicitly pass
"struct mwifiex_ds_get_signal" to get it filled.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: add cfg80211 dump_station handler
Amitkumar Karwar [Fri, 16 Mar 2012 03:51:48 +0000 (20:51 -0700)]
mwifiex: add cfg80211 dump_station handler

This enables user to dump station information using
"iw dev <devname> station dump" command.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: update signal strength in mBm units
Amitkumar Karwar [Fri, 16 Mar 2012 03:51:47 +0000 (20:51 -0700)]
mwifiex: update signal strength in mBm units

During wiphy registration signal_type is initialized to
CFG80211_SIGNAL_TYPE_MBM. So convert signal strength from dBm to
mBm. Also, the value is absolute. Make it negative before
sending to cfg80211.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Add iface name when calling WARN-ON.
Ben Greear [Thu, 15 Mar 2012 23:22:05 +0000 (16:22 -0700)]
mac80211: Add iface name when calling WARN-ON.

This lets the user know which interface has failed
the check_sdata_in_driver check.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Update rx gain initval to improve rx sensitivity
Rajkumar Manoharan [Thu, 15 Mar 2012 22:55:30 +0000 (04:25 +0530)]
ath9k_hw: Update rx gain initval to improve rx sensitivity

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agowireless: rename ht_info to ht_operation
Johannes Berg [Thu, 15 Mar 2012 18:45:16 +0000 (19:45 +0100)]
wireless: rename ht_info to ht_operation

Since some of the HT code pre-dates 802.11n-2009
some names are wrong. The one that bothers me most
is that "HT operation" is called "HT information"
in our code and that causes confusion.

Rename "HT information" to "HT operation" and also
the control_chan field to primary_chan to match
the name used in the spec.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: flush to get the tx status of nullfunc frame immediately
Rajkumar Manoharan [Thu, 15 Mar 2012 00:45:26 +0000 (06:15 +0530)]
mac80211: flush to get the tx status of nullfunc frame immediately

Sometimes the probe frame (nullfunc) is stuck at the hw queue. so that
the mac80211 terminates the connection as it wont see the tx status.
Instead of waiting for long period for ack status, lets call flush
to get nullfunc status immediately. It also helps to send the nullfunc
till max tries reached.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: do not send pspoll when powersave is disabled
Rajkumar Manoharan [Thu, 15 Mar 2012 00:20:36 +0000 (05:50 +0530)]
mac80211: do not send pspoll when powersave is disabled

There might be latency at AP side to update TIM IE which could cause the
station to send pspoll frame even after the wakeup. If the powersave is
disabled, the nullfunc notification alone is sufficient to receive
frames from the AP. And if the pspoll frame was already sent, no need to
resend the frame till it was acked by AP.

Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: recover ar9380 chips from rare stuck state
Rajkumar Manoharan [Thu, 15 Mar 2012 00:04:27 +0000 (05:34 +0530)]
ath9k: recover ar9380 chips from rare stuck state

In the experiment with Azimuth ADEPT-n testbed where the APs transmit
power was reduced to 25% and the signal strength was futher attenuated
by 20dB and induced a path loss of ~7dB, the station was reporting
beacon losses and the following issue were observed.

* rx clear is stuck at low for more than 300ms
* dcu chain and complete state is stuck at one of the hang signature

This patch triggers the hang detection logic that recovers the chip
from any of the above conditions. As the issue was originally reported
in ChromeOs with AR9382 chips, this detection logic is enabled only for
AR9380/2 chips.

Cc: Paul Stewart <pstew@google.com>
Reported-by: Gary Morain <gmorain@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: improve ANI processing and rx desensitizing parameters
Rajkumar Manoharan [Thu, 15 Mar 2012 00:04:26 +0000 (05:34 +0530)]
ath9k_hw: improve ANI processing and rx desensitizing parameters

This patch improves ANI operations by switching among the immunity
levels based on PHY errors and beacon rssi which will adjust receiver
desensitizing parameters. The changes are

* Configure the Weak Signal Detection based on current immunity value.
* At highest OFDM immunity level poor performance was observed with
  strong interference. By tuning the FIR step and spur immunity levels
  and not changing any weak signal detection thresholds at any level
  helped to improve the performance.
* ANI took long time to recover back to lower immunity levels on heavy
  data load. As the listen time got reset to zero before reaching to
  the 5x of aniperiod, the immunity level is not lowering back even
  without any interference. This patch fix that.

Cc: Paul Stewart <pstew@google.com>
Cc: Susinder Gulasekaran <susinder@qca.qualcomm.com>
Signed-off-by: Suresh Chandrasekaran <csuresh@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
David S. Miller [Wed, 28 Mar 2012 02:15:01 +0000 (22:15 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless