Commit Graph

520 Commits

Author SHA1 Message Date
Rafał Miłecki beaa2ecc10 mac80211: brcmfmac: fix PCIe reset crash and WARNING
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit cde8c2f2fb)
2019-11-19 06:51:15 +01:00
Rafał Miłecki 21cc21e9ec mac80211: brcmfmac: backport more kernel 5.4 changes
Patch getting RAM info got upstreamed. A debugging fs entry for testing
reset feature was added.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 681acdcc54)
2019-09-09 13:42:31 +02:00
Rafał Miłecki 9d95a218de mac80211: brcm: improve brcmfmac debugging of firmware crashes
This provides a complete console messages dump.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f51e2d031e)
2019-07-28 16:42:55 +02:00
Rafał Miłecki d9300b721f mac80211: brcm: update brcmfmac 5.4 patches
Use commits from wireless-drivers-next.git.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 95745e26b3)
2019-07-28 16:42:49 +02:00
Rafał Miłecki b55dd9be3f mac80211: brcmfmac: backport fixes from kernel 5.4
This fixes:
1) Crash during USB disconnect
2) Crash in brcmf_txfinalize() on rmmod with packets queued
3) Some errors in exit path

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8231f67218)
2019-07-22 14:15:38 +02:00
Rafał Miłecki b5b5b23b30 mac80211: brcmfmac: backport previously skipped USB fixes
They were skipped due to missing BCDC patches that are backported now.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-07-22 14:15:36 +02:00
Rafał Miłecki 7da50e5f62 mac80211: brcmfmac: backport BCDC layer changes from kernel 4.12
Those changes are needed for backporting more recent crash fixes. There
are quite many BCDC patches but it's hopefully a very well tested code
by now.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-07-22 14:15:34 +02:00
Rafał Miłecki a63907b3bb mac80211: brcmfmac: rename v4.12 patches to allow more backports
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-07-22 14:15:17 +02:00
Hauke Mehrtens 6c5c3a2edc kernel: Update to version 4.4.182
Fixes:
- CVE-2019-11479
- CVE-2019-11478
- CVE-2019-11477
- CVE-2019-11833
- CVE-2019-11091
- CVE-2018-12126
- CVE-2018-12130
- CVE-2018-12127
- CVE-2019-3882
- CVE-2019-6974
- CVE-2019-3819
- CVE-2019-7221
- CVE-2019-7222
- CVE-2019-3701
- CVE-2018-19985
- CVE-2018-1120
And probably more

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-06-18 20:45:33 +02:00
Rafał Miłecki af50ce32c5 mac80211: brcmfmac: backport important fixes from kernel 5.2
1) Crash/Oops fixes
2) One-line patch for BCM43456 support
3) Fix communication with some specific FullMAC firmwares
4) Potential fix for "Invalid packet id" errors
5) Important helper for reporting FullMAC firmware crashes

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2cd234d96b)
2019-06-16 22:30:49 +02:00
Rafał Miłecki d3bab051cf mac80211: brcmfmac: really add early fw crash recovery
Previous commit backported USB fixes instead of firmware crash recovery
patches.

Fixes: eaef74279c ("mac80211: brcmfmac: early work on FullMAC firmware crash recovery")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2d2e615dee)
2019-04-18 13:44:02 +02:00
Rafał Miłecki eaef74279c mac80211: brcmfmac: early work on FullMAC firmware crash recovery
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 02aed76968)
2019-04-18 12:07:47 +02:00
Rafał Miłecki eab6537449 mac80211: brcmfmac: backport 5.0 & 5.1 important changes/fixes
This backports the most important brcmfmac commits that:
1) Fix some bugs
2) Help debugging bugs

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d32bbd7477)
2019-02-26 07:50:22 +01:00
Rafał Miłecki fb333a7fec mac80211: brcmfmac: pick few 4.17 cleanups required for further fixes
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-02-25 21:58:47 +01:00
Rafał Miłecki f3f21b3d2a mac80211: brcmfmac: fix a possible NULL pointer dereference
This fixes a possible crash in the brcmf_fw_request_nvram_done():
[   31.687293] Backtrace:
[   31.689760] [<c004fb4c>] (__wake_up_common) from [<c004fc38>] (__wake_up_locked+0x1c/0x24)
[   31.698043]  r10:c6794000 r9:00000009 r8:00000001 r7:bf54dda0 r6:a0000013 r5:c78e7d38
[   31.705928]  r4:c78e7d3c r3:00000000
[   31.709528] [<c004fc1c>] (__wake_up_locked) from [<c00502a8>] (complete+0x3c/0x4c)
[   31.717148] [<c005026c>] (complete) from [<bf54590c>] (brcmf_fw_request_nvram_done+0x5c8/0x6a4 [brcmfmac])
[   31.726818]  r7:bf54dda0 r6:c6794000 r5:00001990 r4:c6782380
[   31.732544] [<bf545344>] (brcmf_fw_request_nvram_done [brcmfmac]) from [<c0204e40>] (request_firmware_work_func+0x38/0x60)
[   31.743607]  r10:00000008 r9:c6bdd700 r8:00000000 r7:c72c3cd8 r6:c67f4300 r5:c6bda300
[   31.751493]  r4:c67f4300
[   31.754046] [<c0204e08>] (request_firmware_work_func) from [<c0034458>] (process_one_work+0x1e0/0x318)
[   31.763365]  r4:c72c3cc0
[   31.765913] [<c0034278>] (process_one_work) from [<c0035234>] (worker_thread+0x2f4/0x448)
[   31.774107]  r10:00000008 r9:00000000 r8:c6bda314 r7:c72c3cd8 r6:c6bda300 r5:c6bda300
[   31.781993]  r4:c72c3cc0
[   31.784545] [<c0034f40>] (worker_thread) from [<c003984c>] (kthread+0x100/0x114)
[   31.791949]  r10:00000000 r9:00000000 r8:00000000 r7:c0034f40 r6:c72c3cc0 r5:00000000
[   31.799836]  r4:c735dc00 r3:c79ed540
[   31.803438] [<c003974c>] (kthread) from [<c00097d0>] (ret_from_fork+0x14/0x24)
[   31.810672]  r7:00000000 r6:00000000 r5:c003974c r4:c735dc00
[   31.816378] Code: e5b53004 e1a07001 e1a06002 e243000c (e5934000)
[   31.822487] ---[ end trace a0ffbb07a810d503 ]---

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 83bcacb521)
2019-02-11 11:59:41 +01:00
Rafał Miłecki 9d4eed6837 mac80211: brcmfmac: fix use-after-free & possible NULL pointer dereference
1) Using fwctx variable after brcmf_fw_request_done() was executed meant
   accessing freed memory.
2) Using fwctx->completion for the wait_for_completion_timeout() call
   could reuslt in NULL pointer dereference on fw loading error or if
   brcmf_fw_request_done() was executed quickly enough.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 529c95cc15)
2019-01-08 11:46:24 +01:00
Rafał Miłecki e50a5a9328 mac80211: brcmfmac: add 2 more recent changes
First one is a fix for reporting channels to the user space. Important
for users as they could try setting invalid channel and fail to start an
interface.

Later is a support for newer FullMAC chipset firmwares.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-11-09 23:24:11 +01:00
Rafał Miłecki c11f335275 mac80211: brcmutil: backport chanspec debugging patch
It helps debugging possible WARN-ings.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-11-07 13:15:50 +01:00
Rafał Miłecki b1fc9b79d0 mac80211: brcmfmac: backport the latest 4.20 changes
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b50f162b3c)
2018-11-07 13:15:50 +01:00
Rafał Miłecki a360d5a18e mac80211: brcmfmac: rename 4.20 backport patches
Include kernel version to help tracking changes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-11-07 13:06:48 +01:00
Rafał Miłecki 01a8f0e444 mac80211: brcmfmac: backport first important changes from the 4.20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-09-12 10:06:44 +02:00
Rafał Miłecki 9e864bfcce mac80211: brcmfmac: fix compilation with SDIO support
This fixes following error when compiling with CONFIG_BRCMFMAC_SDIO=y:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1100:23: error: 'sdiod' undeclared (first use in this function)
   brcmf_dev_coredump(&sdiod->func1->dev);

Fixes: 9d8940c5b9 ("mac80211: brcmfmac: backport important changes from the 4.18")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-17 12:28:08 +02:00
Rafał Miłecki 13f219569d mac80211: brcmfmac: backport patch setting WIPHY_FLAG_HAVE_AP_SME
It's an important hint for authenticator (e.g. hostapd) about hardware
capabilities.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 16:52:09 +02:00
Rafał Miłecki 0c76265d08 mac80211: brcmfmac: backport important changes from the 4.19
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:06 +02:00
Rafał Miłecki 9d8940c5b9 mac80211: brcmfmac: backport important changes from the 4.18
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:06 +02:00
Rafał Miłecki 84ef414bd4 mac80211: brcmfmac: backport important changes from the 4.16
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:06 +02:00
Rafał Miłecki 57102f6c06 mac80211: brcmfmac: backport important changes from the 4.15
Two more patches that may be worth backporting in the future:
fdd0bd88ceae brcmfmac: add CLM download support
cc124d5cc8d8 brcmfmac: fix CLM load error for legacy chips when user helper is enabled

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:05 +02:00
Rafał Miłecki 6805e44004 mac80211: brcmfmac: backport important changes from the 4.14
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:05 +02:00
Rafał Miłecki e3bc2e488d mac80211: brcmfmac: backport important changes from the 4.13
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:15:02 +02:00
Rafał Miłecki 00b4e65677 mac80211: brcmfmac: backport important changes from the 4.12
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:07:23 +02:00
Rafał Miłecki f8c364b720 mac80211: brcmfmac: backport use-after-free fix from 4.11
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 13:07:09 +02:00
Rafał Miłecki 85e6ac468e mac80211: brcmfmac: group 4.11 backport patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-08-16 09:48:24 +02:00
Daniel Golle 7fc94b2a25 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>
(cherry-picked from commit f4a639a3d7)
2018-06-15 20:37:17 +02:00
Rafał Miłecki fe3db683f9 mac80211: brcmfmac: add support for BCM4366E chipset
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-04-03 13:11:43 +02:00
Rafał Miłecki fad29d2c3d mac80211: brcmfmac: backport commit dropping IAPP packets by default
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2018-03-21 09:36:39 +01:00
Stijn Tintel a5e1f7f5ef mac80211: backport kernel fix for CVE-2017-13080
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 2f701194c2)
2017-10-17 01:57:05 +03:00
Felix Fietkau bff16304b0 brcmfmac: backport length check in brcmf_cfg80211_escan_handler()
Fixes CVE-2017-0786

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-10-16 13:02:04 +02:00
Tomislav Požega eb11207397 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]
2017-05-02 23:17:22 +02:00
Tomislav Požega 64fa4ead32 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]
2017-05-02 23:17:22 +02:00
Daniel Golle 820a39687d 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>
2017-05-02 23:17:22 +02:00
Daniel Golle 5b91d2b52e 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>
2017-05-02 23:17:22 +02:00
Daniel Golle ab7087e24f 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>
2017-05-02 23:17:22 +02:00
Daniel Golle 4314646ac6 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>
2017-05-02 23:17:22 +02:00
Felix Fietkau 5ac51ada60 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>
2017-05-02 23:17:22 +02:00
Felix Fietkau a9728799bc 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>
2017-05-02 23:17:22 +02:00
Felix Fietkau 47bf110cbb mac80211: backport an upstream fix for queue start/stop handling
Fixes issues with 802.11s

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-04-03 15:12:50 +02:00
Felix Fietkau 703515f889 mac80211: sync with master branch as of 9edff13abd
Includes the following changes:
9edff13abd mac80211: disable potentially harmful PS software retry for A-MPDU sessions
75216a76b0 mac80211: backport upstream fix for CSA in IBSS mode
368cc8ef47 mac80211: update brcmfmac backporting brcmf_err cleanups
66a63d25c4 mac80211: fix build on linux 3.18
9eacb9d7fc rt2x00: mt7620: lots of improvements
fd94fa61a7 mac80211: brcmfmac: update Raspberry Pi patches for linux 4.9
649e766a64 mac80211: update to wireless-testing 2017-01-31
47540afa5d ath9k: add a warning to the tx99 config option
b367eef21d mac80211: rt2x00: add support for external LNA on MT7620
9200e168f2 mac80211: move (& update) upstream accepted brcmfmac patches

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-02-24 12:22:29 +01:00
Felix Fietkau e967f4dd27 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>
2017-02-12 14:27:21 +01:00
Álvaro Fernández Rojas 86bd886697 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>
2017-02-07 18:00:16 +01:00
Rafał Miłecki 5c4b2eb3dd 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>
2017-02-06 00:10:49 +01:00