Commit graph

21276 commits

Author SHA1 Message Date
Emmanuel Grumbach a3ead6568c iwlwifi: pcie: fix recovery from ARC reset in WoWLAN
When the ARC is reset when we exit from Sx in case we had
WoWLAN running, we can't access the prph before we reset
the NIC.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:52:23 +02:00
Emmanuel Grumbach 40a76905ad iwlwifi: pcie: warn if extern fw_debug buffer failed
Otherwise we have no way to know that the buffer hasn't been
allocated.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:52:23 +02:00
Gregory Greenman 77d96730db iwlwifi: allow to restrict Tx aggregation size per-device
A few slave bus devices show better performance when we
reduce the size of the Tx A-MPDU.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:13 +02:00
Luciano Coelho 7f549e2c45 iwlwifi: mvm: change the iwl_mvm_d3_iface_iterator into a generic function
Getting the BSS station vif is something that may be needed by other
parts of the code.  So, instead of having an iterator specifically for
d3, change it into a generic one in utils.c.  Additionally, add a
iwl_mvm_get_bss_vif() function to make it easier to retrieving it.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:13 +02:00
Luciano Coelho 3c2f3b20e4 iwlwifi: mvm: add debugfs entry to configure netdetect SSIDs
Before we get all the chain (ie. mac80211, cfg80211, nl80211 and
userspace) changed to support net-detect, we can use this debugfs
entry for easy testing and as a proof of concept.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:13 +02:00
Luciano Coelho b141c23581 iwlwifi: mvm: spin off a function to start scan offload
The net-detect feature will require a scan offload to be started in
the same way it is done now for scheduled scan.  Spin a new function
off of the sched_scan_start op code for reuse.  Additionally,
restructure the function a bit for more readability.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:12 +02:00
Luciano Coelho 1e4d19ca6e iwlwifi: mvm: move the check if associated outside of the iterator for wowlan
Instead of checking if we are associated when suspending with wowlan
enabled in the interface iterator, allow it to return an unassociated
vif and move the check to the main suspend function.  This will be
needed by netdetect, since it should also work when we are not
associated but the vif is active.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:12 +02:00
Luciano Coelho 671b58202e iwlwifi: mvm: split wowlan handling out of the main suspend function
Take the WoWLAN handling code out of the main suspend function,
dividing it into three parts: get_config (which is used before the
firmware is switched), switch_to_d3 (which handles the rebooting of
the hardware with the D3 firmware) and config (which configures the D3
firmware for WoWLAN operation).  This is necessary to prepare for the
net-detect implementation, which will use only the switch_to_d3 part
of this flow.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:12 +02:00
Luciano Coelho 31ca09dd6b iwlwifi: mvm: hold the rtnl when resuming from a d3 test
We use ieee80211_iter_keys() which requires the rtnl to be held.  If
we don't lock the rtnl, like we do when we suspend during a d3 test,
we get the following splat:

 RTNL: assertion failed at net/mac80211/key.c (566)
 CPU: 1 PID: 26529 Comm: cat Tainted: G        W  O 3.10.29-dev #1
 Hardware name: Dell Inc. Latitude E6430/0CPWYR, BIOS A09 12/13/2012
  e7b15008 e7b15008 e68adc1c c168aa62 e68adc54 f91f20b6 f923700c f9236fd8
  00000236 00000000 ece23874 00000000 f94941e0 00000000 e43b8e48 e7b15008
  00000000 e8b69e78 e68adcc0 f9493ab9 e68adc68 00000000 e43b8e48 e7b15008
 Call Trace:
  [<c168aa62>] dump_stack+0x16/0x18
  [<f91f20b6>] ieee80211_iter_keys+0x166/0x170 [mac80211]
  [<f94941e0>] ? iwl_mvm_query_wakeup_reasons+0x5f0/0x5f0 [iwlmvm]
  [<f9493ab9>] iwl_mvm_setup_connection_keep.isra.5+0x99/0x1d0 [iwlmvm]
  [<f9165e28>] ? cfg80211_report_wowlan_wakeup+0x308/0x510 [cfg80211]
  [<f9493fe5>] iwl_mvm_query_wakeup_reasons+0x3f5/0x5f0 [iwlmvm]
  [<c116125a>] ? init_object+0x3a/0x70
  [<f8a5b8ee>] ? iwl_trans_pcie_d3_resume+0x1be/0x3a0 [iwlwifi]
  [<f94956da>] __iwl_mvm_resume+0x14a/0x180 [iwlmvm]
  [<f9495736>] iwl_mvm_d3_test_release+0x26/0xc0 [iwlmvm]
  [<c117a64d>] __fput+0xad/0x210
  [<c117a7bd>] ____fput+0xd/0x10
  [<c10601a1>] task_work_run+0x81/0xb0
  [<c1040fa5>] do_exit+0x255/0xac0
  [<c104e511>] ? dequeue_signal+0x31/0x1a0
  [<c1041888>] do_group_exit+0x38/0xa0
  [<c10a6cfb>] ? trace_hardirqs_on+0xb/0x10
  [<c1051c31>] get_signal_to_deliver+0x1e1/0x8e0
  [<c104bd52>] ? try_to_del_timer_sync+0x42/0x60
  [<c104bd70>] ? try_to_del_timer_sync+0x60/0x60
  [<c168dc82>] ? schedule_timeout+0x102/0x2a0
  [<c10011ba>] do_signal+0x3a/0x8e0
  [<c104b190>] ? __internal_add_timer+0xb0/0xb0
  [<c168de7a>] ? schedule_timeout_interruptible+0x1a/0x20
  [<c104ce39>] ? msleep_interruptible+0x39/0x40
  [<f94939a9>] ? iwl_mvm_d3_test_read+0x49/0x70 [iwlmvm]
  [<c11797fc>] ? vfs_read+0x8c/0x160
  [<c11243af>] ? SyS_fadvise64_64+0x15f/0x2b0
  [<f9493960>] ? iwl_mvm_wowlan_program_keys+0x4a0/0x4a0 [iwlmvm]
  [<c1179a57>] ? SyS_read+0x57/0xa0
  [<c1001acf>] do_notify_resume+0x6f/0xa0
  [<c1692500>] work_notifysig+0x29/0x31

Fix this by hold the rtnl lock when calling __iwl_mvm_resume() in the
d3 test wake up path.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:12 +02:00
Emmanuel Grumbach 8dfc275109 iwlwifi: mvm: remove unneeded NULL pointer check
mac80211 will never call rate_control_tx_status with a NULL
pointer for sta. Remove the superfluous check. This check
misled smatch.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:11 +02:00
Eyal Shapira dc574e5263 iwlwifi: rs: option to easily disable Tx MIMO
The current TLC isn't optimized for low latency and some devices
have issues with MIMO. This kind of combo creates latency issues.
Allow to temporarily disable MIMO for tests in order to solve
the latency issues without the added complexity of MIMO.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:49:11 +02:00
Felix Fietkau 5ca06ebe75 ath9k: use a random MAC address if the EEPROM address is invalid
Based on OpenWrt patch by Gabor Juhos

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:19 -04:00
Felix Fietkau 3468968ef7 ath9k: allow disabling bands via platform data
Some devices have multiple bands enables in the EEPROM data, even though
they are only calibrated for one. Allow platform data to disable
unsupported bands.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:19 -04:00
Felix Fietkau a59dadbeea ath9k: add support for endian swap of eeprom from platform data
On some devices (especially little-endian ones), the flash EEPROM data
has a different endian, which needs to be detected.
Add a flag to the platform data to allow overriding that behavior

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:19 -04:00
Felix Fietkau 7b89fccf15 ath9k_hw: start initial NF calibration after PA calibration on <AR9003
This makes the initial NF calibration less likely to fail.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 6339244b3b ath9k_hw: do not run NF and periodic calibration at the same time
It can cause inconsistent calibration results or in some cases turn the
radio deaf.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 7b8aaead95 ath9k: restart hardware after noise floor calibration failure
When NF calibration fails, the radio often becomes deaf. The usual
hardware hang checks do not detect this, so it's better to issue a reset
when that happens.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 70e535ed00 ath9k: clean up debugfs print of reset causes
Reduce code duplication

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 3b58014472 ath9k: fix processing RXORN interrupts
The "goto chip_reset" is a bit misleading, because it does not actually
issue a chip reset. Instead it is bypassing processing of other
interrupts and assumes that the tasklet will issue a chip reset.

In the case of RXORN this does not happen, so bypassing processing of
other interrupts will simply allow them to fire again. Even if RXORN
was triggering a reset, it is not critical enough to need the bypass
here.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 257b5bc680 ath9k_hw: remove support for UB124 tx gain table
UB124 is a USB based reference design not supported by ath9k or
ath9k_htc.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Felix Fietkau 935477ed7b ath9k_hw: make support for PC-OEM cards optional
The initvals use up quite a bit of space, and PC-OEM support is
typically not needed on embedded systems

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:18 -04:00
Sujith Manoharan 6424b036e5 ath9k: Update AR955x initvals
* Fix a 11b/EVM issue by adjusting
  FIR filter coefficients.

* Fix a problem with receiving probe request
  frames sent at 11b rate.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan d19c230f5f ath9k: Update AR9580 initvals
This fixes RX sensitivity issues with AR9580.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan 1e929d3e02 ath9k: Do not start BA when scanning
mac80211 currently has a race which can be hit
with this sequence:

* Start a scan operation.
* TX BA is initiated by ieee80211_start_tx_ba_session().
* Driver sets up internal state and calls
  ieee80211_start_tx_ba_cb_irqsafe().
* mac80211 adds a packet to sdata->skb_queue with
  type IEEE80211_SDATA_QUEUE_AGG_START.
* ieee80211_iface_work() doesn't process the
  packet because scan is in progress.
* ADDBA response timer expires and the sta/tid is
  torn down.
* Driver receives BA stop notification and calls
  ieee80211_stop_tx_ba_cb_irqsafe().
* This is also added to the queue by mac80211.
* Now, scan finishes.

At this point, the queued up packets might be processed
if some other operation schedules the sdata work. Since
the tids have been cleaned up already, warnings are hit.

If this doesn't happen, the packets are left in the queue
until the interface is torn down.

Since initiating a BA session when scan is in progress
leads to flaky connections, especially in MCC mode, we
can drop the TX BA request. This improves connectivity
with legacy clients in MCC mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan 25f3bc7dbd ath9k: Improve flush() in mcc mode
The flush timeout in MCC mode is very small, since
we are constrained by the time slice for each
channel context, but since only the HW queues are
flushed when switching contexts, it is acceptable.

Since the SW queues are also emptied in the mac80211 flush()
callback, a larger duration is needed. Add an override
argument to __ath9k_flush() and set it when flush()
is called in MCC mode. This allows the driver to
drain both the SW and HW queues.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan 23aab0c25f ath9k: Fix HW scan abort
Instead of using ATH_CHANCTX_EVENT_ASSIGN to abort
a HW scan when a new interface becomes active, use the
mgd_prepare_tx() callback. This allows us to make
sure that the GO's channel becomes operational by
using flush_work().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan 0a019a58e3 ath9k: Send oneshot NoA
This patch makes sure that a GO interface
sends out a new NoA schedule with 200ms duration
when mgd_prepare_tx() is called.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:17 -04:00
Sujith Manoharan a350335c5f ath9k: Fix RoC expiration
mac80211 has to be notified when a RoC period
expires in the driver. In MCC mode, since the
offchannel/RoC timer is set with the requested
duration, ieee80211_remain_on_channel_expired() needs
to be called when the timer expires.

But, currently it is done after we move back to
the operating channel. This is incorrect - fix this
by calling ieee80211_remain_on_channel_expired() when
the RoC timer expires and in ath_roc_complete() when
the RoC request is aborted.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan 828fe01acb ath9k: Use a helper function for bmiss
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan 347a9566ab ath9k: Use a helper function to set NoA
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan a23152a82f ath9k: Use a helper function for offchannel NoA
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan c6500ea29a ath9k: Check for active GO in mgd_prepare_tx()
If a GO interface is active when we receive a
mgd_prepare_tx() call, then we need to send
out a new NoA before switching to a new context.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan 26103b8d1d ath9k: Add a function to check for an active GO
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan 62ae1aef20 ath9k: Fix address management
Since both the arguments need to satisfy
the alignment requirements of ether_addr_copy(),
use memcpy() in cases where there will be no
big performance benefit and make sure that
ether_addr_copy() calls use properly aligned
arguments.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:16 -04:00
Sujith Manoharan 91e6ceb354 ath9k: Send AUTHORIZED event only for station mode
ATH_CHANCTX_EVENT_AUTHORIZED is required to trigger
the MCC scheduler when a station interface becomes
authorized. But, since the driver gets station state
notifications when the current operating mode is AP
too, make sure that we send ATH_CHANCTX_EVENT_AUTHORIZED
only when the interface is in station mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan e2d389b5aa ath9k: Check for pending frames properly
Pending frames in the driver can be present
either in the HW queues or SW. ath9k_has_pending_frames()
currently checks for the HW queues first and then
checks if any ACs are queued in the driver.

In MCC mode, we need to check the HW queues alone, since
the SW queues are just marked as 'stopped' - they will
be processed in the next context switch. But since we
don't differentiate this now, mention whether we want
to check if there are frames in the SW queues.

* The flush() callback checks both HW and SW queues.
* The tx_frames_pending() callback does the same.
* The call to __ath9k_flush() in MCC mode checks HW queues alone.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan 290c8a77e8 ath9k: Fix offchannel flush timeout
An offchannel operation also needs to have
a flush timeout that doesn't exceed the NoA
absence duration of a GO context, so use
channel_switch_time. The first offchannel
operation is set a flush timeout of 10ms since
channel_switch_time will be zero.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan 67259d51df ath9k: Fix MCC flush timeout
In MCC mode, the duration for a channel context
is half the beacon interval and having a large
flush timeout will adversely affect GO operation,
since the default value of 200ms will overshoot
the advertised NoA absence duration.

The scheduler initiates a channel context switch
only when the slot duration for the current
context expires, so there is no possibility of
having a fixed timeout for flush.

Since the channel_switch_time is added to the
absence duration when the GO sets up the NoA
attribute, this is the maximum time that we
have to flush the TX queues. The duration is very
small, but we don't have a choice in MCC mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan 2fae0d9fb0 ath9k: Use configurable timeout for flush
The timeout value for flushing the TX queues
is hardcoded at 200ms right now. Use a channel
context-specific value instead to allow adjustments
to the timeout in case MCC is enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan 8890d05ff5 ath9k: Clear NoA schedule properly
When an active context transitions to inactive
state, the NoA schedule needs to be removed
for the context that has beaconing enabled.
Not doing this will affect p2p clients.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan eaf04a6915 ath9k: Disable beacon tasklet during reset
When a chip reset is done, all running timers,
tasklets etc. are stopped but the beacon tasklet
is left running. Fix this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:15 -04:00
Sujith Manoharan ae2ff23930 ath9k: Set ATH_OP_HW_RESET before HW reset
When a HW reset is done, the interrupt tasklet is
disabled before ISRs are disabled in the HW. This
allows a small window where the HW can still generate
interrupts. Since the tasklet is disabled and not killed,
it is not scheduled but deferred for execution at a later
time.

This happens because ATH_OP_HW_RESET is not set when ath_reset()
is called. When the hw_reset_work workqueue is used, this
problem doesn't arise because ATH_OP_HW_RESET is set
and the ISR bails out.

Set ATH_OP_HW_RESET properly in ath_reset() to avoid
this race - all the ath_reset_internal() callers have
been converted to use ath_reset() in the previous patch.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan 5555c95524 ath9k: Unify reset API
Instead of having ath_reset_internal() and ath_reset()
as two separate calls to perform a HW reset, have
one function. This makes sure that the behavior will
be the same at all callsites.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan be247c1fae ath9k: Process beacons properly
When the current operating channel context has
been marked as ATH_CHANCTX_STATE_FORCE_ACTIVE,
do not process beacons that might be received,
since we have to wait for the station to become
authorized.

Also, since the cached TSF value will be zero
initially do not rearm the timer in this
case when a beacon is received, since it results
in spurious values.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan b8f9279be0 ath9k: Enable multi-channel properly
In MCC mode, currently the decision to enable
the multi-channel state machine is done
based on the association status if one of
the interfaces assigned to a context is in
station mode.

This allows the driver to switch to the other
context before the current station is able to
complete the 4-way handshake in case it is
required and this causes problems.

Instead, enable multi-channel mode when the
station moves to the authorized state. This
disallows an early switch to the other channel.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan df3c6eb34d ath9k: Use sta_state() callback
Instead of using the sta_add()/sta_remove() callbacks,
use the sta_state() callback since this gives
more fine-grained control.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Lorenzo Bianconi 992a36a641 ath9k: do not overwrite AR_PHY_RADAR_1 MSB
Do not overwrite AR_PHY_RADAR_1 most significant byte default value

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Dan Carpenter 9fdc723abf ipw2x00: clean up a condition
The original condition was "(PAGE_SIZE - len)" when "(len < PAGE_SIZE)"
is intended.

This condition is not really sufficient, but also not really needed...
If "len > PAGE_SIZE" then it we will print a warning message in dmesg
but there are no other effects.  Maybe we should just remove the
condition?

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Dan Carpenter 2aa01652cf ipw2x00: remove unused ->ibss_dfs pointer
The ->ibss_dfs pointer is always allocated with a user controlled
length.  This caused a static checker warning because what if the length
was zero?  In that case, any dereference of ->ibss_dfs would lead to an
Oops.

It turns out that this isn't a problem because the ->ibss_dfs pointer is
never used.  This patch deletes it along with all the related code.  In
particular the entire libipw_network_reset() function can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:13 -04:00
Stanislaw Gruszka e9dc51aa2b rt2x00: tune multi-registers I/O timeout
We provide timeout value to rt2x00usb_vendor_request_buff() based on
number of registers to process. That value is passed down to
rt2x00usb_vendor_req_buff_lock() and ends in usb_control_msg(). But we
do not read/write all registers in rt2x00usb_vendor_req_buff_lock() at
once. We read/write them in chunks of 64 bytes in the loop, hence passed
timeout value to low level is too big.

Patch removes timeout argument from rt2x00usb_vendor_request_buff() and
use short REGISTER_TIMEOUT in rt2x00usb_vendor_req_buff_lock(). That
timeout value should be fine for 64 bytes and smaller requests. For
EEPROM read we introduced new timeout value equal to 2 seconds.

Patch fixes process uninterruptible sleep stalls for long period, when
USB bus has problem to satisfy a request and we wait very long time on
usb_start_wait_urb().

Reported-and-tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:13 -04:00
John W. Linville 490f0dc4d5 Merge tag 'for-linville-20141024' of git://github.com/kvalo/ath
Conflicts:
	drivers/net/wireless/ath/wil6210/wil6210.h
2014-10-27 14:09:36 -04:00
Ben Greear 9a0cb89a8a mac80211-hwsim: support creating wiphy w/out creating wlanX
Good for automated testing, where user can create wlan
interfaces with specified names.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-27 08:48:33 +01:00
Ben Greear 5cd8926bbf mac80211-hwsim: support creating radios with specific name
Otherwise, it can be very difficult to know which is which
if you are trying to do detailed testing.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-27 08:48:32 +01:00
Michal Kazior 56a0dee77e ath10k: call correct function for frag threshold
Rts threshold was being configured instead of
fragmentation threshold.

Keep in mind available firmware binaries don't
seem to support fragmentation anyway so this
doesn't fix fragmentation threshold per se.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:35:54 +03:00
Felix Fietkau fa1d4df841 ath10k: add SURVEY_INFO_IN_USE for current channel on survey
When user space requests survey info, it is useful to know which of the survey
data refers to the channel that is currently actively being used.  One of the
use cases is getting the current channel noise for status output.  Without this
flag you would have to look up the channel separately and then compare it
against the frequency in the survey output in user space.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:35:18 +03:00
Michal Kazior a5d85f609d ath10k: re-use trace class
Instead of defining a completely new tracepoint
use an existing tracepoint class.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:34:00 +03:00
Michal Kazior b04e204fca ath10k: remove tsf argument from rx_desc tracing
Fundamentally this was wrong. Tsf is only valid
in last MPDU of a PPDU. This means tsf value was
wrong most of the time during heavy traffic.

Also I don't see much point in exposing a
redundant (and broken) tsf value. Userspace can
already read it from the dumped rx descriptor
buffer.

Cc: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:33:20 +03:00
Michal Kazior 51fc7d74ce ath10k: clear htt->rx_confused on load
Once driver entered the rx_confused state it would
refuse to rx even after firmware is restarted.
Make sure to clear it so that rx works after, e.g.
hw restart or after all interfaces are stopped.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:30:30 +03:00
Michal Kazior 686687c9af ath10k: don't forget to replenish after fragmented Rx
In theory it was possible to drain entire HTT Rx
ring via fragmented Rx leading to Rx lockup.

In practice non-data traffic would always trigger
replenishment via the regular Rx handler.

For correctness sake make sure to replenish the
ring on fragmented Rx.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:30:00 +03:00
Michal Kazior b30595aea3 ath10k: add extra sanity check when popping amsdu
The netbuf pop can return NULL. Make sure to check
for that. It shouldn't happen but better safe than
sorry.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:29:19 +03:00
Michal Kazior 34440df03d ath10k: don't drop frames aggressively
There's little point in dropping, e.g. frames with
FCS error early in ath10k.

This simplifies amsdu_allowed() and gets rid of
htt_rx_mpdu_status usage finally.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:29:07 +03:00
Michal Kazior 4de028064f ath10k: deduplicate htt rx dma unmapping
Treat non-chained and chained popping the same
way. Also this makes netbuf pop fully symmetrical
to (re)filling.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:28:59 +03:00
Michal Kazior 5f69caf793 ath10k: fix rx buffer tracing
Tracing function was called before buffers were
unmapped from DMA.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:28:42 +03:00
Michal Kazior 890d3b2a61 ath10k: use ieee80211 defines for crypto param lengths
Use the globally defined ieee80211 values instead
of re-defining them in the driver again.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:28:33 +03:00
Michal Kazior 10ac1ce879 ath10k: remove unused variable
The rx descriptor variable was no longer used in
the rx handler.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:28:12 +03:00
Michal Kazior f6b946ef78 ath10k: don't drop control and null func Rx
HTT_RX_IND_MPDU_STATUS_MGMT_CTRL was pretty greedy
and because of that ath10k ended up dropping
Control Frames as well as Null Func frames.

Reported-by: Okhwan Lee <ohlee@mwnl.snu.ac.kr>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-24 16:27:56 +03:00
Ben Greear 8cdd9e1c37 mac80211-hwsim: support destroying radio by name
It is not always convenient to have to know the device-id,
so allow deleting by name as well.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[use wiphy_name() instead of dev_name()]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-24 10:20:02 +02:00
Ben Greear 2155c3f823 mac80211-hwsim: add ethtool stats support
This gives a view into packet activity at the virtual radio
level.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-24 10:19:58 +02:00
Emmanuel Grumbach 7f2ac8fb31 iwlwifi: pcie: fix polling in various places
iwl_poll_bit may return a strictly positive value when the
poll doesn't match on the first try.
This was caught when WoWLAN started failing upon resume
even if the poll_bit actually succeeded.

Also change a wrong print. If we reach the end of
iwl_pcie_prepare_card_hw, it means that we couldn't
get the devices.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:49 +03:00
Emmanuel Grumbach 1ffde699aa Revert "iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate"
This reverts commit aa11bbf3df.
This commit was causing connection issues and is not needed
if IWL_MVM_RS_RSSI_BASED_INIT_RATE is set to false by default.

Regardless of the issues mentioned above, this patch added the
following WARNING:

WARNING: CPU: 0 PID: 3946 at drivers/net/wireless/iwlwifi/mvm/tx.c:190 iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]()
Got an HT rate for a non data frame 0x8
CPU: 0 PID: 3946 Comm: wpa_supplicant Tainted: G           O   3.17.0+ #6
Hardware name: LENOVO 20ANCTO1WW/20ANCTO1WW, BIOS GLET71WW (2.25 ) 07/02/2014
 0000000000000009 ffffffff814fa911 ffff8804288db8f8 ffffffff81064f52
 0000000000001808 ffff8804288db948 ffff88040add8660 ffff8804291b5600
 0000000000000000 ffffffff81064fb7 ffffffffa07b73d0 0000000000000020
Call Trace:
 [<ffffffff814fa911>] ? dump_stack+0x41/0x51
 [<ffffffff81064f52>] ? warn_slowpath_common+0x72/0x90
 [<ffffffff81064fb7>] ? warn_slowpath_fmt+0x47/0x50
 [<ffffffffa07a39ea>] ? iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]
 [<ffffffffa07a3cf8>] ? iwl_mvm_tx_skb+0x48/0x3c0 [iwlmvm]
 [<ffffffffa079cb9b>] ? iwl_mvm_mac_tx+0x7b/0x180 [iwlmvm]
 [<ffffffffa0746ce9>] ? __ieee80211_tx+0x2b9/0x3c0 [mac80211]
 [<ffffffffa07492f3>] ? ieee80211_tx+0xb3/0x100 [mac80211]
 [<ffffffffa0749c49>] ? ieee80211_subif_start_xmit+0x459/0xca0 [mac80211]
 [<ffffffff814116e7>] ? dev_hard_start_xmit+0x337/0x5f0
 [<ffffffff81430d46>] ? sch_direct_xmit+0x96/0x1f0
 [<ffffffff81411ba3>] ? __dev_queue_xmit+0x203/0x4f0
 [<ffffffff8142f670>] ? ether_setup+0x70/0x70
 [<ffffffff814e96a1>] ? packet_sendmsg+0xf81/0x1110
 [<ffffffff8140625c>] ? skb_free_datagram+0xc/0x40
 [<ffffffff813f7538>] ? sock_sendmsg+0x88/0xc0
 [<ffffffff813f7274>] ? move_addr_to_kernel.part.20+0x14/0x60
 [<ffffffff811c47c2>] ? __inode_wait_for_writeback+0x62/0xb0
 [<ffffffff813f7a91>] ? SYSC_sendto+0xf1/0x180
 [<ffffffff813f88f9>] ? __sys_recvmsg+0x39/0x70
 [<ffffffff8150066d>] ? system_call_fastpath+0x1a/0x1f
---[ end trace cc19a150d311fc63 ]---

which was reported here: https://bugzilla.kernel.org/show_bug.cgi?id=85691

CC: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:49 +03:00
Emmanuel Grumbach a0855054e5 iwlwifi: dvm: drop non VO frames when flushing
When mac80211 wants to ensure that a frame is sent, it calls
the flush() callback. Until now, iwldvm implemented this by
waiting that all the frames are sent (ACKed or timeout).
In case of weak signal, this can take a significant amount
of time, delaying the next connection (in case of roaming).
Many users have reported that the flush would take too long
leading to the following error messages to be printed:

iwlwifi 0000:03:00.0: fail to flush all tx fifo queues Q 2
iwlwifi 0000:03:00.0: Current SW read_ptr 161 write_ptr 201
iwl data: 00000000: 00 00 00 00 00 00 00 00 fe ff 01 00 00 00 00 00
[snip]
iwlwifi 0000:03:00.0: FH TRBs(0) = 0x00000000
[snip]
iwlwifi 0000:03:00.0: Q 0 is active and mapped to fifo 3 ra_tid 0x0000 [9,9]
[snip]

Instead of waiting for these packets, simply drop them. This
significantly improves the responsiveness of the network.
Note that all the queues are flushed, but the VO one. This
is not typically used by the applications and it likely
contains management frames that are useful for connection
or roaming.

This bug is tracked here:
https://bugzilla.kernel.org/show_bug.cgi?id=56581

But it is duplicated in distributions' trackers.
A simple search in Ubuntu's database led to these bugs:

https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1270808
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1305406
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1356236
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1360597
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1361809

Cc: <stable@vger.kernel.org>
Depends-on: 77be2c54c5 ("mac80211: add vif to flush call")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:48 +03:00
Matti Gottlieb a6cc516314 iwlwifi: mvm: ROC - bug fixes around time events and locking
Don't add the time event to the list. We added it several
times the same time event, which leads to an infinite loop
when walking the list.

Since we (currently) don't support more than one ROC for STA
vif at a time, enforce this and don't add the time event
to any list.

We were also missing the locking of the mutex which led to
a lockdep splat - fix that.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:48 +03:00
Haim Dreyfuss 79b7a69d73 iwlwifi: mvm: Add tx power condition to bss_info_changed_ap_ibss
The tx power should be limited from many reasons.
currently, setting the tx power is available by the mvm only for
station interface. Adding the tx power condition to
bss_info_changed_ap_ibss make it available also for AP.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:48 +03:00
Emmanuel Grumbach 3856b78c1b iwlwifi: mvm: BT coex - fix BT prio for probe requests
The probe requests sent during scan must get BT prio 3.
Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:47 +03:00
Emmanuel Grumbach d14b28fd2c iwlwifi: mvm: BT Coex - update the MPLUT Boost register value
Cc: <stable@vger.kernel.org> [3.16+]
Fixes: 2adc8949ef ("iwlwifi: mvm: BT Coex - fix boost register / LUT values")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:47 +03:00
Liad Kaufman 405b7338ab iwlwifi: 8000: fix string given to MODULE_FIRMWARE
I changed the string but forgot to update the fix also to
MODULE_FIRMWARE().

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:47 +03:00
Emmanuel Grumbach 9180ac5071 iwlwifi: configure the LTR
The LTR is the handshake between the device and the root
complex about the latency allowed when the bus exits power
save. This configuration was missing and this led to high
latency in the link power up. The end user could experience
high latency in the network because of this.

Cc: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:47 +03:00
Michal Kazior 84cbf3a759 ath10k: split ce pipe init/alloc further
Calling init to reinit ce pipe state would also
re-set all static structure links and setting
(which don't change over driver lifecycle).

Make it so alloc links structures and initializes
static data and init part to setup state
variables and clear stuff.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-23 16:41:32 +03:00
Michal Kazior 7c0f0e3c97 ath10k: mask/unmask msi fw irq
This was the final missing bit to making sure the
device doesn't assert interrupts to host.

This should fix possible race when target crashes
during driver teardown.

This also removes an early warm reset workaround
during pci probing.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-23 16:40:38 +03:00
Michal Kazior a428249da9 ath10k: re-disable interrupts after target init
If MSI isn't configured device ROM program expects
legacy interrupts to be enabled before it can
fully boot. Don't forget to disable legacy
interrupts after that.

While at it re-use the legacy irq enabling helper
instead of calling ath10k_pci_write32().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-23 16:35:25 +03:00
Michal Kazior 7d9d5587c2 ath10k: use bss_info as txpower source
This simply changes the source for txpower setup.
It does not make ath10k use different txpower
values for different vifs.

This will make it easier to implement chanctx in
ath10k in the future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:52:38 +03:00
Michal Kazior 21040bf9cb ath10k: simplify computation of mgmt rx band
Using global channel won't work with chanctx. Try
to determine the channel from the information
provided in the wmi event itself alone. This
should be sufficient.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:36:56 +03:00
Michal Kazior 077efc8c42 ath10k: clean up sta auth/assoc code
The code can be symmetrical so make it so. This
makes it easier to understand and work with.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:33:23 +03:00
Michal Kazior b1ecde36ad ath10k: skip some commands on reassoc
It doesn't make much sense to reconfigure peer
completely upon reassociation. This will make it
easier to have a more uniform association code
across different modes.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:33:03 +03:00
Michal Kazior 590922a824 ath10k: clean up assoc code
There's no need to pass bss_conf explicitly as it
is accessible via vif pointer. This requires
slight changes in function prototypes. While at it
clean up listen interval workaround/command.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:32:31 +03:00
Kalle Valo a58227ef69 ath10k: retrieve calibration data from file
A frequent request have been to be able to provide calibration data from a
file as some of the AP devices store the calibration data on an MTD partition.
This patchset adds support for that and also makes it easier to add Device Tree
support later on.

The calibration data is found by using the id string provided by dev_name()
using this format:

cal-<bus>-<id>.bin

With PCI the id string contains bus, slot and func values. For example for a
PCI device in bus 2 slot 0, ath10k will try to retrieve a calibration data from
a file:

/lib/firmware/ath10k/cal-pci-0000:02:00.0.bin

The calibration data sequence is:

1. Check with request_firmware() if there's a calibration file
   ("cal-<bus>-<id>.bin") on the filesystem for this device. If yes, use that. If
   not, goto 2

2. Check if otp.bin is able to successfully load the calibration data
   from OTP. If yes, use that. If not, goto 3.

4. Print an error message that no calibration data found and stop driver
   initialization for this device.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 10:03:33 +03:00
Kalle Valo 8309155977 ath10k: refactor ath10k_init_download_firmware()
This is preparation for being able to download calibration data from a file.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 09:59:07 +03:00
Kalle Valo e07db352ca ath10k: add back enum ath10k_bus
Commit 3a0861fffd ("ath10k: remove ath10k_bus") removed enum ath10k_bus
because it was not used for anything at the time. But now it's needed for for
retrieving the right calibration data file so add it back. Only new addition is
ath10k_bus_str().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-21 09:58:41 +03:00
Jouni Malinen 89c771e5a6 cfg80211: Convert del_station() callback to use a param struct
This makes it easier to add new parameters for the del_station calls
without having to modify all drivers that use this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-20 16:24:21 +02:00
Andy Shevchenko e5ead669a3 wireless: hostap: proc: print properly escaped SSID
Instead of substituting non-printable characters by '_' let's print SSID
properly escaped by using recently added %*pE specifier.

[akpm@linux-foundation.org: fix printk type warning]
[akpm@linux-foundation.org: remove now-unused local `i']
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "John W . Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-14 02:18:27 +02:00
Andy Shevchenko 4b4890cb6a wireless: ipw2x00: print SSID via %*pE
Instead of custom approach this allows to print escaped strings via
recently added kernel extension: %*pE.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "John W . Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-14 02:18:27 +02:00
Andy Shevchenko da169607ae wireless: libertas: print esaped string via %*pE
Instead of custom approach this allows to print escaped strings via
recently added kernel extension: %*pE.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "John W . Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-14 02:18:26 +02:00
Rajkumar Manoharan 82d7aba715 ath10k: fix kernel panic while shutting down AP
Based on GFP flag given to DMA coherent allocation, the behaviour of
dma_free_coherent is changed. This behavioural diffrence is noticeable
in ARM platform. If DMA memory is allocated with GFP_KERNEL, free
coherent can not be called inside spin lock. This is causing kernel
crash in ARM platforms. Fix this by changing GFP flag to atomic.

This is most likely a regression from commit 64badcb6d6 ("ath10k: workaround
fw beaconing bug").

Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-12 20:43:05 +03:00
David S. Miller 4511a4a50e Merge tag 'master-2014-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says:

====================
pull request: wireless-next 2014-10-09

Please pull this batch of fixes intended for the 3.18 stream!

Andrea Merello makes rtl818x_pci use a more reasonable transmission
rate for HW generated frames.

Fabian Frederick tweaks some kernel-doc bits to avoid warnings.

Larry Finger corrects a possible unaligned access in the rtlwifi code.

Marek Puzyniak avoids a kernel panic in ath9k_hw_reset.

Sujith Manoharan goes for the hat trick -- he fixes a smatch warning
in the shared ath code, he fixes a crash in ath9k, and he corrects
a sequence number assignment problem in ath9k too.

For ease of merging, I pulled the last bits of the wireless tree as well...

Please let me know if there are problems!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-10 14:49:55 -04:00
Jukka Rissanen e9ed49bf4c mac80211-hwsim: Add support for HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE
Add support for new attribute HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE
which can be set by the user space component. The attribute
will cause the kernel to destroy all those radios that were
created by a process if that process dies. The old behaviour
i.e., radios are persistent is still the default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-09 16:13:01 +02:00
Luciano Coelho 0f791eb47f mac80211: allow channel switch with multiple channel contexts
Channel switch with multiple channel contexts should now work fine.
Remove check that disallows switches when multiple contexts are in
use.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-09 11:30:09 +02:00
Ben Greear 9ebac15f49 mac80211_hwsim: fix typo, remove unnecessary goto
Trivial cleanups.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-09 09:29:45 +02:00
Ben Greear b7bc9679e4 mac80211_hwsim: fix memory leak on netlink TX failure
If the packet can't be delivered to userspace (at all or
quickly enough) then it can leak - fix that.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[rewrite commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-10-09 09:29:44 +02:00
Linus Torvalds 35a9ad8af0 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Most notable changes in here:

   1) By far the biggest accomplishment, thanks to a large range of
      contributors, is the addition of multi-send for transmit.  This is
      the result of discussions back in Chicago, and the hard work of
      several individuals.

      Now, when the ->ndo_start_xmit() method of a driver sees
      skb->xmit_more as true, it can choose to defer the doorbell
      telling the driver to start processing the new TX queue entires.

      skb->xmit_more means that the generic networking is guaranteed to
      call the driver immediately with another SKB to send.

      There is logic added to the qdisc layer to dequeue multiple
      packets at a time, and the handling mis-predicted offloads in
      software is now done with no locks held.

      Finally, pktgen is extended to have a "burst" parameter that can
      be used to test a multi-send implementation.

      Several drivers have xmit_more support: i40e, igb, ixgbe, mlx4,
      virtio_net

      Adding support is almost trivial, so export more drivers to
      support this optimization soon.

      I want to thank, in no particular or implied order, Jesper
      Dangaard Brouer, Eric Dumazet, Alexander Duyck, Tom Herbert, Jamal
      Hadi Salim, John Fastabend, Florian Westphal, Daniel Borkmann,
      David Tat, Hannes Frederic Sowa, and Rusty Russell.

   2) PTP and timestamping support in bnx2x, from Michal Kalderon.

   3) Allow adjusting the rx_copybreak threshold for a driver via
      ethtool, and add rx_copybreak support to enic driver.  From
      Govindarajulu Varadarajan.

   4) Significant enhancements to the generic PHY layer and the bcm7xxx
      driver in particular (EEE support, auto power down, etc.) from
      Florian Fainelli.

   5) Allow raw buffers to be used for flow dissection, allowing drivers
      to determine the optimal "linear pull" size for devices that DMA
      into pools of pages.  The objective is to get exactly the
      necessary amount of headers into the linear SKB area pre-pulled,
      but no more.  The new interface drivers use is eth_get_headlen().
      From WANG Cong, with driver conversions (several had their own
      by-hand duplicated implementations) by Alexander Duyck and Eric
      Dumazet.

   6) Support checksumming more smoothly and efficiently for
      encapsulations, and add "foo over UDP" facility.  From Tom
      Herbert.

   7) Add Broadcom SF2 switch driver to DSA layer, from Florian
      Fainelli.

   8) eBPF now can load programs via a system call and has an extensive
      testsuite.  Alexei Starovoitov and Daniel Borkmann.

   9) Major overhaul of the packet scheduler to use RCU in several major
      areas such as the classifiers and rate estimators.  From John
      Fastabend.

  10) Add driver for Intel FM10000 Ethernet Switch, from Alexander
      Duyck.

  11) Rearrange TCP_SKB_CB() to reduce cache line misses, from Eric
      Dumazet.

  12) Add Datacenter TCP congestion control algorithm support, From
      Florian Westphal.

  13) Reorganize sk_buff so that __copy_skb_header() is significantly
      faster.  From Eric Dumazet"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1558 commits)
  netlabel: directly return netlbl_unlabel_genl_init()
  net: add netdev_txq_bql_{enqueue, complete}_prefetchw() helpers
  net: description of dma_cookie cause make xmldocs warning
  cxgb4: clean up a type issue
  cxgb4: potential shift wrapping bug
  i40e: skb->xmit_more support
  net: fs_enet: Add NAPI TX
  net: fs_enet: Remove non NAPI RX
  r8169:add support for RTL8168EP
  net_sched: copy exts->type in tcf_exts_change()
  wimax: convert printk to pr_foo()
  af_unix: remove 0 assignment on static
  ipv6: Do not warn for informational ICMP messages, regardless of type.
  Update Intel Ethernet Driver maintainers list
  bridge: Save frag_max_size between PRE_ROUTING and POST_ROUTING
  tipc: fix bug in multicast congestion handling
  net: better IFF_XMIT_DST_RELEASE support
  net/mlx4_en: remove NETDEV_TX_BUSY
  3c59x: fix bad split of cpu_to_le32(pci_map_single())
  net: bcmgenet: fix Tx ring priority programming
  ...
2014-10-08 21:40:54 -04:00
Larry Finger 1fca350b76 rtlwifi: Fix possible unaligned array in ether_addr_copy()
Two macros used to copy BSSID information use ether_addr_copy(), thus
the arrays must be 2-byte aligned. In one case, the array could become
unaligned if the struct containing it were changed. Use the __unaligned(2)
attribute to retain the necessary alignment. In addition, the magic number
used to specify the size of the array is replaced by ETH_ALEN.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-08 15:24:16 -04:00
Sujith Manoharan ca14405e3b ath9k: Fix sequence number assignment
Currently, ath9k uses a global counter for all
frames that need to be assigned a sequence number.
QoS-data frames are handled properly since they
have a per-tid counter. But, beacons and other
management frames use the same counter even if
multiple interfaces or contexts are present.

Fix this issue by making the counter per-interface
and using it when mac80211 sets IEEE80211_TX_CTL_ASSIGN_SEQ.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-08 15:24:15 -04:00
Rajkumar Manoharan 9b57f88f1e ath10k: add tracing for frame transmission
Add tracing support to forward management and data frames to
user space for packet inspection.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-08 13:26:42 +03:00
Janusz Dziedzic 6db0885a6c ath10k: fix WMI scan command length
Fix WMI scan command length we setup when scan request.

This fix issue with 636 firmware when scan always failed
with message:

ath10k_pci 0000:02:00.0: wmi start scan
ath10k_pci 0000:02:00.0: wmi stop scan reqid 1 req_type 0 vdev/scan_id 0
ath10k_pci 0000:02:00.0: failed to stop wmi scan: -11
ath10k_pci 0000:02:00.0: failed to stop scan: -11
ath10k_pci 0000:02:00.0: failed to start hw scan: -110

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-08 13:23:47 +03:00
Bartosz Markowski 8026cae7aa ath10k: advertise all possible firmware(-api) files
This is required if we take into account possibility to load the driver
from initrd (RAM disk), so in other words: very early in the boot process,
before the file system is visible.

In such case we need to have the firmware files accessible from ram disk too,
and this patch guarantee this.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-08 13:22:29 +03:00
Janusz Dziedzic 3c7984e97f ath10k: don't create bssid peer for ibss
It's not really necessary to create bssid peer for
bssid. Self-address peer is sufficient.

This prevents some firmware revisions from crashing.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-08 13:21:06 +03:00
Michal Kazior 2358a544fe ath10k: warn on unhandled htt events
It makes a lot more sense to print these kinds of
problems as a warning instead of a debug.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-08 13:19:54 +03:00
Linus Torvalds 28596c9722 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull "trivial tree" updates from Jiri Kosina:
 "Usual pile from trivial tree everyone is so eagerly waiting for"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
  Remove MN10300_PROC_MN2WS0038
  mei: fix comments
  treewide: Fix typos in Kconfig
  kprobes: update jprobe_example.c for do_fork() change
  Documentation: change "&" to "and" in Documentation/applying-patches.txt
  Documentation: remove obsolete pcmcia-cs from Changes
  Documentation: update links in Changes
  Documentation: Docbook: Fix generated DocBook/kernel-api.xml
  score: Remove GENERIC_HAS_IOMAP
  gpio: fix 'CONFIG_GPIO_IRQCHIP' comments
  tty: doc: Fix grammar in serial/tty
  dma-debug: modify check_for_stack output
  treewide: fix errors in printk
  genirq: fix reference in devm_request_threaded_irq comment
  treewide: fix synchronize_rcu() in comments
  checkstack.pl: port to AArch64
  doc: queue-sysfs: minor fixes
  init/do_mounts: better syntax description
  MIPS: fix comment spelling
  powerpc/simpleboot: fix comment
  ...
2014-10-07 21:16:26 -04:00
Marek Puzyniak c393d17992 ath9k_htc: avoid kernel panic in ath9k_hw_reset
hw pointer of ath_hw is not assigned to proper value
in function ath9k_hw_reset what finally causes kernel panic.
This can be solved by proper initialization of ath_hw in
ath9k_init_priv.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Acked-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-07 15:07:15 -04:00
Sujith Manoharan b18111d911 ath9k: Fix crash in MCC mode
When a channel context is removed, the hw_queue_base
is set to -1, this will result in a panic because
ath9k_chanctx_stop_queues() can be called on an interface
that is not assigned to any context yet - for example,
when trying to scan.

Fix this issue by setting the hw_queue_base to zero
when a channel context is removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-07 14:48:37 -04:00
Sujith Manoharan d2a993e20e ath: Fix smatch warning
drivers/net/wireless/ath/main.c:88 ath_printk()
	 error: we previously assumed 'common->hw' could be null (see line 82)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-07 14:48:37 -04:00
Andrea Merello 79ee65659e rtl818x_pci: fix response rate may be incorrect.
Currently the allowed "respose rate" set (rates for HW generated frames
like ACKs) is the same as the basic rate set.

The HW will use the higher allowed response rate that is lower than the
rate of the received frame.

This is more or less what IEEE80211 mandates, but I missed the fact
that IEEE80211 also says that whenever it happens that for a modulation
class there is no any rate in the basic rates set, then the response rate
set shall include also all the mandatory rates for that modulation class.

This patch adds mandatory OFDM rates to the allowed response rate set if
no OFDM rate is included in the basic rate set.

Depending by the AP, I faced cases in which this patch seems to cause a
noticeable perfomance improvement.

- With my usual test AP there is no particular perfomance difference.
- With a prism54/hostapd AP this patch causes RX thoughput increase from
  about 5Mbps to about 20Mbps.

Hopefully this patch may help people that faced performance regression wrt
the old staging driver.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-07 14:48:37 -04:00
John W. Linville d7ffd588f0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-10-07 14:48:29 -04:00
Rajkumar Manoharan d1e50f4703 ath10k: add tracing for tx info
The tx info such as msdu_id, frame len, vdev id and tid are reported
to user space by tracepoint. This is useful for collecting tx
statistics.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-07 17:10:47 +03:00
Rajkumar Manoharan a0883cf7e7 ath10k: add tracing for rx descriptor
Upon the reception of frame, the descriptor status are reported
to user space by tracepoint. This is useful for collecting rx
statistics.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-07 17:10:40 +03:00
Rajkumar Manoharan bfdd7937ab ath10k: add tracing for ath10k_htt_pktlog
This is useful for collecting pktlog statistics of tx, rx
and rate information, so add tracing for the API call.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-07 17:10:27 +03:00
Rajkumar Manoharan 90174455ae ath10k: add support to configure pktlog filter
Add support to configure packet log filters (tx, rx, rate control)
via debugfs. To disable htt pktlog events set the filters to 0.

ex:

To enable pktlog for all filters

   echo 0x1f > /sys/kernel/debug/ieee80211/phy*/ath10k/pktlog_filter

To disable pktlog

   echo 0 > /sys/kernel/debug/ieee80211/phy*/ath10k/pktlog_filter

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-07 17:09:56 +03:00
David S. Miller a4b4a2b7f9 Merge tag 'master-2014-10-02' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says:

====================
pull request: wireless-next 2014-10-03

Please pull tihs batch of updates intended for the 3.18 stream!

For the iwlwifi bits, Emmanuel says:

"I have here a few things that depend on the latest mac80211's changes:
RRM, TPC, Quiet Period etc...  Eyal keeps improving our rate control
and we have a new device ID. This last patch should probably have
gone to wireless.git, but at that stage, I preferred to send it to
-next and CC stable."

For (most of) the Atheros bits, Kalle says:

"The only new feature is testmode support from me. Ben added a new method
to crash the firmware with an assert for debug purposes. As usual, we
have lots of smaller fixes from Michal. Matteo fixed a Kconfig
dependency with debugfs. I fixed some warnings recently added to
checkpatch."

For the NFC bits, Samuel says:

"We've had major updates for TI and ST Microelectronics drivers, and a
few NCI related changes.

For TI's trf7970a driver:

- Target mode support for trf7970a
- Suspend/resume support for trf7970a
- DT properties additions to handle different quirks
- A bunch of fixes for smartphone IOP related issues

For ST Microelectronics' ST21NFCA and ST21NFCB drivers:

- ISO15693 support for st21nfcb
- checkpatch and sparse related warning fixes
- Code cleanups and a few minor fixes

Finally, Marvell added ISO15693 support to the NCI stack, together with a
couple of NCI fixes."

For the Bluetooth bits, Johan says:

"This 3.18 pull request replaces the one I did on Monday ("bluetooth-next
2014-09-22", which hasn't been pulled yet). The additions since the last
request are:

 - SCO connection fix for devices not supporting eSCO
 - Cleanups regarding the SCO establishment logic
 - Remove unnecessary return value from logging functions
 - Header compression fix for 6lowpan
 - Cleanups to the ieee802154/mrf24j40 driver

Here's a copy from previous request that this one replaces:

'
Here are some more patches for 3.18. They include various fixes to the
btusb HCI driver, a fix for LE SMP, as well as adding Jukka to the
MAINTAINERS file for generic 6LoWPAN (as requested by Alexander Aring).

I've held on to this pull request a bit since we were waiting for a SCO
related fix to get sorted out first. However, since the merge window is
getting closer I decided not to wait for it. If we do get the fix sorted
out there'll probably be a second small pull request later this week.
'"

And,

"Unless 3.17 gets delayed this will probably be our last -next pull request for
3.18. We've got:

  - New Marvell hardware supportr
  - Multicast support for 6lowpan
  - Several of 6lowpan fixes & cleanups
  - Fix for a (false-positive) lockdep warning in L2CAP
  - Minor btusb cleanup"

On top of all that comes the usual sort of updates to ath5k, ath9k,
ath10k, brcmfmac, mwifiex, and wil6210.  This time around there are
also a number of rtlwifi updates to enable some new hardware and
to reconcile the in-kernel drivers with some newer releases of the
Realtek vendor drivers.  Also of note is some device tree work for
the bcma bus.

Please let me know if there are problems!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-05 21:34:39 -04:00
Larry Finger 3f08e47291 rtlwifi: Fix static checker warnings for various drivers
Indenting errors yielded the following static checker warnings:

drivers/net/wireless/rtlwifi/rtl8192ee/hw.c:533 rtl92ee_set_hw_reg() warn: add curly braces? (if)
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c:539 rtl92ee_set_hw_reg() warn: add curly braces? (if)

An unreleased version of the static checker also reported:

drivers/net/wireless/rtlwifi/rtl8723be/trx.c:550 rtl8723be_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8188ee/trx.c:621 rtl88ee_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192ee/trx.c:567 rtl92ee_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8821ae/trx.c:758 rtl8821ae_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c:494 rtl8723e_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:315 rtl92se_rx_query_desc() warn: 'hdr' can't be NULL.
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c:392 rtl92ce_rx_query_desc() warn: 'hdr' can't be NULL.

All of these are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Larry Finger 989377e1cc rtlwifi: Fix Kconfig for RTL8192EE
The driver needs btcoexist, but Kconfig fails to select it. This omission
could cause build errors for some configurations.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Sujith Manoharan e2cba8d759 ath9k: Fix flushing in MCC mode
When we are attempting to switch to a new
channel context, the TX queues are flushed, but
the mac80211 queues are not stopped and traffic
can still come down to the driver.

This patch fixes it by stopping the queues
assigned to the current context/vif before
trying to flush.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Sujith Manoharan 5ba8d9d2f0 ath9k: Fix queue handling for channel contexts
When a full chip reset is done, all the queues
across all VIFs are stopped, but if MCC is enabled,
only the queues of the current context is awakened,
when we complete the reset.

This results in unfairness for the inactive context.
Since frames are queued internally in the driver if
there is a context mismatch, we can awaken all the
queues when coming out of a reset.

The VIF-specific queues are still used in flow control,
to ensure fairness when traffic is high.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Sujith Manoharan a064eaa10c ath9k: Add ath9k_chanctx_stop_queues()
This can be used when the queues of a context
needs to be stopped.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Sujith Manoharan b39031536a ath9k: Pass context to ath9k_chanctx_wake_queues()
Change the ath9k_chanctx_wake_queues() API so
that we can pass the channel context that needs its
queues to be stopped.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:32 -04:00
Sujith Manoharan 4f82eecf73 ath9k: Fix queue handling in flush()
When draining of the TX queues fails, a
full HW reset is done. ath_reset() makes sure
that the queues in mac80211 are restarted,
so there is no need to wake them up again.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:31 -04:00
Sujith Manoharan 60913f4d29 ath9k: Remove duplicate code
ath9k_has_tx_pending() can be used to
check if there are pending frames instead
of having duplicate code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:31 -04:00
Sujith Manoharan fc1314c75e ath9k: Fix pending frame check
Checking for the queue depth outside of
the TX queue lock is incorrect and in this
case, is not required since it is done inside
ath9k_has_pending_frames().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:31 -04:00
Sujith Manoharan b736728575 ath9k: Check pending frames properly
There is no need to check if the current
channel context has active ACs queued up
if the TX queue is not empty.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:31 -04:00
Sujith Manoharan 4b60af4ab4 ath9k: Print RoC expiration
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:26:31 -04:00
Avinash Patil 030bb75a1d mwifiex: add support for SD8887 chipset
This patch adds SD8887 support to mwifiex.
SD8887 is Marvell's 1x1 11ac solution.

The corresponding firmware image file is located at:
"mrvl/sd8887_uapsta.bin"

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:23:15 -04:00
Avinash Patil 554a0113cc mwifiex: few more register offset entries for sdio card structure
This patch adds some more defitions to card specific register structure
and removes static defines for these registers.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:23:15 -04:00
Vladimir Kondratiev dba4b74d2d wil6210: atomic I/O for the card memory
Introduce netdev IOCTLs, to be used by the debug tools.

Allows to read/write single dword value or
memory block, aligned to dword
Different address modes supported:
- BAR offset
- Firmware "linker" address
- target's AHB bus

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:23:14 -04:00
Vladimir Kondratiev c33407a8c5 wil6210: manual FW error recovery mode
Introduce manual FW recovery mode. It is activated if module parameter
@no_fw_recovery set to true. May be changed at runtime.

Recovery information provided by new "recovery" debugfs file. It prints:

mode = [auto|manual]
state = [idle|pending|running]

In manual mode, after FW error, recovery won't start automatically. Instead,
after notification to user space, recovery waits in "pending" state, as indicated by the
"recovery" debugfs file. User space tools may perform data collection and allow to
continue recovery by writing "run" to the "recovery" debugfs file.
Alternatively, recovery pending may be canceled by stopping network interface
i.e. 'ifconfig wlan0 down'

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:23:14 -04:00
Sujith Manoharan e6664dff06 ath: Add support for tracing
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-02 14:23:14 -04:00
Ben Greear 16c1117675 ath10k: use 64-bit vdev map
This can allow more than 32 stations to be supported
without over-running the bitmap.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-01 11:21:43 +03:00
Ben Greear 6cddcc7ac2 ath10k: support ethtool stats
Add support for reading firmware stats through the ethtool
API.  This may be easier for applications to manipulate
compared to parsing a text based debugfs file.

kvalo: remove unneeded ifdefs, call ath10k_debug_fw_stats_request() and added
simple error handling

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-01 11:18:20 +03:00
Ben Greear f51dbe7374 ath10k: add firmware crash counters
Add three counters related to firmware crashes or resets.

Usage:

# cat /sys/kernel/debug/ieee80211/phy0/ath10k/fw_reset_stats
fw_crash_counter                2
fw_warm_reset_counter           43
fw_cold_reset_counter           0
#

kvalo: split into it's own patch, add debugfs file and add locking

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-01 11:16:27 +03:00
Larry Finger 574a7930d7 rtlwifi: Fix randconfig build error with next-20140930
Configuration randconfig-1412075201 gets an error because driver rtl8821ae
depends on driver btcoexist, but Kconfig does not select it.

Reported-by: Jim Davis <jim.epost@gmail.com>
Cc: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:48 -04:00
Maithili Hinge 8342bdac42 mwifiex: add client mac address while configuring keys on GO.
When mwifiex device becomes GO, unicast traffic between client1 and GO stops
when client2 connects to GO. Reason behind this was PTK getting
overwritten by key_material command for client2 as it did not have client
mac address. So, client1 can no more decode GO's ping packets though it
responds to its broadcast packets.

This patch adds case to check for BSS_ROLE instead of bss_type to set
client mac address while configuring keys when device becomes GO.

Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:48 -04:00
Felix Fietkau 315dd1149b ath9k: fix getting tx duration for dynack
On AR9003, tx control and tx status are in separate descriptor rings.
Tx duration is extracted from the tx control descriptor data, which
ar9003_hw_proc_txdesc cannot access.

Fix getting the duration by adding a separate callback for it.

Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:48 -04:00
Sujith Manoharan 4d9f634b02 ath9k: Check early for HW reset
chan_lock is not required for checking if
we are in the middle of a HW reset, so do it
early. This also removes the small window
where the lock is dropped and reacquired.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:48 -04:00
Hante Meuleman 4eb3af7c1d brcmfmac: Add wowl support for PCIE devices.
Add basic wowl (magic packet and disconnect) support. This patch adds
this support only for PCIE bus devices. This feature requires FW which
has support for wowl built in.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:48 -04:00
Hante Meuleman 58b2251e96 brcmfmac: Fix crash on cleanup.
When driver gets unloaded due to error situation there is a chance
a packet gets received while fws has already been cleaned up. This
will result in kernel crash. This patch adds a check to avoid this
crash.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Arend van Spriel f48556e1b6 brcmfmac: assure P2P discovery is disabled when setting P2P_DEVICE mac address
In order to provision the P2P_DEVICE mac address using p2p_da_override iovar
the discovery interface must be disabled. On some targets setting the mac
address failed so disable the discovery interface to be certain.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Hante Meuleman 3ba0661099 brcmfmac: Avoid usage of GFP_ATOMIC.
Msgbuf is using GFP_ATOMIC where GFP_KERNEL is also sufficient. On
some platforms the coherent DMA memory is very limited when using
GFP_ATOMIC. This patch changes usage of GFP_ATOMIC to GFP_KERNEL and
uses worker to make this possible for creation of flowring.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Hante Meuleman ff0a623060 brcmfmac: Fix sign issue with IOCTL return code in msgbuf.
Need a cast to assure correct value is propagated.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Hante Meuleman ef8596e1f1 brcmfmac: On scan timeout do send received results.
Increase driver scan timeout from 8 to 10 seconds and report results
to cfg80211. Without this patch the already received results were
dropped on driver timeout.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Felix Fietkau 5fb9b1b949 ath9k_hw: fix PLL clock initialization for newer SoC
On AR934x and newer SoC devices, the layout of the AR_RTC_PLL_CONTROL
register changed. This currently breaks at least 5/10 MHz operation.
AR933x uses the old layout.

It might also have been causing other stability issues because of the
different location of the PLL_BYPASS bit which needs to be set during
PLL clock initialization.

This patch also removes more instances of hardcoded register values in
favor of properly computed ones with the PLL_BYPASS bit added.

Reported-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Felix Fietkau b874ec8d57 ath9k_hw: reduce ANI spur immunity setting on HT40 extension channel
The cycpwr_thr1 value needs to be lower on the extension channel than on
the control channel, similar to how the register settings are programmed
in the initvals.

Also drop the unnecessary check for HT40 - this register can always be
written. This patch has been reported to improve HT40 stability and
throughput in some environments.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:47 -04:00
Felix Fietkau 171cdab8c7 Revert "ath9k_hw: reduce ANI firstep range for older chips"
This reverts commit 09efc56345

I've received reports that this change is decreasing throughput in some
rare conditions on an AR9280 based device

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:46 -04:00
Avinash Patil b48f8800bb mwifiex: remove unnecessary rx_q lock
SKB lists have their own lock. So this lock is not needed.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30 13:17:46 -04:00