iwlwifi: mvm: reset beacon filtering and BT Coex data upon FW restart
When the firmware asserts, we restart the device and reset
the relevant data we hold in the driver. BT Coex data was
not reset and because of that, the driver wouldn't
reconfigure the firmware properly after firmware restart.
Same for beacon filtering. Fix that.
Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Tue, 15 Jul 2014 11:04:23 +0000 (14:04 +0300)]
iwlwifi: mvm: update smart fifo / beacon filtering upon association
When we associate, we may have heard the beacon before the
association. In that case, BSS_CHANGED_BEACON_INFO will be
set along with BSS_CHANGED_ASSOC in changes in
bss_info_change.
In this case, we didn't update the smart fifo nor beacon
filtering leaving those two feature disabled.
Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
iwlwifi: split fw-error-dump between transport and mvm
The mvm op_mode won't allocate the buffer for the transport
any more. The transport allocates its own buffer and mvm
is in charge of splicing the buffers in the debugfs hook.
This makes the repartition easier to handle.
Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
According to new requirements, the ACK / CTS kill mask is
not related to reduced TX power anymore. This allows to
remove the code that tracked reduced TX power enablement
across different interfaces.
The ACK / CTS kill mask is now fetch from a table. It
depends on the Activity grading (activity from BT) and on
the Look Up Table (LUT) type.
The Remain On Channel framework added to the firmare is
a bit like time events. It allows the driver to request
the firmware to be on a certain channel for a certain time.
Unlike the time events, the ROC infrastructure doesn't need
a MAC context in the firmware - it uses a generic context
called "auxiliary framework".
This is useful for any offchannel activity that is not bound
to a specific MAC.
The flow is synchronized much like with time events:
1) The driver receives an action frame from the wpa_supplicant
via nl80211 that requests to be sent offchannel.
2) The driver sends an Aux ROC command (0x53) to the firmware.
3) The firmware responds with the unique id of the time event.
4) When time event starts, the driver puts the frame in the
Aux queue.
Special care needs to be taken when the time events ends:
the queue needs to be cleaned-up.
Add new AUX ROC command that is intended for HS2.0 purposes.
It is used to send ANQP requests on a specific channel.
This command requests the firmware to trigger a time event
and remain on a certain channel for a given duration.
Triggering the time event is done by using the Aux
Framework in the firmware, and makes use of the Aux station
(similarly to scan).
Liad Kaufman [Thu, 8 May 2014 13:30:24 +0000 (16:30 +0300)]
iwlwifi: mvm: remove 8000 HW family setting of adc sampling on nic config
This patch removes the setting of the ADC sampling bits in
the mvm nic configuration. This setting is not required by
the firmware, and furthermore - it interferes with the DBGC
when it is running in DRAM mode on PCIe.
Arik Nemtsov [Thu, 15 May 2014 08:44:40 +0000 (11:44 +0300)]
iwlwifi: mvm: disallow new TDLS stations when appropriate
HW/FW constraints dictate that TDLS should only be used when a single
phy ctx is active. We also support at most 4 TDLS peers. We don't
support TDLS on a P2P vif.
Unify and move a phy-ctx counting implementation from the power-mgmt code
in order to simplify implementation.
An AP/GO may perform the channel switch slightly before its stations.
This scenario may result in packet loss, since the transmission may start
before the client is actually on a new channel. In order to prevent
potential packet loss disable tx to all the stations when the channel
switch flow starts. Clear the disable_tx bit when a station is seen on a
target channel, or after IWL_MVM_CS_UNBLOCK_TX_TIMEOUT beacons on a new
channel. In addition call ieee80211_sta_block_awake in order to inform
mac80211 that the frames for this station should be buffered.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
According to the spec, GO/AP should perform the channel switch just
before "beacon 0". However, since the exact timing isn't defined,
it may result in a sudden GO disappearance from the channel.
Prevent potential packet loss when performing the CS by scheduling
NoA time event and executing the channel switch flow when a notification
from fw is received.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Luciano Coelho [Wed, 5 Mar 2014 13:41:48 +0000 (15:41 +0200)]
iwlwifi: mvm: CSA unbind-bind flow support for client
Implement support for unbind-bind flow for the client roles. This
includes telling the firmware that we are not associated, removing
time-events, removing quotas and updating power management during the
actual switch, and redoing everything in the new channel.
Luciano Coelho [Tue, 20 May 2014 20:31:05 +0000 (23:31 +0300)]
iwlwifi: mvm: add switch_vif_chanctx operation
Implement the switch_vif_chanctx operation with support for a
single-vif and SWAP mode. The REASSIGN mode and multi-vifs are not
supported yet.
This operation needs to implement 4 steps, namely unassign, remove,
add and assign the chanctx. In order to do this, split out these
operations into locked and non-locked parts, thus allowing us to call
them while locked.
Additionally, in order to allow us to restart the hardware when
something fails, add a boolean to the iwl_mvm_nic_restart() function
that tells whether the restart was triggered by a FW error or
something else.
Johannes Berg [Fri, 6 Jun 2014 13:18:45 +0000 (15:18 +0200)]
iwlwifi: mvm: remove update type argument from quota update
It turns out that adding the update type argument was pointless as
quota update is never called from the add_interface() callback.
Therefore, IWL_MVM_QUOTA_UPDATE_TYPE_NEW isn't actually needed and
then only a "disabled_vif" argument is needed for the upcoming CSA
work.
Remove the whole enum iwl_mvm_quota_update_type and pass the right
arguments (always NULL for disabled vif right now) to the function
in all current call sites.
Johannes Berg [Fri, 23 May 2014 14:15:11 +0000 (16:15 +0200)]
iwlwifi: mvm: don't send zero quota to the firmware
There are some cases where we can currently send zero quota
for a valid binding, e.g. if we update while an interface is
bound to a channel context but not yet acting as an AP.
Avoid this by reordering the checks.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Luciano Coelho [Tue, 13 May 2014 19:28:35 +0000 (22:28 +0300)]
iwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vif
In some cases (e.g. when we're doing a channel switch), we may need to
disable the quota of a vif temporarily. In order to do so, add an
argument to the iwl_mvm_update_quotas() function to tell if the passed
vif is a new one or if it should be disregarded.
Eliad Peller [Wed, 11 Jun 2014 12:51:33 +0000 (15:51 +0300)]
iwlwifi: mvm: rs: don't clear persistent fields
iwl_mvm_rs_rate_init() is called multiple times to re-init
the rate scaling statistics (e.g. after some idle time).
It clears all the lq_sta sta, including some fields that
shouldn't be cleared (e.g. debugfs pointers). Fix it
by adding a new 'persistent' sub-struct, and
avoid clearing it on (re-)init.
Move the initialization of the persistent fields to
rs_alloc_sta instead.
iwlwifi: mvm: BT Coex - convert the sw boost update to new API
No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that, and open the patch to the updates.
Start the new BT Coex implementation.
Don't react to notifications for now - only the initial
configuration is implemented. The rest will happen in next
patches.
Since coex.c now uses the new the new structures in all
functions, we need to adapt the code to compile, even if it
doesn't run yet.
A new API is coming. This new API is not backward
compatible. So we need to keep the old commands to be able
to work with the former API.
Move all the current code into a new file: coex_legacy.
If a firmware with the new API is detected, we currently
just bail out since the implementation of the new API will
come in future patches.
Eran Harary [Wed, 11 Jun 2014 08:37:09 +0000 (11:37 +0300)]
iwlwifi: mvm: read the mac address in family 8000
In family 8000 products the MAC address in the OTP could be in either:
- WFPM address
- PCIE address
In sdio product we should read it from the WFPM, in pcie product we
should read it from the PCIe location.
This is relevant only from otp version 0xE08 and above.
While at it, fix the bytes order in version 0xE08.
iwlwifi: mvm: don't collect logs in the interrupt thread
Instead of reading all the data in the context of the
interrupt thread, collect the data in the restart flow
before the actual restart takes place so that the device
still has all the information.
Remove iwl_mvm_fw_error_sram_dump and move its content to
iwl_mvm_fw_error_dump.
Firmware folks seem say that this flag can make trouble.
Drop it. The advantage of CTS to self is that it slightly
reduces the cost of the protection, but make the protection
less reliable.
We should always prefer to use full RTS protection. Using
CTS to self gives a meaningless improvement, but this flow
is much harder for the firmware which is likely to have
issues with it.
Andrea Merello [Mon, 30 Jun 2014 16:19:40 +0000 (18:19 +0200)]
rtl818x_pci: fix pci probe returns success when it fails
There are several exit path from the PCI probe function.
Some of them, that are taken in case of errors, forget to set the "err"
variable, that is returned by the probe function.
This can lead to the kernel thinking the probe function succeeds while it
didn't, and this in turn causes extra calls to the "remove" function.
This patch fix this problem by ensuring "err" variable is assigned to a proper
non-zero value in each exit path.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:19:27 +0000 (18:19 +0200)]
rtl818x_pci: handle broken PIO mapping
All boards supported by this driver could work using PIO or MMIO for accessing
registers.
This driver tries to access HW by using MMIO, and, if this fails for somewhat
reason, the driver tries to fall back to PIO mode.
MMIO-mode is straightforward on all boards.
PIO-mode is straightforward on rtl8180 only.
On rtl8185 and rtl8187se boards not all registers are directly available in PIO
mode (they are paged).
On rtl8185 there are two pages and it is known how to switch page.
PIO mode works, except for only one access to a register out of default page,
recently added by me in the initialization code with patch:
rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-self
This can be easily fixed to work in both cases (MMIO and PIO).
On rtl8187se, for a number of reasons, there is much more work to do to fix PIO
access.
PIO access is currently broken on rtl8187se, and it never worked.
This patch fixes the said register write for rtl8185 and makes the driver to
fail cleanly if PIO mode is attempted with rtl8187se boards.
While doing this, I converted also a couple of printk(KERN_ERR) to dev_err(), in
order to make checkpatch happy.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:19:10 +0000 (18:19 +0200)]
rtl8180: disable buggy rate fallback mechanism
Currently the driver configures mac80211 to provide two rates for each TX frame:
One initial rate and one alternate fallback rate, each one with its retry count.
HW does not support fully this: rtl8180 doesn't have support for rate scaling at
all, and rtl8185/rtl8187SE supports it in a way that does not fit with mac80211:
The HW does automatically fall back to the next lower rate, and only a lower
limit can be specified, so the HW may TX also on rates in between the two rates
specified by mac80211. Furthermore only the total TX retry count can be
specified for each packet, while the number of TX attempts before scaling rate
can be configured only globally (not per each packet).
Currently the driver sets the HW auto rate fallback mechanism to quickly scale
rate after a couple of retries, and it uses the alternate rate requested by
mac80211 as fallback limit rate (and it does this even wrongly).
The HW indeed will behave differently than what mac80211 mandates, that is
probably undesirable, and the reported TX retry count may not refer to what
mac80211 thinks, and this could fool mac80211.
This patch makes the driver to declare to mac80211 to support only one rate
configuration for each packet, and it does disable the HW auto rate fallback
mechanism, relying only on SW and letting mac80211 to do all by itself.
This should ensure correct operation and fairness respect to mac80211.
Indeed here tests with iperf do not show significant performance differences.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:18:55 +0000 (18:18 +0200)]
rtl8180: fix incorrect TX retry.
HW is programmed with wrong retry count value for TX:
Mac80211 passes to driver the number of times the TX should be attempted.
The HW, instead, wants the number of time the TX should be retried if it fails
the first time (assuming we have to TX it at least one time).
This patch correct this.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:18:36 +0000 (18:18 +0200)]
rtl818x_pci: add comment pointing to the rtl8187se reference code
Rtl8187se support has been added to the rtl818x_pci driver by extracting a lot
of information from a rtl8187se Linux staging driver included in the kernel at
the time rtl8187se support was added.
The rtl818x_pci main file has a comment that advertises this.
Recently this staging driver has been removed from the kernel, but I still feel
it can be useful as "reference" code (in case of bugs, or to implement
improvements in rtl818x_pci driver).
This one-line patch adds a comment in rtl818x_pci driver to point people
searching for that "reference code" to the last kernel version still containing
it (3.14).
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:18:25 +0000 (18:18 +0200)]
rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-self
Measuring time between _end_ of CTS-to-self and _end_ of datapacket (with a
prism54 board and mac80211 hacked to let the MAC timestamp stay untouched in the
radiotap header) resulted in about 300uS, while the datapacket itself should be
by far shorter (less than 100uS) and IFS should be SIFS (10uS).
This measure was confirmed whith a scope: about 250uS IFS has been seen between
the two packets.
This situation causes the CTS-to-self protection mechanism to work incorrectly
due to the NAV expiring during, or even before beginning, the packet
transmission, and it also causes the performances to be anyway reduced due to
time waste.
This problem has been seen at every packet TXed with CTS-to-self enabled on
rtl8185 board.
rtl8187se seems not affected (and rtl8180, being a 802.11b card, does not have
CTS-to-self mechaninsm).
This patch fixes this by adding a magic register write, making the board wait
for correct SIFS after CTS-to-self packet.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andrea Merello [Mon, 30 Jun 2014 16:17:48 +0000 (18:17 +0200)]
rtl818x_pci: Fix BSSID register written incorrectly
BSSID register was written with six byte-writes.
It seems that, similarly to what happens with MAC registers, they needs to be
written with one 16-bit and one 32-bit writes, otherwise the write does not work.
The byte write didn't work only on my rtl8185, while it worked on rtl8180 and
rtl8187se, BTW since there are probably a number of different ASIC revisions out
of there, I let the change to affect all cards.
It shouldn't hurt anyway.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Fabian Frederick [Sat, 28 Jun 2014 12:18:52 +0000 (14:18 +0200)]
drivers/net/wireless/ipw2x00/libipw_module.c: remove unnecessary null test before kfree
Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rsi: fix memory leaks and error handling in rsi_91x_usb
The patch fixes a couple of issues:
- absence of deallocation of rsi_dev->rx_usb_urb[0] in the driver;
- potential NULL pointer dereference because of lack of checks for memory
allocation success in rsi_init_usb_interface().
By the way, it makes rsi_probe() returning error code instead of 1
and fixes comments regarding returning values.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Right now sleep duration is configured as beacon interval. It should be
the multiple of beacon interval by listen period which helps to
reduce station power consumption.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Earlier the listen interval is used to decide switching between
operating and off-channels during bgscan and to improve throughput,
the listen interval is reduced to 1. After optimiztion in scan
state machine, listen period is not used for decision making and
hence reverting it back to original value.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The beacon configurations are not cached properly after the station
associates with AP. Not handling BEACON_INFO, is failing to update
dtim period and also it is causing below warning message.
Thomas Gleixner [Thu, 12 Jun 2014 07:31:34 +0000 (08:31 +0100)]
wireless: mwifiex: Use the proper interfaces
Why is converting time formats so desired if there are proper
interfaces for this?
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Bing Zhao <bzhao@marvell.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Thomas corrected me on that I misunderstood Johannes' comment
for net_timedelta() and the ktime_get_real() usage inside
__net_timestamp().
Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: John W. Linville <linville@tuxdriver.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
p54: use request_firmware_direct() for optional EEPROM override
The p54 driver uses request_firmware() twice, once for actual
firmware and then another time for an optional user overide on
EEPROM, 3826.eeprom. The custom EEPROM is optional but if not
present we'll introduce an extra lag of 60 seconds with udev
present. Annotate we don't want udev nonsense here to avoid
the lag in case its not present.
- ret = request_firmware(&cf, config_file, dev);
+ ret = request_firmware_direct(&cf, config_file, dev);
if (ret < 0) {
... when != goto l;
when != return ret;
when any
} else {
...
release_firmware(cf);
...
}
Cc: Takashi Iwai <tiwai@suse.de> Cc: Christian Lamparter <chunkeey@googlemail.com> Cc: linux-wireless@vger.kernel.org Cc: cocci@systeme.lip6.fr Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Acked-By: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Tue, 24 Jun 2014 08:50:41 +0000 (10:50 +0200)]
b43: update list and code making a selection of firmware files
Clean ucode selection, fix choice of firmware for LCN, drop some goto-s,
add new devices.
Tested on 14e4:4312, 14e4:4315, 14e4:4328, 14e4:432b, 14e4:4353.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
For consistency with other drivers, replace a magic number by a macro.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
For consistency with other drivers, replace a magic number by a macro.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: John W. Linville <linville@tuxdriver.com>