blob: 10406ff1fbc811893f7f939b75deb755d8cde102 [file] [log] [blame]
developerb11a5392022-03-31 00:34:47 +08001/* SPDX-License-Identifier: ISC */
2/* Copyright (C) 2020 MediaTek Inc. */
3
developer7800b8d2022-06-23 22:15:56 +08004#ifndef __BESRA_TESTMODE_H
5#define __BESRA_TESTMODE_H
developerb11a5392022-03-31 00:34:47 +08006
developer7800b8d2022-06-23 22:15:56 +08007struct besra_tm_trx {
developerb11a5392022-03-31 00:34:47 +08008 u8 type;
9 u8 enable;
10 u8 band;
11 u8 rsv;
12};
13
developer7800b8d2022-06-23 22:15:56 +080014struct besra_tm_freq_offset {
developerb11a5392022-03-31 00:34:47 +080015 u8 band;
16 __le32 freq_offset;
17};
18
developer7800b8d2022-06-23 22:15:56 +080019struct besra_tm_slot_time {
developerb11a5392022-03-31 00:34:47 +080020 u8 slot_time;
21 u8 sifs;
22 u8 rifs;
23 u8 _rsv;
24 __le16 eifs;
25 u8 band;
26 u8 _rsv1[5];
27};
28
developer7800b8d2022-06-23 22:15:56 +080029struct besra_tm_clean_txq {
developerb11a5392022-03-31 00:34:47 +080030 bool sta_pause;
31 u8 wcid; /* 256 sta */
32 u8 band;
33 u8 rsv;
34};
35
developer7800b8d2022-06-23 22:15:56 +080036struct besra_tm_cmd {
developerb11a5392022-03-31 00:34:47 +080037 u8 testmode_en;
38 u8 param_idx;
39 u8 _rsv[2];
40 union {
41 __le32 data;
developer7800b8d2022-06-23 22:15:56 +080042 struct besra_tm_trx trx;
43 struct besra_tm_freq_offset freq;
44 struct besra_tm_slot_time slot;
45 struct besra_tm_clean_txq clean;
developerb11a5392022-03-31 00:34:47 +080046 u8 test[72];
47 } param;
48} __packed;
49
50enum {
51 TM_MAC_TX = 1,
52 TM_MAC_RX,
53 TM_MAC_TXRX,
54 TM_MAC_TXRX_RXV,
55 TM_MAC_RXV,
56 TM_MAC_RX_RXV,
57};
58
59struct tm_tx_cont {
60 u8 control_ch;
61 u8 center_ch;
62 u8 bw;
63 u8 tx_ant;
64 __le16 rateval;
65 u8 band;
66 u8 txfd_mode;
67};
68
developer7800b8d2022-06-23 22:15:56 +080069struct besra_tm_rf_test {
developerb11a5392022-03-31 00:34:47 +080070 u8 action;
71 u8 icap_len;
72 u8 _rsv[2];
73 union {
74 __le32 op_mode;
75 __le32 freq;
76
77 struct {
78 __le32 func_idx;
79 union {
80 __le32 func_data;
81 __le32 cal_dump;
82
83 struct tm_tx_cont tx_cont;
84
85 u8 _pad[80];
86 } param;
87 } rf;
88 } op;
89} __packed;
90
91enum {
92 RF_OPER_NORMAL,
93 RF_OPER_RF_TEST,
94 RF_OPER_ICAP,
95 RF_OPER_ICAP_OVERLAP,
96 RF_OPER_WIFI_SPECTRUM,
97};
98
99enum {
100 TAM_ARB_OP_MODE_NORMAL = 1,
101 TAM_ARB_OP_MODE_TEST,
102 TAM_ARB_OP_MODE_FORCE_SU = 5,
103};
104
105#endif