aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7603/init.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-06-19mt76: move mt76_rates in mt76 moduleLorenzo Bianconi1-30/+2
Move mt76_rates array in mt76 module and remove duplicated code since it is shared by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-12mt76: report Rx timestampRyder Lee1-0/+3
Frame reception timestamp (low 32-bits) that indicates the value of the local TSF timer value at the time the first bit of the MAC header in the received frame (PPDU unit) arriving at the MAC. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> 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-12-04wireless: mt76: convert tasklets to use new tasklet_setup() APIAllen Pais1-2/+1
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Allen Pais <apais@linux.microsoft.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: do not set NEEDS_UNIQUE_STA_ADDR for 7615 and 7915Felix Fietkau1-0/+1
The newer chipsets can deal with the same STA on multiple interfaces Preparation for supporting more station interfaces Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7603: check for single-stream EEPROM configurationFelix Fietkau1-5/+0
Some devices using MT7628 or MT7603 have only one antenna chain connected. Detect these using the EEPROM rx/tx path settings Reported-by: Qin Wei <me@vonger.cn> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-13mt76: enable p2p supportLorenzo Bianconi1-0/+2
Introduce p2p-go/p2p-client suppor to mt76 driver 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-03-17mt76: mt7603: make dynamic sensitivity adjustment configurable via debugfsFelix Fietkau1-0/+1
In some cases it may be useful for debugging to disable this feature Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7603: add upper limit for dynamic sensitivity minimum receive powerFelix Fietkau1-0/+1
If the minimum power is raised too much, it can make it impossible for weaker clients to connect, and there are some scenarios where the false detects will not go down no matter how much the sensitivity is adjusted. Fixes connectivity issues in some rare cases Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: do not set HOST_BROADCAST_PS_BUFFERING for mt7615Felix Fietkau1-0/+1
mt7615 handles powersave buffering in firmware Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move WIPHY_FLAG_HAS_CHANNEL_SWITCH in mt76_phy_initLorenzo Bianconi1-1/+0
Move WIPHY_FLAG_HAS_CHANNEL_SWITCH in mt76-core module since now all drivers support Channel Switch Announcement Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7603: simplify led reg definitionsLorenzo Bianconi1-3/+3
Rely on FIELD_PREP macro for led register definitions and remove open coding Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move txpower and antenna mask to struct mt76_phyFelix Fietkau1-5/+5
Adds multiple wiphy support to mt76_get_txpower Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move state from struct mt76_dev to mt76_phyFelix Fietkau1-1/+1
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>
2019-11-20mt76: move interface_modes definition in mt76_core moduleLorenzo Bianconi1-9/+0
Move interface modes declaration in common code since now mt76 chipsets support all modes (NL80211_IFTYPE_STATION, NL80211_IFTYPE_AP, NL80211_IFTYPE_MESH_POINT and NL80211_IFTYPE_ADHOC) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: move SUPPORTS_REORDERING_BUFFER hw property in mt76_register_deviceLorenzo Bianconi1-1/+0
Move SUPPORTS_REORDERING_BUFFER hw property configuration from chip specific code to mt76_register_device since it is supported by all mt76 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: track tx airtime for airtime fairness and surveyFelix Fietkau1-0/+3
Poll per-station hardware counters after tx status events Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: track rx airtime for airtime fairness and surveyFelix Fietkau1-0/+1
Report total rx airtime for valid stations as BSS rx time in survey mt7615 is left out for now, it will be supported later by reading hardware counters instead of calculating airtime in software Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: fix some checkpatch warningsRyder Lee1-2/+1
This fixes the following checkpatch warnings: WARNING: Improper SPDX comment style CHECK: No space is necessary after a cast Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: enable hardware rate up/down selectionFelix Fietkau1-2/+1
Improves performance by switching away from bad rates faster Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: move nl80211_dfs_regions in mt76_dev data structureLorenzo Bianconi1-2/+2
Move dfs region field in mt76_dev data structure since it is used by all drivers. This is a preliminary patch to add DFS support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: mt7603: improve hardware rate switching configurationFelix Fietkau1-1/+10
Now that tx status reporting can figure out the first attempted rate, we can make switching from lower rates to higher rates more conservative. This reduces retries under bad link conditions and ensures that fallback rates get more test coverage Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: mt7603: rework and fix tx status reportingFelix Fietkau1-3/+2
Tx status reporting on mt7603 has a number of issues: - the hardware can alter the first rate index, but it is not reported to the driver - probing is very imprecise, because it alters the per-client rate set, but only considers info->status.rates for rate selection of a single probe packet - short/long GI selection has limitations, which are not accurately reported to mac80211 - if rates are changed while packets are in flight, tx status reports for the old rate set might be processed based on the new selection This led to very suboptimal rate selection with minstrel_ht. This patch completely reworks tx status reporting to get rid of these limitations: - Store the previous and current rate set in the driver + the TSF value at the time of the switch. - Use the tx status TSF value to determine which rate set needs to be used as reference. - Report only short or long GI rates for a single status event, not a mix. - The hardware reports the last used rate index. Use it along with the retry count to figure out what rate was used for the first attempt. - Use the same retry count value for all rate slots to make this calculation work. - Derive the probe rate from the current rateset instead of the skb cb - Do not wait for a status report for the probe frame before removing the probe rate from the rate table. Do it immediately after it was referenced in a tx status report. - Use the first half of the first rate retry budget for the probe rate in order to avoid using too many retries on that rate With this patch, throughput under bad link conditions is improved significantly, and there is a lot less rate fluctuation going on. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: fix setting chan->max_powerFelix Fietkau1-1/+1
When setting chan->max_power after registering the wiphy, chan->max_reg_power needs to be used as a limit Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: mt7603: fix reading target tx power from eepromFelix Fietkau1-0/+4
For the external PA (TSSI OFF) case, the target power needs to be read from a different location in EEPROM Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25mt76: mt7603: add debugfs knob to enable/disable edccaLorenzo Bianconi1-1/+3
Introduce a knob in mt7603 debugfs in order to enable/disable energy detection based on CCA thresholds 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: mt7603: initialize mt76_mcu_ops data structureLorenzo Bianconi1-1/+1
Use __mt76_mcu_send_msg wrapper instead of mt7603_mcu_msg_send. This is a preliminary patch for mt7615-mt7603 mcu code unification Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mt7603: fix initialization of max rx lengthFelix Fietkau1-1/+2
The previous version only accidentally disabled A-MSDU deaggregation by using the wrong mask for rx length configuration, which left previous length value in place. Fix the length and initialize the register completely to keep A-MSDU de-aggregation remaining disabled 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: fix tx power issuesFelix Fietkau1-0/+1
- tx power is stored in the channels after ieee80211_register_hw, so chan->orig_mpwr needs to be updated as well - for non-TSSI devices, mt76x2e needs to use a different target power value from the EEPROM - fix a rounding error in a few places (need to round up, not down) Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: introduce mt76_free_device routineLorenzo Bianconi1-1/+1
Move mt76_tx_free in mt76_free_device routine in order to unmap all txwi descriptors at module unload Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt7603: remove mt7603_mcu_init routineLorenzo Bianconi1-1/+1
Remove mt7603_mcu_init since mcu.mutex has been already initialized in mt76_mmio_init. Run mt7603_load_firmware directly in mt7603_init_hardware Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-04-12mt76: mt7603: add missing initialization for dev->ps_lockFelix Fietkau1-0/+2
Fixes lockdep complaint and a potential race condition Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-03-19mt76: mt7603: use the correct hweight8() functionFelix Fietkau1-1/+1
__sw_hweight8() is only defined if CONFIG_GENERIC_HWEIGHT is enabled. The function that works on all architectures is hweight8(). Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-26mt76: add driver for MT7603E and MT7628/7688Felix Fietkau1-0/+578
This driver is for a newer generation of 2x2 MediaTek 802.11n chipsets. MT7603E is a PCIe chip. MT7628 and MT7688 are MIPS SoC devices with built-in WLAN. MT7688 is limited to 1x1 This driver fully supports AP, station, mesh, ad-hoc and monitor mode. Signed-off-by: Felix Fietkau <nbd@nbd.name>