There is no need to obtain physical device through
wil->pdev->dev path, as it is done by this macro.
The same device already stored as wiphy's device, thus
wil_to_dev() returns the same device as wil_to_pcie_dev()
Remove unnecessary macros, this allows to drop dependency
by pci.h in the firmware download code.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
RX_HTRSH interrupt is handled in exactly the same manner
as RX_DONE interrupt - fetching accumulated packets from RX
ring. In addition there's a rate limitted warning message.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Propagate reason for the disconnect through the relevant call chains:
- report to cfg80211 reason as reported by the firmware
- provide to the firmware reason as requested by cfg80211
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 30 Nov 2014 20:58:32 +0000 (21:58 +0100)]
ath9k: do not access hardware on IRQs during reset
Instead of killing interrupts during reset when the first one happens,
kill them before issuing the reset.
This fixes an easy to reproduce crash with multiple cards sharing the
same IRQ.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 30 Nov 2014 20:52:57 +0000 (21:52 +0100)]
ath5k: fix hardware queue index assignment
Like with ath9k, ath5k queues also need to be ordered by priority.
queue_info->tqi_subtype already contains the correct index, so use it
instead of relying on the order of ath5k_hw_setup_tx_queue calls.
Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 30 Nov 2014 19:38:40 +0000 (20:38 +0100)]
ath9k_hw: fix hardware queue allocation
The driver passes the desired hardware queue index for a WMM data queue
in qinfo->tqi_subtype. This was ignored in ath9k_hw_setuptxqueue, which
instead relied on the order in which the function is called.
Cc: stable@vger.kernel.org Reported-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter [Fri, 28 Nov 2014 09:43:40 +0000 (12:43 +0300)]
brcmsmac: NULL dereferences in brcms_c_detach_mfree()
The brcms_c_attach_malloc() function can call this with a NULL
"wlc->corestate" or "wlc->hw".
Also I threw in a bonus cleanup by deleting an obvious comment and a
no-op NULL assignment. :)
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Revert "rt2x00: Endless loop on hub port power down"
This reverts commit 2ad69ac5976191e9bb7dc4044204a504653ad1bb. It
causes wireless device disappear when we get -EPROTO error form USB
request. I encounter such situation occasionally when resume form
suspend with RT3070 adapter:
[ 289.619985] ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for offset 0x0404 with error -71
[ 289.639368] ieee80211 phy0: rt2800_wait_bbp_ready: Error - BBP register access failed, aborting
[ 289.639374] ieee80211 phy0: rt2800usb_set_device_state: Error - Device failed to enter state 4 (-5)
Without the patch, except printing error, device works just fine after
resume.
Currently after timeouts and REGISTER_BUSY_COUNT tuning, we should
not have any "endless loop", though we can wait quite long when driver
is trying to communicate with the device through non functioning USB
connection. Generally the problem that commit 2ad69ac597619 solves
is kinda artificial.
Cc: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Tue, 25 Nov 2014 19:55:53 +0000 (20:55 +0100)]
brcmutil: add helper function to format board revision
The board revision that is available in hardware can be translated
so it matches the labelling on the board. This is accomplished by
this helper function.
Reviewed-by: Hante Meuleman <meuleman@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>
rt2800: calculate tx power temperature compensation on selected chips
Currently implemented temperature compensation is only valid on some of
supported chips. Other chips do not need temperature compensation or
need different way to do this (not yet implemented in the rt2800
driver). Trying to do run rt2800_get_gain_calibration_delta() when this
is not appropriate on particular chip gives bogus result of TX power
and can make connection unstable.
This is follow up to commit 8c8d2017ba25c510ddf093419048460db1109bc4
"rt2800: fix RT5390 & RT3290 TX power settings regression". On that
commit we avoid setting BBP_R1 register, but the real problem is wrong
temperature compensation calculation.
Reported-and-tested-by: Ronald Wahl <ronald.wahl@raritan.com> Debugged-by: Ronald Wahl <ronald.wahl@raritan.com> Cc: Mike Romberg <mike-romberg@comcast.net> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Lino Sanfilippo [Fri, 28 Nov 2014 01:47:19 +0000 (02:47 +0100)]
wil6210: Fix potential memory leaks on error paths
Fix missing memory deallocation on error paths in wil_write_file_wmi()
and wil_write_file_txmgmt().
Reported-by: Ahmed Tamrawi <ahmedtamrawi@gmail.com> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michal Kazior [Tue, 25 Nov 2014 14:16:05 +0000 (15:16 +0100)]
ath10k: fix station count enforcement
The number of peers isn't directly translatable to
the number of stations because ath10k needs to
reserve a few extra peers for special cases like
multi-vif concurrency.
The previous limit was 126 and 15 stations in AP
mode for 10.x and main firmware branches
respectively. The limit is now 128 and 16 which
was the original intention.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 25 Nov 2014 14:16:04 +0000 (15:16 +0100)]
ath10k: clean up num_peers locking
The var was supposed to be protected by data_lock
but it wasn't so in all instances. It's actually
not necessary to have a spinlock protected
num_peers so drop it.
All instances of num_peers are already within
conf_mutex sections so use that.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Yanbo Li [Tue, 25 Nov 2014 10:24:48 +0000 (12:24 +0200)]
ath10k: add memory dump debugfs interface
Add mem_val debugfs file for dumping the firmware (target) memory and also for
writing to the memory. The firmware memory is accessed through one file which
uses position of the file as the firmware memory address. For example, with dd
use skip parameter for the address.
Beucase target memory width is 32 bits it's strongly recommended to use
blocksize divisable with 4 when using this interface. For example, when using
dd use bs=4 to set the block size to 4 and remember to divide both count and
skip values with four.
Yanbo Li [Tue, 25 Nov 2014 10:24:33 +0000 (12:24 +0200)]
ath10k: add register access debugfs interface
Debugfs files reg_addr and reg_val are used for reading and writing to the
firmware (target) registers. reg_addr contains the address to be accessed,
which also needs to be set first, and reg_value is when used for reading and
writing the actual value in ASCII.
To read a value from the firmware register 0x100000:
Sujith Manoharan [Tue, 25 Nov 2014 06:17:00 +0000 (11:47 +0530)]
ath10k: fix bug reported by lockdep
ath10k_tx_wep_key_work() acquires conf_mutex, so
cancelling it when conf_mutex is already taken
in ath10k_remove_interface() is incorrect, so
move it outside the lock.
Snippet from the lockdep report:
kernel: ======================================================
kernel: [ INFO: possible circular locking dependency detected ]
kernel: 3.18.0-rc5-wl-debug #34 Tainted: G O
kernel: -------------------------------------------------------
kernel: hostapd/451 is trying to acquire lock:
kernel: ((&arvif->wep_key_work)){+.+...}, at: [<ffffffff810872d5>] flush_work+0x5/0x290
kernel: but task is already holding lock:
kernel: (&ar->conf_mutex){+.+.+.}, at: [<ffffffffa0b99f00>] ath10k_remove_interface+0x40/0x290 [ath10k_core]
kernel: which lock already depends on the new lock.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Sujith Manoharan [Tue, 25 Nov 2014 06:16:58 +0000 (11:46 +0530)]
ath10k: fix shared WEP
When static keys are used in shared WEP, when a
station is associated, message 3 is sent with an
encrypted payload. But, for subsequent
authentications that are triggered without a
deauth, the auth frame is decrypted by the HW.
To handle this, check if the WEP keys have already
been set for the peer and if so, mark the
frame as decrypted. This scenario can happen
when a station changes its default TX key and initiates
a new authentication sequence.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 24 Nov 2014 14:34:08 +0000 (15:34 +0100)]
ath10k: don't drop corrupted mgmt frames
Some firmware revisions don't seem to deilver
management frames with FCS error via WMI so narrow
down the HTT rule to not drop corrupted management
frames.
This basically increases number of frames ath10k
reports while sniffing.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 24 Nov 2014 13:58:33 +0000 (14:58 +0100)]
ath10k: fix offchannel cancel failures
When mac80211 requests driver to cancel a hw roc
the driver must not call the expired() callback or
else roc will fail in some cases depending on how
things get scheduled.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 24 Nov 2014 13:58:31 +0000 (14:58 +0100)]
ath10k: fix offchan reliability
New firmware revisions don't need peer creation
when doing offchannel tx. Earlier revisions would
queue and never release frames without a peer.
This prevent new firmware revisions from stopping
replenishing wmi-htc tx credits and improves
reliability of offchannel tx which would sometimes
silently fail.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Ben Greear [Mon, 24 Nov 2014 14:22:10 +0000 (16:22 +0200)]
ath10k: use configured nss instead of max nss
When re-associating a station, the nss was set back to
maximum value even if user had configured small number
of tx chains. So, pay attention to user's config in
this case as well.
Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Ben Greear [Mon, 24 Nov 2014 14:22:10 +0000 (16:22 +0200)]
ath10k: apply chainmask settings to vdev on creation
It appears it takes more than just setting the
hardware's chainmask to make things work well. Without
this patch, a vdev would only use 1x1 rates when chainmask
was set to 0x3.
Setting the 'nss' (number of spatial streams) on the vdev
helps the firmware's rate-control algorithm work properly.
Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Amitkumar Karwar [Tue, 25 Nov 2014 14:43:06 +0000 (06:43 -0800)]
mwifiex: add Tx status support for ACTION frames
ACK status (0/1) for ACTION frames is informed to cfg80211. We
will extend existing logic used for EAPOL frames. The cfg80211
API is different here. Also, we need to explicitly free cloned
skb.
Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 25 Nov 2014 14:43:04 +0000 (06:43 -0800)]
mwifiex: skip delay main work logic for USB interface.
We had introduced delay main work logic to avoid processing
interrupts when Rx pending packet count reaches high threshold.
interrupt processing is restarted later when packet count
reduces lower threashold. This helped to reduce unnecessary
overhead and improve throughput for SD and PCIe chipsets.
As there are no interrupts for USB, we will skip this logic for
USB chipsets.
Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Lorenzo Bianconi [Mon, 24 Nov 2014 23:21:41 +0000 (00:21 +0100)]
ath9k: add TPC capability to TX descriptor path
Add TPC capability to TX descriptor path. Cap per-packet TX power according to
TX power per-rate tables. Currently TPC is supported just by AR9003 based chips
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Lorenzo Bianconi [Mon, 24 Nov 2014 23:21:40 +0000 (00:21 +0100)]
ath9k: add TX power per-rate tables
Add TX power per-rate tables for different MIMO modes (e.g STBC) in order to
cap the maximum TX power value per-rate in the TX descriptor path.
Cap TX power for self generated frames (ACK, RTS/CTS).
Currently TPC is supported just by AR9003 based chips
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Thu, 20 Nov 2014 21:27:02 +0000 (22:27 +0100)]
brcmfmac: correct .disconnect() callback while connecting
When the driver has sent a join iovar to the firmware it waits
for the events to report result of the connection. However, the
wpa_supplicant will request a .disconnect() after a timeout. So
upon calling .disconnect() the interface state may still be
CONNECTING. Clear the CONNECTING bit as well.
Reviewed-by: Hante Meuleman <meuleman@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>
Andreas Ruprecht [Mon, 24 Nov 2014 18:34:32 +0000 (19:34 +0100)]
net: wireless: rtlwifi: rtl8192ee: Fix compilation of the driver
In the Makefile for this driver, the wrong Kconfig option is used
to trigger the compilation of the object file. This leads to the
driver only being included into the kernel when both CONFIG_RTL8821AE
and CONFIG_RTL8192AE are set to "y".
Signed-off-by: Andreas Ruprecht <rupran@einserver.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andreas Ruprecht [Mon, 24 Nov 2014 18:34:31 +0000 (19:34 +0100)]
net: wireless: rtlwifi: Do not always include drivers in obj-m
In four of the rtlwifi drivers, the Makefile contains superfluous
statements indicating the compilation of the driver as an LKM
regardless of the corresponding Kconfig option.
If the corresponding option is set to 'y', the build system will then
see the object file in obj-m and obj-y, which leads to a compilation
as a built-in only. Even though this leads to the desired behavior,
the unconditional appearance in obj-m is confusing for someone reading
the Makefile.
This patch removes the superfluous Makefile statements.
Signed-off-by: Andreas Ruprecht <rupran@einserver.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Thu, 20 Nov 2014 21:26:59 +0000 (22:26 +0100)]
brcmfmac: fix static checker warning in pmklist handling
The patch fixes a static checker warning:
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c:2965
brcmf_cfg80211_set_pmksa()
warn: can 'pmkid_len' be negative?
The answer to the question above is likely no so changing its
type to unsigned is sufficient.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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>
John W. Linville [Mon, 24 Nov 2014 18:59:37 +0000 (13:59 -0500)]
Merge tag 'iwlwifi-next-for-john-2014-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
Emmanuel Grumbach <egrumbach@gmail.com> says:
"Major works are CSA and TDLS. On top of that I have a new
firmware API for scan and a few rate control improvements.
Johannes find a few tricks to improve our CPU utilization
and adds support for a new spin of 7265 called 7265D.
Along with this a few random things that don't stand out."
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ben Greear [Tue, 23 Sep 2014 21:17:19 +0000 (14:17 -0700)]
ath10k: add ATH10K_DBG_WMI_PRINT debug level
There are not many of these messages producted by the
firmware, but they are generally fairly useful, so make it easy to print them
with a separate debug level.
kvalo: fix commit log, rename debug level
Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Johannes Berg [Fri, 21 Nov 2014 16:58:49 +0000 (18:58 +0200)]
ath10k: don't rebuild all the time
There are better ways to get the kernel information, use the
utsname and omit the version code entirely since it's duplicate.
The version magic is rather useless anyway
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Eyal Shapira [Tue, 18 Nov 2014 14:43:55 +0000 (16:43 +0200)]
iwlwifi: mvm: declare support for VHT BF info in radiotap
The driver knows whether an rx frame was beamformed and marks
it in the radiotap VHT flags. However it should also declare
that it knows to extract this info otherwise this gets discarded
by sniffers like Wireshark.
Luciano Coelho [Thu, 20 Nov 2014 06:59:51 +0000 (08:59 +0200)]
iwlwifi: mvm: treat netdetect wake up separately
When the device wakes up due to netdetect, we need to query different
things from the firmware than when it wakes up with a normal WoWLAN.
To make this easier, separate the netdetect wake up handling from the
rest. For now, we don't send netdetect as a wake up reason, treating
it as a non-wireless wake up.
Refactor the iwl_mvm_query_wakeup_reasons() function to split the part
that gets the firmware status from the part that sets up the WoWLAN
status. This will allow netdetect to reuse the code.
Luciano Coelho [Wed, 19 Nov 2014 20:35:37 +0000 (22:35 +0200)]
iwlwifi: mvm: refactor wowlan and netdetect configuration when suspending
We need to send a WOWLAN_CONFIGURATION command also for netdetect and
configure the rfkill release trigger if needed. To do so, refactor
the code that configures wowlan and netdetect when suspending and send
the WOWLAN_CONFIGURATION command also for net_detect.
Luciano Coelho [Fri, 24 Oct 2014 07:39:51 +0000 (10:39 +0300)]
iwlwifi: mvm: add support for net detect
Add the net detect WoWLAN flag to indicate support and use the
nd_config from the WoWLAN configuration to start net detect, if it is
set. The WoWLAN configuration takes precedence over the debugfs
configuration.
Luciano Coelho [Mon, 10 Nov 2014 09:10:21 +0000 (11:10 +0200)]
iwlwifi: mvm: protect session during CSA
When another vif is also running during a channel switch, we need to
use a session protection when we move to the new channel, so that we
don't miss the beacons. Without this, sometimes the other vif
repeatedly gets time exactly when we should be hearing the beacons,
preventing channel switch from completing. Adding a session
protection that lasts from the moment the channel changes until 2
TBTTs later, ensures that we will hear the beacons on the destination
channel.
Luciano Coelho [Mon, 10 Nov 2014 09:10:20 +0000 (11:10 +0200)]
iwlwifi: mvm: clear TE data if CSA time event fails to start
If setting the CSA time event fails, we must clear the TE data,
otherwise we'll try to remove it when, for instance, a disconnection
occurs, causing a SYSASSERT.
Luciano Coelho [Mon, 10 Nov 2014 09:10:18 +0000 (11:10 +0200)]
iwlwifi: mvm: disable beacon filtering during CSA
After a channel switch, transmission on the new channel is only
started once we see a beacon on it. Thus, beacon filtering needs to
be disabled during channel switch so that mac80211 receives this
beacon and finishes the process.
Luciano Coelho [Mon, 10 Nov 2014 09:10:17 +0000 (11:10 +0200)]
iwlwifi: mvm: add a channel_switch op to bypass mac80211 timer
We need to call ieee80211_chswitch_done() ourselves just when the
absence TE started, so we perform the actual context switch early
enough. To do so, add a dummy channel_switch op, which will cause
mac80211 to skip the countdown timer and allow us to call
ieee80211_chswitch_done() to complete the operation.
Luciano Coelho [Mon, 10 Nov 2014 09:10:16 +0000 (11:10 +0200)]
iwlwifi: mvm: finalize on post_switch instead of unassign
Now that mac80211 waits for the first beacon on the new channel before
calling post_channel_switch, the reconfiguration of the firmware
should be done in the post_channel_switch operation instead of when
assigning the vif to the new context.
Luciano Coelho [Mon, 10 Nov 2014 09:10:15 +0000 (11:10 +0200)]
iwlwifi: mvm: schedule CSA time event a bit before beacon 1
Instead of using a hardcoded number of TUs before beacon 0 as the time
to start the absence and actual channel switch, calculate it in
relation to the beacon interval. We use 10 TUs + beacon interval
before beacon 0 to target a bit before beacon 1. This gives us enough
time to switch to the new channel before the AP/GO switches.
Luciano Coelho [Mon, 10 Nov 2014 09:10:14 +0000 (11:10 +0200)]
iwlwifi: mvm: add CSA absent time event for clients
Add an absent time event when pre_channel_switch is called and use the
time event started indication to set the disable_tx bit instead of
doing it in unassign_vif(). This is done so that the firmware queues
are stopped before the actual switch takes place to avoid losing
packets while the AP/GO is performing its actual switch.
Luciano Coelho [Mon, 10 Nov 2014 09:10:13 +0000 (11:10 +0200)]
iwlwifi: mvm: use switching_chanctx argument instead of csa_active
Now that all CSA flows are using the switch_vif_chanctx op, we can
rely on the switching_chanctx boolean that is passed to the
__iwl_mvm_assign_vif_chanctx() and __iwl_mvm_unassign_vif_chanctx()
functions to decide whether the context switch flows need to be
executed. In this way we make the chanctx switch flow more generic,
without having to rely on the csa_active flag being set.
iwlwifi: mvm: Handle failed beacon transmissions during CSA
The spec requires to decrement the CSA counters based on TBTT,
regardless if the beacon was actually transmitted. Previously, the fw
would send beacon notifications only for successfully transmitted
beacons. This behavior resulted in inaccurate CSA countdown. In order
to address this issue, the fw was changed to send beacon
notifications also for not transmitted beacons. Such notifications
have TX_STATUS_INTERNAL_ABORT (0x92).
Don't start the CSA countdown before first successfully transmitted
beacon, in order to guarantee that the CSA is announced for a
required period.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Luciano Coelho [Mon, 10 Nov 2014 09:10:10 +0000 (11:10 +0200)]
iwlwifi: mvm: return the actual error code when switch_vif_chanctx fails
We have code to recover and go back to the original channel context if
something fails in the middle of switch_vif_chanctx, but we return the
error code of the recover calls instead of the original code, so if
the recovery succeeds, we will return 0 (success). Fix this by not
assigning the return value of the recovery calls to ret.
Luciano Coelho [Mon, 10 Nov 2014 09:10:09 +0000 (11:10 +0200)]
iwlwifi: mvm: add support for CHANCTX_SWMODE_REASSIGN_VIF
Add support to reassign vif in switch_vif_chanctx. This is similar to
the existing CHANCTX_SWMODE_SWAP_CONTEXTS mode, but doesn't delete the
old context nor creates a new one, doing to switch between two
existing contexts.
Luciano Coelho [Mon, 10 Nov 2014 09:10:08 +0000 (11:10 +0200)]
iwlwifi: mvm: refactor iwl_mvm_switch_vif_chanctx to support other modes
Currently we only support the CHANCTX_SWMODE_SWAP_CONTEXTS mode, but
we need to support other modes as well. Spin a new function off in
order to make it easier to support other modes.
Luciano Coelho [Mon, 10 Nov 2014 09:10:07 +0000 (11:10 +0200)]
iwlwifi: mvm: only save csa_vif in AP/GO mode
We only need the csa_vif in AP/GO modes, and assigning for other
interfaces may cause problems, because csa_vif is never cleared. To
prevent this, only assign the value if the iftype is
NL80211_IFTYPE_AP. Use a switch to do this, even though, for now,
only the AP interface type is handled, because soon other interface
types will be added as well.
Additionally, convert the WARN() in the error case when a
channel-switch is already running to WARN_ONCE().
Maintain a TDLS channel-switch state and update it according to
notifications from FW and timeouts. Explicitly check all state
transitions are valid.
When switching is initiated by mac80211, use a delayed work to
periodically reschedule it from iwlwifi.
Give the FW mac80211 generated TDLS channel-switch request/response
templates. It will change appropriate values (switch timings) and Tx
them at appropriate times.
Enable the channel switch wiphy capability bit when the FW supports it.
iwlwifi: mvm: use private TFD queues for TDLS stations
When adding a TDLS station, allocate 4 new queues for it. Configure them
to FW and enable them. On station removal, drain the queues if needed
and disable them when empty.
Make sure to flush all packets in the private queues of TDLS stations in
the mac80211 flush() callback.
When TDLS peers are present the FW will send packets on a dedicated
TID vs. the peer when performing TDLS channel-switches. The driver
configures the TID on connection to the peer and the FW is responsible
for maintaining the state of QoS seqno and PN/IV for encryption.
If the FW asserts, the driver cannot correctly reconfigure the starting
seqno/PN to the reloaded FW, thus forcing us to reconnect the peer.
TDLS stations will have private queues, so consider them as well when
allocating a new one. Consolidate the HW-queue iterating code into
a single exported function, to be used by the TDLS code in the future.
Send a dedicated TDLS_CONFIG command when a TDLS peer joins/leaves. The
fields for the command are mostly place-holders, as most of the FW
functionality is not implemented. In the future the dedicated FW TID
will be used for channel-switching and buffer-sta functionality.