1
2#ifndef R819XUSB_CMDPKT_H
3#define R819XUSB_CMDPKT_H
4
5#define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t)
6#define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
7#define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
8#define CMPK_RX_TX_STS_SIZE sizeof(cmpk_tx_status_t)
9#define CMPK_RX_DBG_MSG_SIZE sizeof(cmpk_rx_dbginfo_t)
10#define CMPK_TX_RAHIS_SIZE sizeof(cmpk_tx_rahis_t)
11
12
13#define ISR_TxBcnOk BIT(27)
14#define ISR_TxBcnErr BIT(26)
15#define ISR_BcnTimerIntr BIT(13)
16
17
18
19
20
21
22
23typedef struct tag_cmd_pkt_tx_feedback {
24
25 u8 element_id;
26 u8 length;
27
28
29 u8 TID:4;
30 u8 fail_reason:3;
31 u8 tok:1;
32 u8 reserve1:4;
33 u8 pkt_type:2;
34 u8 bandwidth:1;
35 u8 qos_pkt:1;
36
37
38 u8 reserve2;
39
40 u8 retry_cnt;
41 u16 pkt_id;
42
43
44 u16 seq_num;
45 u8 s_rate;
46 u8 f_rate;
47
48
49 u8 s_rts_rate;
50 u8 f_rts_rate;
51 u16 pkt_length;
52
53
54 u16 reserve3;
55 u16 duration;
56} cmpk_txfb_t;
57
58
59
60
61typedef struct tag_cmd_pkt_interrupt_status {
62 u8 element_id;
63 u8 length;
64 u16 reserve;
65 u32 interrupt_status;
66} cmpk_intr_sta_t;
67
68
69
70typedef struct tag_cmd_pkt_set_configuration {
71 u8 element_id;
72 u8 length;
73 u16 reserve1;
74
75 u8 cfg_reserve1:3;
76 u8 cfg_size:2;
77 u8 cfg_type:2;
78 u8 cfg_action:1;
79 u8 cfg_reserve2;
80 u8 cfg_page:4;
81 u8 cfg_reserve3:4;
82 u8 cfg_offset;
83 u32 value;
84 u32 mask;
85} cmpk_set_cfg_t;
86
87
88
89
90#define cmpk_query_cfg_t cmpk_set_cfg_t
91
92
93typedef struct tag_tx_stats_feedback {
94
95
96
97
98 u16 reserve1;
99 u8 length;
100 u8 element_id;
101
102
103 u16 txfail;
104 u16 txok;
105
106
107 u16 txmcok;
108 u16 txretry;
109
110
111 u16 txucok;
112 u16 txbcok;
113
114
115 u16 txbcfail;
116 u16 txmcfail;
117
118
119 u16 reserve2;
120 u16 txucfail;
121
122
123 u32 txmclength;
124 u32 txbclength;
125 u32 txuclength;
126
127
128 u16 reserve3_23;
129 u8 reserve3_1;
130 u8 rate;
131} __packed cmpk_tx_status_t;
132
133
134
135typedef struct tag_rx_debug_message_feedback {
136
137
138 u16 reserve1;
139 u8 length;
140 u8 element_id;
141
142
143
144
145} cmpk_rx_dbginfo_t;
146
147
148typedef struct tag_tx_rate_history {
149
150
151 u8 element_id;
152 u8 length;
153 u16 reserved1;
154
155
156 u16 cck[4];
157
158
159 u16 ofdm[8];
160
161
162
163
164
165
166 u16 ht_mcs[4][16];
167
168} __packed cmpk_tx_rahis_t;
169
170typedef enum tag_command_packet_directories {
171 RX_TX_FEEDBACK = 0,
172 RX_INTERRUPT_STATUS = 1,
173 TX_SET_CONFIG = 2,
174 BOTH_QUERY_CONFIG = 3,
175 RX_TX_STATUS = 4,
176 RX_DBGINFO_FEEDBACK = 5,
177 RX_TX_PER_PKT_FEEDBACK = 6,
178 RX_TX_RATE_HISTORY = 7,
179 RX_CMD_ELE_MAX
180} cmpk_element_e;
181
182typedef enum _rt_status {
183 RT_STATUS_SUCCESS,
184 RT_STATUS_FAILURE,
185 RT_STATUS_PENDING,
186 RT_STATUS_RESOURCE
187} rt_status, *prt_status;
188
189u32 cmpk_message_handle_rx(struct net_device *dev,
190 struct ieee80211_rx_stats *pstats);
191rt_status SendTxCommandPacket(struct net_device *dev,
192 void *pData, u32 DataLen);
193
194
195#endif
196