aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
AgeCommit message (Collapse)Author
2022-04-27mt76: Fix undefined behavior due to shift overflowing the constantBorislav Petkov
[ Upstream commit dbc2b1764734857d68425468ffa8486e97ab89df ] Fix: drivers/net/wireless/mediatek/mt76/mt76x2/pci.c: In function ‘mt76x2e_probe’: ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_946’ \ declared with attribute error: FIELD_PREP: mask is not constant _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Felix Fietkau <nbd@nbd.name> Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Shayne Chen <shayne.chen@mediatek.com> Cc: Sean Wang <sean.wang@mediatek.com> Cc: Kalle Valo <kvalo@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220405151517.29753-9-bp@alien8.de Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-30mt76: mt76x2e: disable pcie_aspm by defaultLorenzo Bianconi
On same device (e.g. U7612E-H1) PCIE_ASPM causes continuous mcu hangs and instability. Since mt76x2 series does not manage PCIE PS states, first we try to disable ASPM using pci_disable_link_state. If it fails, we will disable PCIE PS configuring PCI registers. This patch has been successfully tested on U7612E-H1 mini-pice card Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-05mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee
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>
2019-05-01mt76: introduce mt76_free_device routineLorenzo Bianconi
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-01mt76: mmio: move mt76_insert_hdr_pad in mt76_dma_tx_queue_skbLorenzo Bianconi
Introduce tx_aligned4_skbs in mt76_driver_ops and move mt76_insert_hdr_pad in mt76_dma_tx_queue_skb. This is a preliminary patch in order to unify tx dma mapping for mt76x02 and new chipsets Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76x2: remove mt76x2_alloc_device routineLorenzo Bianconi
Remove mt76x2_alloc_device since it just runs mt76_alloc_device. Move mt76_alloc_device call in mt76x2_probe Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: move irq handler in mt76x02-lib moudleLorenzo Bianconi
Move mt76x02_irq_handler handler in mt76x02_mmio.c in order to be reused in mt76x0 driver. Move mt76x02_rx_poll_complete routine in mt76x02-lib module. Moreover remove pci_core.c and mt76x2/trace.{c,h} since are empty files Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76x2: move mt76x2_dev in mt76x02_util.hLorenzo Bianconi
Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev in order to be shared between mt76x2 and mt76x0 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76x2: move mt76x2 source files to mt76x2 folderLorenzo Bianconi
Move mt76x2 and mt76x2u drivers to mt76x2 subfolder and leave just shared code in mt76 root folder Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>