1 #ifndef R819XUSB_CMDPKT_H
2 #define R819XUSB_CMDPKT_H
3 /* Different command packet have dedicated message length and definition. */
4 #define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t) /* 20 */
5 #define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t) /* 16 */
6 #define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t) /* 16 */
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)
11 /* 2008/05/08 amy For USB constant. */
12 #define ISR_TxBcnOk BIT27 /* Transmit Beacon OK */
13 #define ISR_TxBcnErr BIT26 /* Transmit Beacon Error */
14 #define ISR_BcnTimerIntr BIT13 /* Beacon Timer Interrupt */
17 /* Define element ID of command packet. */
19 /*------------------------------Define structure----------------------------*/
20 /* Define different command packet structure. */
21 /* 1. RX side: TX feedback packet. */
22 typedef struct tag_cmd_pkt_tx_feedback {
24 u8 element_id; /* Command packet type. */
25 u8 length; /* Command packet length. */
26 /* Change tx feedback info field. */
27 /*------TX Feedback Info Field */
30 u8 tok:1; /* Transmit ok. */
38 /*------TX Feedback Info Field */
44 u8 s_rate; /* Start rate. */
45 u8 f_rate; /* Final rate. */
57 /* 2. RX side: Interrupt status packet. It includes Beacon State,
58 * Beacon Timer Interrupt and other useful informations in MAC ISR Reg. */
59 typedef struct tag_cmd_pkt_interrupt_status {
60 u8 element_id; /* Command packet type. */
61 u8 length; /* Command packet length. */
63 u32 interrupt_status; /* Interrupt Status. */
67 /* 3. TX side: Set configuration packet. */
68 typedef struct tag_cmd_pkt_set_configuration {
69 u8 element_id; /* Command packet type. */
70 u8 length; /* Command packet length. */
72 /* Configuration info. */
85 /* 4. Both side : TX/RX query configuraton packet. The query structure is the
86 same as set configuration. */
87 #define cmpk_query_cfg_t cmpk_set_cfg_t
89 /* 5. Multi packet feedback status. */
90 typedef struct tag_tx_stats_feedback {
91 /* For endian transfer --> Driver will not the same as
92 firmware structure. */
95 u8 length; /* Command packet length */
96 u8 element_id; /* Command packet type */
99 u16 txfail; /* Tx fail count */
100 u16 txok; /* Tx ok count */
103 u16 txmcok; /* Tx multicast */
104 u16 txretry; /* Tx retry count */
107 u16 txucok; /* Tx unicast */
108 u16 txbcok; /* Tx broadcast */
127 } __packed cmpk_tx_status_t;
129 /* 6. Debug feedback message. */
130 /* Define RX debug message */
131 typedef struct tag_rx_debug_message_feedback {
132 /* For endian transfer --> for driver */
135 u8 length; /* Command packet length */
136 u8 element_id; /* Command packet type */
139 /* Variable debug message. */
143 /* Define transmit rate history. For big endian format. */
144 typedef struct tag_tx_rate_history {
145 /* For endian transfer --> for driver */
147 u8 element_id; /* Command packet type */
148 u8 length; /* Command packet length */
151 /* DW 1-2 CCK rate counter */
164 } __packed cmpk_tx_rahis_t;
166 typedef enum tag_command_packet_directories {
168 RX_INTERRUPT_STATUS = 1,
170 BOTH_QUERY_CONFIG = 3,
172 RX_DBGINFO_FEEDBACK = 5,
173 RX_TX_PER_PKT_FEEDBACK = 6,
174 RX_TX_RATE_HISTORY = 7,
178 typedef enum _rt_status {
183 } rt_status, *prt_status;
185 extern u32 cmpk_message_handle_rx(struct net_device *dev,
186 struct ieee80211_rx_stats *pstats);
187 extern rt_status SendTxCommandPacket(struct net_device *dev,
188 void *pData, u32 DataLen);