summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mmio.c
Commit message (Collapse)AuthorAgeFilesLines
* mt76: mt7615: rework IRQ handling to prepare for MSI supportFelix Fietkau2020-05-121-1/+2
| | | | | | | | | | | | With MSI interrupts, IRQs must not be enabled from within the IRQ handler, because that can lead to lost events. Defer IRQ processing to a tasklet, which is also responsible for enabling IRQs (to avoid race conditions against the handler) Co-developed-by: Soul Huang <Soul.Huang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Soul Huang <soul.huang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: Introduce mt76_mcu data structureLorenzo Bianconi2020-02-141-3/+0
| | | | | | | | | | | Introduce mt76_mcu data structure to contain common fields between mt76u_mcu and mt76e_mcu. Initialize mcu common fields in mt76_alloc_device(). Rely on mt76_mcu in mt76_mcu_rx_event and in mt76_mcu_get_response in order to reuse them in usb code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee2019-09-051-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>
* mt76: introduce mt76_mmio_read_copy routineLorenzo Bianconi2019-09-051-3/+10
| | | | | | | | | Add mt76_mmio_read_copy routine and the related function pointer in mt76_bus_ops data structure. mt76_mmio_read_copy will be used to add BIP_CMAC_128 cipher hw support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: round up length on mt76_wr_copyFelix Fietkau2019-09-051-1/+1
| | | | | | | | | | | When beacon length is not a multiple of 4, the beacon could be sent with the last 1-3 bytes corrupted. The skb data is guaranteed to have enough room for reading beyond the end, because it is always followed by skb_shared_info, so rounding up is safe. All other callers of mt76_wr_copy have multiple-of-4 length already. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use readl/writel instead of ioread32/iowrite32Felix Fietkau2019-05-011-2/+2
| | | | | | | Switching to readl/writel is faster because it gets rid of an unnecessary wrapper with extra checks. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mmio: move mt76x02_set_irq_mask in mt76 moduleLorenzo Bianconi2019-05-011-0/+13
| | | | | | | | 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>
* mt76: allow to identify busStanislaw Gruszka2018-10-131-0/+1
| | | | | | | Add helpers to identify bus type. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mmio: add implementation of wr_rp and rd_rpLorenzo Bianconi2018-10-011-0/+26
| | | | | | | | | | Introduce mmio implementation of mt76_mmio_rd_rp and mt76_mmio_wr_rp and remove mt76x2 duplicated code. mt76_mmio_{wr,rd}_rp allows to reuse mt76x0 init code adding mt76x0e support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x02_set_irq_mask in mt76x02_mmio.cLorenzo Bianconi2018-10-011-0/+1
| | | | | | | | | Move mt76x02_set_irq_mask, mt76x02_irq_enable and mt76x02_irq_disable in mt76x02-lib module in order to be reused by mt76x0 driver. Moreover move irq_lock and irqmask in mt76_mmio data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move __iomem regs in mt76_mmioLorenzo Bianconi2018-09-191-4/+4
| | | | | | | Move __iomem regs pointer in mt76_mmio data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: introduce mmio data structure in mt76_devLorenzo Bianconi2018-09-191-0/+4
| | | | | | | | | Introduce mt76_mmio data structure in mt76_dev and move mt76x2_mcu in mt76_mmio. This is a preliminary patch to unify mcu code between mt76x02{e,u} drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add common code shared between multiple chipsetsFelix Fietkau2017-12-071-0/+61
This will be used by drivers for MT76x2e, MT7603e and MT7628 Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>