blob: ff58baf8b5196096d6812d7dec9fb2d2ae0d7e1a [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006#ifndef WLAN_QCT_TLI_H
7#define WLAN_QCT_TLI_H
8
9/*===========================================================================
10
11 W L A N T R A N S P O R T L A Y E R
12 I N T E R N A L A P I
13
14
15DESCRIPTION
16 This file contains the internal declarations used within wlan transport
17 layer module.
18
Jeff Johnson295189b2012-06-20 16:38:30 -070019===========================================================================*/
20
21
22/*===========================================================================
23
24 EDIT HISTORY FOR FILE
25
26
27 This section contains comments describing changes made to the module.
28 Notice that changes are listed in reverse chronological order.
29
30
31 $Header:$ $DateTime: $ $Author: $
32
33
34when who what, where, why
35-------- --- ----------------------------------------------------------
3602/19/10 bad Fixed 802.11 to 802.3 ft issues with WAPI
3701/14/10 rnair Fixed the byte order for the WAI packet type.
3801/08/10 lti Added TL Data Caching
3910/09/09 rnair Add support for WAPI
4002/02/09 sch Add Handoff support
4112/09/08 lti Fixes for AMSS compilation
4212/02/08 lti Fix fo trigger frame generation
4310/31/08 lti Fix fo TL tx suspend
4410/01/08 lti Merged in fixes from reordering
4509/05/08 lti Fixes following QOS unit testing
4608/06/08 lti Added QOS support
4707/18/08 lti Fixes following integration
48 Added frame translation
4906/26/08 lti Fixes following unit testing
5005/05/08 lti Created module.
51
52===========================================================================*/
53
54
55
56/*===========================================================================
57
58 INCLUDE FILES FOR MODULE
59
60===========================================================================*/
61
62/*----------------------------------------------------------------------------
63 * Include Files
64 * -------------------------------------------------------------------------*/
65#include "vos_packet.h"
66#include "vos_api.h"
67#include "vos_timer.h"
68#include "vos_mq.h"
69#include "vos_list.h"
70#include "wlan_qct_tl.h"
71#include "pmcApi.h"
72#include "wlan_qct_hal.h"
73
74
75#define STATIC static
Jeff Johnson295189b2012-06-20 16:38:30 -070076/*----------------------------------------------------------------------------
77 * Preprocessor Definitions and Constants
78 * -------------------------------------------------------------------------*/
79
80/*Maximum number of TIDs */
81#define WLAN_MAX_TID 8
82
Jeff Johnson295189b2012-06-20 16:38:30 -070083/*Offset of the OUI field inside the LLC/SNAP header*/
84#define WLANTL_LLC_OUI_OFFSET 3
85
86/*Size of the OUI type field inside the LLC/SNAP header*/
87#define WLANTL_LLC_OUI_SIZE 3
88
89/*Offset of the protocol type field inside the LLC/SNAP header*/
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -080090#define WLANTL_LLC_PROTO_TYPE_OFFSET (WLANTL_LLC_OUI_OFFSET + WLANTL_LLC_OUI_SIZE)
Jeff Johnson295189b2012-06-20 16:38:30 -070091
92/*Size of the protocol type field inside the LLC/SNAP header*/
93#define WLANTL_LLC_PROTO_TYPE_SIZE 2
94
95/*802.1x protocol type */
96#define WLANTL_LLC_8021X_TYPE 0x888E
97
98/*WAPI protocol type */
99#define WLANTL_LLC_WAI_TYPE 0x88b4
100
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800101#ifdef FEATURE_WLAN_TDLS
102#define WLANTL_LLC_TDLS_TYPE 0x890d
103#endif
104
Jeff Johnson295189b2012-06-20 16:38:30 -0700105/*Length offset inside the AMSDU sub-frame header*/
106#define WLANTL_AMSDU_SUBFRAME_LEN_OFFSET 12
107
108/*802.3 header definitions*/
109#define WLANTL_802_3_HEADER_LEN 14
110
111/* Offset of DA field in a 802.3 header*/
112#define WLANTL_802_3_HEADER_DA_OFFSET 0
113
114/*802.11 header definitions - header len without QOS ctrl field*/
115#define WLANTL_802_11_HEADER_LEN 24
116
117/*802.11 header length + QOS ctrl field*/
118#define WLANTL_MPDU_HEADER_LEN 32
119
120/*802.11 header definitions*/
121#define WLANTL_802_11_MAX_HEADER_LEN 40
122
123/*802.11 header definitions - qos ctrl field len*/
124#define WLANTL_802_11_HEADER_QOS_CTL 2
125
126/*802.11 header definitions - ht ctrl field len*/
127#define WLANTL_802_11_HEADER_HT_CTL 4
128
129/* Offset of Addr1 field in a 802.11 header*/
130#define WLANTL_802_11_HEADER_ADDR1_OFFSET 4
131
132/*802.11 ADDR4 MAC addr field len */
133#define WLANTL_802_11_HEADER_ADDR4_LEN VOS_MAC_ADDR_SIZE
134
135/* Length of an AMSDU sub-frame */
136#define TL_AMSDU_SUBFRM_HEADER_LEN 14
137
138/* Length of the LLC header*/
139#define WLANTL_LLC_HEADER_LEN 8
140
141/*As per 802.11 spec */
142#define WLANTL_MGMT_FRAME_TYPE 0x00
143#define WLANTL_CTRL_FRAME_TYPE 0x10
144#define WLANTL_DATA_FRAME_TYPE 0x20
145
146/*Value of the data type field in the 802.11 frame */
147#define WLANTL_80211_DATA_TYPE 0x02
148#define WLANTL_80211_DATA_QOS_SUBTYPE 0x08
149#define WLANTL_80211_NULL_QOS_SUBTYPE 0x0C
150
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -0800151/*Defines for internal utility functions */
152#define WLANTL_FRAME_TYPE_BCAST 0xff
153#define WLANTL_FRAME_TYPE_MCAST 0x01
154#define WLANTL_FRAME_TYPE_UCAST 0x00
155
Jeff Johnson295189b2012-06-20 16:38:30 -0700156
157/*-------------------------------------------------------------------------
158 BT-AMP related definition - !!! should probably be moved to BT-AMP header
159---------------------------------------------------------------------------*/
160
161/*-------------------------------------------------------------------------
162 Helper macros
163---------------------------------------------------------------------------*/
164 /*Checks STA index validity*/
165#define WLANTL_STA_ID_INVALID( _staid )( _staid >= WLAN_MAX_STA_COUNT )
166
167/*As per Libra behavior */
168#define WLANTL_STA_ID_BCAST 0xFF
169
170/*Checks TID validity*/
171#define WLANTL_TID_INVALID( _tid ) ( _tid >= WLAN_MAX_TID )
172
173/*Checks AC validity*/
174#define WLANTL_AC_INVALID( _tid ) ( _tid >= WLANTL_MAX_AC )
175
176/*Determines the addr field offset based on the frame xtl bit*/
177#define WLANTL_MAC_ADDR_ALIGN( _dxtl ) \
178 ( ( 0 == _dxtl ) ? \
179 WLANTL_802_3_HEADER_DA_OFFSET: WLANTL_802_11_HEADER_ADDR1_OFFSET )
180
181/*Determines the header len based on the disable xtl field*/
182#define WLANTL_MAC_HEADER_LEN( _dxtl) \
183 ( ( 0 == _dxtl )? \
184 WLANTL_802_3_HEADER_LEN:WLANTL_802_11_HEADER_LEN )
185
186/*Determines the necesary length of the BD header - in case
187 UMA translation is enabled enough room needs to be left in front of the
188 packet for the 802.11 header to be inserted*/
189#define WLANTL_BD_HEADER_LEN( _dxtl ) \
190 ( ( 0 == _dxtl )? \
191 (WLANHAL_TX_BD_HEADER_SIZE+WLANTL_802_11_MAX_HEADER_LEN): WLANHAL_TX_BD_HEADER_SIZE )
192
193
194#define WLAN_TL_CEIL( _a, _b) (( 0 != (_a)%(_b))? (_a)/(_b) + 1: (_a)/(_b))
195
196/*get TL control block from vos global context */
197#define VOS_GET_TL_CB(_pvosGCtx) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800198 ((WLANTL_CbType*)vos_get_context( VOS_MODULE_ID_TL, _pvosGCtx))
Jeff Johnson295189b2012-06-20 16:38:30 -0700199
200/* Check whether Rx frame is LS or EAPOL packet (other than data) */
201#define WLANTL_BAP_IS_NON_DATA_PKT_TYPE(usType) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800202 ((WLANTL_BT_AMP_TYPE_AR == usType) || (WLANTL_BT_AMP_TYPE_SEC == usType) || \
203 (WLANTL_BT_AMP_TYPE_LS_REQ == usType) || (WLANTL_BT_AMP_TYPE_LS_REP == usType))
Jeff Johnson295189b2012-06-20 16:38:30 -0700204
205/*get RSSI0 from a RX BD*/
206/* 7 bits in phystats represent -100dBm to +27dBm */
207#define WLAN_TL_RSSI_CORRECTION 100
208#define WLANTL_GETRSSI0(pBD) (WDA_GETRSSI0(pBD) - WLAN_TL_RSSI_CORRECTION)
209
210/*get RSSI1 from a RX BD*/
211#define WLANTL_GETRSSI1(pBD) (WDA_GETRSSI1(pBD) - WLAN_TL_RSSI_CORRECTION)
212
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530213#define WLANTL_GETSNR(pBD) WDA_GET_RX_SNR(pBD)
214
Jeff Johnson295189b2012-06-20 16:38:30 -0700215/* Check whether Rx frame is LS or EAPOL packet (other than data) */
216#define WLANTL_BAP_IS_NON_DATA_PKT_TYPE(usType) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800217 ((WLANTL_BT_AMP_TYPE_AR == usType) || (WLANTL_BT_AMP_TYPE_SEC == usType) || \
218 (WLANTL_BT_AMP_TYPE_LS_REQ == usType) || (WLANTL_BT_AMP_TYPE_LS_REP == usType))
Jeff Johnson295189b2012-06-20 16:38:30 -0700219
220/*---------------------------------------------------------------------------
221 TL signals for TX thread
222---------------------------------------------------------------------------*/
223typedef enum
224{
225 /*Suspend signal - following serialization of a HAL suspend request*/
226 WLANTL_TX_SIG_SUSPEND = 0,
227
228 /*Res need signal - triggered when all pending TxComp have been received
229 and TL is low on resources*/
230 WLANTL_TX_RES_NEEDED = 1,
231
232 /* Forwarding RX cached frames */
233 WLANTL_TX_FWD_CACHED = 2,
234
235 /* Serialized STAID AC Indication */
236 WLANTL_TX_STAID_AC_IND = 3,
237
238 /* Serialzie TX transmit request */
239 WLANTL_TX_START_XMIT = 4,
240
241 /* Serialzie Finish UL Authentication request */
242 WLANTL_FINISH_ULA = 5,
243
Madan Mohan Koyyalamudia96f5442013-05-10 11:32:06 +0530244 /* Serialized Snapshot request indication */
245 WLANTL_TX_SNAPSHOT = 6,
246
Jeff Johnson295189b2012-06-20 16:38:30 -0700247 WLANTL_TX_MAX
248}WLANTL_TxSignalsType;
249
250/*---------------------------------------------------------------------------
251 STA Event type
252---------------------------------------------------------------------------*/
253typedef enum
254{
255 /* Transmit frame event */
256 WLANTL_TX_EVENT = 0,
257
258 /* Receive frame event */
259 WLANTL_RX_EVENT = 1,
260
261 WLANTL_MAX_EVENT
262}WLANTL_STAEventType;
263
264/*---------------------------------------------------------------------------
265
266 DESCRIPTION
267 State machine used by transport layer for receiving or transmitting
268 packets.
269
270 PARAMETERS
271
272 IN
273 pAdapter: pointer to the global adapter context; a handle to TL's
274 control block can be extracted from its context
275 ucSTAId: identifier of the station being processed
276 vosDataBuff: pointer to the tx/rx vos buffer
277
278 RETURN VALUE
279 The result code associated with performing the operation
280
281---------------------------------------------------------------------------*/
282typedef VOS_STATUS (*WLANTL_STAFuncType)( v_PVOID_t pAdapter,
283 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700284 vos_pkt_t** pvosDataBuff,
285 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700286
287/*---------------------------------------------------------------------------
288 STA FSM Entry type
289---------------------------------------------------------------------------*/
290typedef struct
291{
292 WLANTL_STAFuncType pfnSTATbl[WLANTL_MAX_EVENT];
293} WLANTL_STAFsmEntryType;
294
295/* Receive in connected state - only EAPOL or WAI*/
296VOS_STATUS WLANTL_STARxConn( v_PVOID_t pAdapter,
297 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700298 vos_pkt_t** pvosDataBuff,
299 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700300
301/* Transmit in connected state - only EAPOL or WAI*/
302VOS_STATUS WLANTL_STATxConn( v_PVOID_t pAdapter,
303 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700304 vos_pkt_t** pvosDataBuff,
305 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700306
307/* Receive in authenticated state - all data allowed*/
308VOS_STATUS WLANTL_STARxAuth( v_PVOID_t pAdapter,
309 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700310 vos_pkt_t** pvosDataBuff,
311 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700312
313/* Transmit in authenticated state - all data allowed*/
314VOS_STATUS WLANTL_STATxAuth( v_PVOID_t pAdapter,
315 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700316 vos_pkt_t** pvosDataBuff,
317 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700318
319/* Receive in disconnected state - no data allowed*/
320VOS_STATUS WLANTL_STARxDisc( v_PVOID_t pAdapter,
321 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700322 vos_pkt_t** pvosDataBuff,
323 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700324
325/* Transmit in disconnected state - no data allowed*/
326VOS_STATUS WLANTL_STATxDisc( v_PVOID_t pAdapter,
327 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700328 vos_pkt_t** pvosDataBuff,
329 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700330
331/* TL State Machine */
332STATIC const WLANTL_STAFsmEntryType tlSTAFsm[WLANTL_STA_MAX_STATE] =
333{
334 /* WLANTL_STA_INIT */
335 { {
336 NULL, /* WLANTL_TX_EVENT - no packets should get transmitted*/
337 NULL, /* WLANTL_RX_EVENT - no packets should be received - drop*/
338 } },
339
340 /* WLANTL_STA_CONNECTED */
341 { {
342 WLANTL_STATxConn, /* WLANTL_TX_EVENT - only EAPoL or WAI frames are allowed*/
343 WLANTL_STARxConn, /* WLANTL_RX_EVENT - only EAPoL or WAI frames can be rx*/
344 } },
345
346 /* WLANTL_STA_AUTHENTICATED */
347 { {
348 WLANTL_STATxAuth, /* WLANTL_TX_EVENT - all data frames allowed*/
349 WLANTL_STARxAuth, /* WLANTL_RX_EVENT - all data frames can be rx */
350 } },
351
352 /* WLANTL_STA_DISCONNECTED */
353 { {
354 WLANTL_STATxDisc, /* WLANTL_TX_EVENT - do nothing */
355 WLANTL_STARxDisc, /* WLANTL_RX_EVENT - frames will still be fwd-ed*/
356 } }
357};
358
359/*---------------------------------------------------------------------------
360 Reordering information
361---------------------------------------------------------------------------*/
362
363#define WLANTL_MAX_WINSIZE 64
364#define WLANTL_MAX_BA_SESSION 40
365
366typedef struct
367{
368 v_BOOL_t isAvailable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700369 v_U64_t ullReplayCounter[WLANTL_MAX_WINSIZE];
Jeff Johnson295189b2012-06-20 16:38:30 -0700370 v_PVOID_t arrayBuffer[WLANTL_MAX_WINSIZE];
371} WLANTL_REORDER_BUFFER_T;
372
373
374/* To handle Frame Q aging, timer is needed
375 * After timer expired, Qed frames have to be routed to upper layer
376 * WLANTL_TIMER_EXPIER_UDATA_T is user data type for timer callback
377 */
378typedef struct
379{
380 /* Global contect, HAL, HDD need this */
381 v_PVOID_t pAdapter;
382
383 /* TL context handle */
384 v_PVOID_t pTLHandle;
385
386 /* Current STAID, to know STA context */
387 v_U32_t STAID;
388
389 v_U8_t TID;
390} WLANTL_TIMER_EXPIER_UDATA_T;
391
392typedef struct
393{
394 /*specifies if re-order session exists*/
395 v_U8_t ucExists;
396
397 /* Current Index */
398 v_U32_t ucCIndex;
399
400 /* Count of the total packets in list*/
401 v_U16_t usCount;
402
403 /* vos ttimer to handle Qed frames aging */
404 vos_timer_t agingTimer;
405
406 /* Q windoe size */
407 v_U32_t winSize;
408
409 /* Available RX frame buffer size */
410 v_U32_t bufferSize;
411
412 /* Start Sequence number */
413 v_U32_t SSN;
414
415 /* BA session ID, generate by HAL */
416 v_U32_t sessionID;
417
418 v_U32_t currentESN;
419
420 v_U32_t pendingFramesCount;
421
422 vos_lock_t reorderLock;
423
424 /* Aging timer callback user data */
425 WLANTL_TIMER_EXPIER_UDATA_T timerUdata;
426
427 WLANTL_REORDER_BUFFER_T *reorderBuffer;
Madan Mohan Koyyalamudi31e4cad2013-08-21 20:21:14 +0530428
429 v_U16_t LastSN;
Jeff Johnson295189b2012-06-20 16:38:30 -0700430}WLANTL_BAReorderType;
431
432
433/*---------------------------------------------------------------------------
434 UAPSD information
435---------------------------------------------------------------------------*/
436typedef struct
437{
438 /* flag set when a UAPSD session with triggers generated in fw is being set*/
439 v_U8_t ucSet;
440}WLANTL_UAPSDInfoType;
441
442/*---------------------------------------------------------------------------
443 STA Client type
444---------------------------------------------------------------------------*/
445typedef struct
446{
447 /* Flag that keeps track of registration; only one STA with unique
448 ID allowed */
449 v_U8_t ucExists;
450
451 /*The flag controls the Rx path for the station - as long as there are
452 packets at sta level that need to be fwd-ed the Rx path will be blocked,
453 it will become unblocked only when the cached frames were fwd-ed;
454 while the rx path is blocked all rx-ed frames for that STA will be cached
455 */
456 v_U8_t ucRxBlocked;
457
458 /* Function pointer to the receive packet handler from HDD */
459 WLANTL_STARxCBType pfnSTARx;
460
461 /* Function pointer to the transmit complete confirmation handler
462 from HDD */
463 WLANTL_TxCompCBType pfnSTATxComp;
464
465 /* Function pointer to the packet retrieval routine in HDD */
466 WLANTL_STAFetchPktCBType pfnSTAFetchPkt;
467
468 /* Reordering information for the STA */
469 WLANTL_BAReorderType atlBAReorderInfo[WLAN_MAX_TID];
470
471 /* STA Descriptor, contains information related to the new added STA */
472 WLAN_STADescType wSTADesc;
473
474 /* Current connectivity state of the STA */
475 WLANTL_STAStateType tlState;
476
477 /* Station priority */
478 WLANTL_STAPriorityType tlPri;
479
480 /* Value of the averaged RSSI for this station */
481 v_S7_t rssiAvg;
482
483 /* Value of the averaged RSSI for this station in BMPS */
484 v_S7_t rssiAvgBmps;
485
Shailender Karmuchi13c0d082013-03-26 14:41:39 -0700486 /* Value of the Alpha to calculate RSSI average */
487 v_S7_t rssiAlpha;
488
Jeff Johnson295189b2012-06-20 16:38:30 -0700489 /* Value of the averaged RSSI for this station */
490 v_U32_t uLinkQualityAvg;
491
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530492 /* Sum of SNR for snrIdx number of consecutive frames */
493 v_U32_t snrSum;
494
495 /* Number of consecutive frames over which snrSum is calculated */
496 v_S7_t snrIdx;
497
498 /* Average SNR of previous 20 frames */
499 v_S7_t prevSnrAvg;
500
501 /* Average SNR returned by fw */
502 v_S7_t snrAvgBmps;
503
Jeff Johnson295189b2012-06-20 16:38:30 -0700504 /* Tx packet count per station per TID */
505 v_U32_t auTxCount[WLAN_MAX_TID];
506
507 /* Rx packet count per station per TID */
508 v_U32_t auRxCount[WLAN_MAX_TID];
509
510 /* Suspend flag */
511 v_U8_t ucTxSuspended;
512
513 /* Pointer to the AMSDU chain maintained by the AMSDU de-aggregation
514 completion sub-module */
515 vos_pkt_t* vosAMSDUChainRoot;
516
517 /* Pointer to the root of the chain */
518 vos_pkt_t* vosAMSDUChain;
519
520 /* Used for saving/restoring frame header for 802.3/11 AMSDU sub-frames */
521 v_U8_t aucMPDUHeader[WLANTL_MPDU_HEADER_LEN];
522
523 /* length of the header */
524 v_U8_t ucMPDUHeaderLen;
525
526 /* Enabled ACs currently serviced by TL (automatic setup in TL)*/
527 v_U8_t aucACMask[WLANTL_MAX_AC];
528
529 /* Current AC to be retrieved */
530 WLANTL_ACEnumType ucCurrentAC;
531
532 /*Packet pending flag - set if tx is pending for the station*/
533 v_U8_t ucPktPending;
Jeff Johnson017fdc32013-02-27 09:22:30 -0800534
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700535 /*EAPOL Packet pending flag - set if EAPOL packet is pending for the station*/
536 v_U8_t ucEapolPktPending;
537
Jeff Johnson017fdc32013-02-27 09:22:30 -0800538 /*used on tx packet to signal when there is no more data to tx for the
Jeff Johnson295189b2012-06-20 16:38:30 -0700539 moment=> packets can be passed to BAL */
540 v_U8_t ucNoMoreData;
541
542 /* Last serviced AC to be retrieved */
543 WLANTL_ACEnumType ucServicedAC;
544
545 /* Current weight for the AC */
546 v_U8_t ucCurrentWeight;
547
548 /* Info used for UAPSD trigger frame generation */
549 WLANTL_UAPSDInfoType wUAPSDInfo[WLANTL_MAX_AC];
550
551 /* flag to signal if a trigger frames is pending */
552 v_U8_t ucPendingTrigFrm;
553
554 WLANTL_TRANSFER_STA_TYPE trafficStatistics;
555
556 /*Members needed for packet caching in TL*/
557 /*Begining of the cached packets chain*/
558 vos_pkt_t* vosBegCachedFrame;
559
560 /*Begining of the cached packets chain*/
561 vos_pkt_t* vosEndCachedFrame;
562
Jeff Johnson295189b2012-06-20 16:38:30 -0700563
564 /* LWM related fields */
565
566 //current station is slow. LWM mode is enabled.
567 v_BOOL_t ucLwmModeEnabled;
568 //LWM events is reported when LWM mode is on. Able to send more traffic
569 //under the constraints of uBuffThresholdMax
570 v_BOOL_t ucLwmEventReported;
571
572 //v_U8_t uLwmEventReported;
573
574 /* Flow control fields */
575 //memory used in previous round
576 v_U8_t bmuMemConsumed;
577
578 //the number packets injected in this round
579 v_U32_t uIngress_length;
580
581 //number of packets allowed in current round beforing receiving new FW memory updates
582 v_U32_t uBuffThresholdMax;
583
584
585 // v_U32_t uEgress_length;
586
587 // v_U32_t uIngress_length;
588
589 // v_U32_t uBuffThresholdMax;
590
591 // v_U32_t uBuffThresholdUsed;
592
593 /* Value used to set LWM in FW. Initialized to 1/3* WLAN_STA_BMU_THRESHOLD_MAX
594 In the future, it can be dynamically adjusted if we find the reason to implement
595 such algorithm. */
596 v_U32_t uLwmThreshold;
597
598 //tx disable forced by Riva software
599 v_U16_t fcStaTxDisabled;
600
601 /** HDD buffer status for packet scheduling. Once HDD
602 * stores a new packet in a previously empty queue, it
603 * will call TL interface to set the fields. The fields
604 * will be cleaned by TL when TL can't fetch more packets
605 * from the queue. */
606 // the fields are ucPktPending and ucACMask;
607
608 /* Queue to keep unicast station management frame */
609 vos_list_t pStaManageQ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700610
Jeff Johnson295189b2012-06-20 16:38:30 -0700611 /* 1 means replay check is needed for the station,
612 * 0 means replay check is not needed for the station*/
613 v_BOOL_t ucIsReplayCheckValid;
614
615 /* It contains 48-bit replay counter per TID*/
616 v_U64_t ullReplayCounter[WLANTL_MAX_TID];
617
618 /* It contains no of replay packets found per STA.
619 It is for debugging purpose only.*/
620 v_U32_t ulTotalReplayPacketsDetected;
Jeff Johnson295189b2012-06-20 16:38:30 -0700621
Gopichand Nakkala8b54e912013-03-11 10:44:21 +0530622 /* Set when pairwise key is installed, if ptkInstalled is
623 1 then we have to encrypt the data irrespective of TL
624 state (CONNECTED/AUTHENTICATED) */
625 v_U8_t ptkInstalled;
Gopichand Nakkala8a2b1442013-05-29 15:33:14 +0530626
627 v_U32_t linkCapacity;
Jeff Johnson295189b2012-06-20 16:38:30 -0700628}WLANTL_STAClientType;
629
630/*---------------------------------------------------------------------------
631 BAP Client type
632---------------------------------------------------------------------------*/
633typedef struct
634{
635 /* flag that keeps track of registration; only one non-data BT-AMP client
636 allowed */
637 v_U8_t ucExists;
638
639 /* pointer to the receive processing routine for non-data BT-AMP frames */
640 WLANTL_BAPRxCBType pfnTlBAPRx;
641
642 /* pointer to the flush call back complete function */
643 WLANTL_FlushOpCompCBType pfnFlushOpCompleteCb;
644
645 /* pointer to the non-data BT-AMP frame pending transmission */
646 vos_pkt_t* vosPendingDataBuff;
647
648 /* BAP station ID */
649 v_U8_t ucBAPSTAId;
650}WLANTL_BAPClientType;
651
652
653/*---------------------------------------------------------------------------
654 Management Frame Client type
655---------------------------------------------------------------------------*/
656typedef struct
657{
658 /* flag that keeps track of registration; only one management frame
659 client allowed */
660 v_U8_t ucExists;
661
662 /* pointer to the receive processing routine for management frames */
663 WLANTL_MgmtFrmRxCBType pfnTlMgmtFrmRx;
664
665 /* pointer to the management frame pending transmission */
666 vos_pkt_t* vosPendingDataBuff;
667}WLANTL_MgmtFrmClientType;
668
669typedef struct
670{
671 WLANTL_TrafficStatusChangedCBType trafficCB;
672 WLANTL_HO_TRAFFIC_STATUS_TYPE trafficStatus;
673 v_U32_t idleThreshold;
674 v_U32_t measurePeriod;
675 v_U32_t rtRXFrameCount;
676 v_U32_t rtTXFrameCount;
677 v_U32_t nrtRXFrameCount;
678 v_U32_t nrtTXFrameCount;
679 vos_timer_t trafficTimer;
680 v_PVOID_t usrCtxt;
681} WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE;
682
683typedef struct
684{
685 v_S7_t rssiValue;
686 v_U8_t triggerEvent[WLANTL_HS_NUM_CLIENT];
687 v_PVOID_t usrCtxt[WLANTL_HS_NUM_CLIENT];
688 v_U8_t whoIsClient[WLANTL_HS_NUM_CLIENT];
689 WLANTL_RSSICrossThresholdCBType crossCBFunction[WLANTL_HS_NUM_CLIENT];
690 v_U8_t numClient;
691} WLANTL_HO_RSSI_INDICATION_TYPE;
692
693typedef struct
694{
695 v_U8_t numThreshold;
696 v_U8_t regionNumber;
697 v_S7_t historyRSSI;
698 v_U8_t alpha;
699 v_U32_t sampleTime;
700 v_U32_t fwNotification;
701} WLANTL_CURRENT_HO_STATE_TYPE;
702
703typedef struct
704{
705 WLANTL_HO_RSSI_INDICATION_TYPE registeredInd[WLANTL_MAX_AVAIL_THRESHOLD];
706 WLANTL_CURRENT_HO_STATE_TYPE currentHOState;
707 WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE currentTraffic;
708 v_PVOID_t macCtxt;
709 vos_lock_t hosLock;
710} WLANTL_HO_SUPPORT_TYPE;
711
712/*---------------------------------------------------------------------------
713 TL control block type
714---------------------------------------------------------------------------*/
715typedef struct
716{
717 /* TL configuration information */
718 WLANTL_ConfigInfoType tlConfigInfo;
719
720 /* list of the active stations */
Madan Mohan Koyylamudi3b8400c2013-01-24 17:47:01 +0530721 WLANTL_STAClientType* atlSTAClients[WLAN_MAX_STA_COUNT];
722
Jeff Johnson295189b2012-06-20 16:38:30 -0700723
724 /* information on the management frame client */
725 WLANTL_MgmtFrmClientType tlMgmtFrmClient;
726
727 /* information on the BT AMP client */
728 WLANTL_BAPClientType tlBAPClient;
729
730 /* number of packets sent to BAL waiting for tx complete confirmation */
731 v_U16_t usPendingTxCompleteCount;
732
733 /* global suspend flag */
734 v_U8_t ucTxSuspended;
735
736 /* resource flag */
737 v_U32_t uResCount;
738
739 /* dummy vos buffer - used for chains */
740 vos_pkt_t* vosDummyBuf;
741
742 /* temporary buffer for storing the packet that no longer fits */
743 vos_pkt_t* vosTempBuf;
744
745 /* The value of the station id and AC for the cached buffer */
746 v_U8_t ucCachedSTAId;
747 v_U8_t ucCachedAC;
748
749 /* Last registered STA - until multiple sta support is added this will
750 be used always for tx */
751 v_U8_t ucRegisteredStaId;
752
753 /*Current TL STA used for TX*/
754 v_U8_t ucCurrentSTA;
755
756 WLANTL_REORDER_BUFFER_T *reorderBufferPool; /* Allocate memory for [WLANTL_MAX_BA_SESSION] sessions */
757
758 WLANTL_HO_SUPPORT_TYPE hoSupport;
759
760 v_BOOL_t bUrgent;
761
Jeff Johnson295189b2012-06-20 16:38:30 -0700762
763 /* resource flag */
764 v_U32_t bd_pduResCount;
765
766 /* time interval to evaluate LWM mode*/
767 //vos_timer_t tThresholdSamplingTimer;
768
769#if 0
770 //information fields for flow control
771 tFcTxParams_type tlFCInfo;
772#endif
773
774 vos_pkt_t* vosTxFCBuf;
775
776 /* LWM mode is enabled or not for each station. Bit-wise operation.32 station maximum. */
777 // v_U32_t uStaLwmMask;
778
779 /* LWM event is reported by FW. */
780 // v_U32_t uStaLwmEventReported;
781
782 /** Multiple Station Scheduling and TL queue management.
783 4 HDD BC/MC data packet queue status is specified as Station 0's status. Weights used
784 in WFQ algorith are initialized in WLANTL_OPEN and contained in tlConfigInfo field.
785 Each station has fields of ucPktPending and AC mask to tell whether a AC has traffic
786 or not.
787
788 Stations are served in a round-robin fashion from highest priority to lowest priority.
789 The number of round-robin times of each prioirty equals to the WFQ weights and differetiates
790 the traffic of different prioirty. As such, stations can not provide low priority packets if
791 high priority packets are all served.
792 */
793
794 /* Currently served station id. Reuse ucCurrentSTA field. */
795 //v_U8_t uCurStaId;
796
797 /* Current served station ID in round-robin method to traverse all stations.*/
798 WLANTL_ACEnumType uCurServedAC;
799
800 /* How many weights have not been served in current AC. */
801 v_U8_t ucCurLeftWeight;
802
803 /* BC/MC management queue. Current implementation uses queue size 1. Will check whether
804 size N is supported. */
805 vos_list_t pMCBCManageQ;
806
807 v_U32_t sendFCFrame;
808
809 v_U8_t done_once;
810 v_U8_t uFramesProcThres;
Sunil Ravid5406f22013-01-22 00:18:31 -0800811#ifdef FEATURE_WLAN_TDLS
812 /*number of total TDLS peers registered to TL
813 Incremented at WLANTL_RegisterSTAClient(staType == WLAN_STA_TDLS)
814 Decremented at WLANTL_ClearSTAClient(staType == WLAN_STA_TDLS) */
815 v_U8_t ucTdlsPeerCount;
816#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700817 /*whether we are in BMPS/UAPSD/WOWL mode, since the latter 2 need to be BMPS first*/
818 v_BOOL_t isBMPS;
Gopichand Nakkala11acd112012-12-31 16:04:04 -0800819 /* Whether WDA_DS_TX_START_XMIT msg is pending or not */
820 v_BOOL_t isTxTranmitMsgPending;
Jeff Johnson295189b2012-06-20 16:38:30 -0700821}WLANTL_CbType;
822
823/*==========================================================================
824
825 FUNCTION WLANTL_GetFrames
826
827 DESCRIPTION
828
829 BAL calls this function at the request of the lower bus interface.
830 When this request is being received TL will retrieve packets from HDD
831 in accordance with the priority rules and the count supplied by BAL.
832
833 DEPENDENCIES
834
835 HDD must have registered with TL at least one STA before this function
836 can be called.
837
838 PARAMETERS
839
840 IN
841 pAdapter: pointer to the global adapter context; a handle to TL's
842 or BAL's control block can be extracted from its context
843 uSize: maximum size accepted by the lower layer
Jeff Johnson017fdc32013-02-27 09:22:30 -0800844 uFlowMask TX flow control mask. Each bit is defined as
Jeff Johnson295189b2012-06-20 16:38:30 -0700845 WDA_TXFlowEnumType
846
847 OUT
848 vosDataBuff: it will contain a pointer to the first buffer supplied
849 by TL, if there is more than one packet supplied, TL
850 will chain them through vOSS buffers
851
852 RETURN VALUE
853
854 The result code associated with performing the operation
855
856 1 or more: number of required resources if there are still frames to fetch
857 For Volans, it's BD/PDU numbers. For Prima, it's free DXE descriptors.
858 0 : error or HDD queues are drained
859
860 SIDE EFFECTS
861
862============================================================================*/
863v_U32_t
864WLANTL_GetFrames
865(
866 v_PVOID_t pAdapter,
867 vos_pkt_t **ppFrameDataBuff,
868 v_U32_t uSize,
Jeff Johnson295189b2012-06-20 16:38:30 -0700869 v_U8_t uFlowMask,
Jeff Johnson295189b2012-06-20 16:38:30 -0700870 v_BOOL_t* pbUrgent
871);
872
873/*==========================================================================
874
875 FUNCTION WLANTL_TxComp
876
877 DESCRIPTION
878 It is being called by BAL upon asynchronous notification of the packet
879 or packets being sent over the bus.
880
881 DEPENDENCIES
882 Tx complete cannot be called without a previous transmit.
883
884 PARAMETERS
885
886 IN
887 pAdapter: pointer to the global adapter context; a handle to TL's
888 or BAL's control block can be extracted from its context
889 vosDataBuff: it will contain a pointer to the first buffer for which
890 the BAL report is being made, if there is more then one
891 packet they will be chained using vOSS buffers.
892 wTxSTAtus: the status of the transmitted packet, see above chapter
893 on HDD interaction for a list of possible values
894
895 RETURN VALUE
896 The result code associated with performing the operation
897
898 SIDE EFFECTS
899
900============================================================================*/
901VOS_STATUS
902WLANTL_TxComp
903(
904 v_PVOID_t pAdapter,
905 vos_pkt_t *pFrameDataBuff,
906 VOS_STATUS wTxStatus
907);
908
909/*==========================================================================
910
911 FUNCTION WLANTL_RxFrames
912
913 DESCRIPTION
914 Callback registered by TL and called by BAL when a packet is received
915 over the bus. Upon the call of this function TL will make the necessary
916 decision with regards to the forwarding or queuing of this packet and
917 the layer it needs to be delivered to.
918
919 DEPENDENCIES
920 TL must be initiailized before this function gets called.
921 If the frame carried is a data frame then the station for which it is
922 destined to must have been previously registered with TL.
923
924 PARAMETERS
925
926 IN
927 pAdapter: pointer to the global adapter context; a handle to TL's
928 or BAL's control block can be extracted from its context
929
930 vosDataBuff: it will contain a pointer to the first buffer received,
931 if there is more then one packet they will be chained
932 using vOSS buffers.
933
934 RETURN VALUE
935 The result code associated with performing the operation
936
937 SIDE EFFECTS
938
939============================================================================*/
940VOS_STATUS
941WLANTL_RxFrames
942(
943 v_PVOID_t pAdapter,
944 vos_pkt_t *pFrameDataBuff
945);
946
947/*==========================================================================
948
949 FUNCTION WLANTL_RxCachedFrames
950
951 DESCRIPTION
952 Utility function used by TL to forward the cached frames to a particular
953 station;
954
955 DEPENDENCIES
956 TL must be initiailized before this function gets called.
957 If the frame carried is a data frame then the station for which it is
958 destined to must have been previously registered with TL.
959
960 PARAMETERS
961
962 IN
963 pTLCb: pointer to TL handle
964
965 ucSTAId: station for which we need to forward the packets
966
967 vosDataBuff: it will contain a pointer to the first cached buffer
968 received, if there is more then one packet they will be
969 chained using vOSS buffers.
970
971 RETURN VALUE
972 The result code associated with performing the operation
973
974 VOS_STATUS_E_INVAL: Input parameters are invalid
975 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
976 page fault
977 VOS_STATUS_SUCCESS: Everything is good :)
978
979 SIDE EFFECTS
980
981============================================================================*/
982VOS_STATUS
983WLANTL_RxCachedFrames
984(
985 WLANTL_CbType* pTLCb,
986 v_U8_t ucSTAId,
987 vos_pkt_t* vosDataBuff
988);
989
990/*==========================================================================
991 FUNCTION WLANTL_ResourceCB
992
993 DESCRIPTION
994 Called by the TL when it has packets available for transmission.
995
996 DEPENDENCIES
997 The TL must be registered with BAL before this function can be called.
998
999 PARAMETERS
1000
1001 IN
1002 pAdapter: pointer to the global adapter context; a handle to TL's
1003 or BAL's control block can be extracted from its context
1004 uCount: avail resource count obtained from hw
1005
1006 RETURN VALUE
1007 The result code associated with performing the operation
1008
1009 SIDE EFFECTS
1010
1011============================================================================*/
1012VOS_STATUS
1013WLANTL_ResourceCB
1014(
1015 v_PVOID_t pAdapter,
1016 v_U32_t uCount
1017);
1018
1019
1020/*==========================================================================
1021 FUNCTION WLANTL_ProcessMainMessage
1022
1023 DESCRIPTION
1024 Called by VOSS when a message was serialized for TL through the
1025 main thread/task.
1026
1027 DEPENDENCIES
1028 The TL must be initialized before this function can be called.
1029
1030 PARAMETERS
1031
1032 IN
1033 pAdapter: pointer to the global adapter context; a handle to TL's
1034 control block can be extracted from its context
1035 message: type and content of the message
1036
1037
1038 RETURN VALUE
1039 The result code associated with performing the operation
1040
1041 SIDE EFFECTS
1042
1043============================================================================*/
1044VOS_STATUS
1045WLANTL_ProcessMainMessage
1046(
1047 v_PVOID_t pAdapter,
1048 vos_msg_t* message
1049);
1050
1051/*==========================================================================
1052 FUNCTION WLANTL_ProcessTxMessage
1053
1054 DESCRIPTION
1055 Called by VOSS when a message was serialized for TL through the
1056 tx thread/task.
1057
1058 DEPENDENCIES
1059 The TL must be initialized before this function can be called.
1060
1061 PARAMETERS
1062
1063 IN
1064 pAdapter: pointer to the global adapter context; a handle to TL's
1065 control block can be extracted from its context
1066 message: type and content of the message
1067
1068
1069 RETURN VALUE
1070
1071 The result code associated with performing the operation
1072 VOS_STATUS_SUCCESS: Everything is good :)
1073
1074
1075 SIDE EFFECTS
1076
1077============================================================================*/
1078VOS_STATUS
1079WLANTL_ProcessTxMessage
1080(
1081 v_PVOID_t pAdapter,
1082 vos_msg_t* message
1083);
1084
1085/*==========================================================================
1086 FUNCTION WLAN_TLGetNextTxIds
1087
1088 DESCRIPTION
1089 Gets the next station and next AC in the list
1090
1091 DEPENDENCIES
1092
1093 PARAMETERS
1094
1095 OUT
1096 pucSTAId: STAtion ID
1097
1098 RETURN VALUE
1099 The result code associated with performing the operation
1100
1101 SIDE EFFECTS
1102
1103============================================================================*/
1104VOS_STATUS
1105WLAN_TLGetNextTxIds
1106(
1107 v_PVOID_t pAdapter,
1108 v_U8_t* pucSTAId
1109);
1110
1111/*==========================================================================
1112
1113 FUNCTION WLANTL_CleanCb
1114
1115 DESCRIPTION
1116 Cleans TL control block
1117
1118 DEPENDENCIES
1119
1120 PARAMETERS
1121
1122 IN
1123 pTLCb: pointer to TL's control block
1124 ucEmpty: set if TL has to clean up the queues and release pedning pkts
1125
1126 RETURN VALUE
1127 The result code associated with performing the operation
1128
1129 SIDE EFFECTS
1130
1131============================================================================*/
1132VOS_STATUS
1133WLANTL_CleanCB
1134(
1135 WLANTL_CbType* pTLCb,
1136 v_U8_t ucEmpty
1137);
1138
1139/*==========================================================================
1140
1141 FUNCTION WLANTL_CleanSTA
1142
1143 DESCRIPTION
1144 Cleans a station control block.
1145
1146 DEPENDENCIES
1147
1148 PARAMETERS
1149
1150 IN
1151 pAdapter: pointer to the global adapter context; a handle to TL's
1152 control block can be extracted from its context
1153 ucEmpty: if set the queues and pending pkts will be emptyed
1154
1155 RETURN VALUE
1156 The result code associated with performing the operation
1157
1158 SIDE EFFECTS
1159
1160============================================================================*/
1161VOS_STATUS
1162WLANTL_CleanSTA
1163(
1164 WLANTL_STAClientType* ptlSTAClient,
1165 v_U8_t ucEmpty
1166);
1167
1168/*==========================================================================
1169 FUNCTION WLANTL_GetTxResourcesCB
1170
1171 DESCRIPTION
1172 Processing function for Resource needed signal. A request will be issued
1173 to BAL to get mor tx resources.
1174
1175 DEPENDENCIES
1176 The TL must be initialized before this function can be called.
1177
1178 PARAMETERS
1179
1180 IN
1181 pvosGCtx: pointer to the global vos context; a handle to TL's
1182 control block can be extracted from its context
1183
1184
1185 RETURN VALUE
1186 The result code associated with performing the operation
1187
1188 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1189 page fault
1190 VOS_STATUS_SUCCESS: Everything is good :)
1191
1192 Other values can be returned as a result of a function call, please check
1193 corresponding API for more info.
1194 SIDE EFFECTS
1195
1196============================================================================*/
1197VOS_STATUS
1198WLANTL_GetTxResourcesCB
1199(
1200 v_PVOID_t pvosGCtx
1201);
1202
1203/*==========================================================================
1204 FUNCTION WLANTL_PrepareBDHeader
1205
1206 DESCRIPTION
1207 Callback function for serializing Suspend signal through Tx thread
1208
1209 DEPENDENCIES
1210 Just notify HAL that suspend in TL is complete.
1211
1212 PARAMETERS
1213
1214 IN
1215 pAdapter: pointer to the global adapter context; a handle to TL's
1216 control block can be extracted from its context
1217 pUserData: user data sent with the callback
1218
1219 RETURN VALUE
1220 The result code associated with performing the operation
1221
1222 SIDE EFFECTS
1223
1224============================================================================*/
1225void
1226WLANTL_PrepareBDHeader
1227(
1228 vos_pkt_t* vosDataBuff,
1229 v_PVOID_t* ppvBDHeader,
1230 v_MACADDR_t* pvDestMacAdddr,
1231 v_U8_t ucDisableFrmXtl,
1232 VOS_STATUS* pvosSTAtus,
1233 v_U16_t* usPktLen,
1234 v_U8_t ucQosEnabled,
1235 v_U8_t ucWDSEnabled,
1236 v_U8_t extraHeadSpace
1237);
1238
1239/*==========================================================================
1240 FUNCTION WLANTL_Translate8023To80211Header
1241
1242 DESCRIPTION
1243 Inline function for translating and 802.3 header into an 802.11 header.
1244
1245 DEPENDENCIES
1246
1247
1248 PARAMETERS
1249
1250 IN
1251 pTLCb: TL control block
Kiran Venkatappaa044eb92012-12-17 15:48:49 -08001252
1253 *pucStaId Station ID. In case of TDLS, this return the actual
1254 station index used to transmit.
Jeff Johnson295189b2012-06-20 16:38:30 -07001255
1256 IN/OUT
1257 vosDataBuff: vos data buffer, will contain the new header on output
1258
1259 OUT
1260 pvosStatus: status of the operation
1261
1262 RETURN VALUE
1263 No return.
1264
1265 SIDE EFFECTS
1266
1267============================================================================*/
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001268VOS_STATUS
1269WLANTL_Translate8023To80211Header
1270(
1271 vos_pkt_t* vosDataBuff,
1272 VOS_STATUS* pvosStatus,
1273 WLANTL_CbType* pTLCb,
1274 v_U8_t *pucStaId,
Ravi Joshid0699502013-07-08 15:48:47 -07001275 WLANTL_MetaInfoType* pTlMetaInfo,
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001276 v_U8_t *ucWDSEnabled,
1277 v_U8_t *extraHeadSpace
1278);
Jeff Johnson295189b2012-06-20 16:38:30 -07001279/*==========================================================================
1280 FUNCTION WLANTL_Translate80211To8023Header
1281
1282 DESCRIPTION
1283 Inline function for translating and 802.11 header into an 802.3 header.
1284
1285 DEPENDENCIES
1286
1287
1288 PARAMETERS
1289
1290 IN
1291 pTLCb: TL control block
1292 ucStaId: station ID
1293 ucHeaderLen: Length of the header from BD
1294 ucActualHLen: Length of header including padding or any other trailers
1295
1296 IN/OUT
1297 vosDataBuff: vos data buffer, will contain the new header on output
1298
1299 OUT
1300 pvosStatus: status of the operation
1301
1302 RETURN VALUE
1303 Status of the operation
1304
1305 SIDE EFFECTS
1306
1307============================================================================*/
1308VOS_STATUS
1309WLANTL_Translate80211To8023Header
1310(
1311 vos_pkt_t* vosDataBuff,
1312 VOS_STATUS* pvosStatus,
Jeff Johnson017fdc32013-02-27 09:22:30 -08001313 v_U16_t usActualHLen,
Jeff Johnson295189b2012-06-20 16:38:30 -07001314 v_U8_t ucHeaderLen,
1315 WLANTL_CbType* pTLCb,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001316 v_U8_t ucSTAId,
1317 v_BOOL_t bForwardIAPPwithLLC
Jeff Johnson295189b2012-06-20 16:38:30 -07001318);
1319
1320/*==========================================================================
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -08001321 FUNCTION WLANTL_FindFrameTypeBcMcUc
1322
1323 DESCRIPTION
1324 Utility function to find whether received frame is broadcast, multicast
1325 or unicast.
1326
1327 DEPENDENCIES
1328 The STA must be registered with TL before this function can be called.
1329
1330 PARAMETERS
1331
1332 IN
1333 pTLCb: pointer to the TL's control block
1334 ucSTAId: identifier of the station being processed
1335 vosDataBuff: pointer to the vos buffer
1336
1337 IN/OUT
1338 pucBcMcUc: pointer to buffer, will contain frame type on return
1339
1340 RETURN VALUE
1341 The result code associated with performing the operation
1342
1343 VOS_STATUS_E_INVAL: invalid input parameters
1344 VOS_STATUS_E_BADMSG: failed to extract info from data buffer
1345 VOS_STATUS_SUCCESS: success
1346
1347 SIDE EFFECTS
1348 None.
1349============================================================================*/
1350VOS_STATUS
1351WLANTL_FindFrameTypeBcMcUc
1352(
1353 WLANTL_CbType *pTLCb,
1354 v_U8_t ucSTAId,
1355 vos_pkt_t *vosDataBuff,
1356 v_U8_t *pucBcMcUc
1357);
1358
1359/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -07001360
1361 FUNCTION WLANTL_MgmtFrmRxDefaultCb
1362
1363 DESCRIPTION
1364 Default Mgmt Frm rx callback: asserts all the time. If this function gets
1365 called it means there is no registered rx cb pointer for Mgmt Frm.
1366
1367 DEPENDENCIES
1368
1369 PARAMETERS
1370
1371 Not used.
1372
1373 RETURN VALUE
1374 Always FAILURE.
1375
1376============================================================================*/
1377VOS_STATUS
1378WLANTL_MgmtFrmRxDefaultCb
1379(
1380 v_PVOID_t pAdapter,
1381 v_PVOID_t vosBuff
1382);
1383
1384/*==========================================================================
1385
1386 FUNCTION WLANTL_STARxDefaultCb
1387
1388 DESCRIPTION
1389 Default BAP rx callback: asserts all the time. If this function gets
1390 called it means there is no registered rx cb pointer for BAP.
1391
1392 DEPENDENCIES
1393
1394 PARAMETERS
1395
1396 Not used.
1397
1398 RETURN VALUE
1399 Always FAILURE.
1400
1401============================================================================*/
1402VOS_STATUS
1403WLANTL_BAPRxDefaultCb
1404(
1405 v_PVOID_t pAdapter,
1406 vos_pkt_t* vosDataBuff,
1407 WLANTL_BAPFrameEnumType frameType
1408);
1409
1410/*==========================================================================
1411
1412 FUNCTION WLANTL_STARxDefaultCb
1413
1414 DESCRIPTION
1415 Default STA rx callback: asserts all the time. If this function gets
1416 called it means there is no registered rx cb pointer for station.
1417 (Mem corruption most likely, it should never happen)
1418
1419 DEPENDENCIES
1420
1421 PARAMETERS
1422
1423 Not used.
1424
1425 RETURN VALUE
1426 Always FAILURE.
1427
1428============================================================================*/
1429VOS_STATUS
1430WLANTL_STARxDefaultCb
1431(
1432 v_PVOID_t pAdapter,
1433 vos_pkt_t* vosDataBuff,
1434 v_U8_t ucSTAId,
1435 WLANTL_RxMetaInfoType* pRxMetaInfo
1436);
1437
1438/*==========================================================================
1439
1440 FUNCTION WLANTL_STAFetchPktDefaultCb
1441
1442 DESCRIPTION
1443 Default fetch callback: asserts all the time. If this function gets
1444 called it means there is no registered fetch cb pointer for station.
1445 (Mem corruption most likely, it should never happen)
1446
1447 DEPENDENCIES
1448
1449 PARAMETERS
1450
1451 Not used.
1452
1453 RETURN VALUE
1454 Always FAILURE.
1455
1456============================================================================*/
1457VOS_STATUS
1458WLANTL_STAFetchPktDefaultCb
1459(
1460 v_PVOID_t pAdapter,
1461 v_U8_t* pucSTAId,
1462 WLANTL_ACEnumType ucAC,
1463 vos_pkt_t** vosDataBuff,
1464 WLANTL_MetaInfoType* tlMetaInfo
1465);
1466
1467/*==========================================================================
1468
1469 FUNCTION WLANTL_TxCompDefaultCb
1470
1471 DESCRIPTION
1472 Default tx complete handler. It will release the completed pkt to
1473 prevent memory leaks.
1474
1475 PARAMETERS
1476
1477 IN
1478 pAdapter: pointer to the global adapter context; a handle to
1479 TL/HAL/PE/BAP/HDD control block can be extracted from
1480 its context
1481 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1482 wTxSTAtus: status of the transmission
1483
1484
1485 RETURN VALUE
1486 The result code associated with performing the operation; please
1487 check vos_pkt_return_pkt for possible error codes.
1488
1489============================================================================*/
1490VOS_STATUS
1491WLANTL_TxCompDefaultCb
1492(
1493 v_PVOID_t pAdapter,
1494 vos_pkt_t* vosDataBuff,
1495 VOS_STATUS wTxSTAtus
1496);
1497
1498/*==========================================================================
1499
1500 FUNCTION WLANTL_PackUpTriggerFrame
1501
1502 DESCRIPTION
1503 Packs up a trigger frame and places it in TL's cache for tx and notifies
1504 BAL
1505
1506 DEPENDENCIES
1507
1508 PARAMETERS
1509
1510 IN
1511 pTLCb: pointer to the TL control block
1512 pfnSTATxComp: Tx Complete Cb to be used when frame is received
1513 ucSTAId: station id
1514 ucAC: access category
1515
1516 RETURN VALUE
1517 None
1518
1519 SIDE EFFECTS
1520
1521============================================================================*/
1522VOS_STATUS
1523WLANTL_PackUpTriggerFrame
1524(
1525 WLANTL_CbType* pTLCb,
1526 WLANTL_TxCompCBType pfnSTATxComp,
1527 v_U8_t ucSTAId,
1528 WLANTL_ACEnumType ucAC
1529);
1530
1531/*==========================================================================
1532
1533 FUNCTION WLANTL_TxCompTriggFrameSI
1534
1535 DESCRIPTION
1536 Tx complete handler for the service interval trigger frame.
1537 It will restart the SI timer.
1538
1539 PARAMETERS
1540
1541 IN
1542 pvosGCtx: pointer to the global vos context; a handle to
1543 TL/HAL/PE/BAP/HDD control block can be extracted from
1544 its context
1545 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1546 wTxSTAtus: status of the transmission
1547
1548
1549 RETURN VALUE
1550 The result code associated with performing the operation
1551
1552 ============================================================================*/
1553VOS_STATUS
1554WLANTL_TxCompTriggFrameSI
1555(
1556 v_PVOID_t pvosGCtx,
1557 vos_pkt_t* vosDataBuff,
1558 VOS_STATUS wTxSTAtus
1559);
1560
1561/*==========================================================================
1562
1563 FUNCTION WLANTL_TxCompTriggFrameSI
1564
1565 DESCRIPTION
1566 Tx complete handler for the service interval trigger frame.
1567 It will restart the SI timer.
1568
1569 PARAMETERS
1570
1571 IN
1572 pvosGCtx: pointer to the global vos context; a handle to
1573 TL/HAL/PE/BAP/HDD control block can be extracted from
1574 its context
1575 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1576 wTxSTAtus: status of the transmission
1577
1578
1579 RETURN VALUE
1580 The result code associated with performing the operation
1581
1582============================================================================*/
1583VOS_STATUS
1584WLANTL_TxCompTriggFrameDI
1585(
1586 v_PVOID_t pvosGCtx,
1587 vos_pkt_t* vosDataBuff,
1588 VOS_STATUS wTxSTAtus
1589);
1590
1591/*==========================================================================
1592
1593 FUNCTION
1594
1595 DESCRIPTION Read RSSI value out of a RX BD
1596
1597 PARAMETERS: Caller must validate all parameters
1598
1599 RETURN VALUE
1600
1601============================================================================*/
1602VOS_STATUS WLANTL_ReadRSSI
1603(
1604 v_PVOID_t pAdapter,
1605 v_PVOID_t pBDHeader,
1606 v_U8_t STAid
1607);
1608
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301609/*==========================================================================
1610
1611 FUNCTION
1612
1613 DESCRIPTION Read SNR value out of a RX BD
1614
1615 PARAMETERS: Caller must validate all parameters
1616
1617 RETURN VALUE
1618
1619============================================================================*/
1620VOS_STATUS WLANTL_ReadSNR
1621(
1622 v_PVOID_t pAdapter,
1623 v_PVOID_t pBDHeader,
1624 v_U8_t STAid
1625);
Jeff Johnson295189b2012-06-20 16:38:30 -07001626
1627
1628void WLANTL_PowerStateChangedCB
1629(
1630 v_PVOID_t pAdapter,
1631 tPmcState newState
1632);
1633
Jeff Johnson295189b2012-06-20 16:38:30 -07001634/*==========================================================================
Jeff Johnson017fdc32013-02-27 09:22:30 -08001635 FUNCTION WLANTL_FwdPktToHDD
Jeff Johnson295189b2012-06-20 16:38:30 -07001636
1637 DESCRIPTION
1638 Determine the Destation Station ID and route the Frame to Upper Layer
1639
1640 DEPENDENCIES
1641
1642 PARAMETERS
1643
1644 IN
1645 pvosGCtx: pointer to the global vos context; a handle to TL's
1646 control block can be extracted from its context
1647 ucSTAId: identifier of the station being processed
1648 vosDataBuff: pointer to the rx vos buffer
1649
1650 RETURN VALUE
1651 The result code associated with performing the operation
1652
1653 VOS_STATUS_E_INVAL: invalid input parameters
1654 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1655 page fault
1656 VOS_STATUS_SUCCESS: Everything is good :)
1657
1658 SIDE EFFECTS
1659
1660============================================================================*/
1661
1662VOS_STATUS
1663WLANTL_FwdPktToHDD
1664(
1665 v_PVOID_t pvosGCtx,
1666 vos_pkt_t* pvosDataBuff,
1667 v_U8_t ucSTAId
1668);
1669
Jeff Johnson295189b2012-06-20 16:38:30 -07001670#endif /* #ifndef WLAN_QCT_TLI_H */