aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-02-08wifi: mac80211: simplify non-chanctx driversJohannes Berg1-0/+4
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>
2021-12-19mt76: mt76x02: introduce SAR supportLorenzo Bianconi1-1/+6
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>
2021-01-26mt76: move chainmask in mt76_phyLorenzo Bianconi1-1/+1
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>
2021-01-26mt76: move mac_work in mt76_core moduleLorenzo Bianconi1-1/+1
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>
2020-05-12mt76: set runtime stream caps by mt76_phyRyder Lee1-1/+1
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>
2020-05-12mt76: mt76x02: fix handling MCU timeouts during hw restartFelix Fietkau1-13/+6
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>
2020-02-14mt76: avoid extra RCU synchronization on station removalFelix Fietkau1-0/+1
Use sta_pre_rcu_remove callback to clear wcid pointer earlier Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move txpower and antenna mask to struct mt76_phyFelix Fietkau1-1/+1
Adds multiple wiphy support to mt76_get_txpower Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move txpower_conf back to driver specific structsFelix Fietkau1-3/+3
Nothing in the core uses it Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move chainmask back to driver specific structsFelix Fietkau1-1/+1
Nothing in the core uses it Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move state from struct mt76_dev to mt76_phyFelix Fietkau1-5/+5
Allows keeping per-wiphy state separate Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move channel state to struct mt76_phyFelix Fietkau1-1/+1
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>
2020-02-14mt76: add support for an extra wiphy in the main tx pathFelix Fietkau1-1/+1
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>
2019-11-20mt76: move mt76_get_antenna in mt76_core moduleLorenzo Bianconi1-14/+1
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>
2019-11-20mt76: unify channel survey update codeFelix Fietkau1-4/+1
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>
2019-11-20mt76: mt76x2: move mt76x02_mac_reset_counters in mt76x02_mac_startLorenzo Bianconi1-4/+2
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>
2019-09-05mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_completeLorenzo Bianconi1-1/+1
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>
2019-09-05mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee1-12/+1
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>
2019-06-25mt76: mt76x2: move mutex_lock inside mt76x2_set_channelLorenzo Bianconi1-7/+9
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>
2019-05-01mt76: move pre_tbtt_tasklet in mt76_devLorenzo Bianconi1-2/+2
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>
2019-05-01mt76: mt76x02: remove bogus mutex usageStanislaw Gruszka1-10/+3
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>
2019-05-01mt76: move mac_work in mt76_devLorenzo Bianconi1-1/+1
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>
2019-05-01mt76: unify set_timStanislaw Gruszka1-7/+1
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>
2019-02-18mt76: run MAC work every 100msFelix Fietkau1-1/+1
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>
2019-01-17mt76: move mt76x02_get_txpower to mt76 coreFelix Fietkau1-1/+1
It will be reused by mt7603 later Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11mt76: mmio: introduce mt76x02_check_tx_hang watchdogLorenzo Bianconi1-0/+2
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>
2018-11-30mt76: replace sta_add/remove ops with common sta_state functionFelix Fietkau1-2/+1
Allows adding unassociated stations from mac80211 Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
2018-11-30mt76: move dfs support in mt76x02-lib moduleLorenzo Bianconi1-1/+1
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>
2018-11-30mt76: move mt76x02_bss_info_changed in mt76x02-lib moduleLorenzo Bianconi1-38/+1
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>
2018-11-30mt76: move tx protection routines in mt76x02-lib moduleLorenzo Bianconi1-16/+1
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>
2018-11-30mt76: move mt76x02_set_tx_ackto in mt76x02-lib moduleLorenzo Bianconi1-13/+2
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>
2018-11-30mt76: move mt76x02_sta_ps in mt76x02-lib moduleLorenzo Bianconi1-11/+0
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>
2018-11-30mt76: move mt76x02_get_txpower in mt76x02_util.cLorenzo Bianconi1-14/+1
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>
2018-11-30mt76: move mt76x02_sw_scan and mt76x02_sw_scan_complete in mt76x02-lib moduleLorenzo Bianconi1-21/+2
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>
2018-11-30mt76: move mac beacon routines in mt76x02-lib moduleLorenzo Bianconi1-3/+3
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>
2018-10-13mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.cLorenzo Bianconi1-1/+1
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>
2018-10-05mt76: move tpc routines in mt76x02-lib moduleLorenzo Bianconi1-1/+1
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>
2018-10-05mt76: rename mt76x02_util.h in mt76x02.hLorenzo Bianconi1-1/+0
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>
2018-10-05mt76: move mt76x02_tx in mt76x02-lib moduleLorenzo Bianconi1-1/+1
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>
2018-10-05mt76x2: move mt76x2_dev in mt76x02_util.hLorenzo Bianconi1-13/+13
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>
2018-10-05mt76x2: move mt76x2 source files to mt76x2 folderLorenzo Bianconi1-0/+311
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>