blob: 787337064bcf434489b70756601fd6ff539a74ea [file] [log] [blame]
Larry Finger94a79942011-08-23 19:00:42 -05001/******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3 *
4 * This program is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
7 * more details.
8 *
9 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
12 *
13 * The full GNU General Public License is included in this distribution in the
14 * file called LICENSE.
15 *
16 * Contact Information:
17 * wlanfae <wlanfae@realtek.com>
18******************************************************************************/
19#ifndef R819XUSB_CMDPKT_H
20#define R819XUSB_CMDPKT_H
21#define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t)
22#define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
23#define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t)
24#define CMPK_RX_TX_STS_SIZE sizeof(cmpk_tx_status_t)
25#define CMPK_RX_DBG_MSG_SIZE sizeof(cmpk_rx_dbginfo_t)
26#define CMPK_TX_RAHIS_SIZE sizeof(cmpk_tx_rahis_t)
27
28#define ISR_TxBcnOk BIT27
29#define ISR_TxBcnErr BIT26
30#define ISR_BcnTimerIntr BIT13
31
32
33typedef struct tag_cmd_pkt_tx_feedback
34{
35 u8 element_id;
36 u8 length;
37 u8 TID:4; /* */
38 u8 fail_reason:3; /* */
39 u8 tok:1;
40 u8 reserve1:4; /* */
41 u8 pkt_type:2; /* */
42 u8 bandwidth:1; /* */
43 u8 qos_pkt:1; /* */
44
45 u8 reserve2; /* */
46 u8 retry_cnt; /* */
47 u16 pkt_id; /* */
48
49 u16 seq_num; /* */
50 u8 s_rate;
51 u8 f_rate;
52
53 u8 s_rts_rate; /* */
54 u8 f_rts_rate; /* */
55 u16 pkt_length; /* */
56
57 u16 reserve3; /* */
58 u16 duration; /* */
59}cmpk_txfb_t;
60
61typedef struct tag_cmd_pkt_interrupt_status
62{
63 u8 element_id;
64 u8 length;
65 u16 reserve;
66 u32 interrupt_status;
67}cmpk_intr_sta_t;
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#define cmpk_query_cfg_t cmpk_set_cfg_t
88
89typedef struct tag_tx_stats_feedback
90{
91 u16 reserve1;
92 u8 length;
93 u8 element_id;
94
95 u16 txfail;
96 u16 txok;
97
98 u16 txmcok;
99 u16 txretry;
100
101 u16 txucok;
102 u16 txbcok;
103
104 u16 txbcfail;
105 u16 txmcfail;
106
107 u16 reserve2;
108 u16 txucfail;
109
110 u32 txmclength;
111 u32 txbclength;
112 u32 txuclength;
113
114 u16 reserve3_23;
115 u8 reserve3_1;
116 u8 rate;
117}__attribute__((packed)) cmpk_tx_status_t;
118
119typedef struct tag_rx_debug_message_feedback
120{
121 u16 reserve1;
122 u8 length;
123 u8 element_id;
124
125
126}cmpk_rx_dbginfo_t;
127
128typedef struct tag_tx_rate_history
129{
130 u8 element_id;
131 u8 length;
132 u16 reserved1;
133
134 u16 cck[4];
135
136 u16 ofdm[8];
137
138
139
140
141
142 u16 ht_mcs[4][16];
143
144}__attribute__((packed)) cmpk_tx_rahis_t;
145
146typedef enum tag_command_packet_directories
147{
148 RX_TX_FEEDBACK = 0,
149 RX_INTERRUPT_STATUS = 1,
150 TX_SET_CONFIG = 2,
151 BOTH_QUERY_CONFIG = 3,
152 RX_TX_STATUS = 4,
153 RX_DBGINFO_FEEDBACK = 5,
154 RX_TX_PER_PKT_FEEDBACK = 6,
155 RX_TX_RATE_HISTORY = 7,
156 RX_CMD_ELE_MAX
157}cmpk_element_e;
158
159extern u32 cmpk_message_handle_rx(struct net_device *dev, struct rtllib_rx_stats * pstats);
160extern bool cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
161
162
163#endif