Commit graph

17958 commits

Author SHA1 Message Date
Eyal Shapira ab055ce9f5 iwlwifi: mvm: remove unused fields of iwl_rs_rate_info
Some more cleanups of unused fields and their initializations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:32 +02:00
Dan Carpenter 2ab9ba0fdf iwlwifi: pcie: returning positive instead of negative
There is a missing '-' character here so we return positive 'ENOMEM'
instead of negative.  The caller doesn't care.  All non-zero returns
are translated to '-ENOMEM' in iwl_pcie_nic_init().

This is just a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:20 +02:00
Eyal Shapira ab3077009f iwlwifi: mvm: remove rate_scale_data debugfs entry
This isn't very informative and can be deduced from rate_scale_table.
Remove as a preparation for dropping iwl_rs_rate_info.ieee.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:09 +02:00
Luciano Coelho 6965a3540a iwlwifi: pcie: don't swallow error codes in iwl_trans_pcie_alloc()
The iwl_trans_pcie_alloc() function doesn't pass up error codes
returned from functions it calls, swallowing them and returning NULL
in all failure cases.  The caller checks if the return value is NULL
and returns -ENOMEM.  This is not correct, because in certain cases
the failure was not due to an OOM situation.

To fix this, modify the iwl_trans_pcie_alloc() function to use
ERR_PTR() to return error codes and clean up the error handling code
a bit.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:20:29 +02:00
Eytan Lifshitz f8f03c3edc iwlwifi: mvm: add support to the new FW time event API
The time event firmware API will change, add the support for that.
Use the new API throughout and convert to the old where needed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:19:06 +02:00
David Spinadel 52981cd794 mac80211: add vif to testmode cmd
Pass the wdev from cfg80211 on to the driver as the vif
if given and it's valid for the driver.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 14:11:42 +02:00
David Spinadel fc73f11f5f cfg80211: add wdev to testmode cmd
To allow drivers to implement per-interface testmode operations
more easily, pass a wdev pointer if any identification for one
was given from userspace. Clean up the code a bit while at it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 14:11:37 +02:00
Johannes Berg af61a16518 mac80211: add control port protocol TX control flag
A lot of drivers check the frame protocol for ETH_P_PAE,
for various reasons (like making those more reliable).
Add a new flags bitmap to the TX control info and a new
flag indicating the control port protocol is in use to
let all drivers also apply such logic to other control
port protocols, should they be configured.

Also use the new flag in the iwlwifi drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 14:09:29 +02:00
Sujith Manoharan 16fe28e9b4 ath9k: Run the LNA combining algorithm properly
The LNA combining algorithm has to be run for cards
that support the required diversity features, make
sure that that correct conditions are met before
enabing this algorithm.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:28 -04:00
Sujith Manoharan 7d845871ff ath9k: Fix BTCOEX usage for RX diversity
BTCOEX has to be *disabled* for WLAN RX diversity to
work on combo cards.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:26 -04:00
Felix Fietkau f89d1bc427 ath9k: use software queueing for multicast traffic
Create a per-vif dummy node entry for keeping the multicast software
queues. This helps in setups with a lot of mulitcast traffic that could
otherwise potentially drown out unicast traffic to stations.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:24 -04:00
Felix Fietkau 020f20f693 ath9k: improve tx scheduling fairness
Instead of trying to schedule the same TID multiple times in a loop,
iterate over other TIDs/stations first.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:22 -04:00
Felix Fietkau 2800e82bcc ath9k: use software queues for un-aggregated data packets
This is a first step for improving fairness between legacy and 802.11n
traffic, and it should also improve reliability of resets and channel
changes by keeping the hardware queue depth very short.

When an aggregation session is torn down, all packets in the retry queue
will be removed from the BAW and freed.

For all subframes that have not been transmitted yet, the A-MPDU flag
will be cleared, and a sequence number allocated. This ensures that the
next A-MPDU session will get the correct initial sequence number.
This happens both on aggregation session start and stop.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:20 -04:00
Felix Fietkau 026d5b07c0 ath9k: always clear ps filter bit on new assoc
Otherwise in some cases, EAPOL frames might be filtered during the
initial handshake, causing delays and assoc failures.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:18 -04:00
Felix Fietkau 897d7fd9b5 ath9k: fix clearing expired A-MPDU subframes in tx completion
When the tid aggregation state has been marked as inactive, free
completed tx packets immediately. When a new aggregation session has not
been initialized yet, the BAW checks do not recognize it as expired.

Might fix potential stalls in setting up a new aggregation session.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:15 -04:00
Felix Fietkau 73364b0c47 ath9k: prepare queueing code for handling unaggregated traffic
- Allow ath_tx_get_tid_subframe to return non-AMPDU subframes.
- Reset the tid paused state on aggregation stop
- Initialize software queues even when HT is not supported

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:13 -04:00
Felix Fietkau 8fed140855 ath9k: fix block ack window tracking check
When a packet has been tracked as part of the BlockAck window and added
to the hardware queue, it can end up back in the TID queue again with
fi->retries still set to 0 (e.g. if the frame was filtered). Keep an
extra bit for the BAW tracking status to fix this corner case.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:11 -04:00
Felix Fietkau a1cd94d345 ath9k: simplify ath_tx_form_aggr
The check for ATH_AMPDU_SUBFRAME_DEFAULT is unnecessary, since it's set
to half the maximum BlockAck Window size, which is already the maximum
value that h_baw could possibly have. Also remove unnecessary variables.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:09 -04:00
Felix Fietkau 18fcf1c6a6 ath9k: add CAB queue info to debugfs
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:07 -04:00
Felix Fietkau 1803d02d7a ath9k: add function for getting the tx tid for a packet
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:04 -04:00
Felix Fietkau bb195ff61f ath9k: split tid retry packets into a separate queue
Improves packet retry order and helps with further tx queueing
improvements.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:02 -04:00
Felix Fietkau a7586ee441 ath9k: add utility functions for accessing tid queues
Useful for further fixes / cleanups

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:58:00 -04:00
Johannes Berg e33354764d brcmfmac: use CFG80211_TESTMODE_CMD
This is essentially the same, but written shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:57:58 -04:00
Jingoo Han 6cdfc1de17 net: wireless: rt2x00: Staticize rt2x00queue_pause_queue_nocheck()
rt2x00queue_pause_queue_nocheck()is used only in this file.
Fix the following sparse warning:

drivers/net/wireless/rt2x00/rt2x00queue.c:939:6: warning: symbol 'rt2x00queue_pause_queue_nocheck' was not declared. Should it be
static?

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:57:55 -04:00
Sujith Manoharan 36e8825e65 ath9k: Fix build failure
Make sure that CONFIG_ATH9K_BTCOEX_SUPPORT is used for
the WLAN/BT RX diversity hooks.

Reported by the kernel build testing backend.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-09 15:57:53 -04:00
Amitkumar Karwar 562fc5b30f mwifiex: add packet coalesce support
Coalesce filters are configured in firmware based on settings
received from cfg80211.

Packet type which is required by firmware is determined based on
provided patterns in a rule:

Unicast: if pattern '01' with offset 0 is found
Multicast: if pattern '33:33' or '01:00:5e' with offset 0 is found
Broadcast: if pattern 'ff:ff:ff:ff' with offset 0 is found

Some example coalesce configuration files:

1) Coalesce Rx data packets from 192.168.0.88
mac address of our device is 00:50:43:21:53:7A
Source IP address offset comes out as 52 after following
calculations:
    32 bytes of HW 802.11 header + 8 bytes LLC +
    12 bytes in IPV4 header till source IP address
Destination mac is at offset 6 in HW header.

delay=100
condition=1
patterns=01,6+00:50:43:22,10+53:7A,52+c0:a8:00:58

2) Coalesce all broadcast and multicast packets(Multiple packet
types are not allowed in a single rule. Hence created separate
rules)

delay=400
condition=1
patterns=33:33
delay=400
condition=1
patterns=ff:ff:ff:ff

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>
2013-08-09 15:57:51 -04:00
Amitkumar Karwar afd84de473 mwifiex: increase max supported pattern offset
The offset number is increased to accomodate requests from
user to match more fields in a Rx packet.

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>
2013-08-09 15:57:48 -04:00
Amitkumar Karwar 0434c46499 mwifiex: modify mwifiex_is_pattern_supported() routine
It is modified so that it can be reused for coalesce feature.

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>
2013-08-09 15:57:46 -04:00
Amitkumar Karwar 3f4e854a2d mwifiex: rename mef macros
Their names were generic. We need to define similar macros
for coalesce feature. Hence they are renamed here.

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>
2013-08-09 15:57:44 -04:00
John W. Linville 2437f3c5d6 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2013-08-09 15:07:23 -04:00
John W. Linville 4f05444892 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-08-09 15:06:28 -04:00
Ido Yariv 6e8773c314 iwlwifi: pcie: Remove duplicate code from pcie irq handlers
Instead of having the same code sequentially, fall-through.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:29 +02:00
Ido Yariv 351746c9ad iwlwifi: pcie: Refactor iwl_rxq_space
Simplify iwl_rxq_space to improve readability and reduce
the ambiguity spares to a single element.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:15 +02:00
Ido Yariv a9b2924643 iwlwifi: pcie: Refactor iwl_queue_space
Reduce the ambiguity spares to a single element if the window size is not
smaller than the queue size. If smaller, no spares are required at all.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:01 +02:00
Matti Gottlieb f4f3c65984 iwlwifi: introduce external debug level
This debug level will be used in the future for logging
interaction with external modules.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:37:33 +02:00
Alexander Bondar 495191c79f iwlwifi: mvm: Fix beacon filtering enablement via debugfs
The code was only enabling it when already enabled, which
obviously can't work.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:37:10 +02:00
Mohammed Shafi Shajakhan 9d0e2f0772 ath6kl: Fix invalid pointer access on fuzz testing with AP mode
In our Fuz testing, reference client corrupts the dest mac to "00:00:00:00:00:00"
in the WPA2 handshake no 2. During driver init the sta_list entries mac
addresses are by default "00:00:00:00:00:00". Driver returns an invalid
pointer (conn) and the drver shall crash, if rxtids (aggr_conn)
skb queues are accessed, since they would not be initialized.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-07 10:58:59 +03:00
Vasanthakumar Thiagarajan f32036e823 ath6kl: Fix race in heart beat polling
Make sure to cancel heart beat timer before
freeing wmi to avoid potential NULL pointer
dereference.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-07 10:53:36 +03:00
Bartosz Markowski 8cc8df906f ath10k: add SoC power save option to PCI features map
Unify the PCI options location.

By default the SoC PS option is disabled to boost the
performance and due to poor stability on early HW revisions.
In future we can remove the module parameter and turn on/off
the PS for given hardware.

This change also makes the pci module parameter for SoC PS static.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-07 10:03:29 +03:00
Johannes Berg e7f1935c11 wireless: make TU conversion macros available
A few places in the code (mac80211 and iwlmvm) use the same
TU_TO_JIFFIES() macro and could use TU_TO_EXP_TIME() that
mac80211 has. Make these available to everyone and use them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 11:00:59 +02:00
Eliad Peller ef4394b947 iwlwifi: mvm: use designated initialization for some arrays
rs_ht_to_legacy and ant_toggle_lookup are arrays that
represent some state-machine. initialize them explicitly
with designated initialization to make them more clear
and avoid errors.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:35:04 +02:00
Eliad Peller bd3351ba3e iwlwifi: mvm: add some missing cleanups in iwl_mvm_mac_add_interface
iwl_mvm_mac_add_interface() didn't clean up beacon filtering
configuration and ctxt allocation in some error cases.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:52 +02:00
Johannes Berg 5fdda0476c iwlwifi: remove transport suspend/resume indirection
There's no reason for the transport to call itself through
indirect function pointers, inline the (little) code there
is and remove the indirection completely.

Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:33 +02:00
Eliad Peller 1092b9bc0c iwlwifi: pcie: some little cleanups
do some little cleanups in tx.c - eliminate duplicate checks,
use locally cached fields and predefined macros.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:11 +02:00
Eliad Peller e89044d75e iwlwifi: fix some documentation typos
Fix some typos.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:33:58 +02:00
Johannes Berg f5e45f2d96 iwlwifi: mvm: small cleanups in quota management code
Use a C99 initializer to clear the command and move the lockdep
assertion before the restart check. Since this causes problems
with the BUILD_BUG_ON() with some compilers, change that a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:33:47 +02:00
Avri Altman 17dbe56445 iwlwifi: mvm: fix signal reporting for < 3 antennas
When fewer than three antennas are connected (as is
always the case for the current devices), the signal
strength reporting was wrong; fix it.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:32:38 +02:00
Eyal Shapira 977342bc3d iwlwifi: mvm: remove traffic load monitoring in rs
The traffic load monitoring isn't used anymore to decide whether
a Tx aggregation on a specific TID should be started.
No point in collecting these statistics. Remove the relevant code.

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>
2013-08-06 10:32:17 +02:00
Johannes Berg eeb89ab1f0 iwlwifi: pcie: fix resume when no opmode is present
If no opmode is present during suspend/resume (i.e. if
the iwldvm or iwlmvm isn't loaded) the driver crashes
during resume, trying to call the rfkill notification.
Avoid that, and also don't enable the rfkill interrupt
in this case (to avoid crashing trying to handle the
interrupt later.)

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:31:05 +02:00
Matti Gottlieb 3848ab6682 iwlwifi: mvm: Add RX statistics debugfs entry
Add a debugfs entry for the RX statistics received from
the firmware.

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>
2013-08-06 10:30:21 +02:00
Sujith Manoharan 2952f6ef51 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>
2013-08-05 14:52:46 -04:00
Sujith Manoharan b21e3e14ae 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>
2013-08-05 14:52:46 -04:00
Sujith Manoharan 047dc3ac88 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>
2013-08-05 14:52:45 -04:00
Alexey Khoroshilov 0cbe8c87fe 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>
2013-08-05 14:52:45 -04:00
Sujith Manoharan 84893817aa 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>
2013-08-05 14:52:45 -04:00
Sujith Manoharan 31fd216db9 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>
2013-08-05 14:52:44 -04:00
Sujith Manoharan 7bdea96a1b 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>
2013-08-05 14:52:44 -04:00
Sujith Manoharan d715090824 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>
2013-08-05 14:52:43 -04:00
Sujith Manoharan a5354ccaaf 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>
2013-08-05 14:52:43 -04:00
Sujith Manoharan d8d7744b72 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>
2013-08-05 14:52:42 -04:00
Sujith Manoharan 3f2da95517 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>
2013-08-05 14:52:42 -04:00
Sujith Manoharan 6308130542 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>
2013-08-05 14:52:42 -04:00
Sujith Manoharan 3afa6b4f54 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>
2013-08-05 14:52:41 -04:00
Sujith Manoharan f85c3371ae 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>
2013-08-05 14:52:41 -04:00
Sujith Manoharan fd7f838731 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>
2013-08-05 14:52:40 -04:00
Solomon Peachy 5a6e0cf707 cw1200: Fix spurious BUG_ON() trigger when starting AP mode.
There's an underlying race condition with the unjoin_work() call that is
sometimes triggered depending on scheduling order and the phase of the
moon.  This doesn't fix the race condition, but it does remove the
ill-advised BUG_ON() call in an easily-recoverable situation.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:46:07 -04:00
Michal Kazior 32270b61b3 ath10k: fix device teardown
This fixes interrupt-related issue when no
interfaces were running thus the device was
considered powered down.

The power_down() function isn't really powering
down the device. It simply assumed it won't
interrupt. This wasn't true in some cases and
could lead to paging failures upon FW indication
interrupt (i.e. FW crash) because some structures
aren't allocated in that device state.

One reason for that was that ar_pci->started
wasn't reset. The other is interrupts should've
been masked when teardown starts.

The patch reorganized interrupt setup and makes
sure ar_pci->started is reset accordingly.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-05 19:22:16 +03:00
John W. Linville 1f80782786 Merge tag 'for-linville-20130730' of git://github.com/kvalo/ath6kl 2013-08-02 15:40:11 -04:00
John W. Linville 204162296e Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2013-08-02 15:37:34 -04:00
Stanislaw Gruszka 788f7a56fc iwl4965: reset firmware after rfkill off
Using rfkill switch can make firmware unstable, what cause various
Microcode errors and kernel warnings. Reseting firmware just after
rfkill off (radio on) helped with that.

Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=977053

Reported-and-tested-by: Justin Pearce <whitefox@guardianfox.net>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-02 14:54:04 -04:00
Stanislaw Gruszka eca396d7a5 iwl4965: set power mode early
If device was put into a sleep and system was restarted or module
reloaded, we have to wake device up before sending other commands.
Otherwise it will fail to start with Microcode error.

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-02 14:54:04 -04:00
Michal Kazior 591ecdb8f2 ath10k: fix failpath in MSI-X setup
pci_disable_msi() must be called if the initial
request_irq() fails.

Also add a warning message so it's possible to
distinguish request_irq() failure and
pci_enable_msi() failure.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:37:29 +03:00
Michal Kazior 0dbd09e628 ath10k: zero arvif memory on add_interface()
The private memory area in vif provided by
mac80211 isn't guaranteed to be zeroed.

This patch should fix issues when switching
between STA and AP interface types.

The tim_bitmap could become polluted by STA bssid
field (since it's a union), wep_keys array
could also become polluted with invalid pointers
and probably much more.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:37:29 +03:00
Michal Kazior d531cb85d5 ath10k: advertise more conservative intf combinations
Apparently the available firmware has a limit of
handling 7 APs, 3 GOs or 8 STAs. This is based on
empirical tests and it is still possible some
combinations may crash the firmware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:37:28 +03:00
Michal Kazior dcd4a56121 ath10k: make sure to use passive scan when n_ssids is 0
Normally user specifies broadcast ssid for
scanning. If the user wants to do a passive scan
it does not pass any ssids.

The patch makes sure we ath10k tells firmware to
not send anything at all in case it decides no
ssids equals broadcast ssid.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:37:28 +03:00
Michal Kazior 432358ed1d ath10k: prevent using invalid ringbuffer indexes
If the device is removed and hotplug fails
ioread32() will return 0xFFFFFFFF. In that case
reading ringbuffer during device bringup led to
out-of-bounds addressing of a ringbuffer array
that in turn led to a paging failure.

This could be reproduced by the following:
 * boot without acpi/prevent hotplug from working
 * insert and manually detect (pci rescan) the device
 * remove the device physically
 * load ath10k driver
 * kernel crashed

Ringbuffer index reading is now protected by using
an appropriate mask to prevent addressing an
invalid array index.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:37:28 +03:00
Michal Kazior 2e1dea4051 ath10k: implement get_survey()
This implements a limited subset of what can be
reported in the survey dump.

This can be used for assessing approximate channel
load, e.g. for automatic channel selection.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:35:21 +03:00
Michal Kazior 7c199997de ath10k: implement tx checksum offloading
HW supports L3/L4 tx checksum offloading.

This should reduce CPU load and improve
performance on slow host machines.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:28:39 +03:00
Michal Kazior 605f81aae7 ath10k: implement rx checksum offloading
HW supports L3/L4 rx checksum offloading.

This should reduce CPU load and improve
performance on slow host machines.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-08-02 09:28:39 +03:00
Sujith Manoharan e3d5291436 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>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 37133002f5 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>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 9ddf030179 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>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 5f800ffbbb 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>
2013-08-01 15:52:05 -04:00
Sujith Manoharan ef999114ee 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>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 552bde40dd 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>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 9383be4204 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>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 3fbaf4c55b 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>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 4eba10cc80 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>
2013-08-01 15:50:50 -04:00
Stanislaw Gruszka c1de4a9557 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>
2013-08-01 15:49:34 -04:00
Mark Schulte d28e5e5d96 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>
2013-08-01 15:34:35 -04:00
Avinash Patil 78dfca62f1 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>
2013-08-01 15:34:35 -04:00
Amitkumar Karwar c3afd99fb5 mwifiex: fix adapter pointer dereference issue
It has introduced by recent commit 6b41f941d7: "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>
2013-08-01 15:34:35 -04:00
John W. Linville 7546ff9549 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2013-08-01 15:26:52 -04:00
Stone Piao 6621fe18cd mwifiex: fix command 0x2c timeout during p2p_find or p2p_connect
We missed bss_mode check for P2P client.

Signed-off-by: Stone Piao <piaoyun@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>
2013-07-31 15:06:47 -04:00
Avinash Patil 237b2ac8ac mwifiex: fix wrong data rates in P2P client
This patch fixes an issue wherein adhoc rates were being copied
into association request from P2P client.

Cc: <stable@vger.kernel.org> # 3.10.y
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-31 15:06:46 -04:00
Avinash Patil 953b3539ef mwifiex: check for bss_role instead of bss_mode for STA operations
This patch fixes an issue wherein association would fail on P2P
interfaces. This happened because we are checking priv->mode
against NL80211_IFTYPE_STATION. While this check is correct for
infrastructure stations, it would fail P2P clients for which mode
is NL80211_IFTYPE_P2P_CLIENT.

Better check would be bss_role which has only 2 values: STA/AP.

Cc: <stable@vger.kernel.org> # 3.10.y
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-31 15:06:45 -04:00
Emmanuel Grumbach 147fc9be81 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>
2013-07-31 11:05:08 +02:00
Eytan Lifshitz 6be497f29e 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>
2013-07-31 11:05:07 +02:00
Alexander Bondar 8434925f20 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>
2013-07-31 11:05:06 +02:00
Eyal Shapira 2f2ad0d072 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>
2013-07-31 11:05:05 +02:00
Emmanuel Grumbach 913e25640c 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>
2013-07-31 11:05:05 +02:00
Johannes Berg 226eb8cd22 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>
2013-07-31 11:05:04 +02:00
Eran Harary 291aa7c4a4 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>
2013-07-31 11:05:03 +02:00
Hila Gonen 5dca7c241e 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>
2013-07-31 11:05:03 +02:00
Emmanuel Grumbach 77740cb433 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>
2013-07-31 11:05:02 +02:00
Johannes Berg 99545924a1 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>
2013-07-31 11:05:02 +02:00
Johannes Berg 7b8359cf2b 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>
2013-07-31 11:05:01 +02:00
Ilan Peer fd11bd0555 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>
2013-07-31 11:05:00 +02:00
Alexander Bondar 0f2ed58e6e 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>
2013-07-31 11:05:00 +02:00
Johannes Berg 5369d6c167 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>
2013-07-31 11:04:59 +02:00
Matti Gottlieb 88f2fd7300 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>
2013-07-31 11:04:59 +02:00
Johannes Berg ac1ed4163b 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>
2013-07-31 11:04:58 +02:00
Emmanuel Grumbach 58fa2aad29 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>
2013-07-31 11:04:58 +02:00
Avri Altman a2d7b870d0 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>
2013-07-31 11:04:49 +02:00
Michal Kazior 8865bee483 ath10k: detect the number of spatial streams supported by hw
Until now ath10k assumed 3 spatial streams.
However some devices support only 2 spatial
streams.

This patch improves performance on devices that
don't support 3 spatial streams.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-07-31 09:03:56 +03:00
Michal Kazior ba0ccd7aff ath10k: improve tx throughput on slow machines
It is more efficient to move just the 802.11
header instead of the whole payload in most cases.

This has no measurable effect on modern hardware.
It should improve performance by a few percent on
hardware such as an Access Point that have a slow
CPU compared to a typical desktop CPU.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-07-31 09:00:39 +03:00
Michal Kazior 424121c365 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>
2013-07-30 18:01:21 +03:00
Michal Kazior d6015b27f7 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>
2013-07-30 18:01:21 +03:00
Michal Kazior 21bf9112b5 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>
2013-07-30 18:01:21 +03:00
Michal Kazior 08fe9b40d0 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>
2013-07-30 18:01:20 +03:00
Michal Kazior 278c4a85e6 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>
2013-07-30 18:01:20 +03:00
Michal Kazior cf84bd4def 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>
2013-07-30 18:01:20 +03:00
Michal Kazior 9cfbce75c8 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>
2013-07-30 18:01:20 +03:00
Michal Kazior affd321733 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>
2013-07-30 18:01:20 +03:00
Michal Kazior 87571bf0b8 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>
2013-07-30 18:01:20 +03:00
Michal Kazior 293850575d 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>
2013-07-30 18:01:19 +03:00
Michal Kazior 818bdd16b2 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>
2013-07-30 18:01:19 +03:00
Michal Kazior a96d774559 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>
2013-07-30 18:01:19 +03:00
Michal Kazior 1a1b8a889d 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>
2013-07-30 18:01:19 +03:00
Michal Kazior 8cd13cad1c 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>
2013-07-30 18:01:19 +03:00
Michal Kazior 64d151d470 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>
2013-07-30 18:01:19 +03:00
Michal Kazior f7843d7f1a 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>
2013-07-30 18:01:19 +03:00
Michal Kazior dd30a36e11 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>
2013-07-30 18:01:18 +03:00
Michal Kazior 8c5c53682f 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>
2013-07-30 18:01:18 +03:00
Michal Kazior e0c508ab09 ath10k: add missing debug prints
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-07-30 18:01:18 +03:00
Michal Kazior adb8c9b77c 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>
2013-07-30 18:01:18 +03:00
Michal Kazior 548db54cc1 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>
2013-07-30 18:01:18 +03:00
Michal Kazior edb8236df4 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>
2013-07-30 18:01:18 +03:00
Michal Kazior cd003fad17 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>
2013-07-30 18:01:17 +03:00
Michal Kazior e799bbffdd 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>
2013-07-30 18:01:17 +03:00
Michal Kazior 7a5fe3f87c 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>
2013-07-30 18:01:17 +03:00
Michal Kazior ed48b35644 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>
2013-07-30 18:01:17 +03:00
Michal Kazior 342004bea7 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>
2013-07-30 18:01:17 +03:00
Michal Kazior 09af8f85c6 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>
2013-07-30 18:01:17 +03:00
Michal Kazior cba4ca7553 ath10k: fix typo in define name
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-07-30 18:01:16 +03:00
Michal Kazior 3a0861fffd 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>
2013-07-30 18:01:16 +03:00
Michal Kazior 671b96db55 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>
2013-07-30 18:01:16 +03:00
Michal Kazior 679c54a671 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>
2013-07-30 18:01:16 +03:00
Michal Kazior 80c78c67e6 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>
2013-07-30 18:01:16 +03:00
Michal Kazior a783c77076 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>
2013-07-30 18:01:16 +03:00