Skip to content

Commit

Permalink
wifi: mt76: mt7915: add dev->hif2 support for mt7916 WED device
Browse files Browse the repository at this point in the history
Enable two PCIe interfaces (dev->hif2) support for mt7916 when WED is enabled.

Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
Sujuan Chen authored and nbd168 committed Feb 28, 2023
1 parent ab2d365 commit 90d7825
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 8 additions & 2 deletions mt7915/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ static void mt7915_dma_config(struct mt7915_dev *dev)
MT7916_RXQ_BAND0);
RXQ_CONFIG(MT_RXQ_MCU_WA, WFDMA0, MT_INT_WED_RX_DONE_WA_MT7916,
MT7916_RXQ_MCU_WA);
RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0, MT_INT_WED_RX_DONE_BAND1_MT7916,
MT7916_RXQ_BAND1);
if (dev->hif2)
RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0,
MT_INT_RX_DONE_BAND1_MT7916,
MT7916_RXQ_BAND1);
else
RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0,
MT_INT_WED_RX_DONE_BAND1_MT7916,
MT7916_RXQ_BAND1);
RXQ_CONFIG(MT_RXQ_MAIN_WA, WFDMA0, MT_INT_WED_RX_DONE_WA_MAIN_MT7916,
MT7916_RXQ_MCU_WA_MAIN);
TXQ_CONFIG(0, WFDMA0, MT_INT_WED_TX_DONE_BAND0,
Expand Down
4 changes: 3 additions & 1 deletion mt7915/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,9 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
if (ret)
return ret;

if (mtk_wed_device_active(&dev->mt76.mmio.wed) && is_mt7915(&dev->mt76))
if ((mtk_wed_device_active(&dev->mt76.mmio.wed) &&
is_mt7915(&dev->mt76)) ||
!mtk_wed_get_rx_capa(&dev->mt76.mmio.wed))
mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(CAPABILITY), 0, 0, 0);

ret = mt7915_mcu_set_mwds(dev, 1);
Expand Down
10 changes: 5 additions & 5 deletions mt7915/mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,13 +989,13 @@ irqreturn_t mt7915_irq_handler(int irq, void *dev_instance)
struct mt7915_dev *dev = dev_instance;
struct mtk_wed_device *wed = &dev->mt76.mmio.wed;

if (mtk_wed_device_active(wed)) {
if (mtk_wed_device_active(wed))
mtk_wed_device_irq_set_mask(wed, 0);
} else {
else
mt76_wr(dev, MT_INT_MASK_CSR, 0);
if (dev->hif2)
mt76_wr(dev, MT_INT1_MASK_CSR, 0);
}

if (dev->hif2)
mt76_wr(dev, MT_INT1_MASK_CSR, 0);

if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
return IRQ_NONE;
Expand Down

0 comments on commit 90d7825

Please sign in to comment.