platform/kernel/linux-rpi.git
3 years agoMerge tag 'iwlwifi-next-for-kalle-2021-06-22' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 23 Jun 2021 17:48:56 +0000 (20:48 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2021-06-22' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

iwlwifi patches for v5.14

* Some robustness improvements in the PCI code;
* Remove some duplicate and unused declarations;
* Improve PNVM load robustness by increasing the timeout a bit;
* Support for a new HW;
* Suport for BIOS control of 11ax enablement in Russia;
* Support UNII4 enablement from BIOS;
* Support LMR feedback;
* Fix in TWT;
* Some fixes in IML (image loader) DMA handling;
* Fixes in WoWLAN;
* Updates in the WoWLAN FW commands;
* Add one new device to the PCI ID lists;
* Support reading PNVM from a UEFI variable;
* Bump the supported FW API version;
* Some other small fixes, clean-ups and improvements.

# gpg: Signature made Tue 22 Jun 2021 05:19:19 PM EEST
# gpg:                using RSA key 1772CD7E06F604F5A6EBCB26A1479CA21A3CC5FA
# gpg: Good signature from "Luciano Roth Coelho (Luca) <luca@coelho.fi>" [full]
# gpg:                 aka "Luciano Roth Coelho (Intel) <luciano.coelho@intel.com>" [full]

3 years agobrcmfmac: Silence error messages about unsupported firmware features
Dmitry Osipenko [Tue, 11 May 2021 21:15:49 +0000 (00:15 +0300)]
brcmfmac: Silence error messages about unsupported firmware features

KMSG is flooded with error messages about unsupported firmware
features of BCM4329 chip. The GET_ASSOCLIST error became especially
noisy with a newer NetworkManager version of Ubuntu 21.04. Turn the
noisy error messages into info messages and print them out only once.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210511211549.30571-2-digetx@gmail.com
3 years agocfg80211: Add wiphy_info_once()
Dmitry Osipenko [Tue, 11 May 2021 21:15:48 +0000 (00:15 +0300)]
cfg80211: Add wiphy_info_once()

Add wiphy_info_once() helper that prints info message only once.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210511211549.30571-1-digetx@gmail.com
3 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 23 Jun 2021 17:39:07 +0000 (20:39 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for v5.14. Major changes:

ath11k

* enable support for QCN9074 PCI devices

3 years agowcn36xx: Avoid memset() beyond end of struct field
Kees Cook [Thu, 17 Jun 2021 17:10:58 +0000 (10:10 -0700)]
wcn36xx: Avoid memset() beyond end of struct field

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring array fields.

Instead of writing past the end of the header to reach the rest of
the body, replace the redundant function with existing macro to wipe
struct contents and set field values. Additionally adjusts macro to add
missing parens.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210617171058.3410494-1-keescook@chromium.org
3 years agoath11k: Avoid memcpy() over-reading of he_cap
Kees Cook [Wed, 16 Jun 2021 19:54:10 +0000 (12:54 -0700)]
ath11k: Avoid memcpy() over-reading of he_cap

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring array fields.

Since peer_he_cap_{mac,phy}info and he_cap_elem.{mac,phy}_cap_info are not
the same sizes, memcpy() was reading beyond field boundaries. Instead,
correctly cap the copy length and pad out any difference in size
(peer_he_cap_macinfo is 8 bytes whereas mac_cap_info is 6, and
peer_he_cap_phyinfo is 12 bytes whereas phy_cap_info is 11).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210616195410.1232119-1-keescook@chromium.org
3 years agomt7601u: add USB device ID for some versions of XiaoDu WiFi Dongle.
Wei Mingzhi [Fri, 18 Jun 2021 16:08:40 +0000 (00:08 +0800)]
mt7601u: add USB device ID for some versions of XiaoDu WiFi Dongle.

USB device ID of some versions of XiaoDu WiFi Dongle is 2955:1003
instead of 2955:1001. Both are the same mt7601u hardware.

Signed-off-by: Wei Mingzhi <whistler@member.fsf.org>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210618160840.305024-1-whistler@member.fsf.org
3 years agomwifiex: Avoid memset() over-write of WEP key_material
Kees Cook [Thu, 17 Jun 2021 17:15:22 +0000 (10:15 -0700)]
mwifiex: Avoid memset() over-write of WEP key_material

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring array fields.

When preparing to call mwifiex_set_keyparamset_wep(), key_material is
treated very differently from its structure layout (which has only a
single struct mwifiex_ie_type_key_param_set). Instead, add a new type to
the union so memset() can correctly reason about the size of the
structure.

Note that the union ("params", 196 bytes) containing key_material was
not large enough to hold the target of this memset(): sizeof(struct
mwifiex_ie_type_key_param_set) == 60, NUM_WEP_KEYS = 4, so 240
bytes, or 44 bytes past the end of "params". The good news is that
it appears that the command buffer, as allocated, is 2048 bytes
(MWIFIEX_SIZE_OF_CMD_BUFFER), so no neighboring memory appears to be
getting clobbered.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210617171522.3410951-1-keescook@chromium.org
3 years agortlwifi: rtl8192de: Fully initialize curvecount_val
Kees Cook [Thu, 17 Jun 2021 17:13:17 +0000 (10:13 -0700)]
rtlwifi: rtl8192de: Fully initialize curvecount_val

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring array fields.

The size argument to memset() is bytes, but the array element size
of curvecount_val is u32, so "CV_CURVE_CNT * 2" was only 1/4th of the
contents of curvecount_val. Adjust memset() to wipe full buffer size.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210617171317.3410722-1-keescook@chromium.org
3 years agomwl8k: Avoid memcpy() over-reading of mcs.rx_mask
Kees Cook [Thu, 17 Jun 2021 04:14:31 +0000 (21:14 -0700)]
mwl8k: Avoid memcpy() over-reading of mcs.rx_mask

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally reading across neighboring array fields. Use the
sub-structure address directly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210617041431.2168953-1-keescook@chromium.org
3 years agoorinoco: Avoid field-overflowing memcpy()
Kees Cook [Wed, 16 Jun 2021 20:39:51 +0000 (13:39 -0700)]
orinoco: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring array fields.

Validate the expected key size and introduce a wrapping structure
to use as the multi-field memcpy() destination so that overflows
can be correctly detected.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210616203952.1248910-1-keescook@chromium.org
3 years agortw88: coex: remove unnecessary variable and label
wengjianfeng [Thu, 20 May 2021 00:55:45 +0000 (08:55 +0800)]
rtw88: coex: remove unnecessary variable and label

In some funciton, the variable ret just used as return value,and
out label just return ret,so ret and out label are unnecessary,
we should delete these and use return true/false to replace.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210520005545.31272-1-samirweng1979@163.com
3 years agortw88: add quirks to disable pci capabilities
Ping-Ke Shih [Mon, 7 Jun 2021 01:22:54 +0000 (09:22 +0800)]
rtw88: add quirks to disable pci capabilities

8821CE with ASPM cannot work properly on Protempo Ltd L116HTN6SPW. Add a
quirk to disable the cap.

The reporter describes the symptom is that this module (driver) causes
frequent freezes, randomly but usually within a few minutes of running
(thus very soon after boot): screen display remains frozen, no response
to either keyboard or mouse input. All I can do is to hold the power
button to power off, then reboot.

Reported-by: Paul Szabo <psz2036@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210607012254.6306-1-pkshih@realtek.com
3 years agortw88: refine unwanted h2c command
Po-Hao Huang [Fri, 28 May 2021 03:29:01 +0000 (11:29 +0800)]
rtw88: refine unwanted h2c command

Don't send beacon filter h2c when there is no valid context.
Return early instead of printing out warning messages, so others
won't get confused.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210528032901.12927-3-pkshih@realtek.com
3 years agortw88: dump FW crash via devcoredump
Zong-Zhe Yang [Fri, 28 May 2021 03:29:00 +0000 (11:29 +0800)]
rtw88: dump FW crash via devcoredump

Use device coredump framework instead of print_hex_dump to support
FW crash dump. Pass data to the framework if preparing and dumping
are successful. The framework will take the ownership of the data.
The data will be freed after the framework determines its lifetime
is over. A new coredump will not work if the previous one still
exists.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210528032901.12927-2-pkshih@realtek.com
3 years agortw88: notify fw when driver in scan-period to avoid potential problem
Chin-Yen Lee [Fri, 14 May 2021 07:55:17 +0000 (15:55 +0800)]
rtw88: notify fw when driver in scan-period to avoid potential problem

It is found that driver scan could be affected by dynamic mechanism
of firmware, so we notify firmware to stop it in the scan period.
Another, firmware will detect the background noise and report to
driver for further use.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210514075517.14216-3-pkshih@realtek.com
3 years agortw88: add rtw_fw_feature_check api
Chin-Yen Lee [Fri, 14 May 2021 07:55:16 +0000 (15:55 +0800)]
rtw88: add rtw_fw_feature_check api

add api to check if a certain feature is supported.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210514075517.14216-2-pkshih@realtek.com
3 years agortw88: 8822c: update RF parameter tables to v62
Po-Hao Huang [Thu, 6 May 2021 08:36:43 +0000 (16:36 +0800)]
rtw88: 8822c: update RF parameter tables to v62

Update RTL8822C devices' RF tables to v62.
This fixes higher than expected spur in 2400 MHz under CCK mask.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210506083643.18317-1-pkshih@realtek.com
3 years agortw88: Remove duplicate include of coex.h
Wan Jiabing [Fri, 30 Apr 2021 02:49:50 +0000 (10:49 +0800)]
rtw88: Remove duplicate include of coex.h

In commit fb8517f4fade4 ("rtw88: 8822c: add CFO tracking"),
"coex.h" was added here which caused the duplicate include.
Remove the later duplicate include.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210430024951.33406-1-wanjiabing@vivo.com
3 years agortw88: 8822c: fix lc calibration timing
Po-Hao Huang [Mon, 26 Apr 2021 01:32:52 +0000 (09:32 +0800)]
rtw88: 8822c: fix lc calibration timing

Before this patch, we use value from 2 seconds ago to decide
whether we should do lc calibration.
Although this don't happen frequently, fix flow to the way it should be.

Fixes: 7ae7784ec2a8 ("rtw88: 8822c: add LC calibration for RTL8822C")
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210426013252.5665-3-pkshih@realtek.com
3 years agortw88: add path diversity
Po-Hao Huang [Mon, 26 Apr 2021 01:32:51 +0000 (09:32 +0800)]
rtw88: add path diversity

This feature chooses to transmit with antenna that has better signal
strength periodically under 1ss rate.

It can benefit connection quality in the following cases:
1. User is far away from the AP.
2. The far-field pattern of the antenna showed significant signal
strength difference.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210426013252.5665-2-pkshih@realtek.com
3 years agortw88: add beacon filter support
Po-Hao Huang [Mon, 26 Apr 2021 01:32:50 +0000 (09:32 +0800)]
rtw88: add beacon filter support

Adding this supports beacon filter and CQM.
Let firmware perform connection quality monitor and beacon processing.
This make host CPU wakeup less under power save mode.
To make mechanisms work as usual, fw will notify driver events such as
signal change and beacon loss.

This feature needs firmware 9.9.8 or newer to support it, and driver is
compatible with older firmware.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210426013252.5665-1-pkshih@realtek.com
3 years agoiwlwifi: bump FW API to 64 for AX devices
Luca Coelho [Mon, 21 Jun 2021 07:37:40 +0000 (10:37 +0300)]
iwlwifi: bump FW API to 64 for AX devices

Start supporting API version 64 for AX devices.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.8144a5b7d9a7.Ibf77fd7daa7d22f7c46d1c4a572ab9441a761299@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: fw: dump TCM error table if present
Johannes Berg [Mon, 21 Jun 2021 07:37:39 +0000 (10:37 +0300)]
iwlwifi: fw: dump TCM error table if present

If the TCM is present in the hardware (as advertised in the firmware
file TLV data), dump its error log table during firmware error dumps.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.2d2149f6654f.Id831f8fbca59900ba7efc623ffca0ca938b664d3@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add 9560 killer device
ybaruch [Mon, 21 Jun 2021 07:37:38 +0000 (10:37 +0300)]
iwlwifi: add 9560 killer device

add new killer devices configurations.

Signed-off-by: ybaruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.4179f7191531.I3d5ed6b2b39fcd42863a679e21bda23a6c14253e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: move error dump to fw utils
Johannes Berg [Mon, 21 Jun 2021 07:37:37 +0000 (10:37 +0300)]
iwlwifi: move error dump to fw utils

Conceptually, this belongs more into the firmware utils
rather than the mvm opmode, so move the collection and
output there.

Note that this slightly changes the format of the Status
line.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.b82b60d81346.Ide3b688107f6a59c7fc7eb1d8f2002b0a5c1f2d2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: support loading the reduced power table from UEFI
Luca Coelho [Mon, 21 Jun 2021 07:37:36 +0000 (10:37 +0300)]
iwlwifi: support loading the reduced power table from UEFI

This new feature allows OEMs to set a special reduced power table in a
UEFI variable, which we use to tell the firmware to change the TX
power tables.

Read the variable and store it in a dram block to pass it to the
firmware.  We do this as part of the PNVM loading flow.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.259a33ba5074.I2e0bb142d2a9c412547cba89b62dd077b328fdc4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: move UEFI code to a separate file
Luca Coelho [Mon, 21 Jun 2021 07:37:35 +0000 (10:37 +0300)]
iwlwifi: move UEFI code to a separate file

We are going to read more variables from UEFI, so it's cleaner to have
all the code that handles UEFI variables in a separate file.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.c705ac86f2e9.Ia7421c17fe52929e4098b4f0cf070809ed3ef906@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: introduce iwl_wowlan_get_status_cmd
Emmanuel Grumbach [Mon, 21 Jun 2021 07:37:34 +0000 (10:37 +0300)]
iwlwifi: mvm: introduce iwl_wowlan_get_status_cmd

We need to pass the station id to teach the firmware on which
station id we want to get the status.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.45218d913d07.I61a086936508230d86b454636945ceb0b9ea09fd@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: introduce iwl_wowlan_kek_kck_material_cmd_v4
Emmanuel Grumbach [Mon, 21 Jun 2021 07:37:33 +0000 (10:37 +0300)]
iwlwifi: mvm: introduce iwl_wowlan_kek_kck_material_cmd_v4

We need to pass the station id to teach the firmware on which
station id we want to configure the key material.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.13417410e9ea.I140c16e70f8ac91cec7e8189e182e2f672c39258@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: update iwl_wowlan_patterns_cmd
Emmanuel Grumbach [Mon, 21 Jun 2021 07:37:32 +0000 (10:37 +0300)]
iwlwifi: mvm: update iwl_wowlan_patterns_cmd

We need to pass the station id to tell the firmware
on which station we want to configure the patterns.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.73eceb822890.I37347afbc01497a8a9e4d4afe4fa9a965abd31ac@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: introduce iwl_proto_offload_cmd_v4
Emmanuel Grumbach [Fri, 18 Jun 2021 08:01:21 +0000 (11:01 +0300)]
iwlwifi: mvm: introduce iwl_proto_offload_cmd_v4

We need to pass the station id to tell the firmware
on which station we want to configure the protocol
offload.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.c25913d2c08c.Ic0fefac81afb9a2fe396d73528e30e09a8c5eae0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: fix NUM_IWL_UCODE_TLV_* definitions to avoid sparse errors
Luca Coelho [Fri, 18 Jun 2021 08:01:20 +0000 (11:01 +0300)]
iwlwifi: fix NUM_IWL_UCODE_TLV_* definitions to avoid sparse errors

We were assigning these macros manually when sparse is running, but
with newer versions of sparse, it started causing other warnings.  Fix
it by making it a macro when sparse is running.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.dc658639e07f.I69ab6d59ff10c55c8517621eb20a52194dc4783a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: free some DMA memory earlier
Johannes Berg [Fri, 18 Jun 2021 08:01:19 +0000 (11:01 +0300)]
iwlwifi: pcie: free some DMA memory earlier

In gen3, after firmware is alive, we no longer need the
firmware and image loader images, only the context info
itself and PRPH info/scratch need to remain.

Call iwl_pcie_ctxt_info_gen3_free() appropriately in the
alive callback (iwl_trans_pcie_gen2_fw_alive()) with a new
argument indicating whether it can free everything or only
partially.

The context info and PRPH scratch are also not needed after
PNVM load, but we don't have a good hook for freeing after
that, so keep them for now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.8230d91a46c1.Ia7db71e5e6265ca87363f1481eac1bc3bbebb15c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: fill phy_data.d1 for no-data RX
Johannes Berg [Fri, 18 Jun 2021 08:01:18 +0000 (11:01 +0300)]
iwlwifi: mvm: fill phy_data.d1 for no-data RX

We don't fill in phy_data.d1 in no-data RX, and thus we
pretend some data is actually filled in radiotap when it
isn't or has default (zero) values.

Fill in phy_data.d1 appropriately, and while at it also
move the info_type initialization into the initializer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.3d488885f77c.Ib97a2bc57c1e9fb98927dc6f802568db313abe3b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: fix context info freeing
Johannes Berg [Fri, 18 Jun 2021 08:01:17 +0000 (11:01 +0300)]
iwlwifi: pcie: fix context info freeing

After firmware alive, iwl_trans_pcie_gen2_fw_alive() is called
to free the context info. However, on gen3 that will then free
the context info with the wrong size.

Since we free this allocation later, let it stick around until
the device is stopped for now, freeing some of it earlier is a
separate change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.afb63fb8cbc1.If4968db8e09f4ce2a1d27a6d750bca3d132d7d70@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: free IML DMA memory allocation
Johannes Berg [Fri, 18 Jun 2021 08:01:16 +0000 (11:01 +0300)]
iwlwifi: pcie: free IML DMA memory allocation

In the case of gen3 devices with image loader (IML) support,
we were leaking the IML DMA allocation and never freeing it.
Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.07e117dbedb7.I7bb9ebbe0617656986c2a598ea5e827b533bd3b9@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: support LONG_GROUP for WOWLAN_GET_STATUSES version
Emmanuel Grumbach [Fri, 18 Jun 2021 08:01:15 +0000 (11:01 +0300)]
iwlwifi: mvm: support LONG_GROUP for WOWLAN_GET_STATUSES version

It's been a while that the firmware uses LONG_GROUP by default
and not LEGACY_GROUP.
Until now the firmware wrongly advertise the WOWLAN_GET_STATUS
command's version with LEGACY_GROUP, but it is now being fixed.
In order to support both firmwares, first try to get the version
number of the command with the LONG_GROUP and if the firmware
didn't advertise the command version with LONG_GROUP, try to get
the command version with LEGACY_GROUP.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.cd6f4e421430.Iec07c746c8e65bc267e4750f38e4f74f2010ca45@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: support ver 6 of WOWLAN_CONFIGURATION and ver 10 of WOWLAN_GET_STATUSES
Naftali Goldstein [Fri, 18 Jun 2021 08:01:14 +0000 (11:01 +0300)]
iwlwifi: support ver 6 of WOWLAN_CONFIGURATION and ver 10 of WOWLAN_GET_STATUSES

These two version updates deprecate the need to set/get the nonqos sequence
counter during suspend/resume flow respectively; NICs supporting this
version maintain this counter internally and don't lose it during the
suspend/resume flow.

Note that this means that for such NICs the NON_QOS_TX_COUNTER_CMD is no
longer ever sent.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.dd25dd667798.I8db9adcdbb133304b58cf417f8698611138c83b4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't request mac80211 to disable/enable sta's queues
Naftali Goldstein [Fri, 18 Jun 2021 08:01:13 +0000 (11:01 +0300)]
iwlwifi: mvm: don't request mac80211 to disable/enable sta's queues

When operating in AP mode with NICs supporting the AP_LINK_PS hw flag,
mac80211 doesn't need to start/stop queueing tx for connected stations
because the FW already handles that.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.64df994c8fbb.I0fa5cda3a5f893a396eef30a01522422be359e69@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Explicitly stop session protection before unbinding
Ilan Peer [Fri, 18 Jun 2021 08:01:12 +0000 (11:01 +0300)]
iwlwifi: mvm: Explicitly stop session protection before unbinding

In case of unbinding, the FW would remove the session protection time
events without sending a notification, so explicitly cancel the
session protection, so future requests for mgd_prepare_tx() would not
assume that the session protection is running.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.7c30f85ed241.Ibc19fdbefca7135f2c4ea83d0aef6b81b5033dcd@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Read acpi dsm to get unii4 enable/disable bitmap.
Abhishek Naik [Thu, 17 Jun 2021 07:08:52 +0000 (10:08 +0300)]
iwlwifi: mvm: Read acpi dsm to get unii4 enable/disable bitmap.

Read the UNII4 setting from the ACPI table and use it in the
LARI_CONFIG_CHANGE_CMD accordingly.

This setting allows OEMs to enable or disable UNII4, bypassing the FW
defaults.

Signed-off-by: Abhishek Naik <abhishek.naik@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.223090c509c4.If03cb5393607ae494041b6187bcec134d6a1e06d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: remove TR/CR tail allocations
Johannes Berg [Thu, 17 Jun 2021 08:07:28 +0000 (11:07 +0300)]
iwlwifi: pcie: remove TR/CR tail allocations

The TR/CR tail data are meant to be per-queue-arrays, however,
we allocate them completely wrong (we have a separate allocation
per queue).

Looking at this more closely, it turns out that the hardware
never uses these - we have a separate free list per RX queue
and maintain a write pointer for that in a register, and the
RX itself is indicated in the RB status (rb_stts) DMA region.

Despite nothing using the tail pointers, the hardware will
unconditionally access them to write updates, even when we aren't
using CRs/TRs.

Give it dummy values that we never use/update so it can do that
without causing trouble.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617110647.5f5764e04c46.I4d5de1929be048085767f1234a1e07b517ab6a2d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: fix some kernel-doc comments
Johannes Berg [Thu, 17 Jun 2021 07:08:50 +0000 (10:08 +0300)]
iwlwifi: pcie: fix some kernel-doc comments

"ubd" is really called "used_bd", fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.2d4b46c656bb.Iff9ee6a7e65d439169202911dad2cbea626fb887@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: advertise broadcast TWT support
Shaul Triebitz [Thu, 17 Jun 2021 07:08:49 +0000 (10:08 +0300)]
iwlwifi: advertise broadcast TWT support

If the firmware supports broadcast TWT (know by TLV),
add the broadcast TWT HE MAC capability.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.80fee3171b53.Idfb69643f4044ec26865d023d0c2a1d6466694aa@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: support LMR feedback
Avraham Stern [Thu, 17 Jun 2021 07:08:48 +0000 (10:08 +0300)]
iwlwifi: mvm: support LMR feedback

If the LMR feedback is set in the ranging request, set the
corresponding flag in the fw command.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.0c00dd724f5c.I8283b95c26f4226deaea42e7be35aa9d41eb7580@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: correct HE capabilities
Johannes Berg [Thu, 17 Jun 2021 07:08:47 +0000 (10:08 +0300)]
iwlwifi: correct HE capabilities

The (default) HE capabilities for our devices weren't handled
correctly, adjust them to match the correct capabilities of
the devices.

Since the device regulatory will not allow 160 MHz on 5 GHz,
don't advertise this capability by default; do it only if an
NVM file is being loaded that might change the regulatory
parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.e8d0b02ec86b.Ia6ef8cc0480d38af25e6ac45fad9fb15bdfcbc2c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Call NMI instead of REPLY_ERROR
Harish Mitty [Thu, 17 Jun 2021 07:08:46 +0000 (10:08 +0300)]
iwlwifi: mvm: Call NMI instead of REPLY_ERROR

For IWL_DEVICE_FAMILY_22000 & greater, driver will call
NMI instead of REPLY_ERROR as FW->Infra does not support
this command for this family onwards.

Signed-off-by: Harish Mitty <harish.mitty@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.597f4246c79d.Ia0a1bbc2e66b4e849174db685208fc2b8bd5732e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: fix error print when session protection ends
Shaul Triebitz [Thu, 17 Jun 2021 07:08:45 +0000 (10:08 +0300)]
iwlwifi: mvm: fix error print when session protection ends

When the session protection ends and the Driver is not
associated or a beacon was not heard, the Driver
prints "No beacons heard...".
That's confusing for the case where not associated.
Change the print when not associated to "Not associated...".

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.41a5a5a894fa.I9eabb76e7a3a7f4abbed8f2ef918f1df8e825726@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: honour firmware SMPS requests
Johannes Berg [Thu, 17 Jun 2021 07:08:44 +0000 (10:08 +0300)]
iwlwifi: mvm: honour firmware SMPS requests

The firmware can now request SMPS (due to thermal conditions), add
some code to honour such requests and bubble them up through the
stack, subject to our other SMPS constraints, e.g. from Bluetooth.

Then, if the firmware requests SMPS, then we know that it supports
a small extension to the PHY configuration API where a chain mask
of 0 means "use 1 but pick which one yourself", so in this case we
use that extension.

During firmware restart, we stay in the previous state, and the FW
will send us a notification at startup (only) if the temperature is
below the lower or above the high threshold, to sync the state.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.85656b7684b9.I7a661a0758d070a750d3a91874d1a0f5fab9febc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: apply RX diversity per PHY context
Johannes Berg [Thu, 17 Jun 2021 07:08:43 +0000 (10:08 +0300)]
iwlwifi: mvm: apply RX diversity per PHY context

SMPS requests may differ per interfaces due to e.g. Bluetooth
only interfering on 2.4 GHz, so if that's the case we should,
in the case of multiple PHY contexts, still allow RX diversity
on PHY context that have no interfaces with SMPS requests.

Fix the code to pass through the PHY context in question and
skip interfaces with non-matching PHY context while iterating.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.123c6b05809d.I992e3d1c6a29850d02eeec01712b5b685b963a87@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't request SMPS in AP mode
Johannes Berg [Thu, 17 Jun 2021 07:08:42 +0000 (10:08 +0300)]
iwlwifi: mvm: don't request SMPS in AP mode

This is not valid (in the spec) and mac80211 will soon
warn on it, in addition to ignoring it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.d568df20e273.Id45ae38f9b16b3c56fa62266e3e89a1421ea07b0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: identify the RF module
Johannes Berg [Thu, 17 Jun 2021 07:08:41 +0000 (10:08 +0300)]
iwlwifi: pcie: identify the RF module

Identify and print out the RF module to be able to identify
(from logs and through debugfs) which one (and version) is
present on the system.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.cd1ef97b2c04.Iad42a59902a87a50b45b9ce88705863686a83b54@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: yoyo: support region TLV version 2
Mukesh Sisodiya [Sat, 12 Jun 2021 11:32:45 +0000 (14:32 +0300)]
iwlwifi: yoyo: support region TLV version 2

Region TLV version 2 now includes more data, but it is not
relevant for the driver.
In order to support this new version, just mask the new part out.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.60dd4c60ab49.I44fe02af389d3ab089363bf9bde0d99a4c1ff383@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove duplicate iwl_ax201_cfg_qu_hr declaration
Johannes Berg [Sat, 12 Jun 2021 11:32:44 +0000 (14:32 +0300)]
iwlwifi: remove duplicate iwl_ax201_cfg_qu_hr declaration

This configuration struct is declared twice, remove one of the
declarations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.a08c905ec25b.Iff706f9d5b7b666e306549c419d04dcd4d81e5fd@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: remove CSR_HW_RF_ID_TYPE_CHIP_ID
Johannes Berg [Sat, 12 Jun 2021 11:32:43 +0000 (14:32 +0300)]
iwlwifi: pcie: remove CSR_HW_RF_ID_TYPE_CHIP_ID

This is duplicated with CSR_HW_RFID_TYPE so just use the latter
for less typing/shorter lines.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.00b220f4ba53.I1fe216a46e7d9c1316d681daa293064f16ff1899@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: print interrupt number, not index
Johannes Berg [Sat, 12 Jun 2021 11:32:42 +0000 (14:32 +0300)]
iwlwifi: pcie: print interrupt number, not index

Printing the interrupt index in our local array isn't very
useful in an error message, print the interrupt number (as
also shown in e.g. /proc/interrupts) instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.05bc5157e606.Ifb65b5ed2e5296fd8258c40c4287b5443b06d337@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: Add support for AX231 radio module with Ma devices
Matti Gottlieb [Sat, 12 Jun 2021 11:32:41 +0000 (14:32 +0300)]
iwlwifi: pcie: Add support for AX231 radio module with Ma devices

Add support for AX231 radio modules, which we call Fm.
These modules can be used with the Ma family of devices
and above.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.c1fdd153d686.I7ee0485c52fb429de1fe171cb6dc0ae593a26788@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: increase PNVM load timeout
Luca Coelho [Sat, 12 Jun 2021 11:32:40 +0000 (14:32 +0300)]
iwlwifi: increase PNVM load timeout

The FW has a watchdog of 200ms in the PNVM load flow, so the driver
should have a slightly higher timeout.  Change the timeout from 100ms
to 250ms.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: 70d3ca86b025 ("iwlwifi: mvm: ring the doorbell and wait for PNVM load completion")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.ba22aec1e2be.I36bfadc28c480f4fc57266c075a79e8ea4a6934f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: handle pcim_iomap_table() failures better
Johannes Berg [Sat, 12 Jun 2021 11:32:39 +0000 (14:32 +0300)]
iwlwifi: pcie: handle pcim_iomap_table() failures better

pcim_iomap_table() might return NULL, so we shouldn't unconditionally
dereference the return value by taking the [0] entry.

Handle this better by checking for NULL first, and then separately
checking if the [0] entry is NULL.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.9aa4f0e3574a.I458b283f203d5f927f00be1bfbd4b8ebf11c5ae4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't change band on bound PHY contexts
Johannes Berg [Sat, 12 Jun 2021 11:32:38 +0000 (14:32 +0300)]
iwlwifi: mvm: don't change band on bound PHY contexts

When we have a P2P Device active, we attempt to only change the
PHY context it uses when we get a new remain-on-channel, if the
P2P Device is the only user of the PHY context.

This is fine if we're switching within a band, but if we're
switching bands then the switch implies a removal and re-add
of the PHY context, which isn't permitted by the firmware while
it's bound to an interface.

Fix the code to skip the unbind/release/... cycle only if the
band doesn't change (or we have old devices that can switch the
band on the fly as well.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.e9ac313f70f3.I713b9d109957df7e7d9ed0861d5377ce3f8fccd3@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove unused REMOTE_WAKE_CONFIG_CMD definitions
Luca Coelho [Sat, 12 Jun 2021 11:32:37 +0000 (14:32 +0300)]
iwlwifi: remove unused REMOTE_WAKE_CONFIG_CMD definitions

We don't use this command anymore and it is going to be removed from
the FW.  Remove all related definitions.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.549b282ae9a4.Iced05882d73b869e19f50e6a6e7bf9ce6cd7899b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: fix indentation in some scan functions
Luca Coelho [Sat, 12 Jun 2021 11:32:36 +0000 (14:32 +0300)]
iwlwifi: mvm: fix indentation in some scan functions

Two functions had indentation mistakes which were causing sparse
warnings.  Fix them.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.12f3b9fea57e.I42a7556d43de78ec6387e3a699eca10482b0485d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: pass the clock type to iwl_mvm_get_sync_time()
Luca Coelho [Sat, 12 Jun 2021 11:32:35 +0000 (14:32 +0300)]
iwlwifi: mvm: pass the clock type to iwl_mvm_get_sync_time()

Allow the caller to pass the clock type to iwl_mvm_get_sync_time() so
callers with different needs can decide whether to use boottime or
realtime.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.093f6660e69b.Ifd2328ac2130269f729c9c1bceec44ba01d79e88@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: support BIOS enable/disable for 11ax in Russia
Miri Korenblit [Sat, 12 Jun 2021 11:32:34 +0000 (14:32 +0300)]
iwlwifi: mvm: support BIOS enable/disable for 11ax in Russia

Read the new BIOS DSM and Pass to FW if to disable\enable
11ax for Russia according to the BIOS key. This is
needed to enable OEMs to control enable/disable 11ax in Russia.
Also add support for future "enable 11ax in country X" features.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.a705f7cedff8.I580f1021cabcc37e88f5ec5e9a6bbf00aae514b6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoath11k: Enable QCN9074 device
Anilkumar Kolli [Thu, 17 Jun 2021 08:29:40 +0000 (11:29 +0300)]
ath11k: Enable QCN9074 device

The issues mentioned in commit 4e80946197a8
("ath11k: add qcn9074 pci device support") are fixed in firmware.
This patch enables QCN9074 device.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210615211348.92168-1-jouni@codeaurora.org
3 years agoath10k: demote chan info without scan request warning
Caleb Connolly [Thu, 17 Jun 2021 08:29:40 +0000 (11:29 +0300)]
ath10k: demote chan info without scan request warning

Some devices/firmwares cause this to be printed every 5-15 seconds,
though it has no impact on functionality. Demote this to a debug
message.

I see this on SDM845 and MSM8998 platforms, specifically the OnePlus 6 devices,
PocoPhone F1 and OnePlus 5.  On the OnePlus 6 (SDM845) we are stuck with the
following signed vendor fw:

[    9.339873] ath10k_snoc 18800000.wifi: qmi chip_id 0x30214 chip_family 0x4001 board_id 0xff soc_id 0x40030001
[    9.339897] ath10k_snoc 18800000.wifi: qmi fw_version 0x20060029 fw_build_timestamp 2019-07-12 02:14 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HL.2.0.c8-00041-QCAHLSWMTPLZ-1

The OnePlus 5 (MSM8998) is using firmware:

[ 6096.956799] ath10k_snoc 18800000.wifi: qmi chip_id 0x30214 chip_family 0x4001 board_id 0xff soc_id 0x40010002
[ 6096.956824] ath10k_snoc 18800000.wifi: qmi fw_version 0x1007007e fw_build_timestamp 2020-04-14 22:45 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HL.1.0.c6-00126-QCAHLSWMTPLZ-1.211883.1.278648.

Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.2.0.c8-00041-QCAHLSWMTPLZ-1
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.1.0.c6-00126-QCAHLSWMTPLZ-1.211883.1.278648

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210522171609.299611-1-caleb@connolly.tech
3 years agortl8xxxu: avoid parsing short RX packet
Íñigo Huguet [Tue, 11 May 2021 07:19:27 +0000 (09:19 +0200)]
rtl8xxxu: avoid parsing short RX packet

One USB data buffer can contain multiple received network
packets. If that's the case, they're processed this way:
1. Original buffer is cloned
2. Original buffer is trimmed to contain only the first
   network packet
3. This first network packet is passed to network stack
4. Cloned buffer is trimmed to eliminate the first network
   packet
5. Repeat with the cloned buffer until there are no more
   network packets inside

However, if the space remaining in original buffer after
the first network packet is not enough to contain at least
another network packet descriptor, it is not cloned.

The loop parsing this packets ended if remaining space == 0.
But if the remaining space was > 0 but < packet descriptor
size, another iteration of the loop was done, processing again
the previous packet because cloning didn't happen. Moreover,
the ownership of this packet had been passed to network
stack in the previous iteration.

This patch ensures that no extra iteration is done if the
remaining size is not enough for one packet, and also avoid
the first iteration for the same reason.

Probably this doesn't happen in practice, but can happen
theoretically.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210511071926.8951-1-ihuguet@redhat.com
3 years agortl8xxxu: Fix device info for RTL8192EU devices
Pascal Terjan [Sat, 24 Apr 2021 17:29:59 +0000 (18:29 +0100)]
rtl8xxxu: Fix device info for RTL8192EU devices

Based on 2001:3319 and 2357:0109 which I used to test the fix and
0bda:818b and 2357:0108 for which I found efuse dumps online.

== 2357:0109 ==
=== Before ===
Vendor: Realtek
Product: \x03802.11n NI
Serial:
=== After ===
Vendor: Realtek
Product: 802.11n NIC
Serial not available.

== 2001:3319 ==
=== Before ===
Vendor: Realtek
Product: Wireless N
Serial: no USB Adap
=== After ===
Vendor: Realtek
Product: Wireless N Nano USB Adapter
Serial not available.

Signed-off-by: Pascal Terjan <pterjan@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210424172959.1559890-1-pterjan@google.com
3 years agoMerge tag 'mt76-for-kvalo-2021-06-18' of https://github.com/nbd168/wireless into...
Kalle Valo [Sat, 19 Jun 2021 08:49:26 +0000 (11:49 +0300)]
Merge tag 'mt76-for-kvalo-2021-06-18' of https://github.com/nbd168/wireless into pending

mt76 patches for 5.14

* mt7915 MSI support
* disable ASPM on mt7915
* mt7915 tx status reporting
* mt7921 decap offload
* driver fixes
* cleanups
* mt7921 runtime power management improvements
* testmode improvements/fixes
* runtime PM improvements

3 years agomt76: mt7921: allow chip reset during device restart
Lorenzo Bianconi [Fri, 18 Jun 2021 10:30:47 +0000 (12:30 +0200)]
mt76: mt7921: allow chip reset during device restart

Disable chip full reset just during device probing but allow
it during hw restart.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7615: set macwork timeout according to runtime-pm
Lorenzo Bianconi [Fri, 18 Jun 2021 08:08:24 +0000 (10:08 +0200)]
mt76: mt7615: set macwork timeout according to runtime-pm

Set macwork timeout value according to runtime-pm in order to reduce
power consumption

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7663s: enable runtime-pm
Lorenzo Bianconi [Fri, 18 Jun 2021 08:08:23 +0000 (10:08 +0200)]
mt76: mt7663s: enable runtime-pm

Allow the user to enable runtime-pm for mt7663s driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7663s: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx path
Lorenzo Bianconi [Fri, 18 Jun 2021 08:08:22 +0000 (10:08 +0200)]
mt76: mt7663s: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx path

Similar to mt7663e, rely on mt76_connac_pm_ref/mt76_connac_pm_unref to
check PM state and increment/decrement wake counter

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7663s: rely on pm reference counting
Lorenzo Bianconi [Fri, 18 Jun 2021 08:08:21 +0000 (10:08 +0200)]
mt76: mt7663s: rely on pm reference counting

As already done for mt7921 and mt7663e, rely on pm reference counting in
drv/fw_own

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: sdio: do not run mt76_txq_schedule directly
Lorenzo Bianconi [Fri, 18 Jun 2021 08:08:20 +0000 (10:08 +0200)]
mt76: sdio: do not run mt76_txq_schedule directly

In order to support runtime-pm for sdio, do not run mt76_txq_schedule
directly, but schedule tx_worker instead

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: enable HE BFee capability
Deren Wu [Thu, 17 Jun 2021 14:38:25 +0000 (22:38 +0800)]
mt76: mt7921: enable HE BFee capability

Enables HE MU/SU beamformee functionality

Signed-off-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: disable TWT capabilities for the moment
Lorenzo Bianconi [Thu, 17 Jun 2021 11:02:09 +0000 (13:02 +0200)]
mt76: disable TWT capabilities for the moment

Disable TWT REQ/RES mac capabilities since TWT is not supported
yet in mt7915/mt7921.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: fix iv and CCMP header insertion
Ryder Lee [Thu, 17 Jun 2021 07:17:49 +0000 (15:17 +0800)]
mt76: fix iv and CCMP header insertion

The iv from RXD is only for TKIP_RSC/CCMP_PN/GCMP_PN, and it needs a
check for CCMP header insertion. Move mt76_cipher_type to mt76.h to
reduce duplicated code.

Signed-off-by: Xing Song <xing.song@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: fix the coredump is being truncated
Sean Wang [Thu, 17 Jun 2021 01:39:19 +0000 (09:39 +0800)]
mt76: mt7921: fix the coredump is being truncated

Fix the maximum size of the coredump generated with current mt7921
firmware. Otherwise, a truncated coredump would be reported to userland
via dev_coredumpv.

Also, there is an additional error handling enhanced in the patch to avoid
the possible invalid buffer access when the system failed to create the
buffer to hold the coredump.

Fixes: 0da3c795d07b ("mt76: mt7921: add coredump support")
Co-developed-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: fix kernel warning when reset on vif is not sta
Sean Wang [Tue, 15 Jun 2021 21:31:10 +0000 (05:31 +0800)]
mt76: mt7921: fix kernel warning when reset on vif is not sta

ieee80211_disconnect is only called for the staton mode.

[  714.050429] WARNING: CPU: 1 PID: 382 at net/mac80211/mlme.c:2787
ieee80211_disconnect+0x108/0x118 [mac80211]
[  714.116704] Hardware name: MediaTek Asurada rev1 board (DT)
[  714.122303] Workqueue: mt76 mt7921_mac_reset_work [mt7921e]
[  714.127877] pstate: 20c00009 (nzCv daif +PAN +UAO)
[  714.132761] pc : ieee80211_disconnect+0x108/0x118 [mac80211]
[  714.138430] lr : mt7921_vif_connect_iter+0x28/0x54 [mt7921e]
[  714.144083] sp : ffffffc0107cbbd0
[  714.147394] x29: ffffffc0107cbbd0 x28: ffffffb26c9cb928
[  714.152706] x27: ffffffb26c9cbd98 x26: 0000000000000000
[  714.158017] x25: 0000000000000003 x24: ffffffb26c9c9c38
[  714.163328] x23: ffffffb26c9c9c38 x22: ffffffb26c9c8860
[  714.168639] x21: ffffffb23b940000 x20: ffffffb26c9c8860
[  714.173950] x19: 0000000000000001 x18: 000000000000b67e
[  714.179261] x17: 00000000064dd409 x16: ffffffd739cb28f0
[  714.184571] x15: 0000000000000000 x14: 0000000000000227
[  714.189881] x13: 0000000000000400 x12: ffffffd73a4eb060
[  714.195191] x11: 0000000000000000 x10: 0000000000000000
[  714.200502] x9 : ffffffd703a0a000 x8 : 0000000000000006
[  714.205812] x7 : 2828282828282828 x6 : ffffffb200440396
[  714.211122] x5 : 0000000000000000 x4 : 0000000000000004
[  714.216432] x3 : 0000000000000000 x2 : ffffffb23b940c90
[  714.221743] x1 : 0000000000000001 x0 : ffffffb23b940c90
[  714.227054] Call trace:
[  714.229594]  ieee80211_disconnect+0x108/0x118 [mac80211]
[  714.234913]  mt7921_vif_connect_iter+0x28/0x54 [mt7921e]
[  714.240313]  __iterate_interfaces+0xc4/0xdc [mac80211]
[  714.245541]  ieee80211_iterate_interfaces+0x4c/0x68 [mac80211]
[  714.251381]  mt7921_mac_reset_work+0x410/0x468 [mt7921e]
[  714.256696]  process_one_work+0x208/0x3c8
[  714.260706]  worker_thread+0x23c/0x3e8
[  714.264456]  kthread+0x140/0x17c
[  714.267685]  ret_from_fork+0x10/0x18

Fixes: 0c1ce9884607 ("mt76: mt7921: add wifi reset support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: introduce dedicated control for deep_sleep
Lorenzo Bianconi [Sat, 12 Jun 2021 14:49:30 +0000 (16:49 +0200)]
mt76: mt7921: introduce dedicated control for deep_sleep

Introduce ds_enable switch to fully control fw deep_sleep capability

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: limit txpower according to userlevel power
Lorenzo Bianconi [Sat, 12 Jun 2021 12:48:48 +0000 (14:48 +0200)]
mt76: mt7921: limit txpower according to userlevel power

Limit tx power for single-sku according to userlevel power.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: improve code readability for mt7921_update_txs
Lorenzo Bianconi [Sat, 12 Jun 2021 12:43:03 +0000 (14:43 +0200)]
mt76: mt7921: improve code readability for mt7921_update_txs

Introduce mt7921_update_txs routine in order to improve code readability
for tx timestamp parsing/configuration.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add deep sleep control to runtime-pm knob
Sean Wang [Mon, 10 May 2021 15:14:53 +0000 (23:14 +0800)]
mt76: mt7921: add deep sleep control to runtime-pm knob

Add addtional the deep sleep control to runtime-pm knob to
allow us to control driver switching between the full power
mode and the deep sleep mode the firmware is able to support.

Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: enable deep sleep at runtime
Sean Wang [Mon, 10 May 2021 15:14:52 +0000 (23:14 +0800)]
mt76: mt7921: enable deep sleep at runtime

Enable the deep sleep mode with that firmware is able to trap into
the doze state at runtime to reduce the power consumption further.

The deep sleep mode is not allowed in the STA state transition with
the firmware to have the fast connection experience as we've done in
the full power mode

Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix IEEE80211_HE_PHY_CAP7_MAX_NC for station mode
Ryder Lee [Fri, 11 Jun 2021 18:04:20 +0000 (02:04 +0800)]
mt76: mt7915: fix IEEE80211_HE_PHY_CAP7_MAX_NC for station mode

The value of station mode is always 0.

Fixed: 00b2e16e0063 ("mt76: mt7915: add TxBF capabilities")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: use SPDX header file comment style
Tom Rix [Thu, 10 Jun 2021 21:44:38 +0000 (14:44 -0700)]
mt76: use SPDX header file comment style

header files should use '/* SPDX ... */
Change from c file comment syle to header style

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add a space between comment char and SPDX tag
Tom Rix [Thu, 10 Jun 2021 21:44:37 +0000 (14:44 -0700)]
mt76: add a space between comment char and SPDX tag

checkpatch expects a space between '#' and 'SPDX...'
Add a space.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: improve MU stability
Ryder Lee [Thu, 10 Jun 2021 20:03:26 +0000 (04:03 +0800)]
mt76: mt7915: improve MU stability

- Adjust starec flow since VHT MU group is only updated by starec_vht
  follows starec_bf settings.
- Drop unnecessary MU BF checks.

TX MPDU PER (Status = Success):
                                           TOT_MPDU_CNT  FAIL_MPDU_CNT  TX_PER
WCID Rate
1      VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF              114              0   0.00%
       VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF_MU            64              0   0.00%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF              128              0   0.00%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF_MU           745              0   0.00%
       VHT_BW80_2SS_MCS8_LGI_LDPC_MUBF_MU           856              0   0.00%
       VHT_BW80_2SS_MCS8_SGI_LDPC_MUBF_MU          1430              4   0.28%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF_MU          5220             31   0.59%
       VHT_BW80_2SS_MCS9_LGI_LDPC_iBF                59              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF               64              2   3.12%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF_MU         22132             76   0.34%
       VHT_BW80_2SS_MCS9_SGI_LDPC_iBF              2866              1   0.03%
2      VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF_MU          3781              5   0.13%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF_MU           735              0   0.00%
       VHT_BW80_2SS_MCS8_LGI_LDPC_MUBF_MU          1270            365  28.74%
       VHT_BW80_2SS_MCS8_SGI_LDPC_MUBF_MU          3420             57   1.67%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF              128              0   0.00%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF_MU            64              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF              191              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF_MU         18833            320   1.70%
       VHT_BW80_2SS_MCS9_SGI_LDPC_iBF              6040              0   0.00%
287    OFDM 6M

Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: introduce mt7915_mcu_set_txbf()
Ryder Lee [Thu, 10 Jun 2021 18:43:46 +0000 (02:43 +0800)]
mt76: mt7915: introduce mt7915_mcu_set_txbf()

Use mt7915_mcu_set_txbf() to reduce global functions. This can be
easily extended to support other TxBF commands in further patches.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: make mt76_update_survey() per phy
Ryder Lee [Thu, 10 Jun 2021 18:43:45 +0000 (02:43 +0800)]
mt76: make mt76_update_survey() per phy

Reduce duplicated survey for DBDC.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: drop the use of repeater entries for station interfaces
Felix Fietkau [Tue, 25 May 2021 16:45:04 +0000 (18:45 +0200)]
mt76: mt7915: drop the use of repeater entries for station interfaces

There are firmware or hardware issues, which are currently causing tx hangs
when attempting to use these interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: check band caps in mt76_connac_mcu_set_rate_txpower
Lorenzo Bianconi [Sat, 5 Jun 2021 11:50:52 +0000 (13:50 +0200)]
mt76: connac: check band caps in mt76_connac_mcu_set_rate_txpower

Check device band capabilities before configuring single-sku

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mt76_get_next_pkt_id in mt76.h
Lorenzo Bianconi [Thu, 10 Jun 2021 07:44:12 +0000 (09:44 +0200)]
mt76: move mt76_get_next_pkt_id in mt76.h

In order to remove duplicated code, move mt76_get_next_pkt_id routine
in mt76.h

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: reduce rx buffer size to 2048
Lorenzo Bianconi [Wed, 9 Jun 2021 15:13:58 +0000 (17:13 +0200)]
mt76: reduce rx buffer size to 2048

Reduce rx buffer size to 2048 for mt7921/mt7915/mt7615 since we
now support rx amsdu offload

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: fix the maximum interval schedule scan can support
Sean Wang [Wed, 9 Jun 2021 06:15:32 +0000 (14:15 +0800)]
mt76: connac: fix the maximum interval schedule scan can support

Maximum interval (in seconds) for schedule scan plan supported by
the offload firmware can be U16_MAX.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix rx fcs error count in testmode
Shayne Chen [Tue, 8 Jun 2021 06:55:58 +0000 (14:55 +0800)]
mt76: mt7915: fix rx fcs error count in testmode

FCS error packets are filtered by default and won't be reported to
driver, so that RX fcs error and PER in testmode always show zero.
Fix this issue by reading fcs error count from hw counter.

We did't fix this issue by disabling fcs error rx filter since it may
let HW suffer some SER errors.

Fixes: 5d8a83f09941 ("mt76: mt7915: implement testmode rx support")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: testmode: move chip-specific stats dump before common stats
Shayne Chen [Tue, 8 Jun 2021 06:55:57 +0000 (14:55 +0800)]
mt76: testmode: move chip-specific stats dump before common stats

Move chip-specific stats dumping part before common stats dumping
to provide flexibility for per-chip driver to modify the value of
common stats.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: add mt76_connac_mcu_get_nic_capability utility routine
Lorenzo Bianconi [Sun, 6 Jun 2021 13:18:12 +0000 (15:18 +0200)]
mt76: connac: add mt76_connac_mcu_get_nic_capability utility routine

Introduce mt76_connac_mcu_get_nic_capability utility routine to poll
device capabilities returned by mcu fw for CE devices (mt7663/mt7921).
This is a preliminary patch to introduce 6GHz support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>