import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / combo / drv_wlan / mt6620 / wlan / include / nic / nic_tx.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic_tx.h#1 $
3 */
4
5 /*! \file nic_tx.h
6 \brief Functions that provide TX operation in NIC's point of view.
7
8 This file provides TX functions which are responsible for both Hardware and
9 Software Resource Management and keep their Synchronization.
10
11 */
12
13
14
15 /*
16 ** $Log: nic_tx.h $
17 *
18 * 11 18 2011 eddie.chen
19 * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
20 * Add log counter for tx
21 *
22 * 11 10 2011 eddie.chen
23 * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
24 * Add TX_DONE status detail information.
25 *
26 * 08 15 2011 cp.wu
27 * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
28 * add MT6628-specific definitions.
29 *
30 * 04 12 2011 cp.wu
31 * [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path
32 * 1. add nicTxGetResource() API for QM to make decisions.
33 * 2. if management frames is decided by QM for dropping, the call back is invoked to indicate such a case.
34 *
35 * 03 21 2011 cp.wu
36 * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer
37 * portability improvement
38 *
39 * 02 16 2011 cp.wu
40 * [WCXRP00000449] [MT6620 Wi-Fi][Driver] Refine CMD queue handling by adding an extra API for checking availble count and modify behavior
41 * 1. add new API: nicTxGetFreeCmdCount()
42 * 2. when there is insufficient command descriptor, nicTxEnqueueMsdu() will drop command packets directly
43 *
44 * 01 24 2011 cp.wu
45 * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
46 * 1. add an extra counter for tracking pending forward frames.
47 * 2. notify TX service thread as well when there is pending forward frame
48 * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
49 *
50 * 12 15 2010 yuche.tsai
51 * NULL
52 * Update SLT Descriptor number configure in driver.
53 *
54 * 11 16 2010 yarco.yang
55 * [WCXRP00000177] [MT5931 F/W] Performance tuning for 1st connection
56 * Update TX buffer count
57 *
58 * 11 03 2010 cp.wu
59 * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection
60 * 1) use 8 buffers for MT5931 which is equipped with less memory
61 * 2) modify MT5931 debug level to TRACE when download is successful
62 *
63 * 10 18 2010 cp.wu
64 * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore
65 * 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion
66 * 2. shorten polling count for shorter response time
67 * 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well
68 *
69 * 10 06 2010 cp.wu
70 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
71 * code reorganization to improve isolation between GLUE and CORE layers.
72 *
73 * 09 03 2010 kevin.huang
74 * NULL
75 * Refine #include sequence and solve recursive/nested #include issue
76 *
77 * 08 30 2010 cp.wu
78 * NULL
79 * API added: nicTxPendingPackets(), for simplifying porting layer
80 *
81 * 07 26 2010 cp.wu
82 *
83 * change TC4 initial value from 2 to 4.
84 *
85 * 07 13 2010 cp.wu
86 *
87 * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
88 * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
89 * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation
90 *
91 * 07 08 2010 cp.wu
92 *
93 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
94 *
95 * 07 06 2010 yarco.yang
96 * [WPD00003837][MT6620]Data Path Refine
97 * Add MGMT Packet type for HIF_TX_HEADER
98 *
99 * 06 23 2010 cp.wu
100 * [WPD00003833][MT6620 and MT5931] Driver migration
101 * integrate .
102 *
103 * 06 21 2010 cp.wu
104 * [WPD00003833][MT6620 and MT5931] Driver migration
105 * refine TX-DONE callback.
106 *
107 * 06 21 2010 cp.wu
108 * [WPD00003833][MT6620 and MT5931] Driver migration
109 * TX descriptors are now allocated once for reducing allocation overhead
110 *
111 * 06 21 2010 cp.wu
112 * [WPD00003833][MT6620 and MT5931] Driver migration
113 * specify correct value for management frames.
114 *
115 * 06 11 2010 cp.wu
116 * [WPD00003833][MT6620 and MT5931] Driver migration
117 * 1) migrate assoc.c.
118 * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
119 * 3) add configuration options for CNM_MEM and RSN modules
120 * 4) add data path for management frames
121 * 5) eliminate rPacketInfo of MSDU_INFO_T
122 *
123 * 06 10 2010 cp.wu
124 * [WPD00003833][MT6620 and MT5931] Driver migration
125 * 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate
126 * 2) add packet type for indicating management frames
127 *
128 * 06 09 2010 cp.wu
129 * [WPD00003833][MT6620 and MT5931] Driver migration
130 * add necessary changes to driver data paths.
131 *
132 * 06 09 2010 cp.wu
133 * [WPD00003833][MT6620 and MT5931] Driver migration
134 * add TX_PACKET_MGMT to indicate the frame is coming from management modules
135 *
136 * 06 07 2010 cp.wu
137 * [WPD00003833][MT6620 and MT5931] Driver migration
138 * merge wlan_def.h.
139 *
140 * 06 06 2010 kevin.huang
141 * [WPD00003832][MT6620 5931] Create driver base
142 * [MT6620 5931] Create driver base
143 *
144 * 03 30 2010 cp.wu
145 * [WPD00001943]Create WiFi test driver framework on WinXP
146 * remove driver-land statistics.
147 *
148 * 03 24 2010 cp.wu
149 * [WPD00001943]Create WiFi test driver framework on WinXP
150 * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK
151 * * *
152 *
153 * 03 10 2010 cp.wu
154 * [WPD00001943]Create WiFi test driver framework on WinXP
155 * code clean: removing unused variables and structure definitions
156 *
157 * 03 02 2010 tehuang.liu
158 * [WPD00001943]Create WiFi test driver framework on WinXP
159 * Redistributed the initial TC resources for normal operation
160 *
161 * 03 02 2010 cp.wu
162 * [WPD00001943]Create WiFi test driver framework on WinXP
163 * add mutex to avoid multiple access to qmTxQueue simultaneously.
164 *
165 * 02 23 2010 cp.wu
166 * [WPD00001943]Create WiFi test driver framework on WinXP
167 * add new API: wlanProcessQueuedPackets()
168 *
169 * 02 10 2010 cp.wu
170 * [WPD00001943]Create WiFi test driver framework on WinXP
171 * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c]
172 * * * 2) firmware image length is now retrieved via NdisFileOpen
173 * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore
174 * * * 4) nicRxWaitResponse() revised
175 * * * 5) another set of TQ counter default value is added for fw-download state
176 * * * 6) Wi-Fi load address is now retrieved from registry too
177 *
178 * 02 09 2010 cp.wu
179 * [WPD00001943]Create WiFi test driver framework on WinXP
180 * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address
181 * * * * 2. follow MSDN defined behavior when associates to another AP
182 * * * * 3. for firmware download, packet size could be up to 2048 bytes
183 *
184 * 01 27 2010 cp.wu
185 * [WPD00001943]Create WiFi test driver framework on WinXP
186 * 1. eliminate improper variable in rHifInfo
187 * * * * * 2. block TX/ordinary OID when RF test mode is engaged
188 * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
189 * * * * * 4. correct some HAL implementation
190 *
191 * 01 13 2010 tehuang.liu
192 * [WPD00001943]Create WiFi test driver framework on WinXP
193 * Enabled the Burst_End Indication mechanism
194 *
195 * 12 30 2009 cp.wu
196 * [WPD00001943]Create WiFi test driver framework on WinXP
197 * 1) According to CMD/EVENT documentation v0.8,
198 * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
199 * * * * * and result is retrieved by get ATInfo instead
200 * * * * * 2) add 4 counter for recording aggregation statistics
201 ** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:53:28 GMT mtk02752
202 ** remove unused API
203 ** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-27 11:08:00 GMT mtk02752
204 ** add flush for reset
205 ** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-24 19:56:49 GMT mtk02752
206 ** remove redundant eTC
207 ** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-23 22:01:08 GMT mtk02468
208 ** Added MSDU_INFO fields for composing HIF TX header
209 ** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-17 22:40:51 GMT mtk01084
210 ** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-17 17:35:05 GMT mtk02752
211 ** + nicTxMsduInfoList() for sending MsduInfoList
212 ** + NIC_TX_BUFF_COUNT_TC[0~5]
213 ** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-17 11:07:00 GMT mtk02752
214 ** add nicTxAdjustTcq() API
215 ** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 22:28:30 GMT mtk02752
216 ** move aucFreeBufferCount/aucMaxNumOfBuffer into another structure
217 ** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-16 21:44:50 GMT mtk02752
218 ** + nicTxReturnMsduInfo()
219 ** + nicTxFillMsduInfo()
220 ** + rFreeMsduInfoList field in TX_CTRL
221 ** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-16 18:00:43 GMT mtk02752
222 ** use P_PACKET_INFO_T for prPacket to avoid inventing another new structure for packet
223 ** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-16 15:28:49 GMT mtk02752
224 ** add ucQueuedPacketNum for indicating how many packets are queued by per STA/AC queue
225 ** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-16 10:52:01 GMT mtk02752
226 ** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-14 23:39:24 GMT mtk02752
227 ** interface structure redefine
228 ** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-13 21:17:03 GMT mtk02752
229 ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-29 19:53:10 GMT mtk01084
230 ** remove strange code by Frog
231 ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:59:04 GMT mtk01084
232 ** update for new HW architecture design
233 ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-02 13:53:03 GMT mtk01725
234 ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-28 10:36:50 GMT mtk01461
235 ** Add declaration of nicTxReleaseResource()
236 ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:58:39 GMT mtk01461
237 ** Move CMD_INFO_T related define and function to cmd_buf.h
238 ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:53:53 GMT mtk01461
239 ** Add function for SDIO_TX_ENHANCE
240 ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:33:27 GMT mtk01461
241 ** Define constants for TX PATH and add nicTxPollingResource
242 ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:09:32 GMT mtk01461
243 ** Update TX PATH API
244 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:38 GMT mtk01426
245 ** Init for develop
246 **
247 */
248
249 #ifndef _NIC_TX_H
250 #define _NIC_TX_H
251
252 /*******************************************************************************
253 * C O M P I L E R F L A G S
254 ********************************************************************************
255 */
256
257 /*******************************************************************************
258 * E X T E R N A L R E F E R E N C E S
259 ********************************************************************************
260 */
261
262 /*******************************************************************************
263 * C O N S T A N T S
264 ********************************************************************************
265 */
266 #define NIC_TX_RESOURCE_POLLING_TIMEOUT 256
267 #define NIC_TX_RESOURCE_POLLING_DELAY_MSEC 50
268
269 /* Maximum buffer count for individual HIF TCQ */
270
271 #if defined(MT6620)
272 #if CFG_SLT_SUPPORT
273 /* 20101215 mtk01725 Redistributed the initial TC resources for SLT operation */
274 #define NIC_TX_BUFF_COUNT_TC0 0 /* First connection: 0 */
275 #define NIC_TX_BUFF_COUNT_TC1 16 /* First connection: 32 */
276 #define NIC_TX_BUFF_COUNT_TC2 0 /* First connection: 0 */
277 #define NIC_TX_BUFF_COUNT_TC3 0 /* First connection: 0 */
278 #define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
279 #define NIC_TX_BUFF_COUNT_TC5 0 /* First connection: 0 */
280 #else
281 /* 20100302 mtk02468 Redistributed the initial TC resources for normal operation */
282 #define NIC_TX_BUFF_COUNT_TC0 6 /* First connection: 0 */
283 #define NIC_TX_BUFF_COUNT_TC1 8 /* First connection: 32 */
284 #define NIC_TX_BUFF_COUNT_TC2 8 /* First connection: 0 */
285 #define NIC_TX_BUFF_COUNT_TC3 8 /* First connection: 0 */
286 #define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
287 #define NIC_TX_BUFF_COUNT_TC5 2 /* First connection: 0 */
288 #endif
289 #elif defined(MT5931)
290 #define NIC_TX_BUFF_COUNT_TC0 1 /* First connection: 0 */
291 #define NIC_TX_BUFF_COUNT_TC1 14 /* First connection: 32 */
292 #define NIC_TX_BUFF_COUNT_TC2 1 /* First connection: 0 */
293 #define NIC_TX_BUFF_COUNT_TC3 1 /* First connection: 0 */
294 #define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
295 #define NIC_TX_BUFF_COUNT_TC5 1 /* First connection: 0 */
296 #elif defined(MT6628)
297 #define NIC_TX_BUFF_COUNT_TC0 1 /* First connection: 0 */
298 #define NIC_TX_BUFF_COUNT_TC1 20 /* First connection: 32 */
299 #define NIC_TX_BUFF_COUNT_TC2 1 /* First connection: 0 */
300 #define NIC_TX_BUFF_COUNT_TC3 1 /* First connection: 0 */
301 #define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
302 #define NIC_TX_BUFF_COUNT_TC5 1 /* First connection: 0 */
303
304 #endif
305
306 #define NIC_TX_BUFF_SUM (NIC_TX_BUFF_COUNT_TC0 + \
307 NIC_TX_BUFF_COUNT_TC1 + \
308 NIC_TX_BUFF_COUNT_TC2 + \
309 NIC_TX_BUFF_COUNT_TC3 + \
310 NIC_TX_BUFF_COUNT_TC4 + \
311 NIC_TX_BUFF_COUNT_TC5)
312 #if CFG_ENABLE_FW_DOWNLOAD
313
314 #define NIC_TX_INIT_BUFF_COUNT_TC0 8
315 #define NIC_TX_INIT_BUFF_COUNT_TC1 0
316 #define NIC_TX_INIT_BUFF_COUNT_TC2 0
317 #define NIC_TX_INIT_BUFF_COUNT_TC3 0
318 #define NIC_TX_INIT_BUFF_COUNT_TC4 0
319 #define NIC_TX_INIT_BUFF_COUNT_TC5 0
320
321 #define NIC_TX_INIT_BUFF_SUM (NIC_TX_INIT_BUFF_COUNT_TC0 + \
322 NIC_TX_INIT_BUFF_COUNT_TC1 + \
323 NIC_TX_INIT_BUFF_COUNT_TC2 + \
324 NIC_TX_INIT_BUFF_COUNT_TC3 + \
325 NIC_TX_INIT_BUFF_COUNT_TC4 + \
326 NIC_TX_INIT_BUFF_COUNT_TC5)
327
328 #endif
329
330 /*******************************************************************************
331 * D A T A T Y P E S
332 ********************************************************************************
333 */
334 /* 3 /* Session for TX QUEUES */ */
335 /* The definition in this ENUM is used to categorize packet's Traffic Class according
336 * to the their TID(User Priority).
337 * In order to achieve QoS goal, a particular TC should not block the process of
338 * another packet with different TC.
339 * In current design we will have 5 categories(TCs) of SW resource.
340 */
341 typedef enum _ENUM_TRAFFIC_CLASS_INDEX_T {
342 TC0_INDEX = 0, /* HIF TX0: AC0 packets */
343 TC1_INDEX, /* HIF TX0: AC1 packets & non-QoS packets */
344 TC2_INDEX, /* HIF TX0: AC2 packets */
345 TC3_INDEX, /* HIF TX0: AC3 packets */
346 TC4_INDEX, /* HIF TX1: Command packets or 802.1x packets */
347 TC5_INDEX, /* HIF TX0: BMCAST packets */
348 TC_NUM /* Maximum number of Traffic Classes. */
349 } ENUM_TRAFFIC_CLASS_INDEX_T;
350
351 typedef enum _ENUM_TX_STATISTIC_COUNTER_T {
352 TX_MPDU_TOTAL_COUNT = 0,
353 TX_INACTIVE_BSS_DROP,
354 TX_INACTIVE_STA_DROP,
355 TX_FORWARD_OVERFLOW_DROP,
356 TX_AP_BORADCAST_DROP,
357 TX_STATISTIC_COUNTER_NUM
358 } ENUM_TX_STATISTIC_COUNTER_T;
359
360
361 typedef struct _TX_TCQ_STATUS_T {
362 UINT_8 aucFreeBufferCount[TC_NUM];
363 UINT_8 aucMaxNumOfBuffer[TC_NUM];
364 } TX_TCQ_STATUS_T, *P_TX_TCQ_STATUS_T;
365
366 typedef struct _TX_TCQ_ADJUST_T {
367 INT_8 acVariation[TC_NUM];
368 } TX_TCQ_ADJUST_T, *P_TX_TCQ_ADJUST_T;
369
370 typedef struct _TX_CTRL_T {
371 UINT_32 u4TxCachedSize;
372 PUINT_8 pucTxCached;
373
374 /* Elements below is classified according to TC (Traffic Class) value. */
375
376 TX_TCQ_STATUS_T rTc;
377
378 PUINT_8 pucTxCoalescingBufPtr;
379
380 QUE_T rFreeMsduInfoList;
381
382 /* Management Frame Tracking */
383 /* number of management frames to be sent */
384 INT_32 i4TxMgmtPendingNum;
385
386 /* to tracking management frames need TX done callback */
387 QUE_T rTxMgmtTxingQueue;
388
389 #if CFG_HIF_STATISTICS
390 UINT_32 u4TotalTxAccessNum;
391 UINT_32 u4TotalTxPacketNum;
392 #endif
393 UINT_32 au4Statistics[TX_STATISTIC_COUNTER_NUM];
394
395 /* Number to track forwarding frames */
396 INT_32 i4PendingFwdFrameCount;
397
398 } TX_CTRL_T, *P_TX_CTRL_T;
399
400 typedef enum _ENUM_TX_PACKET_SRC_T {
401 TX_PACKET_OS,
402 TX_PACKET_OS_OID,
403 TX_PACKET_FORWARDING,
404 TX_PACKET_MGMT,
405 TX_PACKET_NUM
406 } ENUM_TX_PACKET_SRC_T;
407
408 typedef enum _ENUM_HIF_TX_PACKET_TYPE_T {
409 HIF_TX_PACKET_TYPE_DATA = 0,
410 HIF_TX_PACKET_TYPE_COMMAND,
411 HIF_TX_PACKET_TYPE_HIF_LB,
412 HIF_TX_PACKET_TYPE_MGMT
413 } ENUM_HIF_TX_PACKET_TYPE_T, *P_ENUM_HIF_TX_PACKET_TYPE_T;
414
415 typedef enum _ENUM_TX_RESULT_CODE_T {
416 TX_RESULT_SUCCESS = 0,
417 TX_RESULT_LIFE_TIMEOUT,
418 TX_RESULT_RTS_ERROR,
419 TX_RESULT_MPDU_ERROR,
420 TX_RESULT_AGING_TIMEOUT,
421 TX_RESULT_FLUSHED,
422 TX_RESULT_DROPPED_IN_DRIVER = 32,
423 TX_RESULT_NUM
424 } ENUM_TX_RESULT_CODE_T, *P_ENUM_TX_RESULT_CODE_T;
425
426 /* TX Call Back Function */
427 typedef WLAN_STATUS(*PFN_TX_DONE_HANDLER) (IN P_ADAPTER_T prAdapter,
428 IN P_MSDU_INFO_T prMsduInfo,
429 IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
430
431 /* TX transactions could be divided into 4 kinds:
432 *
433 * 1) 802.1X / Bluetooth-over-Wi-Fi Security Frames
434 * [CMD_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
435 *
436 * 2) MMPDU
437 * [CMD_INFO_T] - [prPacket] - [MSDU_INFO_T] - [prPacket] - direct buffer for frame body
438 *
439 * 3) Command Packets
440 * [CMD_INFO_T] - [pucInfoBuffer] - direct buffer for content of command packet
441 *
442 * 4) Normal data frame
443 * [MSDU_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
444 */
445
446
447 /* PS_FORWARDING_TYPE_NON_PS means that the receiving STA is in Active Mode
448 * from the perspective of host driver (maybe not synchronized with FW --> SN is needed)
449 */
450
451 struct _MSDU_INFO_T {
452 QUE_ENTRY_T rQueEntry;
453 P_NATIVE_PACKET prPacket;
454
455 ENUM_TX_PACKET_SRC_T eSrc; /* specify OS/FORWARD packet */
456 UINT_8 ucUserPriority;
457
458 /* For composing HIF TX header */
459 UINT_8 ucTC; /* Traffic Class: 0~4 (HIF TX0), 5 (HIF TX1) */
460 UINT_8 ucPacketType; /* 0: Data, 1: Command, 2: HIF Loopback 3: Management Frame */
461 UINT_8 ucStaRecIndex;
462 UINT_8 ucNetworkType; /* See ENUM_NETWORK_TYPE_T */
463 UINT_8 ucFormatID; /* 0: MAUI, Linux, Windows NDIS 5.1 */
464 BOOLEAN fgIs802_1x; /* TRUE: 802.1x frame */
465 BOOLEAN fgIs802_11; /* TRUE: 802.11 header is present */
466 UINT_16 u2PalLLH; /* PAL Logical Link Header (for BOW network) */
467 UINT_16 u2AclSN; /* ACL Sequence Number (for BOW network) */
468 UINT_8 ucPsForwardingType; /* See ENUM_PS_FORWARDING_TYPE_T */
469 UINT_8 ucPsSessionID; /* PS Session ID specified by the FW for the STA */
470 BOOLEAN fgIsBurstEnd; /* TRUE means this is the last packet of the burst for (STA, TID) */
471 BOOLEAN fgIsBIP; /* Management Frame Protection */
472 BOOLEAN fgIsBasicRate; /* Force Basic Rate Transmission */
473
474 /* flattened from PACKET_INFO_T */
475 UINT_8 ucMacHeaderLength;
476 UINT_8 ucLlcLength; /* w/o EtherType */
477 UINT_16 u2FrameLength;
478 UINT_8 aucEthDestAddr[MAC_ADDR_LEN]; /* Ethernet Destination Address */
479
480 /* for TX done tracking */
481 UINT_8 ucTxSeqNum;
482 PFN_TX_DONE_HANDLER pfTxDoneHandler;
483 };
484
485
486 /*******************************************************************************
487 * P U B L I C D A T A
488 ********************************************************************************
489 */
490
491 /*******************************************************************************
492 * P R I V A T E D A T A
493 ********************************************************************************
494 */
495
496 /*******************************************************************************
497 * M A C R O S
498 ********************************************************************************
499 */
500
501 #define TX_INC_CNT(prTxCtrl, eCounter) \
502 {((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter]++; }
503
504 #define TX_ADD_CNT(prTxCtrl, eCounter, u8Amount) \
505 {((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter] += (UINT_32)u8Amount; }
506
507 #define TX_GET_CNT(prTxCtrl, eCounter) \
508 (((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter])
509
510 #define TX_RESET_ALL_CNTS(prTxCtrl) \
511 {kalMemZero(&prTxCtrl->au4Statistics[0], sizeof(prTxCtrl->au4Statistics)); }
512
513
514
515 /*******************************************************************************
516 * F U N C T I O N D E C L A R A T I O N S
517 ********************************************************************************
518 */
519 VOID nicTxInitialize(IN P_ADAPTER_T prAdapter);
520
521 WLAN_STATUS nicTxAcquireResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC);
522
523 WLAN_STATUS nicTxPollingResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC);
524
525 BOOLEAN nicTxReleaseResource(IN P_ADAPTER_T prAdapter, IN UINT_8 *aucTxRlsCnt);
526
527 WLAN_STATUS nicTxResetResource(IN P_ADAPTER_T prAdapter);
528
529 UINT_8 nicTxGetResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC);
530
531 WLAN_STATUS nicTxMsduInfoList(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
532
533 WLAN_STATUS nicTxMsduQueue(IN P_ADAPTER_T prAdapter, UINT_8 ucPortIdx, P_QUE_T prQue);
534
535 WLAN_STATUS nicTxCmd(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN UINT_8 ucTC);
536
537 VOID nicTxRelease(IN P_ADAPTER_T prAdapter);
538
539 VOID nicProcessTxInterrupt(IN P_ADAPTER_T prAdapter);
540
541 VOID nicTxFreeMsduInfoPacket(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
542
543 VOID nicTxReturnMsduInfo(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
544
545 BOOLEAN
546 nicTxFillMsduInfo(IN P_ADAPTER_T prAdapter,
547 IN P_MSDU_INFO_T prMsduInfo, IN P_NATIVE_PACKET prNdisPacket);
548
549 WLAN_STATUS nicTxAdjustTcq(IN P_ADAPTER_T prAdapter);
550
551 WLAN_STATUS nicTxFlush(IN P_ADAPTER_T prAdapter);
552
553 #if CFG_ENABLE_FW_DOWNLOAD
554 WLAN_STATUS nicTxInitCmd(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN UINT_8 ucTC);
555
556 WLAN_STATUS nicTxInitResetResource(IN P_ADAPTER_T prAdapter);
557 #endif
558
559 WLAN_STATUS nicTxEnqueueMsdu(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
560
561 UINT_32 nicTxGetFreeCmdCount(IN P_ADAPTER_T prAdapter);
562
563 /*******************************************************************************
564 * F U N C T I O N S
565 ********************************************************************************
566 */
567
568 #endif /* _NIC_TX_H */