Commit Graph

742 Commits (eff8c76aa02275a7b325e0fa93cc349380299fde)

Author SHA1 Message Date
Tomislav Požega 061541f207 mac80211: rt2x00: add r calibration
Add r calibration code as found in mtk driver.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
6 years ago
Tomislav Požega 66929e3414 mac80211: rt2x00: add RF self TXDC calibration
Add TX self calibration based on mtk driver.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
6 years ago
Tomislav Požega 6044682b83 mac80211: rt2x00: write registers required for reducing power consumption
Write registers required for reducing power consumption like the vendor
driver does when ADJUST_POWER_CONSUMPTION_SUPPORT is set.
This helps devices to sync at better TX/RX rates and improves overall
performance.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: edited commit message]
6 years ago
John Crispin d9eefa7a70 mac80211: rebase ontop of v4.18.5
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Felix Fietkau a32a70f4f2 ath9k: add back support for using tx99 with active monitor interfaces
Fixes controlling bitrate

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 7decdf923a mac80211: fix tx queue allocation for active monitor interfaces
Fixes a crash with drivers like ath9k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau ccab68f2d3 ath9k: fix unloading the module
Registering a GPIO chip with the ath9k device as parent prevents unload,
because the gpiochip core increases the module use count.
Unfortunately, the only way to avoid this at the moment seems to be to
register the GPIO chip without a parent device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki b3d441c5f7 mac80211: brcmfmac: backport CYW89342 support & fixes from 4.20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Koen Vandeputte 77024a9d95 mac80211: backport upstream fixes
Backport most significant upstream fixes (excl. hwsim fixes)
Refreshed all patches.

Contains important fixes for CSA (Channel Switch Announcement)
and A-MSDU frames.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Felix Fietkau d9792152fd ath9k: fix setting up tx99 with a monitor mode interface
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Antonio Silverio 672c430d6e mac80211: mwl8k: Expand non-DFS 5G channels
Add non-DFS 5G upper channels (149-165) besides existed 4 lower channels
(36, 40, 44, 48).

Signed-off-by: Antonio Silverio <menion@gmail.com>
6 years ago
Rafał Miłecki fecbd91c7c mac80211: brcmfmac: backport patch for per-firmware features
This allows driver to support features that can't be dynamically
discovered.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Sven Eckelmann ef39d0079b mac80211: ath10k: Limit available channels via DT ieee80211-freq-limit
Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
the RX and TX path. These filtered channel can in theory still be used by
the hardware but the signal strength is reduced so much that it makes no
sense.

There is already a DT property to limit the available channels but ath10k
has to manually call this functionality to limit the currrently set wiphy
channels further.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Rafał Miłecki c0608c6a27 mac80211: brcmfmac: backport 4.19 patches preparing monitor mode support
Monitor mode isn't supported yet with brcmfmac, it's just an early work.
This also prepares brcmfmac to work stable with new firmwares which use
updated struct for passing STA info.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki b26214adb5 mac80211: backport brcmfmac fixes & debugging helpers from 4.18
The most important is probably regression fix in handling platform
NVRAM. That bug stopped hardware from being properly calibrated breaking
e.g. 5 GHz for Netgear R8000.

Other than that it triggers memory dumps when experiencing firmware
problems which is important for debugging purposes.

Fixes: 7e8eb7f309 ("mac80211: backport brcmfmac firmware & clm_blob loading rework")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Ansuel Smith 2dcd955aea mac80211: backport and update patches for ath10k
This commit refreshes and updates the VHT160 ath10k support fix patches
and adds a number of backports from ath-next:

 * 8ed05ed06fca ath10k: handle tdls peer events
 * 229329ff345f ath10k: wmi: modify svc bitmap parsing for wcn3990
 * 14d65775687c ath10k: advertise TDLS wider bandwidth support for 5GHz
 * bc64d05220f3 ath10k: debugfs support to get final TPC stats for 10.4 variants
 * 8b2d93dd2261 ath10k: Fix kernel panic while using worker (ath10k_sta_rc_update_wk)
 * 4b190675ad06 ath10k: fix kernel panic while reading tpc_stats
 * be8cce96f14d ath10k: add support to configure channel dwell time
 * f40105e67478 ath: add support to get the detected radar specifications
 * 6f6eb1bcbeff ath10k: DFS Host Confirmation
 * 260e629bbf44 ath10k: fix memory leak of tpc_stats
 * 38441fb6fcbb ath10k: support use of channel 173
 * 2e9bcd0d7324 ath10k: fix spectral scan for QCA9984 and QCA9888 chipsets

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[move backported patches in the 3xx number space, bring in upstream order,
 replace incomplete patch files with git format-patch ones, rewrite commit
 message, fix subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Sven Eckelmann 87493dac11 mac80211: initialize sinfo in cfg80211_get_station
Most of the implementations behind cfg80211_get_station will not initialize
sinfo to zero before manipulating it. For example, the member "filled",
which indicates the filled in parts of this struct, is often only modified
by enabling certain bits in the bitfield while keeping the remaining bits
in their original state. A caller without a preinitialized sinfo.filled can
then no longer decide which parts of sinfo were filled in by
cfg80211_get_station (or actually the underlying implementations).

cfg80211_get_station must therefore take care that sinfo is initialized to
zero. Otherwise, the caller may tries to read information which was not
filled in and which must therefore also be considered uninitialized. In
batadv_v_elp_get_throughput's case, an invalid "random" expected throughput
may be stored for this neighbor and thus the B.A.T.M.A.N V algorithm may
switch to non-optimal neighbors for certain destinations.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
John Crispin 66c5696cdf mac80211: rtl8xxxu: drop support patches
After a very enlightening but unfortunately far too short exchange with Jes
we mutually agreed to drop the patches. They are unfortunately not ready
yet.

Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Mathias Kresin 60deb3cdef mac80211: ath10k: use tpt LED trigger by default
Use the tpt LED trigger for each created phy led. Ths way LEDs attached
to the ath10k GPIO pins are indicating the phy status and blink on
traffic.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
John Crispin cac1a4be66 mac80211: drop 355-ath9k-limit-retries-for-powersave-response-frames.patch
several people reported this bug to be causing drop out issues

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Ansuel Smith 134e832814 mac80211: ath10k fix vht160 firmware crash
When the 160mhz width is selected the ath10k firmware crash. This fix this problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
6 years ago
Ansuel Smith 61d57a2f88 mac80211: ath10k add leds support
This adds support for leds handled by the wireless chipset.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
6 years ago
Rafał Miłecki c446e38c86 mac80211: backport brcmfmac changes from kernel 4.18
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 7e8eb7f309 mac80211: backport brcmfmac firmware & clm_blob loading rework
It backports remaining brcmfmac changes from 4.17.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 3c8bb92655 mac80211: backport brcmfmac data structure rework
It backports brcmfmac commits from kernel 4.17.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 0da9303e5b mac80211: backport "brcmfmac: cleanup and some rework" from 4.17
It was described by Arend as:

> This series is intended for 4.17 and includes following:
>
>  * rework bus layer attach code.
>  * remove duplicate variable declaration.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Sven Eckelmann 4270847a2c mac80211: ath10k: Allow to enable the thermal code of ath10k
Some ath10k firmware versions allow to access the chip internal a
temperature sensor and allow to reduce the amount of the time when the card
is allowed to send. The latter is required on devices which tend to
overheat.

An userspace service has to read
/sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input regularly and
then decide how much the device has to be throttled. This can be done by
writing to /sys/class/ieee80211/phy*/device/cooling_device/cur_state. By
default it is not throttled (0) but it can be throttled up to 100(%).

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Daniel Golle f4a639a3d7 mac80211: rt2x00: no longer use TXOP_BACKOFF for probe frames
Import a revert-commit from Stanislaw Gruszka which significantly
improves WiFi performance on rt2x00 based hardware.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
John Crispin 83fb9ec5e0 ath79: make ahb wifi work
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Thomas Hebb 751746c736 mac80211: update patch to read ath10k variant from DT
This patch was revised upstream before being merged, and OpenWrt's copy
was never updated to reflect the revision.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
[refreshed patches]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Stefan Lippers-Hollmann a330ecebf5 mac80211: ath10k: Suppress "Unknown eventid: 36925" warnings
Merge upstream patch from Sathishkumar Muruganandam
<murugana@codeaurora.org> for OpenWrt's backports package:
https://lkml.kernel.org/r/<1522049641-19521-1-git-send-email-murugana@codeaurora.org>
Commit-ID: 606204bb863fa3b0bb54929d79b4dc46338f9180

* FW has Smart Logging feature enabled by default for detecting failures
* and processing FATAL_CONDITION_EVENTID (36925 - 0x903D) back to host.
*
* Since ath10k doesn't implement the Smart Logging and FATAL CONDITION
* EVENT processing yet, suppressing the unknown event ID warning by moving
* this under ATH10K_DBG_WMI.
*
* Simulated the same issue by having associated STA powered off when
* ping flood was running from AP backbone. This triggerd STA KICKOUT
* in AP followed by FATAL CONDITION event 36925.
*
* Issue was reproduced and verified in below DUT
* ------------------------------------------------
* AP mode of OpenWRT QCA9984 running 6.0.8 with FW ver 10.4-3.5.3-00053
*
* Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Hauke Mehrtens 51e4868fc9 mac80211: Fix loading of rsi_sdio module
When CONFIG_PM was not set rsi_sdio_reinit_device() was not compiled
into the driver but referenced.
This is a backport form the mainline Linux kernel.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Evgeniy Didin 36314c12c0 mac80211: add RedPine RS9113 module support
RedPine RS9113 wireless module requires rsi91x driver to be built
and linux-firmware/rsi/rs9113_wlan_qspi.rps to be installed.
Also we add patch for successful compilation of rsi91x driver.

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: John Crispin <john@phrozen.org>
6 years ago
Rafał Miłecki 0f1a1489a6 mac80211: backport brcmfmac fixes from 4.16
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau e062bd8563 mac80211: avoid changing skb truesize in A-MSDU aggregation
Should fix recently reported data corruption issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Christian Lamparter e713b5ba6f mac80211: ath10k: search all IEs for variant before falling back
This patch adds the patch that was posted to ath10k-devel ML:
<https://patchwork.kernel.org/patch/10233491/>
|From: Thomas Hebb <tommyhebb@gmail.com>
|Subject: [PATCH] ath10k: search all IEs for variant before falling back
|Date: Wed, 21 Feb 2018 11:43:39 -0500
|[...]
|This patch fixes the issue by first searching the entire file for the ID
|with variant, and searching for the fallback ID only if that search
|fails. It also includes some code cleanup in the area, as
|ath10k_core_fetch_board_data_api_n() no longer does its own string
|mangling to remove the variant from an ID, instead leaving that job to a
|new flag passed to ath10k_core_create_board_name().
|
|I've tested this patch on a QCA4019 and verified that the driver behaves
|correctly for 1) both fallback and variant BDFs present, 2) only fallback
|BDF present, and 3) no matching BDFs present.
|
|Fixes: 1657b8f84ed9 ("ath10k: search SMBIOS for OEM board file extension")
|Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

Note: 937-ath10k-calibration-variant.patch has been reassigned a new 081
number, as it now ships with upstream.... But also because this patch
requires the change in ath10k_core_create_board_name().

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Felix Fietkau 916277a033 mac80211: minstrel: make short preamble CCK available when not used at connect time
The BSS short preamble state can change without rate control
update notification.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 6011f7bcf0 mac80211: fix a tx queue memory accounting error
Fixes rare hard to trigger tx hangs after some time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 11d70f0600 mac80211: avoid sampling rates that are too slow, improves throughput
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki 9046e921af mac80211: brcmfmac: better logging of firmware api errors
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 9543fb1ecd mac80211: brcmfmac: backport remaining changes from 4.16
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 8d78cccc6e mac80211: brcmfmac: enlarge caps buffer & final sdio restructuring
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 66bdf62a2a mac80211: brcmfmac: restructuring sdio access functions - take 2
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki bb04b7ced7 mac80211: brcmfmac: restructuring sdio access functions
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki e52e8480ad mac80211: brcmfmac: backport remaining changes from 4.15
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki c29a2a4283 mac80211: brcmfmac: firmware halt and scan cleanup
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 81542331cb mac80211: reorder patches putting backports first
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau 1f427bd616 mac80211: add a missing check to the last minstrel fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki a186c2ab70 mac80211: rename patches accepted upstream
This is to simplify maintenance. It's easy to say now which patches need
some extra work and/or sending upstream. Updating to newer backports
should be also simpler with this.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau 2389ebbd48 Revert "ath: do not apply broken power limits with ATH_USER_REGD"
This reverts commit 79a768a90f.
Some devices can go over their power limits with this commit, so this
needs to be handled on a case by case basis instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau cc19aa3e71 mac80211: update the A-MSDU fast-rx patch to the latest version
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau d59c6b53f4 mac80211: add more minstrel fixes
Improves 2.4 GHz throughput

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 55bd80f6d8 mac80211: fix regression introduced by the recent minstrel changes
The cck rates array needs to be initialized for both the minstrel and
the minstrel_ht variant

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau c4c64f5305 mac80211: add an optimization for fast-rx support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau fb1be20d63 mac80211: sync fast-rx patch with updated version
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 393661640b mac80211: fix various issues with fast-rx mode
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 848a4abf27 ath9k: merge a RCU fix for station tx cleanup
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau c8d07575e5 mac80211: add minstrel improvements/fixes
- Simplify debugfs code
- Reduce size
- Fix handling of CCK rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 526921f20e mac80211: round up tx status headroom
Fixes unaligned access exceptions in mt76 when transmitting beacons

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Matthias Schiffer bf1032d71f
mac80211: replace revert for 11s compatiblity with upstream fix
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer d58c8f4029
mac80211: revert "wireless: set correct mandatory rate flags"
Revert upstream commit 1bd773c077de "wireless: set correct mandatory rate
flags", as it breaks 11s interoperability: nodes can only associate when
neither or both have this patch. As this is a regression from released
versions, revert to the old code for now.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Felix Fietkau 166741240a mac80211: mesh: drop frames appearing to be from us
Upstream backport to fix issues arising from devices with duplicate MAC
addresses

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau e2c0e904c0 ath9k: discard undersized packets
Sometimes the hardware will push small packets that trigger a WARN_ON
in mac80211. Discard them early to avoid this issue.

Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Matthias Schiffer e9fa0b9f3a
ath9k, ath10k(-ct): move spectral scan support under a separate config symbol
Backport patches that separate spectral scan support from general debugfs
support of ath9k/ath10k; this allows to remove the dependency on
KERNEL_RELAY from these driver packages even with debugfs enabled and
avoids the memory footprint of the relay buffers allocated by ath9k/ath10k
even when they aren't used at all.

The KERNEL_RELAY dependency is moved to a new config symbol that enables
spectral scan support in these drivers.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Sven Eckelmann f39fc67c8e mac80211: ath10k: search DT for BDF variant info
Board Data File (BDF) is loaded upon driver boot-up procedure. The right
board data file is identified on QCA4019 using bus, bmi-chip-id and
bmi-board-id.

The problem, however, can occur when the (default) board data file cannot
fulfill the vendor requirements and it is necessary to use a different
board data file.

This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
Something similar has to be provided for systems without SMBIOS but with
device trees. No solution was specified by QCA and therefore a new one has
to be found for ath10k.

The device tree requires addition strings to define the variant name

    wifi@a000000 {
    	status = "okay";
    	qcom,ath10k-calibration-variant = "RT-AC58U";
    };

    wifi@a800000 {
    	status = "okay";
    	qcom,ath10k-calibration-variant = "RT-AC58U";
    };

This would create the boarddata identifiers for the board-2.bin search

 *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
 *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
6 years ago
Felix Fietkau 111b499024 mac80211: tweak TSQ settings
Latencies can be much higher on wifi devices, especially with
aggregation. Tune the network stack setting introduced in the previous
commit to account for that.
This commit reintroduces the previously reverted one with a fix for the
crash issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 47fa8654a1 Revert "mac80211: tweak TSQ settings"
This reverts commit 2dc485250d.
This patch needs some additional checks in order to avoid overwriting
unrelated fields for request sockets.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6a6dc94e0c mac80211: fix a race condition that could lead to a use-after-free on a timer
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9247864b6e mac80211: fix netlink family id for nl80211 messages
Fixes responses for nl80211 calls

Reported-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 2dc485250d mac80211: tweak TSQ settings
Latencies can be much higher on wifi devices, especially with
aggregation. Tune the network stack setting introduced in the previous
commit to account for that

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f9fa266faf mac80211: update to wireless-testing 2017-11-01
The wireless regdb is now loaded via firmware loading, CRDA support and
built-in regdb support have been removed.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Mathias Kresin 8d3857a347 ath9k: unset the default LED pin if used by platform buttons
Unset the default LED gpio pin if the same gpio pin is used by a button
defined via platform button. It prevents the change of the GPIO value
on wireless up/down or wireless traffic.

Fixes: FS#1129

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Jonas Gorski 1dcd8e7cf1 mac80211: backport fixes for fix for CVE-2017-13080
Backport two fixes for the fix of CVE-2017-13080, preventing side channel
attacks and making it work for TKIP.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 years ago
Stijn Tintel 2f701194c2 mac80211: backport kernel fix for CVE-2017-13080
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Felix Fietkau 5bd006aa26 mac80211: fix tx power regression
Revert an accidental change that was introduced by having an old version
of the patch in my git tree, which was merged in 609208597b

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 609208597b mac80211: update to wireless-testing 2017-10-06
Rework the code to get rid of some extra kernel module dependencies
introduced in the last update.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens ba1aedafeb mac80211: fix compile error on PowerPC (PPC_85xx)
Including linux/interrupt.h in linux/hrtimer.h causes this error message
on PowerPC builds on x86, ARM and MIPS it works:

  CC [M]  /backports-4.14-rc2-1/compat/main.o
In file included from /backports-4.14-rc2-1/backport-include/linux/printk.h:5:0,
                 from ./include/linux/kernel.h:13,
                 from /backports-4.14-rc2-1/backport-include/linux/kernel.h:3,
                 from ./include/linux/list.h:8,
                 from /backports-4.14-rc2-1/backport-include/linux/list.h:3,
                 from ./include/linux/module.h:9,
                 from /backports-4.14-rc2-1/backport-include/linux/module.h:3,
                 from /backports-4.14-rc2-1/compat/main.c:1:
./include/linux/ratelimit.h: In function 'ratelimit_state_exit':
./include/linux/ratelimit.h:62:11: error: dereferencing pointer to incomplete type 'struct task_struct'
    current->comm, rs->missed);
           ^
./include/linux/printk.h:279:37: note: in definition of macro 'pr_warning'
  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                     ^
./include/linux/ratelimit.h:61:3: note: in expansion of macro 'pr_warn'
   pr_warn("%s: %d output lines suppressed due to ratelimiting\n",
   ^

The backport of the hrtimer_start() functions needs the
linux/interrupt.h because some parts are defined there. Fix this by
moving the hrtimer_start() backport to the linux/interrupt.h backport
header file.

Fixes: a8f63a0717f5: ("mac80211: update to backports-4.14-rc2")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens a8f63a0717 mac80211: update to backports-4.14-rc2
This updates mac80211 to backprots-4.14-rc2.
This was compile and runtime tested with ath9k, ath10k and b43
with multiple stations and ieee80211w and in different scenarios by many
other people.

To create the backports-4.14-rc2-1.tar.xz use this repository:
https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git
from tag v4.14-rc2-1

Then run this:
./gentree.py --git-revision v4.14-rc2 --clean  <path to linux repo> ../backports-4.14-rc2-1

This also adapts the ath10k-ct and mt76 driver to the changed cfg80211
APIs and syncs the nl80211.h file in iw with the new version from
backports-4.14-rc2.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 1b2c93988f mac80211: add dev_coredumpm() function
dev_coredumpm() was added with kernel 4.7, but it is used by iwlwifi.
When the dev coredump framework form compat-wireless is used this is not
a problem because it already contains this, but this is deactivated if
the build system finds out that it is already included in the kernel we
compile against. This option was now activated by the bluetooth driver
btmrvl. Having dev coredump in the kernel adds about 400 bytes to the
lzma compressed kernel for brcm47xx.

This is copied from a more recent backports version to add the
dev_coredumpm() function when the internal core devdump is not used.

Fixes: a5922f6 ("kernel: bluetooth: add marvell sdio bluetooth module")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Toke Høiland-Jørgensen 76c3a033f6 ath10k: Re-enable intermediate softqueues for all devices
The upstream ath10k driver disables the intermediate softqueues for some
devices. This patch reverts that behaviour and always enables the
softqueues (and associated bufferbloat fixes). We have had reports of people
running this with good results:
https://lists.bufferbloat.net/pipermail/make-wifi-fast/2017-September/001497.html

This also refreshes mac80211 patches.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
7 years ago
Felix Fietkau ea72f22bdf ath9k: fix regression in multicast buffering fix
Update the more data flag on the last frame, but tx from the first frame
on.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 35868234e7 ath9k: fix typo in US tx power reduction fix
Use max_t instead of min_t to prevent the value from going below zero

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 22a74ed310 ath9k: fix more-data flag for buffered multicast packets
The flag needs to be cleared for the last packet in the list, not the
first one. Fixes some issues with multicast packet loss for powersave
clients connected to an ath9k AP.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9b6585b11a ath9k: adjust tx power reduction for US regulatory domain
FCC regulatory rules allow for up to 3 dBi antenna gain. Account for
this in the EEPROM based tx power reduction code.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 45572fe831 mac80211: refresh patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Pavel Kubelun 025cb640cd ath10k: increase bmi timeout to fix OTP on qca99xx boards and add bmi identification through pre-cal file
Backporting upstream patches.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [refresh, rename patches]
7 years ago
Felix Fietkau c6c1f6a548 mac80211: use KERNEL_MAKEOPTS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Golle 5e5499c612 mac80211: rt2x00: remove unneccessary code
Use chanreg and dccal helpers to reduce the size of ePA code.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: fixed white-space so patch applies]
7 years ago
Chris Blake ad0c1d3a31 mac80211: Backport AR934x OTP Patch
Merged upstream in https://patchwork.kernel.org/patch/9572541/, this
patch fixes the OTP offset used by the AR934x and AR955X to properly
enable reading from the OTP.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Daniel Golle 61cfc8075b mac80211: rt2x00: add incomplete support for external PA on MT7620
Do as the vendor driver does -- however, some devices apparently
patched support for external PA into the driver similar to how it was
done on Rt3352, using EEPROM_NIC_CONF1 rather than EEPROM_NIC_CONF2,
hence we check for both fields. Somehow the vendor driver also no
longer offers the option of only one of the TX paths having an external
PA (which was probably to weird to ever be implemented in practise,
though it doesn't seem like a particularly bad idea to me). Do the same
in rt2x00 and enable support for external PA on both TX paths whenever
it is set for TX0 in EEPROM.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle 3d71d1d9a9 mac80211: rt2x00: reorder patches and prepare for MT7620 external PA
Import change to make external PA capability consistent with the
vendor driver instead of having the logic inverted.
While at it, apply patches in the same order as they got merged
upstream.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Tomislav Požega e209988a17 mac80211: rt2800: fix mt7620 E2 channel registers
update RF register 47 and 54 values according to vendor driver

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: moved changes into a separate patch]
7 years ago
Tomislav Požega d2f864f7bf mac80211: rt2800: fix mt7620 vco calibration registers
Use register values from init LNA function instead of the ones from
restore LNA function. Apply register values based on rx path
configuration.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: moved changes into a separate patch]
7 years ago
Daniel Golle 97d1c49cac mac80211: rt2x00: fix MT7620 LNA gain and VCO-after-ALC
This should fix issues with bad RX as well as AP not coming up and/or
scanning failing.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Mathias Kresin 4a4c00e7c4 ath9k: drop obsolete patch
Now that the wireless LEDs are added via platform leds this patch isn't
required any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin b06559e5b7 ath9k: ignore led_pin if ath9k GPIO controller is used with DT
Don't setup the default led pin if the ath9k GPIO controller is used
via device tree to prevent collision. In case any of the pins exposed
by the ath9k is used, the phyNtpt trigger needs to be set in userspace.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 20b45df7eb ath9k: enable GPIO chip only if requested via DT
In case that the atheros device tree binding is used, enable access to
the GPIO chip only if the gpio-controller device tree parameter is used
for the ath9k node.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 192f0a3db8 ath9k: unset the default LED pin if used by platform leds
Unset the default LED gpio pin if the same gpio pin is used by a LED
defined via platform LED. This prevents that the default led trigger
gets assigned to this LED and the GPIO value gets changed on
wifi up/down in case the led is not used for signaling the wifi state.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Felix Fietkau cffeb31107 mac80211: backport an upstream fix for queue start/stop handling
Fixes issues with 802.11s

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Golle 399d5cf532 mac80211: rt2x00: import upstream changes and rebase our patches
Some of our local patches have been accepted upstream. And there are
some more relevant changes (mostly for rt2800usb). Import them and
rebase our remaining local patches on top.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Hannu Nyman c69a89fe23 mac80211: ath10k: allow failure getting board id via otp
ath10k tries to fetch board id via otp, but that fails for many chips
like QCA988x, QCA9984 etc. Recent commit cc189c0b7f removed the earlier
hack that had allowed QCA radios to work, as that hack was incompatible
with the new wifi chips being introduced to the source tree.

Restore functionality for the existing wifi chips by modifying the
return value of the 'board id via otp' function to a value that is recognised
as a harmless error, so that name evaluation continues by using the board file.

Patch originally suggested by Christian Lamparter in forum discussion.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
7 years ago
Felix Fietkau 09ae540cd4 ath9k: fix power limits on init
The tx power applied by set_txpower is limited by the CTL (conformance
test limit) entries in the EEPROM. These can change based on the user
configured regulatory domain.
Depending on the EEPROM data this can cause the tx power to become too
limited, if the original regdomain CTLs impose lowr limits than the CTLs
of the user configured regdomain.

To fix this issue, set the initial channel limits without any CTL
restrictions and only apply the CTL at run time when setting the channel
and the real tx power.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 79a768a90f ath: do not apply broken power limits with ATH_USER_REGD
If a device uses the default EEPROM code, typically only the main CTLs
are valid, and they do not apply properly when switching to a different
regulatory domain. If the regdomain deviates from the EEPROM one, force
the world roaming regdomain to ensure that power limits are sane

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Christian Lamparter cc189c0b7f mac80211: enable ath10k AHB support for QCA4019
This patch enables the ATH10K_AHB support for the QCA4019
devices on the AHB bus.

This patch also removes 936-ath10k_skip_otp_check.patch
because it breaks the AHB device identification.
"Patch is wrong. I find it frustrating OpenWRT/LEDE doesn't
try to work with upstream on ixing these things right."

[1] <https://www.mail-archive.com/ath10k@lists.infradead.org/msg05896.html>

It also limits ath10k memory hunger (This is a problem with 128MiB RAM)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Rafał Miłecki 13006712ea mac80211: brcmfmac: backport patches pushed on 2017-03-20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Daniel Golle 562484f25c rt2x00: mt7620: make fixes requested upstream
Introduce RT6352 instead of matching against RF7620.
Clean up channel setting rfvals.
Port bandwidth filter calibration.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle 181bc02d2e rt2x00: mt7620: yet another beauty session
So here is another round of improvements for MT7620 WiFi.

This commit fixes a few significant issues related to TX_PWR_CFG_x and
TX_ALC and also makes the code more readable by adding register
descriptions for things added for MT7620 and use the usual bit-field
access macros and the now defined macros instead of plain bit-ops and
magic numbers.

Properly describe EEPROM_TARGET_POWER at word 0x68 (== byte 0xD0) and
thereby fix internal TXALC which would otherwise just read
out-of-bounds of the EEPROM map.

Split-out tx-power/ALC related stuff into an additional function.
Fix VCO calibration, it was carried out properly in the channel
switching but incomplete in the actual VCO calibration function.
Also there is no need to trigger VCO calibration in channel switching,
the VCO calibration function is already being called at this point.
Remove it from channel switching function to avoid redundant code.

The TX power calibration differs significantly from all other
Mediatek/Ralink chips: They finally allow 0.5dB steps stored as 8-bit
values for (almost) each bitrate -- and promptly ran out of space and
for some reason didn't want to change the EEPROM layout. The hence
opted for a scheme of sharing values for some adjecent bitrates and
a highly over-complicated (or obfuscated?) way to populate the
TX_PWR_CFG_x registers with the values stored in the EEPROM.
The code here now looks much less complicated than what you see in the
vendor's driver, however, it does the exact same thing:
bGpwrdeltaMinus is a constant and always TRUE, hence half of the
code was dead. Gpwrdelta is always 0 (rather than using the value read
from the EEPROM). What remains is some very grotesque effort to avoid
0x20, probably some hardware bug related to some misunderstanding of
what a singed 8-bit value is (imagine: if it was a signed 6-bit value
then someone could believe that 0x20 == 0x0). And then they didn't
clean it up once they later on anandonned that whole story of having a
constant offset for 40 MHz channels and just set the offset to be
constant 0 -- there is no effort for avoiding 0x20 for the 20 MHz
values stored in the EEPROM, hence that's probably just a forbidden
value in the EEPROM specs and won't appear anyway...
Anyway, the whole thing felt like solving some college math test
where in the end everything cancels out and the result equals 0 ;)
To make sure that channel bandwidth power compensation really doesn't
need to be taken care of, output a warning when the corresponding
value stored in the EEPROM is non-zero.

Also there is no apparent reason to refrain from initializing RFCSR
register 13, it doesn't fail what-so-ever.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Rafał Miłecki 339de82347 mac80211: brcmfmac: always print error when PSM's watchdog fires
This error is important enough to be displayed even without debugging.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau 9edff13abd mac80211: disable potentially harmful PS software retry for A-MPDU sessions
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 4137b8b764 mac80211: rename patch to avoid duplicate number
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f28eef4460 mac80211: refresh patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Koen Vandeputte 75216a76b0 mac80211: backport upstream fix for CSA in IBSS mode
Allows to change channels on-the-fly using CSA when using IBSS.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Felix Fietkau 764cd09dd8 ath9k: fix various issues in the airtime-fairness implementation
Effects of the bugs could include memory corruption, tx hangs, kernel
crahes, possibly other things as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Rafał Miłecki 368cc8ef47 mac80211: update brcmfmac backporting brcmf_err cleanups
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau 66a63d25c4 mac80211: fix build on linux 3.18
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Golle 9eacb9d7fc rt2x00: mt7620: lots of improvements
This commit combines all the changes I've made on my staging tree
into a single commit fixing many issues with our patch for MT7620.

First of all, checkpatch.pl revealed numerous code style issues with
the patch, so fix all the white-space and commets. Also use
usleep_range instead of legacy timing and relax timing for VCO
calibration just like the vendor driver does.

Several line programming registers were commented out in the patch.
Originally this came from the features present but disabled by default
in the vendor's driver (RTMP_TEMPERATURE_CALIBRATION and
ADJUST_POWER_CONSUMPTION_SUPPORT). Remove the dead code for now, it can
easily be re-added if we actually intend to support those features.

Move values from mt7620_freqconfig type into the existing rf_channel
struct, this shouldn't be a new typedef and it is possible to use the
existing struct because rf_channel got 4 32-bit fields, so two of the
8-bit values from mt7620_freqconfig can easily be stored in the same
32-bit field.

Map values such that
Rdiv -> rf1
N    -> rf2
K    -> rf3[0:7]
D    -> rf3[8:15]
Ksd  -> rf4

This makes the channel switching logic already look a bit more like
what we are used to in rt2x00... Probably many of the read-modify-write
calls could still be replaced by macros intended for that.

iq calibration seems to be identical to RT5592, so just enable it.
Test shows that this improves things quite a lot, datarates went up
by a couple of megabits when running iperf, signal quality seems jumpy
in the first few seconds once a station connencts, the stabelizes on a
value significantly better than what it was before.

Add description to the patch and reference the original OpenWrt commit
by which it was added.

The patch now passes checkpatch.pl and can thus be discussed with the
upstream authors of the rt2x00 driver.

Funded-by: https://www.kickstarter.com/projects/1327597961/better-support-for-mt7620a-n-in-openwrt-lede/

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Álvaro Fernández Rojas fd94fa61a7 mac80211: brcmfmac: update Raspberry Pi patches for linux 4.9
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
7 years ago
Álvaro Fernández Rojas deb15cb23c brcmfmac: improve Raspberry Pi 3 stability
- Really disable power management (wrong config flags).
- Disable internal roaming engine.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
7 years ago
Felix Fietkau 2a4d2e4519 mac80211: fix ath9k kernel crash with linux 4.9
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 649e766a64 mac80211: update to wireless-testing 2017-01-31
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Rafał Miłecki b622f40249 mac80211: brcmfmac: backport wowlan netdetect fixes
I needed a moment to figure out relation between this patchset and the
nl80211: fix validation of scheduled scan info for wowlan netdetect

It appears nl80211 commit will go on top of brcmfmac changes so it's
safe to backport these patches.

One patch that was excluded is commit 2a2a5d1835b6 ("brcmfmac: add
.update_connect_params() callback") as it depends on missing commit
088e8df82f91 ("cfg80211: Add support to update connection parameters").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 99d3774a3c mac80211: brcmfmac: backport PSM watchdog improvements
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 4491979dc9 mac80211: brcmfmac: backport minor code cleanups
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 2a1d8c1f79 mac80211: brcmfmac: backport 4.10 fixes & typo fix
This includes memory leak fix in initialization path.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 863a06b0a4 mac80211: brcmfmac: backport scheduled scan cleanup and chip support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 4e611ac5df mac80211: brcmfmac: backport some old patches from 2016
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 52be05e190 mac80211: rename brcmfmac patches to use higher prefix
There are more patches to backport that should go before these.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau 33a840a3ff ath9k: remove the deaf rx path state check patch
This needs to be refined and reworked before we can safely leave it
enabled by default

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 82d580e8b5 ath9k: fix up a refcount imbalance error in the IRQ related fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b94177e10f ath9k: add stability fixes for long standing hang issues (FS#13, #34, #373, #383)
The radio would stop communicating completely. This issue was easiest to
trigger on AR913x devices, e.g. the TP-Link TL-WR1043ND, but other
hardware was occasionally affected as well.

The most critical issue was a race condition in disabling/enabling IRQs
between the IRQ handler and the IRQ processing tasklet

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 4cacc1c5f5 mac80211: refresh patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Rafał Miłecki 4376e69473 mac80211: brcmfmac: don't use uninitialize mem for country codes
There was a bug in brcmfmac patch that could result in treating random
memory as source of country codes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau 6b013019f9 Add back the commit "ath9k: Add airtime fairness scheduler"
This reverts commit c296ba834d.
According to several reports, the issues with the airtime fairness
changes are gone in current versions.
It's time to re-apply the patch now.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Golle b367eef21d mac80211: rt2x00: add support for external LNA on MT7620
Reported-by: Tom Psyborg <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Rafał Miłecki 9200e168f2 mac80211: move (& update) upstream accepted brcmfmac patches
These 3 patches are now in wireless-drivers-next tree.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 25200ae7a5 mac80211: brcmfmac: add early (& hacky) patch for storing country codes
This allows some basic region switching on Netgear R8000. More devices &
codes may be added. Ideally it should be converted into DT info & patch.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 5fba00a686 mac80211: use wiphy_read_of_freq_limits in brcmfmac
This makes use of cfg80211 feature backported & described in
188626f17c ("mac80211: backport cfg80211 support for
ieee80211-freq-limit DT property").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau e7e91e62bb mac80211: backport a fix for a tx related race condition
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau a46d1fde4b mac80211: refresh patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Koen Vandeputte adf2fef5e8 mac80211: backport some upstream fixes
Backports the following upstream fixes:

mac80211: initialize fast-xmit 'info' later
mac80211: fix legacy and invalid rx-rate report
mac80211: fix tid_agg_rx NULL dereference

Compiled and tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Hauke Mehrtens 5b089e45a6 kernel: update 4.4 kernel to 4.4.42
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 2b6284f5a8 mac80211: fix broken spatial multiplexing defaults
Most mac80211 drivers leave the SMPS field in the HT capabilities
uninitialized (unfortunately defaults to static SMPS), which leads to
some devices limiting themselves to single-stream rates in some modes
(mostly mesh and IBSS).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Rafał Miłecki f714fe46a9 mac80211: pending brcmfmac patches cleaning channels management
They prepare brcmfmac for using wiphy_read_of_freq_limits.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 07df80a1a6 mac80211: rename b43 patches to make more space
Just 6 patches were using 80*, 81*, 82* and 84* prefixes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Rafał Miłecki 188626f17c mac80211: backport cfg80211 support for ieee80211-freq-limit DT property
This property allows specifying extra limits for wireless device in DT.
For a full documentation see upstream commit b330b25eaabd ("dt-bindings:
document common IEEE 802.11 frequency limit property").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau e3072599f6 ath9k: don't run periodic and nf calibration at the same time
Might fix some stability issues on older chips

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c296ba834d Revert "ath9k: Add airtime fairness scheduler"
This reverts commit 528f46d082.
After this commit, several users reported stability issues. Revert it
now so it doesn't cause issues for the upcoming release

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c9c68c7177 ath9k: fix issues with external reset on AR913x
An external reset patch for AR955x accidentally led to external reset
being issued twice on AR913x, once before the RTC reset and once after.
This may be causing some stability issues.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f04b651453 ath5k: drop bogus warning on drv_set_key with unsupported cipher (FS#334)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 00ad43f047 ath9k: remove old rx dma stop check optimization
This commit was added to improve reset time on old SoC devices that run
into chip hangs more frequently. However with the more recent addition
of full WMAC reset on these chips, it could be problematic.
Drop this patch to ensure that DMA activity is really stopped before the
chip reset is issued

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Toke Høiland-Jørgensen 528f46d082 ath9k: Add airtime fairness scheduler
This adds a patch that introduces airtime fairness scheduling to ath9k,
which can significantly improve network efficiency in mixed-rate
environments.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau a032940bfb Revert "ath9k: Add airtime fairness scheduler"
Accidentally pushed to the wrong branch

This reverts commit 47bc081e76.
8 years ago
Toke Høiland-Jørgensen 47bc081e76 ath9k: Add airtime fairness scheduler
This adds a patch that introduces airtime fairness scheduling to ath9k,
which can significantly improve network efficiency in mixed-rate
environments.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Christian Lamparter b3a871dd3d mac80211: backport "cfg80211: limit scan results cache size"
The patch commit states:
"It's possible to make scanning consume almost arbitrary amounts
of memory, e.g. by sending beacon frames with random BSSIDs at
high rates while somebody is scanning.

Limit the number of BSS table entries we're willing to cache to
1000, limiting maximum memory usage to maybe 4-5MB, but lower
in practice - that would be the case for having both full-sized
beacon and probe response frames for each entry; this seems not
possible in practice, so a limit of 1000 entries will likely be
closer to 0.5 MB."

Signed-off-by: Johannes Berg <johannes.berg@intel.com>"

This patch was added in 4.4.36. But because LEDE backports
cfg80211, mac80211 and the wifi drivers separately, it needs
to be added manually for now. It can be dropped later as it
will be part of the next mac80211 refresh.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years ago
Felix Fietkau 00bc7f0357 mac80211: merge a number of minstrel/minstrel_ht performance and memory usage improvements
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 28f6951600 ath10k: fix a soft-lockup on firmware restart
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 7dcccacb98 ath10k: fix a bug on sending null-func frames
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 66482e179b ath10k: fix DMA allocation issues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 57f7f91f0c mac80211: refresh all patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 4872c36c55 ath9k: add a RCU related bugfix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Martin Blumenstingl 448b9b67e1 kernel: mac80211: disable ath9k bands via device tree
These properties allow overriding the settings from the EEPROM
which indicate whether a band is enabled or not.
Setting this property is only needed when the RF circuit does not
support the 2.4GHz or 5GHz band while it is enabled nevertheless in the
EEPROM.

These patches will be replaced with a future upstream version which
will introduces an ieee80211 device tree property to disable bands.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
8 years ago
Martin Blumenstingl 3f889418a5 kernel: mac80211: add pending ath9k EEPROM swapping patches
There are two types of swapping the EEPROM data in the ath9k driver.
Before this series one type of swapping could not be used without the
other.

The first type of swapping looks at the "magic bytes" at the start of
the EEPROM data and performs swab16 on the EEPROM contents if needed.
The second type of swapping is EEPROM format specific and swaps
specific fields within the EEPROM itself (swab16, swab32 - depends on
the EEPROM format).

With this series the second part now looks at the EEPMISC register
inside the EEPROM, which uses a bit to indicate if the EEPROM data
is Big Endian (this is also done by the FreeBSD kernel).
This has a nice advantage: currently there are some out-of-tree hacks
(in OpenWrt and LEDE) where the EEPROM has a Big Endian header on a
Big Endian system (= no swab16 is performed) but the EEPROM itself
indicates that it's data is Little Endian. Until now the out-of-tree
code simply did a swab16 before passing the data to ath9k, so ath9k
first did the swab16 - this also enabled the format specific swapping.
These out-of-tree hacks are still working with the new logic, but it
is recommended to remove them. This implementation is based on a
discussion with Arnd Bergmann who raised concerns about the
robustness and portability of the swapping logic in the original OF
support patch review, see [0].

After a second round of patches (= v1 of this series) neither Arnd
Bergmann nor I were really happy with the complexity of the EEPROM
swapping logic. Based on a discussion (see [1] and [2]) we decided
that ath9k should use a defined format (specifying the endianness
of the data - I went with __le16 and __le32) when accessing the
EEPROM fields. A benefit of this is that we enable the EEPMISC based
swapping logic by default, just like the FreeBSD driver, see [3]. On
the devices which I have tested (see below) ath9k now works without
having to specify the "endian_check" field in ath9k_platform_data (or
a similar logic which could provide this via devicetree) as ath9k now
detects the endianness automatically. Only EEPROMs which are mangled
by some out-of-tree code still need the endian_check flag (or one can
simply remove that mangling from the out-of-tree code).

[0] http://www.spinics.net/lists/linux-wireless/msg152634.html
[1] https://marc.info/?l=linux-wireless&m=147250597503174&w=2
[2] https://marc.info/?l=linux-wireless&m=147254388611344&w=2
[3] 50719b56d9/sys/dev/ath/ath_hal/ah_eeprom_9287.c (L351)

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
8 years ago
Martin Blumenstingl 1847248fc1 kernel: mac80211: backport ath9k device tree support patches
These patches add support for configuring ath9k based devices via
devicetree. This was tested on PCI(e) based devices. This should work
for AHB based devices as well (adding more AHB specific properties may
still be needed) as soon as the ath79 platform is ready to populate the
ath9k wmac via devicetree.
This patchset was accepted upstream, more information can be found on
the linux-wireless list:
https://www.spinics.net/lists/linux-wireless/msg155474.html

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
8 years ago
Matthias Schiffer fa845e9978
ath9k: add support for the HSR tuner of the Ubiquiti UAP Outdoor+
Without setting the HSR to the selected channel, the WLAN of the UAP
Outdoor+ will exhibit high packet loss in RX.

Based-on-patch-by: Stefan Rompf <stefan@loplof.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer a250556d27
ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Mathias Kresin b6832817eb mac80211: rt2x00: add support for mac addr from device tree
Backport upstream accepted patch which allows to override the EEPROM
mac address with one from device tree.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin e7c019c24d mac80211: rt2x00: fold patches
The patch 615-rt2x00-fix_20mhz_clk.patch fixes code introduced by
611-rt2x00-rf_vals-rt3352-xtal20.patch and makes the the platform data
property clk_is_20mhz obsolete.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 4f7a0601e6 mac80211: rt2x00: add mtd-eeprom swab function
Most of the lantiq devices with ralink wifi have the EEPROM stored
in big endian byte order in flash, but the driver expects the EEPROM to
be in little endian.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 7f235df571 mac80211: rt2x00: remove eeprom filename dependency from mtd-eeprom
The ralink,mtd-eeprom device tree property doesn't require the
ralink,eeprom property to work.

Rework the error handling and user notification as well. Do not log an
error if the mtd-eeprom parameter isn't used. It could be intentional
and should not scare the user.

Check if the number of bytes read from the mtd devices matches the
requested number of bytes.

In case of an mtd read error, give a hint to the user which partition
was tried to read from.

In case everything is fine, notify the user as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 2516c0572e mac80211: rt2x00: improve eeprom_file property handling
Call the rt2x00lib_get_eeprom_file_name only once and from the function
where the EEPROM filename is required.

Error only out if an EEPROM file is mandatory. Use the
REQUIRE_EEPROM_FILE bit to determine if it is mandatory.

Do not set the REQUIRE_EEPROM_FILE bit while requesting an EEPROM file.
It should be (and is) set before requesting an EEPROM file.

Do not redirect users to upstream while using a function of a custom
patch.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Felix Fietkau 17ecd879b8 Revert "mwl8k: remove synchronous device init hack"
This reverts commit cb037d1842.
See 6aa07b8202 for more information

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 6aa07b8202 Revert "mac80211: remove ath10k delayed initialization hack"
This reverts commit efd9dec319.

ath10k can take a long time to probe, long enough for netifd to fail to
initialize already configured wireless devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau cae688544d mac80211: fix A-MSDU tx aggregation (FS#174)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau db82db3203 mac80211: minor cleanup
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 5c11a4b311 mac80211: fix a tx A-MPDU aggregation issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 12bd0f2820 mac80211: replace the previous fix with a revert of the faulty upstream commit
This avoids potential breakage in rt2x00usb

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau cb037d1842 mwl8k: remove synchronous device init hack
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin efd9dec319 mac80211: remove ath10k delayed initialization hack
LEDE no longer requires all PHYs to be initialized to
create the configuration files during bootup. This patch
removes the now obsolete ath10k patch.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Felix Fietkau f78405f500 mac80211: fix regdomain change issues with CONFIG_ATH_USER_REGD
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 69ace0824f mac80211: fix a minor issue in the header padding patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 4dfc0be07b mac80211: fix AP powersave issues introduced in the last wireless-testing update (FS#241)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau b7b223be41 mac80211: backport some upstream a-msdu tx fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 5f9598a432 mac80211: fix build error in ath10k with hwmon enabled
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau ad51e09fd1 mac80211: update to wireless-testing 2016-10-08
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Álvaro Fernández Rojas 757228b137 mac80211: update rtl8xxxu patches
Adds the latest patches from Jes Sorensen for rtl8xxxu, which improve
rtl8732bu, rtl8192eu and rtl8188eu support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Felix Fietkau fc88eb3fdf ath9k: remove patch causing stability issues with powersave devices (FS#176)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
John Crispin 72e9d19f6e mac80211: fix rfkill dependency
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Álvaro Fernández Rojas c795794eef mac80211: use upstream patches for rtl8xxxu
Also improves rtl8188eu support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Rafał Miłecki a0ce6982d8 mac80211: backport brcmfmac changes from 2016-09-27
This fixes bug that could cause WARNING on every add_key/del_key call.
It also replaces WARNING with a simple message. They may still occur
e.g. on station going out of range and A-MPDU stall in the firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Rafał Miłecki 45b73af7f6 mac80211: backport brcmfmac changes from 2016-09-26
All these patches are in wireless-drirvers-next. There is support for
hidden SSID, few new devices and many fixes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Felix Fietkau da4e81960d mac80211: fix crash in mac80211_hwsim
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Álvaro Fernández Rojas 092e77d948 rtl8xxxu: add support for rtl8188eu
Patches by Jes Sorensen:
https://git.kernel.org/cgit/linux/kernel/git/jes/linux.git/

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Felix Fietkau f3747020e2 mac80211: fix tx issue with CCMP PN generated in hardware
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau c4bfb119d8 mac80211: remove the fq-disable hack, now that reordering is fixed
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau a194ffd4a8 mac80211: fix packet loss on fq reordering
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 49a6f67c39 mac80211: backport new register bitfield macros
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 9cf0444768 mac80211: add a tx sequence number allocation fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau dbc9ee5b72 ath9k: fix regression in tx queueing patch
power save response frames can go through the old tx path, and the tid
needs to be set for sequence numbers to be assigned correctly.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau a894a535ff mac80211: add fixes for dealing with unexpected BlockAck frames
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 372d0fea29 ath9k: add a bunch of powersave handling fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago