1#ifndef R819XUSB_CMDPKT_H
2#define R819XUSB_CMDPKT_H
3
4#define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t)
5#define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
6#define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
7#define CMPK_RX_TX_STS_SIZE sizeof(cmpk_tx_status_t)
8#define CMPK_RX_DBG_MSG_SIZE sizeof(cmpk_rx_dbginfo_t)
9#define CMPK_TX_RAHIS_SIZE sizeof(cmpk_tx_rahis_t)
10
11
12#define ISR_TxBcnOk BIT27
13#define ISR_TxBcnErr BIT26
14#define ISR_BcnTimerIntr BIT13
15
16
17
18
19
20
21
22typedef struct tag_cmd_pkt_tx_feedback
23{
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
60typedef struct tag_cmd_pkt_interrupt_status
61{
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{
72 u8 element_id;
73 u8 length;
74 u16 reserve1;
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#define cmpk_query_cfg_t cmpk_set_cfg_t
90
91
92typedef struct tag_tx_stats_feedback
93{
94
95
96 u16 reserve1;
97 u8 length;
98 u8 element_id;
99
100
101 u16 txfail;
102 u16 txok;
103
104
105 u16 txmcok;
106 u16 txretry;
107
108
109 u16 txucok;
110 u16 txbcok;
111
112
113 u16 txbcfail;
114 u16 txmcfail;
115
116
117 u16 reserve2;
118 u16 txucfail;
119
120
121 u32 txmclength;
122 u32 txbclength;
123 u32 txuclength;
124
125
126 u16 reserve3_23;
127 u8 reserve3_1;
128 u8 rate;
129}__attribute__((packed)) cmpk_tx_status_t;
130
131
132
133typedef struct tag_rx_debug_message_feedback
134{
135
136
137 u16 reserve1;
138 u8 length;
139 u8 element_id;
140
141
142
143
144}cmpk_rx_dbginfo_t;
145
146
147typedef struct tag_tx_rate_history
148{
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
167
168
169
170
171
172
173
174
175
176
177 u16 ht_mcs[4][16];
178
179}__attribute__((packed)) cmpk_tx_rahis_t;
180
181typedef enum tag_command_packet_directories
182{
183 RX_TX_FEEDBACK = 0,
184 RX_INTERRUPT_STATUS = 1,
185 TX_SET_CONFIG = 2,
186 BOTH_QUERY_CONFIG = 3,
187 RX_TX_STATUS = 4,
188 RX_DBGINFO_FEEDBACK = 5,
189 RX_TX_PER_PKT_FEEDBACK = 6,
190 RX_TX_RATE_HISTORY = 7,
191 RX_CMD_ELE_MAX
192}cmpk_element_e;
193
194typedef enum _rt_status{
195 RT_STATUS_SUCCESS,
196 RT_STATUS_FAILURE,
197 RT_STATUS_PENDING,
198 RT_STATUS_RESOURCE
199}rt_status,*prt_status;
200
201extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
202
203extern u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats * pstats);
204extern rt_status SendTxCommandPacket( struct net_device *dev, void* pData, u32 DataLen);
205
206
207#endif
208