1 /* SPDX-License-Identifier: ISC */ 2 /* Copyright (C) 2020 MediaTek Inc. */ 3 4 #ifndef __MT7921_MCU_H 5 #define __MT7921_MCU_H 6 7 #include "../mt76_connac_mcu.h" 8 9 struct mt7921_mcu_tx_done_event { 10 u8 pid; 11 u8 status; 12 __le16 seq; 13 14 u8 wlan_idx; 15 u8 tx_cnt; 16 __le16 tx_rate; 17 18 u8 flag; 19 u8 tid; 20 u8 rsp_rate; 21 u8 mcs; 22 23 u8 bw; 24 u8 tx_pwr; 25 u8 reason; 26 u8 rsv0[1]; 27 28 __le32 delay; 29 __le32 timestamp; 30 __le32 applied_flag; 31 u8 txs[28]; 32 33 u8 rsv1[32]; 34 } __packed; 35 36 /* ext event table */ 37 enum { 38 MCU_EXT_EVENT_RATE_REPORT = 0x87, 39 }; 40 41 struct mt7921_mcu_eeprom_info { 42 __le32 addr; 43 __le32 valid; 44 u8 data[MT7921_EEPROM_BLOCK_SIZE]; 45 } __packed; 46 47 #define MT_RA_RATE_NSS GENMASK(8, 6) 48 #define MT_RA_RATE_MCS GENMASK(3, 0) 49 #define MT_RA_RATE_TX_MODE GENMASK(12, 9) 50 #define MT_RA_RATE_DCM_EN BIT(4) 51 #define MT_RA_RATE_BW GENMASK(14, 13) 52 53 enum { 54 MT_EBF = BIT(0), /* explicit beamforming */ 55 MT_IBF = BIT(1) /* implicit beamforming */ 56 }; 57 58 struct mt7921_mcu_ant_id_config { 59 u8 ant_id[4]; 60 } __packed; 61 62 struct mt7921_txpwr_req { 63 u8 ver; 64 u8 action; 65 __le16 len; 66 u8 dbdc_idx; 67 u8 rsv[3]; 68 } __packed; 69 70 struct mt7921_txpwr_event { 71 u8 ver; 72 u8 action; 73 __le16 len; 74 struct mt7921_txpwr txpwr; 75 } __packed; 76 77 enum { 78 TM_SWITCH_MODE, 79 TM_SET_AT_CMD, 80 TM_QUERY_AT_CMD, 81 }; 82 83 enum { 84 MT7921_TM_NORMAL, 85 MT7921_TM_TESTMODE, 86 MT7921_TM_ICAP, 87 MT7921_TM_ICAP_OVERLAP, 88 MT7921_TM_WIFISPECTRUM, 89 }; 90 91 struct mt7921_rftest_cmd { 92 u8 action; 93 u8 rsv[3]; 94 __le32 param0; 95 __le32 param1; 96 } __packed; 97 98 struct mt7921_rftest_evt { 99 __le32 param0; 100 __le32 param1; 101 } __packed; 102 #endif 103