Amitkumar Karwar [Thu, 28 Jun 2012 02:57:57 +0000 (19:57 -0700)]
mwifiex: use correct firmware command to get power limits
"priv->max_tx_power_level" and "priv->min_tx_power_level" variables
are initialized to maximum and minimum power levels supported by
hardware by sending correct firmware 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>
Amitkumar Karwar [Thu, 28 Jun 2012 02:57:56 +0000 (19:57 -0700)]
mwifiex: wakeup main thread to handle command queued
We miss to wakeup main thread after adding command to cmd pending
queue at follwing places. These commands are handled later when
main thread is woken up for handling an interrupt for sleep event
from firmware. This adds worst case delay of 50msec.
1) We don't wakeup main thread when asynchronous command is added
to cmd pending queue. Move queue_work() call from
mwifiex_wait_queue_complete() to mwifiex_send_cmd_async() to wakeup
main thread for sync as well as async commands.
2) Scan operation is triggered due to following reasons
a) request from user (ex. "iw scan" command)
b) Scan performed by driver internally.
In first case main thread is woken up when first scan command is
queued in cmd pending queue (we don't need to wakeup main thread for
subsequent scan commands, because they are queued in scan command
response handler), but it is not done for second case. queue_work()
is moved inside mwifiex_scan_networks() to handle both the cases.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 28 Jun 2012 00:33:41 +0000 (02:33 +0200)]
ath9k: de-duplicate initvals
The initvals tool from https://github.com/mcgrof/qca-swiss-army-knife has
been modified to detect identical initval tables and replace them with
macros. This patch contains the generated changes.
On MIPS this reduces the binary size by 24 KB with no runtime changes.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 27 Jun 2012 12:58:19 +0000 (14:58 +0200)]
ath9k: fix ANI operation in AP mode
ath9k_ani_reset (which is called at reset time) uses a state variable
ani->update_ani to prevent the ANI noise immunity state on the operating
channel from being overwritten by background scans. Unfortunately this
is also being set for AP mode, since it's mixed with code that is only
supposed to change the default settings after a reset.
In AP mode this has the side effect of having ANI run, but being unable to
change its runtime noise immunity level, making it effectively useless.
Fix this by getting rid of ani->update_ani and passing a parameter to
ath9k_hw_set_ofdm_nil and ath9k_hw_set_cck_nil instead.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Paul Bolle [Wed, 27 Jun 2012 08:36:27 +0000 (10:36 +0200)]
iwlegacy: print how long queue was actually stuck
Every now and then, after resuming from suspend, the iwlegacy driver
prints
iwl4965 0000:03:00.0: Queue 2 stuck for 2000 ms.
iwl4965 0000:03:00.0: On demand firmware reload
I have no idea what causes these errors. But the code currently uses
wd_timeout in the first error. wd_timeout will generally be set at
IL_DEF_WD_TIMEOUT (ie, 2000). Perhaps printing for how long the queue
was actually stuck can clarify the cause of these errors.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Tue, 26 Jun 2012 19:26:40 +0000 (21:26 +0200)]
brcmfmac: fix sparse warning introduced with checkdied patch
The commit "brcmfmac: introduce checkdied debugfs functionality"
also introduced a sparse warning:
..../brcmfmac/dhd_sdio.c:3147:45: sparse: cast to restricted __le32
This patch fixes this sparse warning.
Reported-by: Fengguang Wu <wfg@linux.intel.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Tue, 26 Jun 2012 19:26:39 +0000 (21:26 +0200)]
brcmfmac: add BCM4334 support
BCM4334 is a dualband a/b/g/n WiFi chip support 20MHz/40MHz
channels. This patch adds support for its SDIO interface.
Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Tue, 26 Jun 2012 19:26:38 +0000 (21:26 +0200)]
brcmfmac: reduce allocations needed during nvram data download
The nvram data is preprocessed before being sent to the device
and just before sending an additional allocation was done that
assured word alignment of the data. This has moved to the
preprocessing step to reduce allocations and subsequent copying
of the nvram data.
Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Tue, 26 Jun 2012 19:26:37 +0000 (21:26 +0200)]
brcmfmac: use firmware data buffer directly for nvram
The nvram file could be parsed directly in the data buffer in the
firmware structure passed by request_firmware function. This patch
gets rid of the redundant memcpy.
Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Tue, 26 Jun 2012 19:26:36 +0000 (21:26 +0200)]
brcmfmac: move glom alignment setting to SDIO bus layer
txglomming alignment is a SDIO bus specific feature. It is more
appropriate to place it in SDIO bus layer instead of common layer.
Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Tue, 26 Jun 2012 19:26:35 +0000 (21:26 +0200)]
brcmfmac: restrict dongle txglom disable to old SDIO core
txglomming is a firmware feature for sdio bus interface. For SDIO
device cores newer than revision 11, the default setting of
firmware should be used instead of disabling it from the host side.
Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Tue, 26 Jun 2012 19:26:34 +0000 (21:26 +0200)]
brcmfmac: add support for bus specific data command
brcmfmac need to support data command setting for dongle's bus
core. A list must be placed at brcmf_bus structure before calling
brcmf_bus_start in order to be sent by brcmf_c_preinit_dcmds.
Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sven Eckelmann [Mon, 25 Jun 2012 05:15:22 +0000 (07:15 +0200)]
ath9k: raise aggregation limit to 64k for HT IBSS
mac80211 adds stations in HT IBSS as soon as a frame comes by,
even if the HT capabilities are not known yet (they are often
received later, e.g. in beacons). So far, ampdu factor/density
are only calculated when the station is initially added.
This patch changes this to update ampdu factor/density settings
when starting a blockack session.
Using this patch, we had performance boosts from 60 to 150 MBit/s
between two 2x2 Atheros devices in 5 GHz HT IBSS mode.
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The cause is due to calling kfree_skb() with interrupts disabled.
This bug is discussed in https://bugzilla.redhat.com/show_bug.cgi?id=797709.
Reported-and-Tested by: Ivan Ivanovich <iivanich@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Eyal Shapira [Tue, 26 Jun 2012 07:41:17 +0000 (10:41 +0300)]
wlcore: print stack trace in every recovery
As recovery queuing can now occur from multiple code paths
it's convenient to know what triggered it in all cases
other than an intended recovery which is part of the
switch between single role to multi role.
Eyal Shapira [Tue, 26 Jun 2012 07:41:16 +0000 (10:41 +0300)]
wlcore: queue recovery in case of bus errors during cmd_remove_peer
Following the addition of propagating errors from the bus ops
there's a need to distinguish between bus errors (including timeout)
and a legitimate timeout occuring in cmd_wait_for_event_or_timeout.
In case of real bus errors we need to queue recovery even in cases
where a timeout on a response from the FW to a command is acceptable.
Eyal Shapira [Tue, 26 Jun 2012 07:41:15 +0000 (10:41 +0300)]
wlcore: fix broken TX due to wrong queuing of recovery
commit 14bba17b "wl12xx: Propagate errors from wl1271_raw_write32"
breaks down TX in certain scenarios. wl1271_irq_locked() propagates
errors from wl1271_tx_work_locked however it may return -EBUSY
when the FW queues are full which is a legitimate case and not a
a real error. In this case a recovery is triggered by wl1271_irq
and this keeps repeating itself so TX is completely broken.
Fix it by avoiding propagating return values as errors even if they
aren't. Only bus (SDIO or SPI) ops failures would be progagated
as only these should trigger recovery.
Luciano Coelho [Mon, 25 Jun 2012 11:41:20 +0000 (14:41 +0300)]
wlcore: fix some failure cases in wlcore_probe()
We need to release the IRQ if hw_info() or identify_chip() fails. And
we need unregister the HW with mac80211 if there are any failures
after it's registered.
Luciano Coelho [Mon, 25 Jun 2012 11:15:55 +0000 (14:15 +0300)]
wl18xx: deprecate PG1 support
The new PG2 version of the chip has a few differences in terms of FW
API if compared to PG1. PG1 is just a sample that shouldn't be used
in real life, so to avoid having to handle both separately, mark the
PG1 version as deprecated and bail out during probe.
Johannes Berg [Mon, 25 Jun 2012 12:46:44 +0000 (14:46 +0200)]
mac80211_hwsim: fix smatch/sparse complaints
The code is fine in both cases as-is, but we can
write it slightly differently to fix smatch/sparse
complaints:
* compare the skb pointer (which we use as a cookie)
by casting the skb to unsigned long rather than the
cookie to a pointer (fixes "different address spaces")
* when transmitting, data->channel must be assigned,
don't check it (fixes "dereferenced before check")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 11:36:25 +0000 (13:36 +0200)]
mac80211: trace debug messages
It can be very useful to have all debug messages
available when debugging, but hard to correlate
between different sources, so add a trace event
for all mac80211 debug messages.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 09:29:50 +0000 (11:29 +0200)]
mac80211: clean up debugging
There are a few things that make the logging and
debugging in mac80211 less useful than it should
be right now:
* a lot of messages should be pr_info, not pr_debug
* wholesale use of pr_debug makes it require *both*
Kconfig and dynamic configuration
* there are still a lot of ifdefs
* the style is very inconsistent, sometimes the
sdata->name is printed in front
Clean up everything, introducing new macros and
separating out the station MLME debugging into
a new Kconfig symbol.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Arik Nemtsov [Thu, 21 Jun 2012 15:10:52 +0000 (18:10 +0300)]
wlcore: prevent recovery in the middle of resume
Take the mutex early in the resume handler and use the locked version of
the IRQ routine. This ensures any recoveries queued will only take place
after resume has fully completed.
Arik Nemtsov [Thu, 21 Jun 2012 15:10:51 +0000 (18:10 +0300)]
wlcore: refactor threaded IRQ routine
Separate the threaded IRQ handling routine into two functions.
The outer function takes the mutex and calls recovery on errors. It also
performs a Tx-path optimization to avoid redundant works.
The inner function is simplified - all calls to recovery are removed and
it assumes the lock is taken. The locked variant will be reused elsewhere.
Arik Nemtsov [Thu, 21 Jun 2012 15:10:49 +0000 (18:10 +0300)]
wlcore: force recovery on resume if suspended without recovering
If an error is detected after mac80211 is already suspended, the recovery
work will not be queued. This will leave the driver in a bad state on
resume.
Detect this in the resume op and re-queue a recovery.
Arik Nemtsov [Thu, 21 Jun 2012 15:10:48 +0000 (18:10 +0300)]
wlcore: don't allow SDIO read/writes after failure
Set a flag and after the first read/write failure is encountered.
This flag will disallow further SDIO read/writes until op_stop() is
executed, which will clear all flags.
This prevents further errors from occurring, since one error usually
indicates that IO operations won't work anymore until the chip is
rebooted. By blocking more calls, we avoid extra timeouts and having
to wait for them to occur.
[Added second paragraph explaining why the change is needed. -- Luca]
Arkady Miasnikov [Mon, 18 Jun 2012 13:21:12 +0000 (16:21 +0300)]
wlcore: access the firmware memory via debugfs
Applications running in the user space needs access to the
memory of the chip. Examples of such access
- read/write global variables
- access to firmware log
- dump memory after firmware panic event
Arbitrary 4-bytes aligned location can be accessed by
read/write file wlcore/mem
[Check return value of wlcore_raw_read/write and wlcore_set_partition
calls as required by the recent IO changes. -- Luca]
Larry Finger [Thu, 21 Jun 2012 18:08:04 +0000 (13:08 -0500)]
rtlwifi: Change debug level for deletion of an entry in CAM
When running in AP mode, the driver reports all deletions from CAM in
a cryptic manner that makes users think it is an error. change so that
the condition is only reported at higher-levels of debugging.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Thu, 21 Jun 2012 13:49:13 +0000 (15:49 +0200)]
brcmsmac: fix NULL pointer crash in brcms_c_regd_init()
In the function brcms_c_regd_init() the channels are validated
against the device capabilities. This is done for both 2.4G and
5G band, but there are devices that are 2.4G only, ie. BCM4313.
For that device this leads to a NULL dereference. This patch adds
a check in brcms_c_regd_init() to fix this.
Issue introduced in wireless-next tree by following commit: cf03c5d brcm80211: smac: inform mac80211 of the X2 regulatory domain
Cc: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Thu, 21 Jun 2012 09:33:32 +0000 (11:33 +0200)]
brcmfmac: make inclusion of vmalloc.h explicit fixing linux-next build
This patch fixes problem detected in linux-next build for powerpc
allyesconfig. The error message below is no longer observed:
CC drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.o
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c: In function 'brcmf_sdio_dump_console':
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3085: error: implicit declaration of function 'vzalloc'
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3085: warning: assignment makes pointer from integer without a cast
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3113: error: implicit declaration of function 'vfree'
make[2]: *** [drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.o] Error 1
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Thu, 21 Jun 2012 02:58:37 +0000 (19:58 -0700)]
mwifiex: enhance power save for USB and PCIe chipsets
FW will not explicitly notify about host sleep activation to the
host for USB and PCIe chipsets. Hence host should generate Host
Sleep Activated event as soon as Host Sleep parameters are
configured to FW successfully.
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>
Amitkumar Karwar [Thu, 21 Jun 2012 02:58:36 +0000 (19:58 -0700)]
mwifiex: wake up main thread to handle Tx traffic if scan is delayed/aborted
This is a flaw in recently implemented logic to handle Tx traffic
and scan operation simultaneously. We missed to wakeup main thread
to handle Tx traffic if scan is delayed/aborted.
For some cards (SD8797, for example), firmware will send SLEEP event
if there is no activity for 50msec. While handling the SLEEP event,
main thread will be woken up and Tx packet gets sent hence. In worst
case Tx traffic will be delayed for 50msec.
For other cards, such as USB8797, firmware won't send SLEEP event.
So, Tx traffic gets stuck if no other event triggers the wakeup of
main thread.
This patch fixes above issues.
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>
Ido Yariv [Tue, 19 Jun 2012 21:03:46 +0000 (00:03 +0300)]
wlcore: Force checking of io functions' return values
All io functions' return values should be propagated and handled. Add a
__must_check annotation to verify that the return values are checked and
to avoid future mistakes.
Ido Yariv [Mon, 18 Jun 2012 15:15:50 +0000 (18:15 +0300)]
wlcore: Propagate errors from wl1271_read_hwaddr
Propagate errors from wl1271_read_hwaddr. This function is only used
when reading the FW log (following a recovery), so don't read the FW log
in case of a bus error.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.
Ido Yariv [Tue, 19 Jun 2012 21:48:23 +0000 (00:48 +0300)]
wlcore: Propagate errors from wl1271_raw_write32
Propagate errors from wl1271_raw_write32 and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.
Ido Yariv [Mon, 18 Jun 2012 12:50:21 +0000 (15:50 +0300)]
wlcore: Propagate errors from wl1271_raw_read32
Propagate errors from wl1271_raw_read32. Since the read functions had no
way of returning errors in-band, change their prototypes.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.
Ido Yariv [Mon, 18 Jun 2012 10:21:55 +0000 (13:21 +0300)]
wlcore: Propagate errors from wl1271_write
Propagate errors from wl1271_write and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.
Ido Yariv [Mon, 18 Jun 2012 09:31:16 +0000 (12:31 +0300)]
wlcore: Propagate errors from wl1271_read
Propagate errors from wl1271_read and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.
Ido Yariv [Sun, 17 Jun 2012 18:59:42 +0000 (21:59 +0300)]
wlcore: Propagate errors from wlcore_raw_*_data functions
wlcore_raw_read_data is called when the FW status is read which happens
while handling interrupts and when the FW log is read following a
recovery. Request a recovery in the former case, and don't read the FW
log in case the FW status read failed.
Ido Yariv [Sun, 17 Jun 2012 18:29:51 +0000 (21:29 +0300)]
wlcore: Change raw io functions to return errors
Make wl1271_raw_write and wl1271_raw_read return errors so the driver
could handle these appropriately.
Since the prototype has changed, also rename the prefix of these
functions to wlcore.
Ido Yariv [Sun, 17 Jun 2012 17:30:05 +0000 (20:30 +0300)]
wlcore: Change read/write ops to return errors
While bus operations may fail, either due to HW or FW issues, these are
never propagated to higher layers. As a result, the core driver has no
way of knowing that the operations failed, and will only recover if high
level logic requires it (e.g. no command completion).
Change read/write bus operations to return errors to let higher layer
functionality handle these.
Ido Yariv [Sun, 20 May 2012 07:38:16 +0000 (10:38 +0300)]
wlcore: Fix sdio out-of-sync power state
wl12xx_sdio_power_off() manually powers down the card regardless of the
runtime pm state. If wl12xx_sdio_power_on() is called before the card
was suspended by runtime PM, it will not power up the card.
As part of the HW detection, the chip's power is toggled. Since this
happens in the context of probing sdio, the power reference counter will
be higher than zero. As a result, when wl12xx_sdio_power_off() is
called, the chip will be powered down while still having a positive
power reference counter. If the interface is quickly activated, the
driver might try to transfer data to a powered off chip.
Fix this by ensuring that wl12xx_sdio_power_on() explicitly powers on
the chip in case runtime pm claims the chip is already powered on. To
avoid cases in which it is not possible to determine if the chip was
really powered on (card's power reference counter is positive), operate
on the mmc_card instead of the function.
Also verify that the chip is indeed powered on before powering off, to
avoid wrong reference counter values in error cases.
Instead of reporting the signal received in the last
rx packet, which might be inaccurate if rx traffic is
low and beacon filtering is enabled, get the signal
from the driver/FW.
Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luciano Coelho [Thu, 21 Jun 2012 12:33:10 +0000 (15:33 +0300)]
wl18xx: use %zu for size_t arguments in printk calls
After 934b9d1e (wl18xx: avoid some -Wformat warnings) there was still
a warning with (at least) ARM gcc version 4.4.1:
drivers/net/wireless/ti/wl18xx/main.c: In function 'wl18xx_conf_init':
drivers/net/wireless/ti/wl18xx/main.c:1026: warning: format '%ld' expects type 'long int', but argument 2 has type 'unsigned int'
Fix this by using %zu for the both formats, since the fw->size and the
macro (derived from sizeof()) are size_t.
Arik Nemtsov [Wed, 13 Jun 2012 16:09:25 +0000 (19:09 +0300)]
wl18xx: sane defaults for HT capabilities
Introduce a default set of HT capabilities that are set according to the
number of antennas on the board. Move the HT setting code down to allow
the number of antennas to be set (and optionally overridden) before it.
Remove the "mimo" HT option, since the default mode now enables MIMO is
possible.
Use this opportunity to add a helper function for setting HT
capabilities and reduce the volume of the code a bit.
wlcore: read FW logs from FW memory on watchdog recovery
FW uses a few memory blocks as a buffer to accumulate FW logs before
transmitting them to the host over SDIO. When FW WatchDog recovery
occurs, the last FW traces are still pending in the buffer. Driver is
to read these FW traces whether log mode is continuous or on demand.
FW memory blocks allocated for the log buffer are handled as a link list:
the first 4 bytes in each memory block contain FW address to the next block.
The end of list condition depends on FW log mode:
- on demand: the list is cyclic, the next address is equal to the first address
- continuous: the address is equal to 0x2000000
Log data resides inside FW memory block with offset depending on
logger mode:
- on demand: 4 bytes (address of the next memory block)
- continuous: 4 bytes and Rx Descriptor structure size
Described FW logger API is backward compatible with previous FW versions.
Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Yoni Divinsky [Wed, 13 Jun 2012 15:56:54 +0000 (18:56 +0300)]
wlcore: do not report noise level in get survey op
The get survey op expects the low level driver to report
the noise level for a a given channel.
The noise calculated in wlcore is (rssi-snr/2), but since
the snr reported by the FW is a derivative from the rssi
this calculation is useless, and should not be reported
to the user space.
Reporting incorrect noise, results in the wpa_supplicant
miscalculating the roaming candidate priority, thus causing
a situation where an AP with a lower rssi level would be
chosen over a better AP.
Arik Nemtsov [Mon, 11 Jun 2012 07:41:08 +0000 (10:41 +0300)]
wl18xx: set Tx align quirk for PG2
Before patch b5d6d9b (wlcore/wl12xx/wl18xx: don't use TX align quirk
for wl127x), this was automatically set for all platforms. As this
should now be set explicitly, set it for PG2 as well.
Arik Nemtsov [Sun, 10 Jun 2012 19:57:30 +0000 (22:57 +0300)]
wl18xx: increase Rx descriptors for PG2
New PG2 firmwares have additional Rx descriptors.
Add a module parameter to manually set the number of Rx descriptors for
older versions (PG1). We cannot discriminate based on chip-id, since
this value must be set on probe.
Arik Nemtsov [Sun, 10 Jun 2012 16:10:45 +0000 (19:10 +0300)]
wlcore: reconfigure sleep_auth when removing interfaces
The sleep_auth value of the last interface to be set up prevailed when
an interface was removed. Take care of this by correctly configuring the
value according to the remaining STA/AP interfaces.
Take this opportunity to refactor the sleep_auth setting code for better
readability.
Arik Nemtsov [Sun, 10 Jun 2012 14:09:22 +0000 (17:09 +0300)]
wlcore: allow setting sleep_auth before interface init
Hold a value for sta_sleep_auth that is amenable to change by debugfs.
When detecting a legal value in this variable on interface init, use it
as an override value for sleep_auth.
This makes debugging more intuitive using the debugfs value.
Increment the conf version since we added an element to the conf
structure.
Note: An AP going up will always set sleep_auth to PSM_CAM.
Luciano Coelho [Tue, 28 Feb 2012 17:13:28 +0000 (19:13 +0200)]
wlcore: add a debugfs entry to allow changing the sleep mode by hand
For FW debugging purposes, we may need to change the sleep mode
(aka. sleep_auth) by hand, and set it to the mode we want. To allow
this, a debugfs entry is added.
Now we store the sleep_auth value that has been set and use that
instead of the quirk to decide whether we should enter ELP or not.
Arik Nemtsov [Wed, 6 Jun 2012 07:48:56 +0000 (10:48 +0300)]
wlcore: suppress error message on Rx BA session removal
The ampdu_action() function is called on the reconfig() path to remove
existing Rx BA sessions. Since these don't exist for the low level
driver, we output an error message. Turn the message into a debug
message for now, until the mac80211 reconfig flow is changed.
Johannes Berg [Wed, 20 Jun 2012 09:47:42 +0000 (11:47 +0200)]
iwlwifi: limit mac_change_interface to BSS context
Currently when mac80211 asks to change the interface
type, we will accept it for both the BSS and PAN
contexts. This is not terribly complicated today,
but with the addition of the P2P Device abstraction
the PAN context handling will get more complex, so
restrict mac_change_interface to the BSS context.
Also fix a small locking issue and use is_active
instead of the vif pointer to check if the other
context is activated, guarding exclusive interface
types on the BSS context (IBSS) against the PAN
context being used for something else.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 20 Jun 2012 14:24:59 +0000 (16:24 +0200)]
iwlwifi: increase scan timeout
When the first interface is active, then scanning
on it or the second interface can take a little
longer than 7s (I observed around 8s.) Bump the
timeout to 15s to avoid aborting a scan that is
still running, just taking more time.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 20 Jun 2012 19:25:15 +0000 (21:25 +0200)]
iwlwifi: fix radio reset scan dwell vs. quiet time
My previous commit to shorten the radio reset time
caused issues as the firmware checks the active
dwell time against the quiet time, asserting that
the dwell is >= quiet time. This isn't really
needed in case of passive scanning like here, but
of course we need to pass that check.
To fix this, override the quiet time to be the
same as the radio reset dwell time.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Larry Finger [Wed, 20 Jun 2012 16:47:26 +0000 (11:47 -0500)]
rtlwifi: rtl8192se: Fix gcc 4.7.x warning
With gcc 4.7.x, the following warning is issued as the routine that sets
the array has the possibility of not initializing the values:
CC [M] drivers/net/wireless/rtlwifi/rtl8192se/phy.o
drivers/net/wireless/rtlwifi/rtl8192se/phy.c: In function ‘rtl92s_phy_set_txpower’:
drivers/net/wireless/rtlwifi/rtl8192se/phy.c:1268:23: warning: ‘ofdmpowerLevel[0]’ may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: do not sampling on ani timer when chip is in sleep
The baseband and cycle counters are being sampled during ani
processing for debugging purpose. Whenever the ani is postponded
due to sleep state, taking samples on that time is of no use and
also unneccesarily waking up the chip might increase the power
consumption on idle associated state. Hence moving debug function
within powersave block.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When WLAN enter full sleep mode, WLAN HW should send out a LNA_TAKE
message for BT to take control of the shared LNA. Otherwise BT traffic
is completely stopped whenever the wlan interface is moved full sleep
mode.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
During driver stop, btcoex is disabled and also btcoex_hw.enabled
is set to false. Afterwards mci_is_enabled returns false so that
BT is not gaining SPDT control on WLAN sleep. Fix that.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
WLAN driver initialization is muting BT which is terminating
the ongoing BT traffic. The reason to mute BT is to avoid any
incoming MCI messages from BT when MCI reset is in progress that
could corrupt WLAN MCI RX state machine. But we should not
dedicate radio completely to WLAN in driver init itself. So this
patch removes the wlan weightage changes from mute BT to retain
BT connection.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bala Shanmugam [Mon, 18 Jun 2012 06:06:58 +0000 (11:36 +0530)]
ath9k: fix incorrect profile type manupulation
Two MCI interrupts are generated while adding A2DP and headset profiles
with different types and same connection handle. While disconnecting,
only one MCI interrupt is generated with last added profile type value
for both profiles.
While adding second profile type decrement first one.
Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Firmware supports changing filters using ACX_RX_CFG command,
so use it in .configure_filter callback. Firmware also supports
probe request filtering, so add it too along the way.
This will also re-enable BSSID filter which is now removed by
join command while associating.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This driver has a hack in cmd.c which effectively disables all filtering.
This seems to be triggering a firmware bug where it stops reporting any
rx packets after random time on some routers, which is eliminated (or at
least appears much more rarely) when filtering is on.
I have found that only BSSID filter needs to be disabled for association
to work, so disable only that instead of all filtering.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Seth Forshee [Sat, 16 Jun 2012 12:47:56 +0000 (07:47 -0500)]
brcm80211: smac: use current regulatory domain when checking whether OFDM is allowed
The brcmsmac internal regulatory data is being used to determine whether
OFDM should be allowed, and this is only done once during
initialization. To be effective this needs to be checked against
mac80211's regulatory rules for the current channel.
Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>