summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76.h
AgeCommit message (Collapse)Author
2020-12-04mt76: attempt to free up more room when filling the tx queueFelix Fietkau
Run dma cleanup immediately if the queue is almost full, instead of waiting for the tx interrupt Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: improve tx queue stop/wakeFelix Fietkau
Instead of stopping and waking only a single queue, handle all phy tx queues mapped ot the same hardware queue. Also allow the driver to block tx queues Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7915: introduce dbdc supportLorenzo Bianconi
Introduce mt7915 dbdc support. If dbdc is available, mt7915 primary phy will work on 2.4GHz band, while secondary one on 5GHz band. Co-developed-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move hw mac_addr in mt76_phyLorenzo Bianconi
This is a preliminary patch to properly support mt7915 dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move band allocation in mt76_register_phyLorenzo Bianconi
This is a preliminary patch to introduce dbdc support to mt7915 devices Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move band capabilities in mt76_phyLorenzo Bianconi
This is a preliminary patch to move properly support mt7915 dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move tx hw data queues in mt76_phyLorenzo Bianconi
Move hw data queues in mt76_phy from mt76_dev since mt7915 supports per phy hw queues in dbdc mode Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move mcu queues to mt76_dev q_mcu arrayLorenzo Bianconi
Move mcu queue to a dedicated array q_mcu in mt76_dev structure. This is a preliminary patch to move data queues in mt76_phy and properly support dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: rely on mt76_queue in tx_queue_skb_raw signatureLorenzo Bianconi
This is a preliminary patch to move data queues in mt76_phy and properly support dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: introduce mt76_init_mcu_queue utility routineLorenzo Bianconi
Introduce mt76_init_mcu_queue utility routine in order to allocate dedicate q_mcu pointers for mcu hw queues. This is a preliminary patch to move data queues in mt76_phy and add dbdc support to mt7915 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: rely on mt76_queue in tx_queue_skb signatureLorenzo Bianconi
Rely on mt76_queue instead of qid in tx_queue_skb signature. This is a preliminary patch to move data queues in mt76_phy and add dbdc support to mt7915 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: dma: rely on mt76_queue in mt76_dma_tx_cleanup signatureLorenzo Bianconi
This is a preliminary patch to move data queues in mt76_phy and properly support dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7663s: rely on mt76_queue in mt7663s_tx_run_queue signatureLorenzo Bianconi
This is a preliminary patch to move data queues in mt76_phy and properly support dbdc for mt7915 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move mt76_init_tx_queue in common codeLorenzo Bianconi
Move mt76_init_tx_queue in mac80211.c since it is shared by all drivers. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: testmode: add support for LTF and GI combinations for HE modeShayne Chen
Prepare for setting different LTF (1x, 2x, and 4x) and GI (0.8us, 1.6us, 3.2us) combinations in HE rate mode. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: testmode: add tx_rate_stbc parameterShayne Chen
Add the parameter to control STBC function in testmode. Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt76u: use dedicated thread for status workLorenzo Bianconi
Split tx and status path in mt76-usb module relying on mt76 workers APIs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt76u: rely on woker APIs for rx workLorenzo Bianconi
In order to improve parallelism, convert rx path in mt76-usb module to mt76 workers APIs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move mt76_mcu_send_firmware in common moduleLorenzo Bianconi
Move mt76_mcu_send_firmware routine in common code since it is actually shared between mt7615, mt7663, mt7603 and mt7915 devices Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: sdio: get rid of sched.lockLorenzo Bianconi
sched quota is now updated in mt7663s_txrx_worker so there is no more need of sched.lock mutex Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: implement functions to get the response skb for MCU callsFelix Fietkau
Can be used by the caller to get the response data directly instead of using the hack of storing the result in internal data structures from .mcu_parse_response Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: make mcu_ops->mcu_send_msg optionalFelix Fietkau
Remove it from mt7615 and mt7915 and implement it in core code instead Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msgFelix Fietkau
This removes some code duplication and prepares the code for making the MCU API more flexible Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: implement .mcu_parse_response in struct mt76_mcu_opsFelix Fietkau
Do not free skb inside that function Preparation for further cleanup Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: rename __mt76_mcu_skb_send_msg to mt76_mcu_skb_send_msgFelix Fietkau
Preparation for further cleanup Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: rename __mt76_mcu_send_msg to mt76_mcu_send_msgFelix Fietkau
Preparation for further cleanup Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7915: add encap offload for 4-address mode stationsFelix Fietkau
Enable MWDS mode in firmware as well and fix txp->rept_wds_wcid for wcid >= 255 Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: sdio: convert {status/net}_work to mt76_workerLorenzo Bianconi
In order to improve driver throughput, convert status_work and net_work to mt76 worker APIs. Remove txrx_wq sdio workqueue since it is no longer used Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7663s: convert txrx_work to mt76_workerLorenzo Bianconi
In order to improve driver throughput, convert txrx_work to mt76 worker threads APIs. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04mt76: mt7663s: move tx/rx processing in the same txrx workqueueLorenzo Bianconi
Move mt7663 tx and rx processing in the same workqueue in order to reduce jitter that can hit tcp performances. This is a preliminary patch to switch to mt76 workers APIs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7663s: introduce sdio tx aggregationLorenzo Bianconi
Introduce sdio tx aggregation to reduce bus transaction ands improve tx throughput. For the moment the skb are copied in a dedicated buffer since mmc APIs do not support sg table for zero-copy. Since skb data are already copied in xmit_buff[], avoid linearization in ma80211 layer. Relying on tx aggregation, we improve tx tpt of ~65%. Tested-by: Sean Wang <sean.wang@mediatek.com> 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-09-24mt76: move pad estimation out of mt76_skb_adjust_padLorenzo Bianconi
Move frame pad computation out of mt76_skb_adjust_pad routine. This is a preliminary patch to introduce sdio tx aggregation. Tested-by: Sean Wang <sean.wang@mediatek.com> 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-09-24mt76: remove retry_q from struct mt76_txq and related codeFelix Fietkau
Since the switch to using AQL by default, mtxq->retry_q is never filled anymore Remove it to get rid of a few more unnecessary cycles in the tx path Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: move txwi handling code to dma.c, since it is mmio specificFelix Fietkau
This way we can make some functions static Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: dma: cache dma map address/len in struct mt76_queue_entryFelix Fietkau
Accessing them from uncached memory can be expensive, so it's cheaper to cache them Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: convert from tx tasklet to tx worker threadFelix Fietkau
This improves performance by allowing the scheduler to move the tx scheduling work to idle CPUs. Since tx scheduling work is very latency sensitive and kept short via AQL, sched_set_fifo_low is used to keep worker priority above normal tasks Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt76x02: tune tx ring sizeFelix Fietkau
Increase data queue size to improve performance. Reduce PS/mgmt queue size Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: remove struct mt76_sw_queueFelix Fietkau
All members except for the struct mt76_queue pointer have been removed Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: rely on AQL for burst size limits on tx queueingFelix Fietkau
Now that AQL works well on all mt76 drivers, completely replace the arbitrary burst sizing and number of bursts logic for tx scheduling. For the short period of time in which AQL does not work well yet, limit each stations to 16 in-flight packets that have no estimated tx time. This should avoid filling the queue if a station connects and queues up a large number of packets before rate control information is available, especially with hardware rate control Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: remove swq from struct mt76_sw_queueFelix Fietkau
Since txq selection was moved to mac80211, it is no longer used 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-09-24mt76: unify queue tx cleanup codeFelix Fietkau
Cleanup and preparation for changing tx scheduling behavior Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7663s: fix unable to handle kernel paging requestSean Wang
Use buffer allocated with kmalloc instead of with stack to fix kernel crash due to Unable to handle kernel paging request at virtual address ffffffc0095cbce8. [ 156.977349] Unable to handle kernel paging request at virtual address ffffffc0095cbce8 [ 156.985270] Mem abort info: [ 156.988059] ESR = 0x96000045 [ 156.991104] Exception class = DABT (current EL), IL = 32 bits [ 156.997013] SET = 0, FnV = 0 [ 157.000057] EA = 0, S1PTW = 0 [ 157.003190] Data abort info: [ 157.006061] ISV = 0, ISS = 0x00000045 [ 157.009887] CM = 0, WnR = 1 [ 157.012850] swapper pgtable: 4k pages, 39-bit VAs, pgdp = 0000000042adcba2 [ 157.019715] [ffffffc0095cbce8] pgd=0000000000000000, pud=0000000000000000 [ 157.026499] Internal error: Oops: 96000045 [#1] PREEMPT SMP [ 157.032065] Modules linked in: mt7663s mt7663_usb_sdio_common mt7615_common ... [ 157.073007] Process CompositorTileW (pid: 1625, stack limit = 0x000000003f2389fc) [ 157.080484] CPU: 0 PID: 1625 Comm: CompositorTileW Not tainted 4.19.137 #36 [ 157.092219] pstate: 80000085 (Nzcv daIf -PAN -UAO) [ 157.097012] pc : __memcpy+0xc0/0x180 [ 157.100585] lr : swiotlb_tbl_unmap_single+0x84/0x14c [ 157.105540] sp : ffffff8008003cb0 [ 157.108845] x29: ffffff8008003cb0 x28: ffffff9c1a211f60 [ 157.114149] x27: ffffff9c19ecc018 x26: 0000000000001000 [ 157.119452] x25: ffffff9c1a378000 x24: 0000000000000001 [ 157.124755] x23: ffffff9c1a378000 x22: 00000000000001ff [ 157.130058] x21: 0000000000000000 x20: 00000000fbefe800 [ 157.135360] x19: 0000000000000070 x18: 0000000000000000 [ 157.140663] x17: 0000000000000000 x16: 0000000000000000 [ 157.145965] x15: 0000000000000000 x14: 0000000000000000 [ 157.151267] x13: 0000000000000000 x12: 000000000000000d [ 157.156569] x11: 000000000000000c x10: 0000000a7befe800 [ 157.161873] x9 : fffffff680000000 x8 : 0000000000000000 [ 157.167175] x7 : 0000000100000003 x6 : ffffffc0095cbce8 [ 157.172479] x5 : 0000000000000000 x4 : 0000000000000000 [ 157.177781] x3 : 0000000000000002 x2 : fffffffffffffff0 [ 157.183085] x1 : ffffffca7befe810 x0 : ffffffc0095cbce8 [ 157.188389] Call trace: [ 157.190832] __memcpy+0xc0/0x180 [ 157.194053] swiotlb_unmap_sg_attrs+0xa8/0xb0 [ 157.198406] __swiotlb_unmap_sg_attrs+0x8c/0xa4 [ 157.202931] msdc_unprepare_data+0x6c/0x84 [ 157.207019] msdc_request_done+0x58/0x98 [ 157.210934] msdc_data_xfer_done+0x1a8/0x1d0 [ 157.215195] msdc_irq+0x12c/0x17c [ 157.218505] __handle_irq_event_percpu+0xd8/0x298 [ 157.223202] handle_irq_event+0x60/0xdc [ 157.227031] handle_fasteoi_irq+0xa4/0x1d4 [ 157.231120] __handle_domain_irq+0x84/0xc4 [ 157.235210] gic_handle_irq+0x124/0x1a4 [ 157.239038] el0_irq_naked+0x4c/0x54 [ 157.242608] Code: 14000028 f1020042 5400024a a8c12027 (a88120c7) [ 157.248693] ---[ end trace 28b8090135b0a2e1 ]--- [ 157.265589] Kernel panic - not syncing: Fatal exception in interrupt [ 157.271944] SMP: stopping secondary CPUs [ 157.275865] Kernel Offset: 0x1c10e00000 from 0xffffff8008000000 [ 157.281779] CPU features: 0x0,2188200c [ 157.285519] Memory Limit: none Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7915: add Tx A-MSDU offloading supportRyder Lee
This disables the software A-MSDU aggregation in mac80211 and enables hardware offloading Suggested-by: Yiwei Chung <yiwei.chung@mediatek.com> Suggested-by: YF Luo <yf.luo@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Co-developed-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: move mt76_check_agg_ssn to driver tx_prepare callsFelix Fietkau
mt7615 and newer drivers do not need this, since they use sequence number offload Moving this code also reduces the number of callsites to make it easier to review Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: fix double DMA unmap of the first buffer on 7615/7915Felix Fietkau
A small part of the first skb buffer is passed to the firmware for parsing via DMA, while the full buffer is passed as part of the TXP. Avoid calling DMA unmap on the first part (with a different length than map) Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt76s: get rid of unused variableLorenzo Bianconi
Remove unused state variable in mt76_sdio structure Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt76s: move tx/rx processing in 2 separate worksLorenzo Bianconi
In order to maximize parallelism, split status work in tx status work and rx net work Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt76s: move status processing in txrx wqLorenzo Bianconi
As it has been done for tx and rx processing, move tx/rx status processing into mt76s_txrx_wq workqueue Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-24mt76: mt7663s: move rx processing in txrx wqLorenzo Bianconi
Move rx processing to mt76s_txrx_wq in order to minimize the interval when the sdio bus is locked during rx Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>