History log of /linux-master/drivers/net/wireless/mediatek/mt76/mt7921/main.c
Revision Date Author Comments
# 06777c8f 10-Apr-2024 Hao Zhang <hao.zhang@mediatek.com>

wifi: mt76: mt7921e: add LED control support

Introduce wifi LED switch control, add flow to Control a wifi
gpio pin based on the status of WIFI radio, if the pin is connected
to an LED, the LED will indicate the status of the WiFi radio.

Signed-off-by: Hao Zhang <hao.zhang@mediatek.com>
Co-developed-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 42e85997 03-Apr-2024 Rong Yan <rong.yan@mediatek.com>

wifi: mt76: mt7921: cqm rssi low/high event notify

The implementation amounts to setting the driver flag
IEEE80211_VIF_SUPPORTS_CQM_RSSI, and then providing
mechanisms for continuously updating enough information
to be able to provide notifications to userspace when
RSSI drops below a certain threshold

Signed-off-by: Rong Yan <rong.yan@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 352d9661 06-Feb-2024 Leon Yen <leon.yen@mediatek.com>

wifi: mt76: mt7921: fix a potential association failure upon resuming

In multi-channel scenarios, the granted channel must be aborted before
suspending. Otherwise, the firmware will be put into a wrong state,
resulting in an association failure after resuming.
With this patch, the granted channel will be aborted before suspending
if necessary.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# f3f8f050 30-Jan-2024 Breno Leitao <leitao@debian.org>

wifi: fill in MODULE_DESCRIPTION()s for mt76 drivers

W=1 builds now warn if module is built without a MODULE_DESCRIPTION().
Add descriptions to the MediaTek mt76 drivers.

Here is a sorted list of descriptions. It might make the reviewing
process easier.

MODULE_DESCRIPTION("MediaTek MT7603E and MT76x8 wireless driver");
MODULE_DESCRIPTION("MediaTek MT7615E and MT7663E wireless driver");
MODULE_DESCRIPTION("MediaTek MT7615E MMIO helpers");
MODULE_DESCRIPTION("MediaTek MT7663 SDIO/USB helpers");
MODULE_DESCRIPTION("MediaTek MT7663S (SDIO) wireless driver");
MODULE_DESCRIPTION("MediaTek MT7663U (USB) wireless driver");
MODULE_DESCRIPTION("MediaTek MT76x02 helpers");
MODULE_DESCRIPTION("MediaTek MT76x02 MCU helpers");
MODULE_DESCRIPTION("MediaTek MT76x0E (PCIe) wireless driver");
MODULE_DESCRIPTION("MediaTek MT76x0U (USB) wireless driver");
MODULE_DESCRIPTION("MediaTek MT76x2 EEPROM helpers");
MODULE_DESCRIPTION("MediaTek MT76x2E (PCIe) wireless driver");
MODULE_DESCRIPTION("MediaTek MT76x2U (USB) wireless driver");
MODULE_DESCRIPTION("MediaTek MT76x connac layer helpers");
MODULE_DESCRIPTION("MediaTek MT76x EEPROM helpers");
MODULE_DESCRIPTION("MediaTek MT76x helpers");
MODULE_DESCRIPTION("MediaTek MT76x SDIO helpers");
MODULE_DESCRIPTION("MediaTek MT76x USB helpers");
MODULE_DESCRIPTION("MediaTek MT7915E MMIO helpers");
MODULE_DESCRIPTION("MediaTek MT7921 core driver");
MODULE_DESCRIPTION("MediaTek MT7921E (PCIe) wireless driver");
MODULE_DESCRIPTION("MediaTek MT7921S (SDIO) wireless driver");
MODULE_DESCRIPTION("MediaTek MT7921U (USB) wireless driver");
MODULE_DESCRIPTION("MediaTek MT7925 core driver");
MODULE_DESCRIPTION("MediaTek MT7925E (PCIe) wireless driver");
MODULE_DESCRIPTION("MediaTek MT7925U (USB) wireless driver");
MODULE_DESCRIPTION("MediaTek MT792x core driver");
MODULE_DESCRIPTION("MediaTek MT792x USB helpers");
MODULE_DESCRIPTION("MediaTek MT7996 MMIO helpers");

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240130104243.3025393-10-leitao@debian.org


# 10f29031 21-Nov-2023 Ming Yen Hsieh <mingyen.hsieh@mediatek.com>

wifi: mt76: mt7921: fix wrong 6Ghz power type

To avoid using incorrect 6g power settings after disconnection,
it should to update back to the default state when disconnected.

Fixes: 51ba0e3a15eb ("wifi: mt76: mt7921: add 6GHz power type support for clc")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 51ba0e3a 29-Sep-2023 Ming Yen Hsieh <mingyen.hsieh@mediatek.com>

wifi: mt76: mt7921: add 6GHz power type support for clc

There are several power type should be supported in 6GHz band. mt7921
apply 6GHz power type from AP settings and clc will setup the
corresponding regulatory power.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 5ab7d466 20-Sep-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt792x: move some common usb code in mt792x module

Move the following shared usb routines in mt792x module:
- mt792xu_stop
- mt792x_stop

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


# f5020655 18-Sep-2023 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: move struct ieee80211_chanctx_conf up to struct mt76_vif

Move struct ieee80211_chanctx_conf up to struct mt76_vif to allow the
connac2 library can access the struct ieee80211_chanctx_conf * member in
struct mt76_vif.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: David Ruth <druth@chromium.org>
Tested-by: David Ruth <druth@chromium.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 0335c034 29-Aug-2023 Felix Fietkau <nbd@nbd.name>

wifi: mt76: fix race condition related to checking tx queue fill status

When drv_tx calls race against local tx scheduling, the queue fill status checks
can potentially race, leading to dma queue entries being overwritten.
Fix this by deferring packets from drv_tx calls to the tx worker, in order to
ensure that all regular queue tx comes from the same context.

Reported-by: Ryder Lee <Ryder.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# e8c18412 28-Aug-2023 Johannes Berg <johannes.berg@intel.com>

wifi: cfg80211: annotate iftype_data pointer with sparse

There were are a number of cases in mac80211 and iwlwifi (at
least) that used the sband->iftype_data pointer directly,
instead of using the accessors to find the right array entry
to use.

Make sparse warn when such a thing is done.

To not have a lot of casts, add two helper functions/macros

- ieee80211_set_sband_iftype_data()
- for_each_sband_iftype_data()

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


# 29f5a494 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: move acpi_sar code in mt792x-lib module

Move acpi_sar code in mt792x-lib module since it is shared between
mt7921 and mt7925 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 311f121c 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: move mac shared code in mt792x-lib module

Reduce duplicated code moving mac shared code in mt792x-lib module.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# c74df1c0 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt792x: introduce mt792x-lib module

mt792x-lib module will contain the shared code between mt7921 and new
MT79 WiFi7 chipset

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 20249e1a 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: move mt792x_hw_dev in mt792x.h

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# c605d0ce 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: move mt792x_mutex_{acquire/release} in mt792x.h

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 975e122d 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rename mt7921_dev in mt792x_dev

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 78562b2c 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rename mt7921_phy in mt792x_phy

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# b7bfad2c 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rename mt7921_sta in mt792x_sta

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 15ca8970 28-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rename mt7921_vif in mt792x_vif

This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# ef591d74 22-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: move ampdu_state in mt76_wcid

ampdu_state field is used by most of the drivers, so move it in
mt76_wcid structure.

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


# d17a2fe8 22-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rely on shared poll_list field

Rely on poll_list field in mt76_wcid structure and get rid of
private copy.

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


# 419acc51 22-Jun-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rely on shared sta_poll_list and sta_poll_lock

Rely on sta_poll_list and sta_poll_lock fields in mt76_dev structure
and get rid of private copies.

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


# 749c2c2b 17-May-2023 Ryder Lee <ryder.lee@mediatek.com>

wifi: mt76: add tx_nss histogram to ethtool stats

mt76_connac2_mac_fill_txs() counts tx_nss but ethtool doesn't show
stats. Add missing histogram accordingly.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 9aecfa75 15-May-2023 Deren Wu <deren.wu@mediatek.com>

wifi: mt76: mt7921e: report tx retries/failed counts in tx free event

Get missing tx retries/failed counts from txfree done events and report
them via mt7921_sta_statistics().

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 52a1f158 12-May-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: mt7921: rely on mib_stats shared definition

Get rid of private copy of mib_stats structure.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# d616d368 10-May-2023 Deren Wu <deren.wu@mediatek.com>

wifi: mt76: mt7921: do not support one stream on secondary antenna only

mt7921 support following antenna combiantions only.
* primary + secondary (2x2)
* primary only (1x1)

Since we cannot work on secondary antenna only, return error if the
antenna bitmap is 0x2 in .set_antenna().

For example:
iw phy0 set antenna 3 3 /* valid */
iw phy0 set antenna 1 1 /* valid */
iw phy0 set antenna 2 2 /* invalid */

Cc: stable@vger.kernel.org
Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Suggested-by: Knox Chiou <knoxchiou@google.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 6a8b899d 02-Apr-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: add mt76_connac_gen_ppe_thresh utility routine

gen_ppe_thresh routine is shared between mt7615, mt7915, mt7921 and
mt7996 so move it in mt76_connac module.

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


# a5af1481 07-Mar-2023 Neil Chen <yn.chen@mediatek.com>

wifi: mt76: mt7921: use driver flags rather than mac80211 flags to mcu

FIF_* flags from mac80211 is not ABI. mt7921 should not pass it into mcu
directly. Remap FIF_* to driver defined flags as mcu command input.

Fixes: c222f77fd421 ("wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistent")
Signed-off-by: Neil Chen <yn.chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# fcc51acf 10-Feb-2023 Deren Wu <deren.wu@mediatek.com>

wifi: mt76: mt7921: fix wrong command to set STA channel

Should not use AND operator to check vif type NL80211_IFTYPE_MONITOR, and
that will cause we go into sniffer command for both STA and MONITOR
mode. However, the sniffer command would set channel properly (with some
extra options), the STA mode still works even if using the wrong
command.

Fix vif type check to make sure we using the right command to update
channel.

Fixes: 914189af23b8 ("wifi: mt76: mt7921: fix channel switch fail in monitor mode")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# e6db67fa 30-Mar-2023 Felix Fietkau <nbd@nbd.name>

wifi: mt76: ignore key disable commands

This helps avoid cleartext leakage of already queued or powersave buffered
packets, when a reassoc triggers the key deletion.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230330091259.61378-1-nbd@nbd.name


# 731425f3 31-Jan-2023 Shayne Chen <shayne.chen@mediatek.com>

wifi: mt76: add EHT rate stats for ethtool

Add support to get EHT rate stats from ethtool.
This is the preliminary patch to add EHT support for mt7996.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 192ad406 17-Jan-2023 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: enable page_pool stats

Enable page_pool ethtool statistics for mt7915 and mt7921 chipsets.

Tested-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# c222f77f 17-Jan-2023 Neil Chen <yn.chen@mediatek.com>

wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistent

The rx filter, in mt7921 series, may be changed in fw operation. There is
a racing problem if rx filter controlled by both driver and firmware at
the same time. To avoid this issue, let mt7921 driver set rx filter by new
command MCU_CE_CMD_SET_RX_FILTER and allow the firmware controlling it
only.

Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Neil Chen <yn.chen@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 67fc7a30 16-Dec-2022 Deren Wu <deren.wu@mediatek.com>

wifi: mt76: mt7921: add ack signal support

This reports signal strength of ACK packets from the peer as measured
at each interface.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 914189af 16-Dec-2022 Deren Wu <deren.wu@mediatek.com>

wifi: mt76: mt7921: fix channel switch fail in monitor mode

When the chanctx enabled, IEEE80211_CONF_CHANGE_CHANNEL in .config()
would not be called anymore. mt76 cannot control RF channel for monitor.
Add monitor type set-channel flow in .change_chanctx().

Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support")
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# de19b9c8 21-Dec-2022 Felix Fietkau <nbd@nbd.name>

wifi: mt76: mt7921: fix deadlock in mt7921_abort_roc

When mt7921_abort_roc is called with dev->mutex held, it can deadlock while
calling cancel_work_sync(&phy->roc_work), because the work function could
be waiting to acquire the mutex.

Fix this by flushing the work before taking the mutex

Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 7eefb93d 16-Nov-2022 YN Chen <YN.Chen@mediatek.com>

wifi: mt76: mt7921: fix wrong power after multiple SAR set

We should update CLC config before SAR set to synchronize all
related settings.

Fixes: 23bdc5d8cadf ("wifi: mt76: mt7921: introduce Country Location Control support")
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 41ac53c8 14-Nov-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: introduce chanctx support

The firmware can have the capability to manage the channel context
scheduling on multiple roles running on the device including Station,
AP and P2P GC/GO mode (will be extended based on the future patchset)
to help users sharing the network with others on a single device.

The firmware is able to support the channel chanctx up to 2 interface
simultaneously running on the different channels.

Another thing to be noted is that before the driver is going sent out the
management frames, the driver has to get the privilege from the firmware
to occupy the current channel context until the frame handshake is
completed and then get the privilege back to the firmware.

Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 034ae28b 14-Nov-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: introduce remain_on_channel support

Introduce remain_on_channel support. Additionally, we add
mt7921_check_offload_capability to disable .remain_on_channel and
.cancel_remain_on_channel and related configuration because those
operations would rely on the fundamental MCU commands that will be only
supported with newer firmware.

Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# a0ab9c31 10-Nov-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: add chanctx parameter to mt76_connac_mcu_uni_add_bss signature

Add a chanctx parameter to mt76_connac_mcu_uni_add_bss signature to allow
the firmware binds the BSS into the specific channel context.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# d107501a 02-Nov-2022 Lorenzo Bianconi <lorenzo@kernel.org>

wifi: mt76: move aggr_stats array in mt76_phy

Move aggregation stats array per-phy instead of share it between multiple
interfaces. This is a preliminary patch to add mt7996 driver support.

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


# 1bf66dc3 29-Aug-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value

We should reset mstat->airtime_ac along with clear up the entries in the
hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the
value msta->airtime_ac - [tx, rx]_last may be a negative and that is not
the actual airtime the device took in the last run.

Reported-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# dc877523 10-Aug-2022 Ryder Lee <ryder.lee@mediatek.com>

wifi: mt76: move move mt76_sta_stats to mt76_wcid

This is a preliminary patch for WED's TxS support.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 59c20b91 29-Jul-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload

Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race
with the context holding dev->muxtex and the driver might access the
device in low power state.

Fixes: 24299fc869f7 ("mt76: mt7921: enable rx header traslation offload")
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 52b44015 29-Jul-2022 Sean Wang <sean.wang@mediatek.com>

wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_ap

Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race
with the context holding dev->muxtex and the driver might access the
device in low power state.

Fixes: 9d958b60ebc2 ("mt76: mt7921: fix command timeout in AP stop period")
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# b3e2130b 24-Jun-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: change QoS settings API to take link into account

Take the link into account in the QoS settings (EDCA parameters)
APIs.

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


# a1a99d7b 04-Jul-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: add phy_idx to mt76_wcid

Introduce phy_idx to mt76_wcid structure instead of ext_phy.
This is a preliminary patch to add newer chipset support.

Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# b146f238 30-Jun-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: add len parameter to __mt76_mcu_msg_alloc signature

Introduce len to __mt76_mcu_msg_alloc signature in order to add the
capability to specify two different value for allocation and copy length.

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


# 4aa8e0a4 21-Jun-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: enable HW beacon filter in the initialization stage

The current driver has worked with HW beacon filter and connection
monitor all the way, here we move the enablement into the initialization
stage like other HW features being done to get rid of others are
confused why these configurations would be changed at runtime.

We still leave a way to turn off these offload features in debugfs knobs
but that is just for debugging purposes.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# abdb2b52 21-Jun-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: enable HW beacon filter not depending on PM flag

The hardware beacon filter works whether or not the PM flag is set, so we
drop redundant dependency checks on PM flags.

Additionally, the patch implicitly allow the MT7921[E, S, U] to have a
consistent configuration of the hardware beacon filter.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# fc6ee71a 20-Jun-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move mcu_txd/mcu_rxd structures in shared code

This is a preliminary patch to add mt7990 chipset support.

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


# 9d958b60 08-Jun-2022 Deren Wu <deren.wu@mediatek.com>

mt76: mt7921: fix command timeout in AP stop period

Due to AP stop improperly, mt7921 driver would face random command timeout
by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and
congiure BSS network settings in both hooks.

The new flow is shown below.
* AP start
.start_ap()
configure BSS network resource
set BSS to connected state
.bss_info_changed()
enable fw beacon offload

* AP stop
.bss_info_changed()
disable fw beacon offload (skip this command)
.stop_ap()
set BSS to disconnected state (beacon offload disabled automatically)
destroy BSS network resource

Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 182071cd 07-Jun-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: move connac2_mac_write_txwi in mt76_connac module

mac_write_txwi code is shared between connac2 devices (mt7915 and
mt7921). Move it in connac module.

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


# 63db9d40 20-May-2022 Deren Wu <deren.wu@mediatek.com>

mt76: mt7921: introduce ACPI SAR config in tx power

Add new function mt7921_set_tx_sar_pwr() to update SAR power from
.set_sar_specs and ACPI setting. Both settings would be merged into
mt76_freq_range_power for final tx power value.

Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 7b7090b4 24-May-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: split bss_info_changed method

Split the bss_info_changed method to vif_cfg_changed and
link_info_changed, with the latter getting a link ID.
Also change the 'changed' parameter to u64 already, we
know we need that.

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


# f276e20b 10-May-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: move interface config to new struct

We'll use bss_conf for per-link configuration later, so
move out all the non-link-specific data out into a new
struct ieee80211_vif_cfg used in the vif.

Some adjustments were done with the following spatch:

@@
expression sdata;
struct ieee80211_vif *vifp;
identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator };
@@
(
-sdata->vif.bss_conf.var
+sdata->vif.cfg.var
|
-vifp->bss_conf.var
+vifp->cfg.var
)

@bss_conf@
struct ieee80211_bss_conf *bss_conf;
identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator };
@@
-bss_conf->var
+vif_cfg->var

(though more manual fixups were needed, e.g. replacing
"vif_cfg->" by "vif->cfg." in many files.)

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


# 5fc201aa 11-May-2022 Deren Wu <deren.wu@mediatek.com>

mt76: mt7921: add ipv6 NS offload support

Add ipv6 NS offload for WoWLAN state.

Tested in this way:
1. Put device-A into WoW state.
2. ping6 from device-B to device-A.
3. In sniffer, see Neighbour advertisement from device-A.

Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# deb0891b 14-Apr-2022 Colin Ian King <colin.king@intel.com>

mt76: mt7921: make read-only array ppet16_ppet8_ru3_ru0 static const

Don't populate the read-only array ppet16_ppet8_ru3_ru0 on the stack but
instead make it static const. Also makes the object code a little smaller.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 116c6960 06-Apr-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: Add AP mode support

add AP mode support to mt7921 that can work for mt7921[e,s,u]
with the common code.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 47eea8ad 17-Mar-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: honor pm user configuration in mt7921_sniffer_interface_iter

Honor runtime-pm user configuration in mt7921_sniffer_interface_iter
routine if we do not have a monitor interface.

Fixes: 1f12fa34e5dc5 ("mt76: mt7921: don't enable beacon filter when IEEE80211_CONF_CHANGE_MONITOR is set")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 5e0abf6f 17-Mar-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: rely on mt76_dev rxfilter in mt7921_configure_filter

mt7921 is currently using rxfilter defined in mt76_dev for rx filter
configuration. Fix mt7921_configure_filter implementation.

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


# b619e013 17-Mar-2022 Evelyn Tsai <evelyn.tsai@mediatek.com>

mt76: fix MBSS index condition in DBDC mode

MT7915_MAX_INTERFACES is per-band declaration in MT7915/MT7986/MT7916.
Enlarge vif_mask to 64 bits wide, including the bit operation.

Reviewed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 51fb1278 25-Mar-2022 Felix Fietkau <nbd@nbd.name>

mt76: fix use-after-free by removing a non-RCU wcid pointer

Fixes an issue caught by KASAN about use-after-free in mt76_txq_schedule
by protecting mtxq->wcid with rcu_lock between mt76_txq_schedule and
sta_info_[alloc, free].

[18853.876689] ==================================================================
[18853.876751] BUG: KASAN: use-after-free in mt76_txq_schedule+0x204/0xaf8 [mt76]
[18853.876773] Read of size 8 at addr ffffffaf989a2138 by task mt76-tx phy0/883
[18853.876786]
[18853.876810] CPU: 5 PID: 883 Comm: mt76-tx phy0 Not tainted 5.10.100-fix-510-56778d365941-kasan #5 0b01fbbcf41a530f52043508fec2e31a4215

[18853.876840] Call trace:
[18853.876861] dump_backtrace+0x0/0x3ec
[18853.876878] show_stack+0x20/0x2c
[18853.876899] dump_stack+0x11c/0x1ac
[18853.876918] print_address_description+0x74/0x514
[18853.876934] kasan_report+0x134/0x174
[18853.876948] __asan_report_load8_noabort+0x44/0x50
[18853.876976] mt76_txq_schedule+0x204/0xaf8 [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2]
[18853.877002] mt76_txq_schedule_all+0x2c/0x48 [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2]
[18853.877030] mt7921_tx_worker+0xa0/0x1cc [mt7921_common f0875ebac9d7b4754e1010549e7db50fbd90a047]
[18853.877054] __mt76_worker_fn+0x190/0x22c [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2]
[18853.877071] kthread+0x2f8/0x3b8
[18853.877087] ret_from_fork+0x10/0x30
[18853.877098]
[18853.877112] Allocated by task 941:
[18853.877131] kasan_save_stack+0x38/0x68
[18853.877147] __kasan_kmalloc+0xd4/0xfc
[18853.877163] kasan_kmalloc+0x10/0x1c
[18853.877177] __kmalloc+0x264/0x3c4
[18853.877294] sta_info_alloc+0x460/0xf88 [mac80211]
[18853.877410] ieee80211_prep_connection+0x204/0x1ee0 [mac80211]
[18853.877523] ieee80211_mgd_auth+0x6c4/0xa4c [mac80211]
[18853.877635] ieee80211_auth+0x20/0x2c [mac80211]
[18853.877733] rdev_auth+0x7c/0x438 [cfg80211]
[18853.877826] cfg80211_mlme_auth+0x26c/0x390 [cfg80211]
[18853.877919] nl80211_authenticate+0x6d4/0x904 [cfg80211]
[18853.877938] genl_rcv_msg+0x748/0x93c
[18853.877954] netlink_rcv_skb+0x160/0x2a8
[18853.877969] genl_rcv+0x3c/0x54
[18853.877985] netlink_unicast_kernel+0x104/0x1ec
[18853.877999] netlink_unicast+0x178/0x268
[18853.878015] netlink_sendmsg+0x3cc/0x5f0
[18853.878030] sock_sendmsg+0xb4/0xd8
[18853.878043] ____sys_sendmsg+0x2f8/0x53c
[18853.878058] ___sys_sendmsg+0xe8/0x150
[18853.878071] __sys_sendmsg+0xc4/0x1f4
[18853.878087] __arm64_compat_sys_sendmsg+0x88/0x9c
[18853.878101] el0_svc_common+0x1b4/0x390
[18853.878115] do_el0_svc_compat+0x8c/0xdc
[18853.878131] el0_svc_compat+0x10/0x1c
[18853.878146] el0_sync_compat_handler+0xa8/0xcc
[18853.878161] el0_sync_compat+0x188/0x1c0
[18853.878171]
[18853.878183] Freed by task 10927:
[18853.878200] kasan_save_stack+0x38/0x68
[18853.878215] kasan_set_track+0x28/0x3c
[18853.878228] kasan_set_free_info+0x24/0x48
[18853.878244] __kasan_slab_free+0x11c/0x154
[18853.878259] kasan_slab_free+0x14/0x24
[18853.878273] slab_free_freelist_hook+0xac/0x1b0
[18853.878287] kfree+0x104/0x390
[18853.878402] sta_info_free+0x198/0x210 [mac80211]
[18853.878515] __sta_info_destroy_part2+0x230/0x2d4 [mac80211]
[18853.878628] __sta_info_flush+0x300/0x37c [mac80211]
[18853.878740] ieee80211_set_disassoc+0x2cc/0xa7c [mac80211]
[18853.878851] ieee80211_mgd_deauth+0x4a4/0x10a0 [mac80211]
[18853.878962] ieee80211_deauth+0x20/0x2c [mac80211]
[18853.879057] rdev_deauth+0x7c/0x438 [cfg80211]
[18853.879150] cfg80211_mlme_deauth+0x274/0x414 [cfg80211]
[18853.879243] cfg80211_mlme_down+0xe4/0x118 [cfg80211]
[18853.879335] cfg80211_disconnect+0x218/0x2d8 [cfg80211]
[18853.879427] __cfg80211_leave+0x17c/0x240 [cfg80211]
[18853.879519] cfg80211_leave+0x3c/0x58 [cfg80211]
[18853.879611] wiphy_suspend+0xdc/0x200 [cfg80211]
[18853.879628] dpm_run_callback+0x58/0x408
[18853.879642] __device_suspend+0x4cc/0x864
[18853.879658] async_suspend+0x34/0xf4
[18853.879673] async_run_entry_fn+0xe0/0x37c
[18853.879689] process_one_work+0x508/0xb98
[18853.879702] worker_thread+0x7f4/0xcd4
[18853.879717] kthread+0x2f8/0x3b8
[18853.879731] ret_from_fork+0x10/0x30
[18853.879741]
[18853.879757] The buggy address belongs to the object at ffffffaf989a2000
[18853.879757] which belongs to the cache kmalloc-8k of size 8192
[18853.879774] The buggy address is located 312 bytes inside of
[18853.879774] 8192-byte region [ffffffaf989a2000, ffffffaf989a4000)
[18853.879787] The buggy address belongs to the page:
[18853.879807] page:000000004bda2a59 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d89a0
[18853.879823] head:000000004bda2a59 order:3 compound_mapcount:0 compound_pincount:0
[18853.879839] flags: 0x8000000000010200(slab|head)
[18853.879857] raw: 8000000000010200 ffffffffbc89e208 ffffffffb7fb5208 ffffffaec000cc80
[18853.879873] raw: 0000000000000000 0000000000010001 00000001ffffffff 0000000000000000
[18853.879885] page dumped because: kasan: bad access detected
[18853.879896]
[18853.879907] Memory state around the buggy address:
[18853.879922] ffffffaf989a2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[18853.879935] ffffffaf989a2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[18853.879948] >ffffffaf989a2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[18853.879961] ^
[18853.879973] ffffffaf989a2180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[18853.879986] ffffffaf989a2200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[18853.879998] ==================================================================

Cc: stable@vger.kernel.org
Reported-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1f12fa34 15-Mar-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: don't enable beacon filter when IEEE80211_CONF_CHANGE_MONITOR is set

IEEE80211_CONF_CHANGE_MONITOR would be set every time even when vif runs as
sta mode.

If vif runs as sta mode, the beacon filter would be falsely enabled
earlier than the associated state.

That is not the behavior the firmware expects and also breaks the original
logic of sta mode. Thus, we only limit the operation to set the beacon
filter only for monitor mode when IEEE80211_CONF_CHANGE_MONITOR is set.

Fixes: 4ad65a54617c ("mt76: mt7921: toggle runtime-pm adding a monitor vif")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 0d2afe09f 14-Mar-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: add mt7921u driver

Introduce support for MT7921U 802.11ax 2x2:2SS wireless devices.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 07241519 28-Feb-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: use mt76_hw instead of open coding it

use mt76_hw instead of open coding it

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# cbaa0a40 28-Feb-2022 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: fix up the monitor mode

Properly set up the monitor mode the firmware can support to fix up
RTS/CTS and beacon frames cannot be captured and forwarded to the host.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 4a74ecc8 16-Jan-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: move mt76_connac_lmac_mapping in mt76-connac module

mt76_connac_lmac_mapping is shared between mt7921 and mt7915

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


# 4ad65a54 11-Jan-2022 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: toggle runtime-pm adding a monitor vif

Toggle runtime-pm and deep-sleep configuration adding/removing
a montior vif in order to forward all tx/rx frames to mac80211.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 827e7799 08-Jan-2022 Ben Greear <greearb@candelatech.com>

mt76: mt7921: fix crash when startup fails.

If the nic fails to start, it is possible that the
reset_work has already been scheduled. Ensure the
work item is canceled so we do not have use-after-free
crash in case cleanup is called before the work item
is executed.

This fixes crash on my x86_64 apu2 when mt7921k radio
fails to work. Radio still fails, but OS does not
crash.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 6683d988 19-Dec-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: move mt76_connac_mcu_add_key in connac module

Move key configuration code shared between mt7921 and mt7915 in
mt76-connac module and remove duplicated code.

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


# 54722402 09-Dec-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: introduce MCU_UNI_CMD macro

Similar to MCU_EXT_CMD, introduce MCU_UNI_CMD for unified commands

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


# e6d2070d 09-Dec-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: introduce MCU_EXT macros

Introduce MCU_EXT_CMD and MCU_EXT_QUERY macros in mt76_connac module.
This is a preliminary patch to reuse mt76_connac module in mt7915
driver.

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


# 00ff5234 26-Nov-2021 Shayne Chen <shayne.chen@mediatek.com>

mt76: mt7921: use correct iftype data on 6GHz cap init

Set 6GHz cap to iftype data which is matched to the type of
current interface.

Fixes: 50ac15a511e3 ("mt76: mt7921: add 6GHz support")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 5ad4faca 19-Nov-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921s: fix the device cannot sleep deeply in suspend

According to the MT7921S firmware, the cmd MCU_UNI_CMD_HIF_CTRL have to
be last MCU command to execute in suspend handler and all data traffic
have to be stopped before the cmd MCU_UNI_CMD_HIF_CTRL starts as well
in order that mt7921 can successfully fall into the deep sleep mode.

Where we reuse the flag MT76_STATE_SUSPEND and avoid creating
another global flag to stop all of the traffic onto the SDIO bus.

Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Reported-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 6906aa93 19-Nov-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: move mt76_connac_mcu_set_hif_suspend to bus-related files

This is a preliminary patch for the following patch
("mt76: mt7921s: fix the device cannot sleep deeply in suspend).

mt76_connac_mcu_set_hif_suspend eventually would be handled in each
bus-level suspend/resume handler in either mt7921/sdio.c or mt7921/pci.c
depending on what type of the bus the device is running on. We can move
mt76_connac_mcu_set_hif_suspend to bus-related files to simplify the logic.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# b3cb885e 21-Nov-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move sar utilities to mt76-core module

Move mt76_get_sar_power and mt76_init_sar_power in the common code.
This is a preliminary patch to add sar support to mt76x02 drivers.

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


# 5d461321 20-Nov-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: honor mt76_connac_mcu_set_rate_txpower return value in mt7921_config

Check return code from mt76_connac_mcu_set_rate_txpower() in mt7921_config
routine.

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


# 7f969050 16-Nov-2021 Deren Wu <deren.wu@mediatek.com>

mt76: mt7921: introduce 160 MHz channel bandwidth support

Introduce the basic configuration for BW160 capability in 7922

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 2363b6a6 28-Oct-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: drop offload_flags overwritten

offload_flags have to be dropped for mt7921 because mt76.omac_idx 0 would
always run as station mode that would cause Tx encapsulation setting
is not applied to mac80211.

Also, drop IEEE80211_OFFLOAD_ENCAP_4ADDR too because it is not really
being supported.

Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 75c5bd68 26-Nov-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

ieee80211: change HE nominal packet padding value defines

It's easier to use and understand, and to extend for EHT later,
if we use the values here instead of the shifted values.

Unfortunately, we need to add _POS so that we can use it in
places like iwlwifi/mvm where constants are needed.

While at it, fix the typo ("NOMIMAL") which also helps catch any
conflicts.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://lore.kernel.org/r/20211126104817.7c29a05b8eb5.I2ca9faf06e177e3035bec91e2ae53c2f91d41774@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# a88cae72 22-Oct-2021 Randy Dunlap <rdunlap@infradead.org>

mt76: mt7921: fix Wformat build warning

ARRAY_SIZE() is of type size_t, so the format specfier should
be %zu instead of %lu.

Fixes this build warning:

../drivers/net/wireless/mediatek/mt76/mt7921/main.c: In function ‘mt7921_get_et_stats’:
../drivers/net/wireless/mediatek/mt76/mt7921/main.c:1024:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
dev_err(dev->mt76.dev, "ei: %d SSTATS_LEN: %lu",

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: linux-wireless@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: Ryder Lee <ryder.lee@mediatek.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211022233251.29987-1-rdunlap@infradead.org


# 568a1b51 18-Oct-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: add per-vif counters in ethtool

Similar to mt7915 driver, add per-vif tx counters in ethtool.

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


# fe041bee 18-Oct-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: move tx amsdu stats in mib_stats

Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

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


# 6eb58cea 18-Oct-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: introduce stats reporting through ethtool

Similar to mt7915 driver, add tx/rx statistics reporting through ethtool.

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


# 6c833df9 18-Oct-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: do not reset MIB counters in get_stats callback

MIB counters are used for ethtool stats as well

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


# 8910a4e5 18-Oct-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: add MT7921_COMMON module

This is a preliminary patch to introduce mt7921s support.

MT7921_COMMON module grouping bus independent objects the both mt7921e and
mt7921s can share with and have to rely on.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# bd1e3e7b 13-Sep-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: introduce packet_id idr

Introduce per-wcid idr to manage packet id for txs. This allow fast idr
lookup and skb queueing at the same time.

Tested-by: mrkiko.rs@gmail.com
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 50ac15a5 23-Aug-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: add 6GHz support

Unlock 6GHz band if supported by the device. Configure HE 6G
capabilities.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1799c220 03-Sep-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: remove mt7921_sta_stats

mt7921_sta_stats is no longer needed

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


# 8c19b3fe 03-Sep-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: remove mcu rate reporting code

Remove unused tx rate reporting through mcu tx done event since
now tx status is fully supported

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


# 970ab80e 03-Sep-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: report tx rate directly from tx status

Report tx rate from tx status packets instead of receiving periodic mcu
event. This improves flexibility, accuracy and AQL performance, and
simplifies code flow for better readability.

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


# 890809ca 08-Aug-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: introduce mt7921_mcu_set_beacon_filter utility routine

Introduce mt7921_mcu_set_beacon_filter utility routine in order to
remove duplicated code for hw beacon filtering.
Move mt7921_pm_interface_iter in debugfs since it is just used there.
Make the following routine static:
- mt7921_pm_interface_iter
- mt7921_mcu_uni_bss_bcnft
- mt7921_mcu_set_bss_pm

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


# 82e0f596 09-Aug-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: get rid of monitor_vif

Remove monitor_vif pointer from mt7921 since it is just a leftover of
initial porting.

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


# bce84458 21-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: introduce testmode support

We add the testmode support to access the testmode feature provided
by the MT7921 firmware.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 502604f5 28-Jun-2021 YN Chen <YN.Chen@mediatek.com>

mt76: mt7921: add .set_sar_specs support

add .set_sar_specs to allow configuring SAR power limitations on the
frequency ranges from the userland.

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# d5c9d0a2 11-Jul-2021 Gustavo A. R. Silva <gustavoars@kernel.org>

mt76: mt7921: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix the
following warning by explicitly adding a break statement:

drivers/net/wireless/mediatek/mt76/mt7921/main.c:392:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 1153668e 17-Jun-2021 Deren Wu <deren.wu@mediatek.com>

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>


# 5512c974 17-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

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>


# 495cd981 12-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

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>


# 8225816d 12-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

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>


# f5056657 10-May-2021 Sean Wang <sean.wang@mediatek.com>

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>


# 5bc52dee 05-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: make mt7921_set_channel static

Make mt7921_set_channel routine static since it is only used in main.c

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


# 6ab079e2 02-Jun-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: add mt76_connac_power_save_sched in mt76_connac_pm_unref

Schedule power_save work running mt76_connac_pm_unref in order to reduce
power consumption

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# a60951d4 31-May-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: enable hw offloading for wep keys

Enable wep key hw offloading for sta mode. This patch fixes
WoW support for wep connections.

Tested-by: Deren.Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 213f8728 19-May-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: fix OMAC idx usage

OMAC idx have to be same with BSS idx according to firmware usage.

Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@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>


# 24299fc8 06-May-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: enable rx header traslation offload

As already done for mt7615 and mt7915, enable rx header translation
offload for mt7921 in order to reduce cpu load in the rx path.

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


# d4826d17 28-May-2021 Felix Fietkau <nbd@nbd.name>

mt76: mt7921: remove leftover 80+80 HE capability

Fixes interop issues with some APs that disable HE Tx if this is present

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210528120304.34751-1-nbd@nbd.name


# 36fcc8cf 19-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: introduce mt7921_mcu_sta_add routine

mt7921_mcu_sta_add will be used to add and remove wtbl entries.
Create broadcast wtbl entry after AP association

Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 310718ba 18-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: do not run mt76_txq_schedule_all directly

In order to not break runtime-pm, do run mt76_txq_schedule_all in
mt7615_set_channel/mt7921_set_channel but rely on mt76_worker_schedule

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


# 9800462d 18-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: rely on mt76_connac_pm_ref/mt76_connac_pm_unref in tx path

Introduce mt7921_tx_worker routine as mt76 tx worker callback for
mt7921.
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>


# f4f4089e 16-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: move mcu_update_arp_filter in mt76_connac module

Move mt76_connac_mcu_update_arp_filter in mt76_connac module since the
code is shared between mt7615 and mt7921

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


# 18369a4f 13-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: introduce single-sku support for mt7663/mt7921

Introduce support for rate-txpower compensation for mt7663/mt7921 chipsets.
Rate-txpower limit is specified through dts

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


# 2f516444 08-Apr-2021 Johannes Berg <johannes.berg@intel.com>

wireless: fix spelling of A-MSDU in HE capabilities

In the HE capabilities, spell A-MSDU correctly, not "A-MDSU".

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.9e6ff1af1181.If6868bc6902ccd9a95c74c78f716c4b41473ef14@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 1f851b8d 08-Apr-2021 Johannes Berg <johannes.berg@intel.com>

wireless: align HE capabilities A-MPDU Length Exponent Extension

The A-MPDU length exponent extension is defined differently in
802.11ax D6.1, align with that.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.c2a257d3e2df.I3455245d388c52c61dace7e7958dbed7e807cfb6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 76cf4221 08-Apr-2021 Johannes Berg <johannes.berg@intel.com>

wireless: align some HE capabilities with the spec

Some names were changed, align that with the spec as of
802.11ax-D6.1.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.b1e5fbab0d8c.I3eb6076cb0714ec6aec6b8f9dee613ce4a05d825@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 92e91636 10-Apr-2021 Felix Fietkau <nbd@nbd.name>

mt76: mt7921: remove 80+80 MHz support capabilities

This mode is not supported by the hardware

Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 9c9d8321 05-Apr-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: fix inappropriate WoW setup with the missing ARP informaiton

Fix the Wake-on-WoWLAN failure should rely on ARP Information is being
updated in time to the firmware.

Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 859c85fd 03-Apr-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: always wake the device in mt7921_remove_interface

Make sure the mcu is not in sleep mode before sending mcu messages in
mt7921_remove_interface routine.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 60468f7f 27-Mar-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: fix key set/delete issue

Similar to the mt7915 driver, deleting a key with the previous key index
deletes the current key. Rework the code to better keep track of
multiple keys and check for the key index before deleting the current
key

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


# 93c81df5 24-Mar-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: properly configure rcpi adding a sta to the fw

Properly configure rcpi based on association process rssi. rcpi is used
by rate controller embedded into the fw to initialize amsdu size.

Tested-by: Jayden.Kuo <jayden.kuo@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 5802106f 24-Mar-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: connac: introduce mt76_sta_cmd_info data structure

Introduce mt76_sta_cmd_info data structure to contain parameters passed
to mt76_sta_cmd_info routine. This is preliminary patch to properly
configure rcpi for mt7921 devices.

Tested-by: Jayden.Kuo <jayden.kuo@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1921b892 12-Mar-2021 Colin Ian King <colin.king@canonical.com>

mt76: mt7921: remove redundant check on type

Currently in the switch statement case where type is
NL80211_IFTYPE_STATION there is a check to see if type
is not NL80211_IFTYPE_STATION. This check is always false
and is redundant dead code that can be removed.

Addresses-Coverity: ("Logically dead code")
Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# de29d0af 11-Mar-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: remove leftovers from dbdc configuration

Remove leftovers from dbdc configuration since mt7921
does not support it.

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


# 1f7396ac 07-Mar-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: introduce __mt7921_start utility routine

This is a preliminary patch to introduce mt7921 chip reset support.

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# f92f81d3 25-Feb-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: check mcu returned values in mt7921_start

Properly check returned values from mcu utility routines in
mt7921_start.

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


# 3ab0269d 24-Feb-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: get rid of mt7921_sta_rc_update routine

Since the rate selection is currently managed by the fw, get rid of
empty mt7921_sta_rc_update routine

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


# f76e9019 22-Feb-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: fix stats register definitions

Fix register definitions for mac80211 stats reporting.
Move mib counter reset to mt7921_get_stats routine.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 9dfd2785 19-Feb-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: add flush operation

add flush operation to make sure cfg80211_mlme_deauth is able to flush
the deauthtication frame into air immediately.

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: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 159f6dd6 19-Feb-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: switch to new api for hardware beacon filter

Current firmware only supports new api for enabling hardware beacon filter.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Beacon filter cmd have to rely on the associatied access point's beacon
interval and DTIM information.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1d8efc74 27-Jan-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: introduce Runtime PM support

Introduce runtime PM to mt7921 driver

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 022159b0 27-Jan-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: rely on mt76_connac_mcu module for suspend and WoW support

Rely on mt76_connac_mcu module for suspend and WoW support and remove
duplicated code

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


# 80fc1e37 27-Jan-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: rely on mt76_connac_mcu module for sched_scan and hw_scan

Rely on mt76_connac_mcu module for sched_scan and hw_scan and remove
duplicated code

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


# 67aa2743 27-Jan-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt7921: rely on mt76_connac_mcu common library

Rely on mt76_connac_mcu common library and remove duplicated code

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


# ffa1bf97 27-Jan-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: introduce PM support

Introduce suspend/resume and WoW (Wake-on-WoWLAN) support to mt7921
driver to allow remote wakeu-up from the suspend state.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 56d965da 27-Jan-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: introduce 802.11 PS support in sta mode

Enable 802.11 power-save support available in mt7921 firmware

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 29f9d8b0 27-Jan-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: introduce schedule scan support

introduce schedule scan to control mt7921 firmware to do background scan in
defined plan to see if the matched SSID is available.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# e0f9fdda 27-Jan-2021 Sean Wang <sean.wang@mediatek.com>

mt76: mt7921: add ieee80211_ops

Filling ieee80211_ops with the mt7921 operations.

Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>