]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
11 years agoath9k: Add more PCI IDs for WB225 cards
Sujith Manoharan [Mon, 5 Aug 2013 09:38:28 +0000 (15:08 +0530)]
ath9k: Add more PCI IDs for WB225 cards

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix antenna control init for AR9485
Sujith Manoharan [Mon, 5 Aug 2013 09:38:27 +0000 (15:08 +0530)]
ath9k: Fix antenna control init for AR9485

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove ath_ant_comb_update()
Sujith Manoharan [Mon, 5 Aug 2013 09:38:26 +0000 (15:08 +0530)]
ath9k: Remove ath_ant_comb_update()

During a HW reset, the diversity config is programmed
in the set_board_values() eeprom callback, there is no
need to do it again by calling ath_ant_comb_update().

Fixed antenna support is not fully handled for 1-stream
cards, it can be done later.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agohostap: do not return positive number on failure path in prism2_open()
Alexey Khoroshilov [Mon, 5 Aug 2013 03:18:28 +0000 (07:18 +0400)]
hostap: do not return positive number on failure path in prism2_open()

prism2_open() as an .ndo_open handler should not return positive numbers
in case of failure, but it does return 1 in a couple of places.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Support ANT diversity for WB225
Sujith Manoharan [Sun, 4 Aug 2013 08:52:02 +0000 (14:22 +0530)]
ath9k: Support ANT diversity for WB225

WB225 based cards like CUS198 and CUS230 support
both fast antenna diversity and LNA combining. Add support
for this and also program the SWCOM register with the
correct "ant_ctrl_comm2g_switch_enable" value.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Set SWCOM value for CUS198
Sujith Manoharan [Sun, 4 Aug 2013 08:52:01 +0000 (14:22 +0530)]
ath9k: Set SWCOM value for CUS198

CUS198/CUS230 cards require a custom value to be
programmed into the SWCOM register. Assign this during
init time.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove "shared_chain_lnadiv"
Sujith Manoharan [Sun, 4 Aug 2013 08:52:00 +0000 (14:22 +0530)]
ath9k: Remove "shared_chain_lnadiv"

This variable is redundant since we can use
common->bt_ant_diversity to determine if diversity
has to be enabled/disabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Program HW for WB195 diversity
Sujith Manoharan [Sun, 4 Aug 2013 08:51:59 +0000 (14:21 +0530)]
ath9k: Program HW for WB195 diversity

The MC_GAIN_CTL/CCK_DETECT registers have to be programmed
with the correct configuration values if WLAN/BT RX diversity
is enabled. Add this and also take care of the BTCOEX mode
when fast diversity is enabled/disabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Enable WLAN/BT Ant Diversity for WB225/WB195
Sujith Manoharan [Sun, 4 Aug 2013 08:51:58 +0000 (14:21 +0530)]
ath9k: Enable WLAN/BT Ant Diversity for WB225/WB195

A custom solution for Asus is WB195 based and supports
WLAN/BT Rx diversity. Identify this card and set the
capability.

CUS198/CUS230, which are based on WB225 also support
WLAN/BT Rx diversity.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv
Sujith Manoharan [Sun, 4 Aug 2013 08:51:57 +0000 (14:21 +0530)]
ath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv

Use "ath9k_hw_set_bt_ant_diversity" instead.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add a HW capability for WLAN/BT RX diversity
Sujith Manoharan [Sun, 4 Aug 2013 08:51:56 +0000 (14:21 +0530)]
ath9k: Add a HW capability for WLAN/BT RX diversity

Make use of this capability to restrict the usage of the
debugfs file and modparam using which this feature can
be enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup WLAN/BT RX diversity
Sujith Manoharan [Sun, 4 Aug 2013 08:51:55 +0000 (14:21 +0530)]
ath9k: Cleanup WLAN/BT RX diversity

For single-chain WLAN+BT cards, the BT antenna can be used for
WLAN RX when the BT interface is disabled. Rename the modparam
"antenna_diversity" to "bt_ant_diversity" to clarify this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix antenna diversity for CUS198
Sujith Manoharan [Sun, 4 Aug 2013 08:51:54 +0000 (14:21 +0530)]
ath9k: Fix antenna diversity for CUS198

CUS198/CUS230 need a few tweaks in the antenna diversity
algorithm to accomodate RSSI variation. Add a couple
of knobs to control low RSSI threshold and fast antenna
diversity bias values.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Print LNA combining mode during init
Sujith Manoharan [Sun, 4 Aug 2013 08:51:53 +0000 (14:21 +0530)]
ath9k: Print LNA combining mode during init

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add information about antenna diversity
Sujith Manoharan [Sun, 4 Aug 2013 08:51:52 +0000 (14:21 +0530)]
ath9k: Add information about antenna diversity

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'for-linville-20130730' of git://github.com/kvalo/ath6kl
John W. Linville [Fri, 2 Aug 2013 19:40:11 +0000 (15:40 -0400)]
Merge tag 'for-linville-20130730' of git://github.com/kvalo/ath6kl

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 2 Aug 2013 19:37:34 +0000 (15:37 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoath9k: Add statistics for antenna diversity
Sujith Manoharan [Thu, 1 Aug 2013 15:27:06 +0000 (20:57 +0530)]
ath9k: Add statistics for antenna diversity

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use a subroutine to calculate ALT ratio
Sujith Manoharan [Thu, 1 Aug 2013 06:23:23 +0000 (11:53 +0530)]
ath9k: Use a subroutine to calculate ALT ratio

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Simplify checks in quick_scan
Sujith Manoharan [Thu, 1 Aug 2013 06:23:22 +0000 (11:53 +0530)]
ath9k: Simplify checks in quick_scan

There is a function to do a ratio comparison for ALT,
so make use of it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use a helper function for checking LNA options
Sujith Manoharan [Thu, 1 Aug 2013 06:23:21 +0000 (11:53 +0530)]
ath9k: Use a helper function for checking LNA options

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use a subroutine to try LNA switch
Sujith Manoharan [Thu, 1 Aug 2013 06:23:20 +0000 (11:53 +0530)]
ath9k: Use a subroutine to try LNA switch

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add ALT check for cards with GROUP-3 config
Sujith Manoharan [Thu, 1 Aug 2013 06:23:19 +0000 (11:53 +0530)]
ath9k: Add ALT check for cards with GROUP-3 config

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use a subroutine to check for short scan
Sujith Manoharan [Thu, 1 Aug 2013 06:23:18 +0000 (11:53 +0530)]
ath9k: Use a subroutine to check for short scan

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Do a quick scan only when scan_not_start is true
Sujith Manoharan [Thu, 1 Aug 2013 06:23:17 +0000 (11:53 +0530)]
ath9k: Do a quick scan only when scan_not_start is true

Right now, it is being done for all cases.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add a debugfs file for antenna diversity
Sujith Manoharan [Mon, 29 Jul 2013 10:34:49 +0000 (16:04 +0530)]
ath9k: Add a debugfs file for antenna diversity

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwl4965: better skb management in rx path
Stanislaw Gruszka [Mon, 1 Jul 2013 12:19:30 +0000 (14:19 +0200)]
iwl4965: better skb management in rx path

4965 version of Eric patch "iwl3945: better skb management in rx path".
It fixes several problems :

1) skb->truesize is underestimated.
   We really consume PAGE_SIZE bytes for a fragment,
   not the frame length.
2) 128 bytes of initial headroom is a bit low and forces reallocations.
3) We can avoid consuming a full page for small enough frames.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: drop BROKEN from SSB_SFLASH
Rafał Miłecki [Tue, 25 Jun 2013 08:13:46 +0000 (10:13 +0200)]
ssb: drop BROKEN from SSB_SFLASH

With recent patches ssb can fetch info about serial flash and register
it as a platform device. No more reasons to mark it BROKEN.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192cu: fix function declaration header
Mark Schulte [Thu, 1 Aug 2013 02:30:14 +0000 (19:30 -0700)]
rtlwifi: rtl8192cu: fix function declaration header

Move rtl92cu_update_hal_rate_tbl declaration to hw.h to correspond with function
definition in hw.c.
Fixes sparse warning in hw.c warning: symbol 'rtl92cu_update_hal_rate_tbl' was
not declared.

Signed-off-by: Mark Schulte <schultetwin@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: populate rates in probe request using cfg80211_scan_request
Avinash Patil [Wed, 31 Jul 2013 00:18:56 +0000 (17:18 -0700)]
mwifiex: populate rates in probe request using cfg80211_scan_request

Whenever available, use cfg80211_scan_request to populates rates
in outgoing probe request. This will help to advertise band specific
rates and fix an issue where 11b rates were advertised in probe
request going out on 11a band.

This will also ensure that we do not advertise 11b rates while P2P
scan is going on.

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>
11 years agomwifiex: fix adapter pointer dereference issue
Amitkumar Karwar [Wed, 31 Jul 2013 00:18:15 +0000 (17:18 -0700)]
mwifiex: fix adapter pointer dereference issue

It has introduced by recent commit 6b41f941d7cd: "mwifiex:
handle driver initialization error paths" which adds error
path handling for mwifiex_fw_dpc().

release_firmware(adapter->*) is called for success as well
as failure paths. In failure paths, adapter is already freed
at this point.

The issue is fixed by moving mwifiex_free_adapter() call.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Thu, 1 Aug 2013 19:26:52 +0000 (15:26 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agoiwlwifi: mvm: advertise support for DYNAMIC / STATIC SMPS
Emmanuel Grumbach [Sun, 28 Jul 2013 08:00:52 +0000 (11:00 +0300)]
iwlwifi: mvm: advertise support for DYNAMIC / STATIC SMPS

This feature is fully supported by iwlwmvm, so advertise
it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: add high temperature SKU thermal throttling parameters
Eytan Lifshitz [Wed, 24 Jul 2013 11:49:18 +0000 (14:49 +0300)]
iwlwifi: mvm: add high temperature SKU thermal throttling parameters

When the NIC is expected to operate in high temperature,
it is advisable to put more aggresive thermal throttling
parameters, in order to prevent CT-kill.

Signed-off-by: eytan lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: list Emmanuel in maintainers file
Johannes Berg [Tue, 23 Jul 2013 12:03:39 +0000 (14:03 +0200)]
iwlwifi: list Emmanuel in maintainers file

Wey-Yi has moved on a while ago, but we forgot to update the
maintainers file. Since Emmanuel is de facto maintaining the
driver along with myself now, list him instead.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Change beacon abort escape time value
Alexander Bondar [Mon, 22 Jul 2013 12:39:26 +0000 (15:39 +0300)]
iwlwifi: mvm: Change beacon abort escape time value

Set beacon abort escape timer values - 6 beacons in D0 state,
9 beacons in D3 and D0i3.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: remove duplicate rate scale init code
Eyal Shapira [Mon, 15 Jul 2013 11:57:28 +0000 (14:57 +0300)]
iwlwifi: remove duplicate rate scale init code

The rate scale windows are cleared twice as part of the init.
Cleanup this duplication in both mvm and dvm.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: remove obsolete flag in TX command API
Emmanuel Grumbach [Sun, 21 Jul 2013 05:04:28 +0000 (08:04 +0300)]
iwlwifi: mvm: remove obsolete flag in TX command API

This API isn't valid any more. It wasn't used anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: report per-chain signal to mac80211
Johannes Berg [Wed, 3 Jul 2013 09:55:17 +0000 (11:55 +0200)]
iwlwifi: mvm: report per-chain signal to mac80211

Instead of reporting the maximum signal strength and the
antenna bitmap in the antenna field (which is really just
for radiotap and defined differently), report the signal
strength values per chain and set the chain bitmap.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: fix debugfs restart if fw_restart is disabled
Eran Harary [Wed, 3 Jul 2013 08:00:06 +0000 (11:00 +0300)]
iwlwifi: mvm: fix debugfs restart if fw_restart is disabled

If fw_restart is disabled, using the fw_restart debugfs
file will enable fw_restart and then send the failing
command, but this still frequently fails restart because
it resets fw_restart afterwards and is thus racy.

Fix this by tracking fw_restart separately and allowing
"always restart", "never restart" and "restart N times".

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Change beacon filtering command
Hila Gonen [Tue, 16 Jul 2013 08:15:35 +0000 (11:15 +0300)]
iwlwifi: mvm: Change beacon filtering command

Change beacon filtering command due to a change in the API.

In case the FW supports the old API, we do not send the
BF HCMD and assume that since the corresponding struct in
the FW is zeroed by default then we don't need to disable
it in the FW actively.

Signed-off-by: Hila Gonen <hila.gonen@intel.com>
Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: register vif debugfs for AP mode too
Emmanuel Grumbach [Wed, 26 Jun 2013 20:51:41 +0000 (23:51 +0300)]
iwlwifi: mvm: register vif debugfs for AP mode too

The current registered the per-vif debugfs handler for
STA mode only.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoiwlwifi: mvm: split constants into separate file
Johannes Berg [Fri, 14 Jun 2013 11:36:21 +0000 (13:36 +0200)]
iwlwifi: mvm: split constants into separate file

To make maintaining some constant default values in the
driver easier, declare them in a separate file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: assign quota per virtual interface
Johannes Berg [Wed, 10 Jul 2013 10:59:38 +0000 (12:59 +0200)]
iwlwifi: mvm: assign quota per virtual interface

Instead of assigning quota per used binding (channel) assign
the same amount of quota for each virtual interface so that
when there are more than two interfaces using more than one
channel, we'll stay on the channels proportionally to the
number of virtual interfaces using the channels.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Return on inconsistency in add interface
Ilan Peer [Sun, 16 Jun 2013 09:18:11 +0000 (12:18 +0300)]
iwlwifi: mvm: Return on inconsistency in add interface

Return in case that HW restart is in progress but the added
interface is not found during the iteration over all the interfaces.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Change AM->PSM timeout for EAPOL frames
Alexander Bondar [Tue, 2 Jul 2013 16:51:09 +0000 (19:51 +0300)]
iwlwifi: mvm: Change AM->PSM timeout for EAPOL frames

Currently after sending EAPOL frame FW transition to power saving mode
within 10 or 100 msec (as specified by power table command). According
to new requirement this timeout for a specific EAPOL frame must be
controlled by the driver by setting tx_pm_timeout field of TX_CMD to 2
(PM_FRAME_ENUM_MGMT). This value corresponds to 32 msec timeout.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: support six IPv6 addresses in D3
Johannes Berg [Mon, 8 Jul 2013 09:17:06 +0000 (11:17 +0200)]
iwlwifi: mvm: support six IPv6 addresses in D3

Newer firmware supports offloading more IPv6 addresses for NDP,
adjust the code to send the correct command depending on the
firmware capability.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Enable user set TX power
Matti Gottlieb [Tue, 9 Jul 2013 12:25:46 +0000 (15:25 +0300)]
iwlwifi: mvm: Enable user set TX power

Support Tx power limitations. These limitations can come from
mac80211 for various reasons.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: reprobe device on firmware error during restart
Johannes Berg [Thu, 4 Jul 2013 13:25:25 +0000 (15:25 +0200)]
iwlwifi: mvm: reprobe device on firmware error during restart

If we get a firmware error during restart, we currently abandon any
hope and simply fail, getting stuck until the driver is reloaded.
Unfortunately, there isn't really much else we can do since restart
will likely continue to fail, and asking mac80211 for disconnection
just causes more error.

To allow the user to at least set up the device again completely
from scratch, reprobe the device and in doing so completely destroy
any mac80211/driver state.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: remove the default calibration values for 7000
Emmanuel Grumbach [Tue, 25 Jun 2013 20:01:28 +0000 (23:01 +0300)]
iwlwifi: mvm: remove the default calibration values for 7000

The fw is now able to run TX_IQ_SKEW and RX_IQ_SKEW by
itself. No need for default values any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: new api to get signal strength
Avri Altman [Mon, 8 Jul 2013 22:42:17 +0000 (01:42 +0300)]
iwlwifi: mvm: new api to get signal strength

A new API that replaces the rx signal strength calculation via agc & rssi.
The energy is now calculated outside the driver and transferred by the fw.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoath10k: fix rts/fragmentation threshold setup
Michal Kazior [Mon, 22 Jul 2013 12:13:31 +0000 (14:13 +0200)]
ath10k: fix rts/fragmentation threshold setup

If RTS and fragmentation threshold values are
0xFFFFFFFF they should be considered disabled and
no min/max limits must be applied.

This fixes some issues with throughput issues,
especially with VHT.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: fix memleak in mac setup
Michal Kazior [Mon, 22 Jul 2013 12:13:30 +0000 (14:13 +0200)]
ath10k: fix memleak in mac setup

In some cases channel arrays were never freed.

The patch also unifies error handling in the mac
setup function.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: don't reset HTC endpoints unnecessarily
Michal Kazior [Mon, 22 Jul 2013 12:13:29 +0000 (14:13 +0200)]
ath10k: don't reset HTC endpoints unnecessarily

Endpoints are re-initialized upon HTC start anyway
so there's no need to do that twice in case of
restarting HTC (i.e. in case of hardware
recovery).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: prevent HTC from being used after stopping
Michal Kazior [Mon, 22 Jul 2013 12:13:28 +0000 (14:13 +0200)]
ath10k: prevent HTC from being used after stopping

It was possible to submit new HTC commands
after/while HTC stopped. This led to memory
corruption in some rare cases.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: create debugfs interface to trigger fw crash
Michal Kazior [Mon, 22 Jul 2013 12:08:51 +0000 (14:08 +0200)]
ath10k: create debugfs interface to trigger fw crash

This can be useful for testing. To perform a
forced firmware crash write 'crash' to
'simulate_fw_crash' debugfs file. E.g.

  echo crash > /sys/kernel/debug/ieee80211/phy1/ath10k/simulate_fw_crash

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: fix NULL dereference for injected packets
Michal Kazior [Tue, 16 Jul 2013 09:04:54 +0000 (11:04 +0200)]
ath10k: fix NULL dereference for injected packets

Tx processing functions dereference vif and caused
NULL to be dereferenced for injected frames.

Don't call these functions at all for injected
frames. It doesn't make much sense to do so
anyway.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: implement fw crash simulation command
Michal Kazior [Tue, 16 Jul 2013 07:54:36 +0000 (09:54 +0200)]
ath10k: implement fw crash simulation command

This can be useful to test FW crash handling.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: implement device recovery
Michal Kazior [Tue, 16 Jul 2013 07:54:35 +0000 (09:54 +0200)]
ath10k: implement device recovery

Restart the hardware if FW crashes.

If FW crashes during recovery we leave the
hardware in a "wedged" state to avoid recursive
recoveries.

When in "wedged" state userspace may bring
interfaces down (to issue stop()) and then bring
one interface (to issue start()) to reload
hardware manually.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: skip fw stats debugfs interface if device is down
Michal Kazior [Tue, 16 Jul 2013 07:38:59 +0000 (09:38 +0200)]
ath10k: skip fw stats debugfs interface if device is down

If the device is not running then there may be no
FW at all to send the query to. If the FW is
already there it might still trigger a crash if
the command is sent before the device is fully
initialized.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: store firmware files in memory
Michal Kazior [Tue, 16 Jul 2013 07:38:58 +0000 (09:38 +0200)]
ath10k: store firmware files in memory

Different FW versions may provide different
functions thus mean different hw capabilities
advertised to mac80211.

It is safe to swap firmware files on disk during
driver/device runtime without worries.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: defer hw setup to start/stop mac80211 hooks
Michal Kazior [Tue, 16 Jul 2013 07:38:57 +0000 (09:38 +0200)]
ath10k: defer hw setup to start/stop mac80211 hooks

This fixes suspend-to-disk. The hardware is now
re-initialized upon freeze/thaw properly.

This also makes suspend/resume re-initialize the
hardware as WoWLAN support is not done yet.

With some little work it should be possible to
support hw reconfiguration for hw/fw recovery.

HW must be initialized once before registering to
mac80211 because FW determinates what hw
capabilities can be advertised.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: make sure all resources are freed upon ath10k_stop()
Michal Kazior [Tue, 16 Jul 2013 07:38:56 +0000 (09:38 +0200)]
ath10k: make sure all resources are freed upon ath10k_stop()

This is necessary for proper hw reconfiguration
and to avoid memory leaks.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: move free_vdev_map initialization
Michal Kazior [Tue, 16 Jul 2013 07:38:55 +0000 (09:38 +0200)]
ath10k: move free_vdev_map initialization

This is necessary for hw reconfiguration to work.
Since mac80211 is not calling remove_interface()
is such case we must reset free_vdev_map.

Also use a define instead of a hardcoded value for
vdev map initialization.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: decouple suspend code
Michal Kazior [Tue, 16 Jul 2013 07:38:54 +0000 (09:38 +0200)]
ath10k: decouple suspend code

Split up fw-related and hw-related suspension code.

Although we don't advertise WoW support to
mac80211 yet it's useful to keep the code in
suspend/resume hooks.

At this point there's no need to keep pci pm ops.
In case of WoW mac80211 calls ath10k_suspend()
which should take care of entering low-power mode.
In case WoW is not available mac80211 will go
through regular interface teradown and use start/stop.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: reset BMI state upon init
Michal Kazior [Tue, 16 Jul 2013 07:38:53 +0000 (09:38 +0200)]
ath10k: reset BMI state upon init

This is necessary if we want to be able to restart
hw on-the-fly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: allow deferred regd update
Michal Kazior [Tue, 16 Jul 2013 07:38:52 +0000 (09:38 +0200)]
ath10k: allow deferred regd update

Regulatory domain notification hook can be called
regardless of the hw state (i.e. before start
mac80211 callback).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: decouple core start/stop logic
Michal Kazior [Tue, 16 Jul 2013 07:38:51 +0000 (09:38 +0200)]
ath10k: decouple core start/stop logic

Enables code reuse for proper hw reconfiguration
that is in turn required for proper
suspend/hibernation/wowlan support.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: decouple pci start/stop logic
Michal Kazior [Tue, 16 Jul 2013 07:38:50 +0000 (09:38 +0200)]
ath10k: decouple pci start/stop logic

Split logic that prepares the device for BMI
phase/cleans up related resources.

This is necessary for ath10k to be able to restart
hw on the fly without reloading the module.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: add missing debug prints
Michal Kazior [Fri, 5 Jul 2013 13:15:17 +0000 (16:15 +0300)]
ath10k: add missing debug prints

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: abort scan properly if wmi_scan_stop fails
Michal Kazior [Fri, 5 Jul 2013 13:15:16 +0000 (16:15 +0300)]
ath10k: abort scan properly if wmi_scan_stop fails

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: improve locking
Michal Kazior [Fri, 5 Jul 2013 13:15:15 +0000 (16:15 +0300)]
ath10k: improve locking

Add more lockdep asserts and a few conf_mutex
locks. It's better to be on the safe side.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: embed HTT struct inside ath10k
Michal Kazior [Fri, 5 Jul 2013 13:15:14 +0000 (16:15 +0300)]
ath10k: embed HTT struct inside ath10k

This reduces number of allocations and simplifies
memory managemnt.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: embed HTC struct inside ath10k
Michal Kazior [Fri, 5 Jul 2013 13:15:13 +0000 (16:15 +0300)]
ath10k: embed HTC struct inside ath10k

This reduces number of allocations and simplifies
memory managemnt.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: rename hif callback
Michal Kazior [Fri, 5 Jul 2013 13:15:12 +0000 (16:15 +0300)]
ath10k: rename hif callback

The `set_callbacks` is a more appopriate name for
the function. Let's leave `init` for something
else.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: change function to take struct ath10k as arg
Michal Kazior [Fri, 5 Jul 2013 13:15:11 +0000 (16:15 +0300)]
ath10k: change function to take struct ath10k as arg

This aligns it to the argument list of other
similar functions.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: provide errno if bmi read/write fails
Michal Kazior [Fri, 5 Jul 2013 13:15:10 +0000 (16:15 +0300)]
ath10k: provide errno if bmi read/write fails

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: lower print level for a message
Michal Kazior [Fri, 5 Jul 2013 13:15:09 +0000 (16:15 +0300)]
ath10k: lower print level for a message

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: silent warning in IBSS mode
Michal Kazior [Fri, 5 Jul 2013 13:15:08 +0000 (16:15 +0300)]
ath10k: silent warning in IBSS mode

There is no TIM IE generated in IBSS beacons by
mac80211.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: fix typo in define name
Michal Kazior [Fri, 5 Jul 2013 13:15:07 +0000 (16:15 +0300)]
ath10k: fix typo in define name

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: remove ath10k_bus
Michal Kazior [Fri, 5 Jul 2013 13:15:06 +0000 (16:15 +0300)]
ath10k: remove ath10k_bus

It serves no purpose.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: do not setup rts/frag thresholds for suspended interfaces
Michal Kazior [Fri, 5 Jul 2013 13:15:05 +0000 (16:15 +0300)]
ath10k: do not setup rts/frag thresholds for suspended interfaces

mac80211 calls for rts/frag threshold hooks before
any interface is brought back up again when
resuming.

We would set vdev parameters before given vdev is
created lading to a FW crash.

rts/frag thresholds will be re-set accordingly in
add_interface() hook anyway.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: setup rts/frag thresholds upon vdev creation
Michal Kazior [Fri, 5 Jul 2013 13:15:04 +0000 (16:15 +0300)]
ath10k: setup rts/frag thresholds upon vdev creation

mac80211 configures rts/frag thresholds per-hw not
per-vif. ath10k FW expects those values to be set
per-vdev (i.e. per-vif).

ath10k should now respect rts/frag thresholds set
before a given interface was brought up.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: fix possible deadlock
Michal Kazior [Fri, 5 Jul 2013 13:15:03 +0000 (16:15 +0300)]
ath10k: fix possible deadlock

It was possible to have a deadlock due to inverted
locking of local->iflist_mtx and
ath10k->conf_mutex.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath10k: fix teardown ordering
Michal Kazior [Fri, 5 Jul 2013 13:15:02 +0000 (16:15 +0300)]
ath10k: fix teardown ordering

This should fix memory corruption if HIF is tried
to be restarted.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agomwifiex: code rearrangement in sdio.c
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:56 +0000 (19:17 -0700)]
mwifiex: code rearrangement in sdio.c

Some function definitions are moved to appropriate place
to avoid forward declarations.

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>
11 years agomwifiex: handle driver initialization error paths
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:55 +0000 (19:17 -0700)]
mwifiex: handle driver initialization error paths

mwifiex_fw_dpc() asynchronously takes care of firmware download
and initialization. Currently the error paths in mwifiex_fw_dpc()
are not handled. So if wrong firmware is downloaded, required
cleanup work is not performed. memory is leaked and workqueue
remains unterminated in this case.

mwifiex_terminate_workqueue() is moved to avoid forward
declaration.

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>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Thu, 25 Jul 2013 20:48:01 +0000 (16:48 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

11 years agoiwlwifi: mvm: enable pre-scan passive to active
David Spinadel [Mon, 8 Jul 2013 10:12:29 +0000 (13:12 +0300)]
iwlwifi: mvm: enable pre-scan passive to active

Enable passive to active scan feature, on channels that was
active in the past hour.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: dvm: remove P2P support
Johannes Berg [Mon, 1 Jul 2013 11:48:56 +0000 (13:48 +0200)]
iwlwifi: dvm: remove P2P support

We're not planning to support P2P on older devices, so
remove the Kconfig option and associated code for it.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobgmac: make bgmac depend on bcm47xx
Hauke Mehrtens [Tue, 23 Jul 2013 21:28:49 +0000 (23:28 +0200)]
bgmac: make bgmac depend on bcm47xx

bgmac uses bcm47xx_nvram.h which is only available when BCM47XX was
selected. Earlier BCMA_HOST_SOC depended on BCM47XX so this was not
build on any other archs, but that changed. We should modify this
driver to get access to the nvram or the variables through platform
data.

This fixes a build problem in linux-next reported by Stephen Rothwell:

drivers/net/ethernet/broadcom/bgmac.c:19:27: fatal error: bcm47xx_nvram.h: No such file or directory
 #include <bcm47xx_nvram.h>
                           ^

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowireless: rt2x00: rt2800usb: add RT3573 devices
Xose Vazquez Perez [Tue, 23 Jul 2013 12:55:15 +0000 (14:55 +0200)]
wireless: rt2x00: rt2800usb: add RT3573 devices

taken from Ralink linux and windows drivers:

0x1b75, 0x7733 AirLive 450Mbps Wireless-N Dual Band USB Adapter
0x0b05, 0x17bc ASUS USB-N66 450Mbps Dual Band USB Adapter
0x0b05, 0x17ad ASUS USB-N66 Dual Band N Network Adapter
0x050d, 0x1103 Belkin Wireless Adapter
0x148f, 0xf301 Cameo Ralink3573 3x3 single band USB dongle
0x7392, 0x7733 Edimax
0x0e66, 0x0020 Hawking HD45U Dual Band USB Wireless-N Adapter
0x0e66, 0x0021 Hawking HD45U Dual Band Wls-450N Adapter
0x04bb, 0x094e I-O DATA WN-AG450U Wireless LAN Adapter
0x0789, 0x016b Logitec LAN-W450AN/U2
0x0846, 0x9012 NETGEAR WNDA4100 N900 Wireless Dual Band USB Adapter
0x0846, 0x9019 NETGEAR WNDA4200D Wireless Dual Band USB Adapter
0x2019, 0xed19 Planex GW-USDual450
0x148f, 0x3573 Ralink 802.11n USB Wireless LAN Card
0x0df6, 0x0067 Sitecom Wireless Dualband Network Adapter N750 X6
0x0df6, 0x006a Sitecom Wireless Dualband Network Adapter N900 X7
0x0586, 0x3421 ZyXEL Dual-Band Wireless N450 USB Adapter

Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix diversity combining for AR9285
Sujith Manoharan [Tue, 23 Jul 2013 10:55:17 +0000 (16:25 +0530)]
ath9k: Fix diversity combining for AR9285

When antenna diversity combining is enabled in the EEPROM,
the initial values for the MAIN/ALT config have to be
programmed correctly. This patch adds it for AR9285.

Since the diversity combining macros are common to all chip
families, remove the redundant AR9285 macros and move the
definitions to phy.h.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: modify mwifiex_ap_sta_limits to advertise support for P2P
Avinash Patil [Tue, 23 Jul 2013 02:17:58 +0000 (19:17 -0700)]
mwifiex: modify mwifiex_ap_sta_limits to advertise support for P2P

We support maximum simultaneous 2 non-AP station interfaces and
they can assume role of Station/P2P client/P2P GO.
Advertise this support to cfg80211 so that concurrent P2P/STA
operation is possible.

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>
11 years agomwifiex: remove duplicate structure host_cmd_tlv
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:57 +0000 (19:17 -0700)]
mwifiex: remove duplicate structure host_cmd_tlv

We already have 'struct mwifiex_ie_types_header' with same
definition. Hence host_cmd_tlv is removed in this patch.

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>
11 years agomwifiex: correction in mwifiex_check_fw_status() return status
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:54 +0000 (19:17 -0700)]
mwifiex: correction in mwifiex_check_fw_status() return status

For PCIe cards, when wrong firmware is downloaded, firmware is
failed to be ready in 10 seconds. We should return an error at
this point. But currently we are sending first command to firmware.
As expected firmware doesn't respond to this command and command
timeout occurs.

This patch fixes the problem by removing unnecessary 'ret'
variable modifications in "if (ret) {" block.
The block is just supposed to update "adapter->winner" flag.

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>
11 years agomwifiex: replace mdelay with msleep
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:53 +0000 (19:17 -0700)]
mwifiex: replace mdelay with msleep

It is observed that when wrong firmware is downloaded for
PCIe card, system hangs for 10 seconds. The reason is mdelay()
is used when firmware status is polled.

Replace mdelay with msleep(non-blocking API) to fix the issue.

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>
11 years agomwifiex: reduce firmware poll retries
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:52 +0000 (19:17 -0700)]
mwifiex: reduce firmware poll retries

After downloading the firmware, firmware status is checked by
reading a register. Polling interval is 100 msecs. Therefore 100
retries means the status is checked for 10 secs which is more than
sufficient for firmware to get ready.

This patch removes 1000 retries macro usage, because 100secs
time is not practical.

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>
11 years agomwifiex: add unregister_dev handler for usb interface
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:51 +0000 (19:17 -0700)]
mwifiex: add unregister_dev handler for usb interface

Clear the data pointer stored in USB interface structure in
this handler. This helps to return from mwifiex_usb_disconnect()
if driver deinitialization is already performed while handling
an error path for mwifiex_usb_probe().

USB8797 card gets enumerated twice. First enumeration is for
firmware download and second enumeration expects firmware
initialization. mwifiex_usb_probe() always takes care of
deinitialization for first enumeration after firmware download.

Also, this change matches our handling for SDIO and PCIe
interfaces.

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>
11 years agomwifiex: move if_ops.cleanup_if() call
Amitkumar Karwar [Tue, 23 Jul 2013 02:17:50 +0000 (19:17 -0700)]
mwifiex: move if_ops.cleanup_if() call

As if_ops.init_if() is called in mwifiex_register(),
corresponding cleanup routine should be called in
mwifiex_unregister().

Currently it's there in mwifiex_adapter_cleanup(), hence
interface specific cleanup is not performed if driver
initialization is failed.

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>