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