Commit 978fdd66 authored by Shayne Chen's avatar Shayne Chen Committed by Felix Fietkau

mt76: mt7915: switch proper tx arbiter mode in testmode

Switch proper tx arbiter mode during testmode tx to prevent from
entering the flow of normal tx in FW.
Also, testmode SU and MU tx need to use different arbiter mode.
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 82a980f8
...@@ -278,6 +278,7 @@ enum { ...@@ -278,6 +278,7 @@ enum {
MCU_EXT_CMD_SCS_CTRL = 0x82, MCU_EXT_CMD_SCS_CTRL = 0x82,
MCU_EXT_CMD_FW_DBG_CTRL = 0x95, MCU_EXT_CMD_FW_DBG_CTRL = 0x95,
MCU_EXT_CMD_SET_RDD_TH = 0x9d, MCU_EXT_CMD_SET_RDD_TH = 0x9d,
MCU_EXT_CMD_MURU_CTRL = 0x9f,
MCU_EXT_CMD_SET_SPR = 0xa8, MCU_EXT_CMD_SET_SPR = 0xa8,
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab, MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac, MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
......
...@@ -165,6 +165,28 @@ mt7915_tm_set_slot_time(struct mt7915_phy *phy, u8 slot_time, u8 sifs) ...@@ -165,6 +165,28 @@ mt7915_tm_set_slot_time(struct mt7915_phy *phy, u8 slot_time, u8 sifs)
sizeof(req), false); sizeof(req), false);
} }
static int
mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu)
{
struct mt7915_dev *dev = phy->dev;
struct {
__le32 cmd;
u8 op_mode;
} __packed req = {
.cmd = cpu_to_le32(MURU_SET_ARB_OP_MODE),
};
if (!enable)
req.op_mode = TAM_ARB_OP_MODE_NORMAL;
else if (mu)
req.op_mode = TAM_ARB_OP_MODE_TEST;
else
req.op_mode = TAM_ARB_OP_MODE_FORCE_SU;
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL), &req,
sizeof(req), false);
}
static int static int
mt7915_tm_set_wmm_qid(struct mt7915_dev *dev, u8 qid, u8 aifs, u8 cw_min, mt7915_tm_set_wmm_qid(struct mt7915_dev *dev, u8 qid, u8 aifs, u8 cw_min,
u16 cw_max, u16 txop) u16 cw_max, u16 txop)
...@@ -397,6 +419,10 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en) ...@@ -397,6 +419,10 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en)
mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en); mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en);
mt7915_mcu_add_bss_info(phy, phy->monitor_vif, en); mt7915_mcu_add_bss_info(phy, phy->monitor_vif, en);
mt7915_mcu_add_sta(dev, phy->monitor_vif, NULL, en);
if (!en)
mt7915_tm_set_tam_arb(phy, en, 0);
} }
static void static void
...@@ -438,6 +464,9 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en) ...@@ -438,6 +464,9 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en)
} }
} }
mt7915_tm_set_tam_arb(phy, en,
td->tx_rate_mode == MT76_TM_TX_MODE_HE_MU);
/* if all three params are set, duty_cycle will be ignored */ /* if all three params are set, duty_cycle will be ignored */
if (duty_cycle && tx_time && !ipg) { if (duty_cycle && tx_time && !ipg) {
ipg = tx_time * 100 / duty_cycle - tx_time; ipg = tx_time * 100 / duty_cycle - tx_time;
......
...@@ -96,4 +96,14 @@ enum { ...@@ -96,4 +96,14 @@ enum {
RF_OPER_WIFI_SPECTRUM, RF_OPER_WIFI_SPECTRUM,
}; };
enum {
TAM_ARB_OP_MODE_NORMAL = 1,
TAM_ARB_OP_MODE_TEST,
TAM_ARB_OP_MODE_FORCE_SU = 5,
};
enum {
MURU_SET_ARB_OP_MODE = 14,
};
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment