summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
AgeCommit message (Collapse)Author
2020-12-04wireless: mt76: convert tasklets to use new tasklet_setup() APIAllen Pais
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-09-24mt76: mt7603: tune tx ring sizeFelix Fietkau
Stop relying on global tx ring size, reduce size for PS/mgmt queue Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: remove qid argument to drv->tx_complete_skbFelix Fietkau
It is not needed Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: vif_mask to struct mt76_phyFelix Fietkau
All drivers use this in pretty much the same way. Moving it to core helps with some checks for the upcoming testmode support Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7603: make dynamic sensitivity adjustment configurable via debugfsFelix Fietkau
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 Fietkau
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: mt7603: increase dma mcu rx ring sizeFelix Fietkau
The ring is used for looping back tx powersave filtered frames, so it could use some more room, in case more than one aggregate was queued Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: move ampdu_ref from mt76_dev to driver structFelix Fietkau
It is only used by the driver Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: introduce struct mt76_phyFelix Fietkau
This is preparation for supporting multiple wiphys per device to support the concurrent dual-band feature of MT7615D On the first wiphy, hw->priv will point to struct mt76_dev, which contains a struct mt76_phy at the start. For the secondary wiphy, hw->priv will point to a mt76_phy encapsulated in a driver specific struct To simplify access to struct mt76_phy members from drivers, the driver specific device struct is changed to add a union of struct mt76_dev and struct mt76_phy as the first element Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: track tx airtime for airtime fairness and surveyFelix Fietkau
Poll per-station hardware counters after tx status events Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: report rx a-mpdu subframe statusFelix Fietkau
This can be used in monitor mode to figure out which subframes were sent as part of which A-MPDU Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: remove q_rx field from struct mt7603_devFelix Fietkau
It is no longer used Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7603: collect aggregation statsLorenzo Bianconi
Introduce ampdu_stat entry in mt7603 debugfs in order to dump 802.11 aggr cumulative statistics Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7603: move survey_time in mt76_devLorenzo Bianconi
Move survey_time field in mt76_dev in order to be reused adding survey support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: move nl80211_dfs_regions in mt76_dev data structureLorenzo Bianconi
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: rework and fix tx status reportingFelix Fietkau
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-25mt76: mt7603: add debugfs knob to enable/disable edccaLorenzo Bianconi
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 Bianconi
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: move beacon_mask in mt76_devLorenzo Bianconi
Move beacon_mask 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: move beacon_int in mt76_devLorenzo Bianconi
Move beacon_int 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 Bianconi
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: add skb pointer to mt76_tx_infoLorenzo Bianconi
Pass skb pointer to tx_prepare_skb through mt76_tx_info data structure. This is a preliminary patch to properly support dma error path for new chipsets (e.g. 7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move mac_work in mt76_devLorenzo Bianconi
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: move tx tasklet to struct mt76_devFelix Fietkau
Allows it to be scheduled from core code Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt7603: remove mt7603_mcu_init routineLorenzo Bianconi
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-05-01mt76: introduce mt76_tx_info data structureLorenzo Bianconi
Add mt76_tx_info as auxiliary data structure to pass values to tx_prepare_skb pointer. This is a preliminary patch to add support for new chipsets (e.g. mt7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_complete_skb function pointerLorenzo Bianconi
Remove mt76_queue dependency from tx_complete_skb function pointer and rely on mt76_tx_qid instead. Remove flush from tx_complete_skb signature. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_prepare_skb function pointerLorenzo Bianconi
Remove mt76_queue dependency from tx_prepare_skb function pointer and rely on mt76_tx_qid instead. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mmio: move mt76x02_set_irq_mask in mt76 moduleLorenzo Bianconi
Move mt76x02_set_irq_mask in mt76 module in order to be reused adding support for mt7603 driver and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-04-12mt76: mt7603: fix sequence number assignmentFelix Fietkau
If the MT_TXD3_SN_VALID flag is not set in the tx descriptor, the hardware assigns the sequence number. However, the rest of the code assumes that the sequence number specified in the 802.11 header gets transmitted. This was causing issues with the aggregation setup, which worked for the initial one (where the sequence numbers were still close), but not for further teardown/re-establishing of sessions. Additionally, the overwrite of the TID sequence number in WTBL2 was resetting the hardware assigned sequence numbers, causing them to drift further apart. Fix this by using the software assigned sequence numbers 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 Fietkau
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>