"RU484/SU40", "RU996/SU80", "RU2x996/SU160"
};
struct mt7915_phy *phy = file->private;
+ struct mt7915_dev *dev = phy->dev;
s8 txpower[MT7915_SKU_RATE_NUM], *buf;
- int i;
+ u32 reg;
+ int i, ret;
+
+ ret = mt7915_mcu_get_txpower_sku(phy, txpower, sizeof(txpower));
+ if (ret)
+ return ret;
+
+ /* Txpower propagation path: TMAC -> TXV -> BBP */
+ seq_printf(file, "\nPhy %d\n", phy != &dev->phy);
- seq_printf(file, "\nBand %d\n", phy != &phy->dev->phy);
- mt7915_mcu_get_txpower_sku(phy, txpower, sizeof(txpower));
for (i = 0, buf = txpower; i < ARRAY_SIZE(mt7915_sku_group_len); i++) {
u8 mcs_num = mt7915_sku_group_len[i];
buf += mt7915_sku_group_len[i];
}
+ reg = is_mt7915(&dev->mt76) ? MT_WF_PHY_TPC_CTRL_STAT(phy->band_idx) :
+ MT_WF_PHY_TPC_CTRL_STAT_MT7916(phy->band_idx);
+
+ seq_printf(file, "\nBaseband transmit power %ld\n",
+ mt76_get_field(dev, reg, MT_WF_PHY_TPC_POWER));
+
return 0;
}
#define MT_WF_PHY_RXTD12_IRPI_SW_CLR_ONLY BIT(18)
#define MT_WF_PHY_RXTD12_IRPI_SW_CLR BIT(29)
+#define MT_WF_PHY_TPC_CTRL_STAT(_phy) MT_WF_PHY(0xe7a0 + ((_phy) << 16))
+#define MT_WF_PHY_TPC_CTRL_STAT_MT7916(_phy) MT_WF_PHY(0xe7a0 + ((_phy) << 20))
+#define MT_WF_PHY_TPC_POWER GENMASK(15, 8)
+
#define MT_MCU_WM_CIRQ_BASE 0x89010000
#define MT_MCU_WM_CIRQ(ofs) (MT_MCU_WM_CIRQ_BASE + (ofs))
#define MT_MCU_WM_CIRQ_IRQ_MASK_CLR_ADDR MT_MCU_WM_CIRQ(0x80)