summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7603/init.c
Commit message (Collapse)AuthorAgeFilesLines
* mt76: move interface_modes definition in mt76_core moduleLorenzo Bianconi2019-11-201-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>
* mt76: move SUPPORTS_REORDERING_BUFFER hw property in mt76_register_deviceLorenzo Bianconi2019-11-201-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>
* mt76: mt7603: track tx airtime for airtime fairness and surveyFelix Fietkau2019-11-201-0/+3
| | | | | | Poll per-station hardware counters after tx status events Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: track rx airtime for airtime fairness and surveyFelix Fietkau2019-11-201-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>
* mt76: mt7603: fix some checkpatch warningsRyder Lee2019-09-051-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>
* mt76: mt7603: enable hardware rate up/down selectionFelix Fietkau2019-09-051-2/+1
| | | | | | Improves performance by switching away from bad rates faster Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move nl80211_dfs_regions in mt76_dev data structureLorenzo Bianconi2019-06-271-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>
* mt76: mt7603: improve hardware rate switching configurationFelix Fietkau2019-06-271-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>
* mt76: mt7603: rework and fix tx status reportingFelix Fietkau2019-06-271-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>
* mt76: fix setting chan->max_powerFelix Fietkau2019-06-271-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>
* mt76: mt7603: fix reading target tx power from eepromFelix Fietkau2019-06-271-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>
* mt76: mt7603: add debugfs knob to enable/disable edccaLorenzo Bianconi2019-06-251-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>
* mt76: move pre_tbtt_tasklet in mt76_devLorenzo Bianconi2019-05-011-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>
* mt76: mt7603: initialize mt76_mcu_ops data structureLorenzo Bianconi2019-05-011-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>
* mt76: mt7603: fix initialization of max rx lengthFelix Fietkau2019-05-011-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>
* mt76: move mac_work in mt76_devLorenzo Bianconi2019-05-011-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>
* mt76: fix tx power issuesFelix Fietkau2019-05-011-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>
* mt76: introduce mt76_free_device routineLorenzo Bianconi2019-05-011-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>
* mt7603: remove mt7603_mcu_init routineLorenzo Bianconi2019-05-011-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>
* mt76: mt7603: add missing initialization for dev->ps_lockFelix Fietkau2019-04-121-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>
* mt76: mt7603: use the correct hweight8() functionFelix Fietkau2019-03-191-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>
* mt76: add driver for MT7603E and MT7628/7688Felix Fietkau2019-02-261-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>
OpenPOWER on IntegriCloud