mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
wifi: mt76: mt7925: extend MCU support for testmode
Add MCU command and its handling needed for testmode support on MT7925. This enables low-level chip testing features such as continuous TX/RX.. Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Michael Lo <michael.lo@mediatek.com> Link: https://patch.msgid.link/20250505233618.1951021-1-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
aa97ff5782
commit
ba7fe3b064
|
|
@ -1184,6 +1184,11 @@ enum {
|
|||
#define MCU_UNI_CMD(_t) (__MCU_CMD_FIELD_UNI | \
|
||||
FIELD_PREP(__MCU_CMD_FIELD_ID, \
|
||||
MCU_UNI_CMD_##_t))
|
||||
|
||||
#define MCU_UNI_QUERY(_t) (__MCU_CMD_FIELD_UNI | __MCU_CMD_FIELD_QUERY | \
|
||||
FIELD_PREP(__MCU_CMD_FIELD_ID, \
|
||||
MCU_UNI_CMD_##_t))
|
||||
|
||||
#define MCU_CE_CMD(_t) (__MCU_CMD_FIELD_CE | \
|
||||
FIELD_PREP(__MCU_CMD_FIELD_ID, \
|
||||
MCU_CE_CMD_##_t))
|
||||
|
|
@ -1289,11 +1294,13 @@ enum {
|
|||
MCU_UNI_CMD_EFUSE_CTRL = 0x2d,
|
||||
MCU_UNI_CMD_RA = 0x2f,
|
||||
MCU_UNI_CMD_MURU = 0x31,
|
||||
MCU_UNI_CMD_TESTMODE_RX_STAT = 0x32,
|
||||
MCU_UNI_CMD_BF = 0x33,
|
||||
MCU_UNI_CMD_CHANNEL_SWITCH = 0x34,
|
||||
MCU_UNI_CMD_THERMAL = 0x35,
|
||||
MCU_UNI_CMD_VOW = 0x37,
|
||||
MCU_UNI_CMD_FIXED_RATE_TABLE = 0x40,
|
||||
MCU_UNI_CMD_TESTMODE_CTRL = 0x46,
|
||||
MCU_UNI_CMD_RRO = 0x57,
|
||||
MCU_UNI_CMD_OFFCH_SCAN_CTRL = 0x58,
|
||||
MCU_UNI_CMD_PER_STA_INFO = 0x6d,
|
||||
|
|
|
|||
|
|
@ -3383,6 +3383,14 @@ int mt7925_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb,
|
|||
cmd == MCU_UNI_CMD(CHIP_CONFIG))
|
||||
uni_txd->option &= ~MCU_CMD_ACK;
|
||||
|
||||
if (mcu_cmd == MCU_UNI_CMD_TESTMODE_CTRL ||
|
||||
mcu_cmd == MCU_UNI_CMD_TESTMODE_RX_STAT) {
|
||||
if (cmd & __MCU_CMD_FIELD_QUERY)
|
||||
uni_txd->option = 0x2;
|
||||
else
|
||||
uni_txd->option = 0x6;
|
||||
}
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,13 +104,6 @@ enum {
|
|||
MT7925_TM_WIFISPECTRUM,
|
||||
};
|
||||
|
||||
struct mt7925_rftest_cmd {
|
||||
u8 action;
|
||||
u8 rsv[3];
|
||||
__le32 param0;
|
||||
__le32 param1;
|
||||
} __packed;
|
||||
|
||||
struct mt7925_rftest_evt {
|
||||
__le32 param0;
|
||||
__le32 param1;
|
||||
|
|
@ -605,6 +598,47 @@ struct roc_acquire_tlv {
|
|||
u8 rsv[3];
|
||||
} __packed;
|
||||
|
||||
enum ENUM_CMD_TEST_CTRL_ACT {
|
||||
CMD_TEST_CTRL_ACT_SWITCH_MODE = 0,
|
||||
CMD_TEST_CTRL_ACT_SET_AT = 1,
|
||||
CMD_TEST_CTRL_ACT_GET_AT = 2,
|
||||
CMD_TEST_CTRL_ACT_SET_AT_ENG = 3,
|
||||
CMD_TEST_CTRL_ACT_GET_AT_ENG = 4,
|
||||
CMD_TEST_CTRL_ACT_NUM
|
||||
};
|
||||
|
||||
enum ENUM_CMD_TEST_CTRL_ACT_SWITCH_MODE_OP {
|
||||
CMD_TEST_CTRL_ACT_SWITCH_MODE_NORMAL = 0,
|
||||
CMD_TEST_CTRL_ACT_SWITCH_MODE_RF_TEST = 1,
|
||||
CMD_TEST_CTRL_ACT_SWITCH_MODE_ICAP = 2,
|
||||
CMD_TEST_CTRL_ACT_SWITCH_MODE_NUM
|
||||
};
|
||||
|
||||
union testmode_data {
|
||||
__le32 op_mode;
|
||||
__le32 channel_freq;
|
||||
u8 rf_at_info[84];
|
||||
};
|
||||
|
||||
union testmode_evt {
|
||||
__le32 op_mode;
|
||||
__le32 channel_freq;
|
||||
u8 rf_at_info[1024];
|
||||
};
|
||||
|
||||
struct uni_cmd_testmode_ctrl {
|
||||
u16 tag;
|
||||
u16 length;
|
||||
u8 action;
|
||||
u8 reserved[3];
|
||||
union testmode_data data;
|
||||
} __packed;
|
||||
|
||||
struct mt7925_rftest_cmd {
|
||||
u8 padding[4];
|
||||
struct uni_cmd_testmode_ctrl ctrl;
|
||||
} __packed;
|
||||
|
||||
static inline enum connac3_mcu_cipher_type
|
||||
mt7925_mcu_get_cipher(int cipher)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user