Commit graph

34102 commits

Author SHA1 Message Date
Arik Nemtsov
4455556d71 wlcore: don't set SDIO_FAILED flag when driver state is off
If some IO read/write fails while the FW is not loaded, a recovery
will not take place. This means the SDIO_FAILED flag will stay in place
forever and prevent further read/writes.

This can happen if a check for STATE_OFF was forgotten in some routine.

Take this opportunity to rename the flag to IO_FAILED, since we support
other buses as well.

Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10 12:10:14 -04:00
Yoni Divinsky
c45ee4ff1f wlcore: change the wait for event mechanism
wlcore needs to wait for certain events for example
for roc complete event. Usually the events are received
from the FW very fast, therefore wlcore can poll with
a short delay and if after a second the event was
not received yet poll with a long (1-5 msec) delay.

This implementation is similar to the sending of
commands to the FW.

Empirically the change reduced the wait for roc event
from ~10-40msec to 100s of usecs.

[replace udelay/msleep with usleep_range - Arik]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10 12:10:14 -04:00
Ido Yariv
c24ec83bca wlcore: Prevent processing of work items during op_stop
The interrupt line is disabled in op_stop using disable_irq. Since
pending interrupts are synchronized, the mutex has to be released before
disabling the interrupt to avoid a deadlock with the interrupt handler.

In addition, the internal state of the driver is only set to 'off'
after the interrupt is disabled. Otherwise, if an interrupt fires after
the state is set but before the interrupt line is disabled, the
interrupt handler will not be able to acknowledge the interrupt
resulting in an interrupt storm.

The driver's operations might be called during recovery. If these
acquire the mutex after it was released by op_stop, but before the
driver's state is changed, they may queue new work items instead of just
failing. This is especially problematic in the case of scans, in which a
new scan may be scheduled after all scan requests were cancelled.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10 12:10:14 -04:00
Eliad Peller
d8ae5a257c wlcore: implement .flush callback
implement the .flush() callback by simply calling wl1271_tx_flush().

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:14 -04:00
Luciano Coelho
66ef60ad03 wl12xx/wlcore: increase FW filename version
We have some API changes and new features in the new firmwares that
are not compatible with older drivers.  Increase the version of the FW
filenames for wl12xx to 5.

Additionally, remove the duplicate definitions from wlcore_i.h and
remove the MODULE_FIRMWARE macro calls from the SDIO and SPI modules,
since they're irrelevant there.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:13 -04:00
Yoni Divinsky
3df74f46d8 wlcore: add probe request templates for sched and one-shot scans
The driver configures the firmware template for probe requests during
the scan process.  If the same template is used for one-shot and sched
scans they will override each other when running scans simultaneously.

This fix works only on firmwares later than X.3.9.2.112 for single
role and X.3.9.2.23 for multi-role.

[Some cleaning-up and renaming of the quirk to something smaller --
Luca.]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:13 -04:00
Arik Nemtsov
b034fd6f4f wlcore: always clear recovery flag during recovery_work
If recovery is called when the FW is off, we should clear the recovery
flag. Otherwise we risk booting the driver in permanent pending-recovery
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:13 -04:00
Arik Nemtsov
aafec111dd wlcore: avoid debug prints during intended FW recovery
Don't read the FW panic log or print other debug data when recovery is
intended (i.e. FW type switch). This takes valuable time and can be
confusing to the user.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:13 -04:00
Arik Nemtsov
fd92dc5d5d wlcore: remove recover cmd from testmode
This command is buggy (doesn't take the mutex) and unused. Instead, the
"start_recovery" file is used for the same purpose. Remove the code but
keep the command constant to avoid breaking the testmode ABI.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:13 -04:00
Arik Nemtsov
8cdc44aab2 wlcore: don't stop tx queue via watermark if already stopped
If a Tx queue is currently stopped because of our Tx watermark flow
control, don't stop it again. This causes a warning to appear.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:12 -04:00
Arik Nemtsov
4a1ccce852 wlcore/wl12xx/wl18xx: check min FW version
Refuse to boot if the FW version is too old. The minimum version is set
per chip, with the option of setting it per PG in the future.

When boot fails because of an old FW, display a helpful message.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:12 -04:00
Victor Goldenshtein
01b3c0e4df wlcore: enable sched scan while connected
New wl12xx firmware supports scheduled scans also while connected.
Stop blocking sched scan requests when connected and add a quirk to
block in hardware that don't support it (currently wl18xx doesn't).

This requires FW version 6/7.3.10.2.112 for single-role and
6/7.5.6.0.25 for multi-role.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10 12:10:12 -04:00
Mohammed Shafi Shajakhan
c32cdbd84f ath9k: Stop the BTCOEX timers before disabling BTCOEX
Its safe to stop the BTCOEX timers 'period_timer' and
'no_stomp_timer' before disabling BTCOEX. These timers
can call ath9k_hw_btcoex_enable (or) change the BT
stomp type if they seem to be running after we had
called ath9k_hw_btcoex_disable, which is obviously
not correct.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:38 -04:00
Mohammed Shafi Shajakhan
dd89f05a75 ath9k: Fix MCI cleanup
We are doing MCI cleanup eventhough BTCOEX is not enabled
via module parameter. This means we do ath_mci_cleanup
though we skipped calling ath_mci_setup. Yet it does not
causes any issues now  as we free the DMA buffer allocated
only when it is allocated during ath_mci_setup.

Reviewed-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:37 -04:00
Rafał Miłecki
cddec90254 b43: N-PHY: fix RSSI calibration
Specs were updated, change code to match it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:36 -04:00
Arend van Spriel
32c336a5df brcmsmac: fix brcms_c_regd_init() which crashed after 11ad patch
This patch fixes an OOPS in brcmsmac driver, which was introduced
by the 11ad patch 'cfg80211: add 802.11ad (60gHz band) support'.
The value IEEE80211_NUM_BANDS increased, which was used in the
brcms_c_regd_init() function.

Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:35 -04:00
Gabor Juhos
2b943a3315 ath9k: enable support for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:34 -04:00
Gabor Juhos
b3d7aa432a ath9k: set 4ADDRESS bit in RX filter for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:34 -04:00
Gabor Juhos
c12b60214c ath9k: enable PLL workaround for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:33 -04:00
Gabor Juhos
fc05a31784 ath9k: fix PLL initialization for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:32 -04:00
Gabor Juhos
2e2c9cc37e ath9k: skip internal regulator configuration for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:32 -04:00
Gabor Juhos
3b8a0577b7 ath9k: disable SYNC_HOST1_FATAL interrupts for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:31 -04:00
Gabor Juhos
db4a3de9db ath9k: fix RF channel frequency configuration for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:30 -04:00
Gabor Juhos
1ed0f8db5b ath9k: fix PAPRD settings for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:30 -04:00
Gabor Juhos
2d00de48ff ath9k: fix antenna control configuration for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:29 -04:00
Gabor Juhos
4b091727ba ath9k: fix XPABIASLEVEL settings for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:28 -04:00
Gabor Juhos
8528f12ed7 ath9k: read spur frequency information from eeprom for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:28 -04:00
Gabor Juhos
8bc45c6bf2 ath9k: add mode register initialization code for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:27 -04:00
Gabor Juhos
a0fbb9bd25 ath9k: add initvals for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:26 -04:00
Gabor Juhos
2f8d10fd86 ath9k: enable TX/RX data byte swap for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:26 -04:00
Gabor Juhos
c95b584b8d ath9k: clear pciexpress flag for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:25 -04:00
Gabor Juhos
485124cbb7 ath9k: add BB name string for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:25 -04:00
Gabor Juhos
9476f4d636 ath9k: add platform_device_id for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:24 -04:00
Gabor Juhos
813831dc67 ath9k: set MAC version for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:23 -04:00
Gabor Juhos
a4e26081cb ath9k: define MAC version for AR9550
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:23 -04:00
Gabor Juhos
b123377935 ath9k: define DEVID for QCA955x
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:22 -04:00
Oskar Schirmer
f9f674cb88 net/wireless: remove macro defined twice with same value
In the list of commands CMD_802_11_EEPROM_ACCESS had been
defined twice, unnecessarily, luckily with same value.

Remove one occurence.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Cc: Marcelo Tosatti <marcelo@kvack.org>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:22 -04:00
Amitkumar Karwar
8a279d5b4d mwifiex: add set_antenna handler support
This enables user to set mode of Tx/Rx path using "iw set antenna"
command. For non MIMO chips, the command will be used for selecting
specific antenna or configuring antenna diversity mode.

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>
2012-07-09 16:36:21 -04:00
Rajkumar Manoharan
83bfea4219 ath9k_hw: fix AR9462 2g5g switch on full reset
On full reset, mci reset will put LNA update on 2G mode. And
Whenever 2g5g_switch is forced at the end of full reset, lna
update should not be skipped. Not doing so, is affecting WLAN
rx and causing beacon loss when BTCOEX is enabled on AR9462.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:20 -04:00
Rajkumar Manoharan
08d4df410a ath9k: fix power consumption on network sleep when BTCOEX is enabled
The chip is waken up for every 45ms in btcoex timer cycle to
for sharing the radio between BT and WLAN. Whenever the wlan
interface is in network sleep mode, do not schedule hw timers.
This could reduce power consumption on idle associated state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:20 -04:00
Rajkumar Manoharan
b73f3e7804 ath9k: fix fullsleep power consumption when BTCOEX is enabled
As soon as the interface brought up, btcoex timer starts running
eventhough the interface is in idle state and WLAN chip is moved
to full sleep mode. There is no point in running btcoex timer when
the wlan interface is in sleep mode and also it might consumes
more power on WLAN idle unassociated state. So lets stop the
btcoex when wlan is idle state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:19 -04:00
Rajkumar Manoharan
54717e5330 ath9k_hw: do not load noise floor readings when it is running
Noise floor calibration is performed on longcal interval and
the reading will be updated in history buffer. On rare occasions,
the previous noisefloor calibration might not be completed within
the period and trying to load nf reading will be failed. In such
situation, postpone the nf cabliration to next cycle to give
enough time to complete the calibration. This was already taken
care for ar9002 chips.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:18 -04:00
Rajkumar Manoharan
1fe860edb0 ath9k_hw: start noisefloor calibration after MCI reset
noisefloor calibration has to be loaded and started after
chip reset completion and restoring chainmask. Right now it is
being started before MCI reset completion on full reset. Fix that.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:18 -04:00
Thomas Huehn
1960195725 ath9k: fixing register bit shift values of control packets to support TPC
Some register values of bit shifts are corrected in order to support the upcoming
transmission power control (tpc) for control packets as well.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:02 -04:00
Mohammed Shafi Shajakhan
c11216d1f6 ath9k: Fix clearing of BTCOEX flags
BTCOEX flags are set/cleared by atomic operations.
We got to do the same in ath9k_btcoex_timer_resume,
while clearing those BTCOEX flags.

Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:01 -04:00
Avinash Patil
2152fe9c2f mwifiex: parse WPS IEs from beacon_data
Parse WPS IEs from start_ap as well as change_beacon handlers
and set them to FW. Beacon IEs, Probe Response IEs and Assoc
Response IEs are parsed from beacon_data and set to FW with
related masks.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09 16:36:00 -04:00
Avinash Patil
2dd2bd6b36 mwifiex: advertise WPS probe response offload support to cfg80211
Being a fullmac driver, mwifiex takes care of populating
beacon, probe response, association response WPS IEs to firmware.
And firmware is responsible for constructing these frames.
Advertise this to cfg80211.

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>
2012-07-09 16:36:00 -04:00
Avinash Patil
5370c83684 mwifiex: add change_beacon cfg80211 handler
This patch adds support for change_beacon handler which is needed
for setting modified management IEs to driver and FW.

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>
2012-07-09 16:35:59 -04:00
Avinash Patil
bd6aa03025 mwifiex: overwrite earlier IE buffers for new set IE request
All IE buffers are freshly supplied. In such case, there is no need
to preserve earlier buffers with same management mask and index.

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>
2012-07-09 16:35:59 -04:00
Avinash Patil
ea4c12f02b mwifiex: separate IE parsing for Head/Tail IEs and beacon_ies etc
While Head/Tail IEs may contain RSN/WPA IEs which needs to be set
for all mgmt subtypes, beacon_ies, probe_resp_ies, assoc_resp_ies
are for specific mgmt subtypes. Move them to separate function.

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>
2012-07-09 16:35:58 -04:00