History log of /linux-master/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
Revision Date Author Comments
# 0a44dfc0 29-Jan-2024 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: simplify non-chanctx drivers

There are still surprisingly many non-chanctx drivers, but in
mac80211 that code is a bit awkward. Simplify this by having
those drivers assign 'emulated' ops, so that the mac80211 code
can be more unified between non-chanctx/chanctx drivers. This
cuts the number of places caring about it by about 15, which
are scattered across - now they're fewer and no longer in the
channel context handling.

Link: https://msgid.link/20240129194108.6d0ead50f5cf.I60d093b2fc81ca1853925a4d0ac3a2337d5baa5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


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

mt76: mt76x02: introduce SAR support

Add SAR spec support to mt76x02 driver to allow configuring SAR power
limitations on the frequency ranges from the userland.

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


# b9027e08 04-Jan-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move chainmask in mt76_phy

Move chainmask from driver phy to mt76_phy since it is used by all
drivers. This is a preliminary patch to create a common mcu library used
by mt7615 and mt7921 drivers

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>


# a782f8bf 04-Jan-2021 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move mac_work in mt76_core module

Move mac_work delayed_work and mac_work_count in mt76_phy since it is
used by all drivers. This is a preliminary patch to create a common mcu
library used by mt7615 and mt7921 drivers

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>


# bb3e3fec 24-Apr-2020 Ryder Lee <ryder.lee@mediatek.com>

mt76: set runtime stream caps by mt76_phy

This patch can support concurrent dual-band operation.

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


# fd6c2dfa 16-Feb-2020 Felix Fietkau <nbd@nbd.name>

mt76: mt76x02: fix handling MCU timeouts during hw restart

If a MCU timeout occurs before a hw restart completes, another hw restart
is scheduled, and the station state gets corrupted.
To speed up dealing with that, do not issue any MCU commands after the first
timeout, and defer handling timeouts until the reset has completed.
Also ignore errors in MCU commands during start/config to avoid making user
space fail on this condition. If it happens, another restart is scheduled
quickly, and that usually recovers the hardware properly.

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


# 43ba1922 06-Feb-2020 Felix Fietkau <nbd@nbd.name>

mt76: avoid extra RCU synchronization on station removal

Use sta_pre_rcu_remove callback to clear wcid pointer earlier

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


# beaaeb6b 15-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: move txpower and antenna mask to struct mt76_phy

Adds multiple wiphy support to mt76_get_txpower

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


# 9e5f6dd7 15-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: move txpower_conf back to driver specific structs

Nothing in the core uses it

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


# db7aa188 15-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: move chainmask back to driver specific structs

Nothing in the core uses it

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


# 011849e0 15-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: move state from struct mt76_dev to mt76_phy

Allows keeping per-wiphy state separate

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


# 96747a51 12-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: move channel state to struct mt76_phy

Add support for an extra wiphy in mt76_set_channel and mt76_get_survey
This is preparation for supporting multiple wiphys per device to support the
concurrent dual-band feature of MT7615D

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


# 9fba6d07 11-Oct-2019 Felix Fietkau <nbd@nbd.name>

mt76: add support for an extra wiphy in the main tx path

This is preparation for supporting multiple wiphys per device to support the
concurrent dual-band feature of MT7615D

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


# e49c76d4 14-Nov-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move mt76_get_antenna in mt76_core module

Move mt76_get_antenna in mac80211.c in order to be reused by all
drivers. Initialize .get_antenna function pointer for mt76x0, mt7603,
mt7615 and mt76x2u drivers

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


# aec65e48 05-Sep-2019 Felix Fietkau <nbd@nbd.name>

mt76: unify channel survey update code

Host time is used to calculate the channel active time on mt7603 and mt7615.
Use the same on mt76x02 and move the lock to core code to get rid of some
duplicated code.

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


# ad571c93 12-Sep-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt76x2: move mt76x02_mac_reset_counters in mt76x02_mac_start

Move mt76x02_mac_reset_counters in mt76x02_mac_start and get rid of
mt76x2_mac_start since it is just a wrapper for mt76x02_mac_start

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


# 8b8ab5c2 21-Aug-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_complete

Introduce a default implementation for mt76_sw_scan and
mt76_sw_scan_complete in mt76 module and remove duplicated code
since most of the drivers share the same implementation

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


# 0e3d6777 24-Jul-2019 Ryder Lee <ryder.lee@mediatek.com>

mt76: switch to SPDX tag instead of verbose boilerplate text

No functional change intended.

Add SPDX identifiers to all remaining files in /mt76.

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


# 6e4caaea 10-May-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: mt76x2: move mutex_lock inside mt76x2_set_channel

This is a preliminary patch to run mt76x02_edcca_init atomically

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


# dc6057f4 30-Apr-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move pre_tbtt_tasklet in mt76_dev

Move pre_tbtt_tasklet tasklet in mt76_dev data structure since
it is used by all drivers

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


# 091a79fd 26-Apr-2019 Stanislaw Gruszka <sgruszka@redhat.com>

mt76: mt76x02: remove bogus mutex usage

mac80211 .start(), .stop() callbacks are never called concurrently with
other callbacks. The only concurencly is with mt76 works which we cancel
on stop() and schedule on start().

This fixes possible deadlock on cancel_delayed_work_sync(&dev->mac_work)
as mac_work also take mutex.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 37426fb6 18-Mar-2019 Lorenzo Bianconi <lorenzo@kernel.org>

mt76: move mac_work in mt76_dev

Move mac_work delayed work in mt76_dev data structure since
it is used by all drivers and it will be reused adding mac work to
mt7615

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


# 87d53103 19-Mar-2019 Stanislaw Gruszka <sgruszka@redhat.com>

mt76: unify set_tim

All mt76 drivers (now also USB drivers) require empty .set_tim
callback. Add it to common mt76 module and use on all drivers.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 2e405024 03-Feb-2019 Felix Fietkau <nbd@nbd.name>

mt76: run MAC work every 100ms

ED/CCA Tx blocking checks need to be run every 100 ms in order to avoid
triggering too late and keeping tx blocking on for too long

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


# 9313faac 06-Dec-2018 Felix Fietkau <nbd@nbd.name>

mt76: move mt76x02_get_txpower to mt76 core

It will be reused by mt7603 later

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


# c1e0d2be 28-Dec-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: mmio: introduce mt76x02_check_tx_hang watchdog

Port mt76x02_check_tx_hang watchdog from vendor driver in order to
perform a device reset when tx mac/dma logic hangs. Tx mac/dma stuck
has been observed when the device is heavy loaded or in a noisy
environment. Moreover introduce wdt delayed work in order to run
tx_hang watchdog. For the moment run mt76x02_check_tx_hang watchdog
just on mt76x2 devices since the issue has not been observed on mt76x0
driver yet

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# e28487ea 16-Nov-2018 Felix Fietkau <nbd@nbd.name>

mt76: replace sta_add/remove ops with common sta_state function

Allows adding unassociated stations from mac80211

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>


# e6cb3291 22-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move dfs support in mt76x02-lib module

Move mt76x2 DFS support in mt76x02-lib module in order to
be reused by mt76x0 driver and unlock DFS frequencies

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# cc726268 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_bss_info_changed in mt76x02-lib module

Unify drv_bss_info_changed mac80211 callback and remove duplicated
code in mt76x0 and mt76x2 drivers

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 317ed42b 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move tx protection routines in mt76x02-lib module

Move mt76x02_set_rts_threshold and mt76x02_mac_set_tx_protection
routines in mt76x02-lib module and remove duplicated code in mt76x0
and mt76x2 drivers. Remove pci_mac.c and mt76x0/mac.c since now are
empty files

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 36704051 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_set_tx_ackto in mt76x02-lib module

Move mt76x02_set_tx_ackto and mt76x02_set_coverage_class routines
in mt76x02-lib module in order to be reused by mt76x0 driver.
This is a preliminary patch to unify drv_bss_info_changed mac80211
callback between mt76x0 and mt76x2 drivers

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# f7c8a0f2 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_sta_ps in mt76x02-lib module

Move mt76x02_sta_ps utility routine in mt76x02_util.c
in order to be reused by mt76x0 driver adding AP support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1da0a411 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_get_txpower in mt76x02_util.c

Move mt76x02_get_txpower utility routine in mt76x02-lib module
in order to be reused by mt76x0 and mt76x2u drivers

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# c2756a1c 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_sw_scan and mt76x02_sw_scan_complete in mt76x02-lib module

Move mt76x02_sw_scan and mt76x02_sw_scan_complete utility routines
in mt76x02_util.c in order to be reused by mt76x0 and mt76x2u drivers
and remove duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# dc33b251 19-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mac beacon routines in mt76x02-lib module

Move mt76x02_beacon mac routines in mt76x02_mac.c in
order to be reused by mt76x0 driver adding AP support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1770f0fa 09-Nov-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: fix uninitialized mutex access setting rts threshold

Fix following crash due to a leftover uninitialized mutex access
in mt76x2_set_rts_threshold routine.

[ 31.018059] Call Trace:
[ 31.018341] register_lock_class+0x51f/0x530
[ 31.018828] __lock_acquire+0x6c/0x1580
[ 31.019247] lock_acquire+0x88/0x120
[ 31.021089] __mutex_lock+0x4a/0x4f0
[ 31.023343] mt76x2_set_rts_threshold+0x28/0x50
[ 31.023831] ieee80211_set_wiphy_params+0x16d/0x4e0
[ 31.024344] nl80211_set_wiphy+0x72b/0xbc0
[ 31.024781] genl_family_rcv_msg+0x192/0x3a0
[ 31.025233] genl_rcv_msg+0x42/0x89
[ 31.026079] netlink_rcv_skb+0x38/0x100
[ 31.026475] genl_rcv+0x1f/0x30
[ 31.026804] netlink_unicast+0x19c/0x250
[ 31.027212] netlink_sendmsg+0x1ed/0x390
[ 31.027615] sock_sendmsg+0x31/0x40
[ 31.027973] ___sys_sendmsg+0x23c/0x280
[ 31.030414] __sys_sendmsg+0x42/0x80
[ 31.030783] do_syscall_64+0x4a/0x170
[ 31.031160] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[ 31.031677] RIP: 0033:0x7f3498b39ba7
[ 31.033953] RSP: 002b:00007fffe19675b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[ 31.034883] RAX: ffffffffffffffda RBX: 00000000012d5350 RCX: 00007f3498b39ba7
[ 31.035756] RDX: 0000000000000000 RSI: 00007fffe19675f0 RDI: 0000000000000003
[ 31.036587] RBP: 00000000012da740 R08: 0000000000000002 R09: 0000000000000000
[ 31.037422] R10: 0000000000000006 R11: 0000000000000246 R12: 00000000012da880
[ 31.038252] R13: 00007fffe19675f0 R14: 00007fffe19678c0 R15: 00000000012da880

Fixes: 108a4861ef19 ("mt76: create new mt76x02-lib module for common mt76x{0,2} code")
Reported-by: lorenzo.trisolini@fluidmesh.com
Reported-by: luca.bisti@fluidmesh.com
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 8d66af49 07-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.c

Use mt76x02_dev data structure as reference in mt76x02_mac.c
instead of mt76_dev

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1ea0a1b1 05-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move tpc routines in mt76x02-lib module

Move mt76x02_tx_get_txpwr_adj and mt76x02_tx_set_txpwr_auto routines
in mt76x02-lib module since they are shared between mt76x0 and mt76x2
drivers. Moreover remove get_txpwr_adj function pointer

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 7a07adcd 05-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: rename mt76x02_util.h in mt76x02.h

Rename mt76x02_util.h header file in mt76x02.h since now contains
all mt76x02 related definitions and not just utility routines
declarations

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 2f0308d0 04-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76: move mt76x02_tx in mt76x02-lib module

Move mt76x02_tx shared routine in mt76x02-lib module and remove
duplicated code. Moreover remove mt76x0/tx.c since it is an empty
file

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# e40803f2 04-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76x2: move mt76x2_dev in mt76x02_util.h

Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev
in order to be shared between mt76x2 and mt76x0 driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>


# 1613c621 01-Oct-2018 Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

mt76x2: move mt76x2 source files to mt76x2 folder

Move mt76x2 and mt76x2u drivers to mt76x2 subfolder and
leave just shared code in mt76 root folder

Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>