blob: 36d1f29e6b00e426423a138680825f20db53d46f [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
257 /* Forwarding RX cached frames */
258 WLANTL_TX_FWD_CACHED = 2,
259
260 /* Serialized STAID AC Indication */
261 WLANTL_TX_STAID_AC_IND = 3,
262
263 /* Serialzie TX transmit request */
264 WLANTL_TX_START_XMIT = 4,
265
266 /* Serialzie Finish UL Authentication request */
267 WLANTL_FINISH_ULA = 5,
268
Madan Mohan Koyyalamudia96f5442013-05-10 11:32:06 +0530269 /* Serialized Snapshot request indication */
270 WLANTL_TX_SNAPSHOT = 6,
271
Jeff Johnson295189b2012-06-20 16:38:30 -0700272 WLANTL_TX_MAX
273}WLANTL_TxSignalsType;
274
275/*---------------------------------------------------------------------------
276 STA Event type
277---------------------------------------------------------------------------*/
278typedef enum
279{
280 /* Transmit frame event */
281 WLANTL_TX_EVENT = 0,
282
283 /* Receive frame event */
284 WLANTL_RX_EVENT = 1,
285
286 WLANTL_MAX_EVENT
287}WLANTL_STAEventType;
288
289/*---------------------------------------------------------------------------
290
291 DESCRIPTION
292 State machine used by transport layer for receiving or transmitting
293 packets.
294
295 PARAMETERS
296
297 IN
298 pAdapter: pointer to the global adapter context; a handle to TL's
299 control block can be extracted from its context
300 ucSTAId: identifier of the station being processed
301 vosDataBuff: pointer to the tx/rx vos buffer
302
303 RETURN VALUE
304 The result code associated with performing the operation
305
306---------------------------------------------------------------------------*/
307typedef VOS_STATUS (*WLANTL_STAFuncType)( v_PVOID_t pAdapter,
308 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700309 vos_pkt_t** pvosDataBuff,
310 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700311
312/*---------------------------------------------------------------------------
313 STA FSM Entry type
314---------------------------------------------------------------------------*/
315typedef struct
316{
317 WLANTL_STAFuncType pfnSTATbl[WLANTL_MAX_EVENT];
318} WLANTL_STAFsmEntryType;
319
320/* Receive in connected state - only EAPOL or WAI*/
321VOS_STATUS WLANTL_STARxConn( v_PVOID_t pAdapter,
322 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700323 vos_pkt_t** pvosDataBuff,
324 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700325
326/* Transmit in connected state - only EAPOL or WAI*/
327VOS_STATUS WLANTL_STATxConn( v_PVOID_t pAdapter,
328 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700329 vos_pkt_t** pvosDataBuff,
330 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700331
332/* Receive in authenticated state - all data allowed*/
333VOS_STATUS WLANTL_STARxAuth( v_PVOID_t pAdapter,
334 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700335 vos_pkt_t** pvosDataBuff,
336 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700337
338/* Transmit in authenticated state - all data allowed*/
339VOS_STATUS WLANTL_STATxAuth( v_PVOID_t pAdapter,
340 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700341 vos_pkt_t** pvosDataBuff,
342 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700343
344/* Receive in disconnected state - no data allowed*/
345VOS_STATUS WLANTL_STARxDisc( v_PVOID_t pAdapter,
346 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700347 vos_pkt_t** pvosDataBuff,
348 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700349
350/* Transmit in disconnected state - no data allowed*/
351VOS_STATUS WLANTL_STATxDisc( v_PVOID_t pAdapter,
352 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700353 vos_pkt_t** pvosDataBuff,
354 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700355
356/* TL State Machine */
357STATIC const WLANTL_STAFsmEntryType tlSTAFsm[WLANTL_STA_MAX_STATE] =
358{
359 /* WLANTL_STA_INIT */
360 { {
361 NULL, /* WLANTL_TX_EVENT - no packets should get transmitted*/
362 NULL, /* WLANTL_RX_EVENT - no packets should be received - drop*/
363 } },
364
365 /* WLANTL_STA_CONNECTED */
366 { {
367 WLANTL_STATxConn, /* WLANTL_TX_EVENT - only EAPoL or WAI frames are allowed*/
368 WLANTL_STARxConn, /* WLANTL_RX_EVENT - only EAPoL or WAI frames can be rx*/
369 } },
370
371 /* WLANTL_STA_AUTHENTICATED */
372 { {
373 WLANTL_STATxAuth, /* WLANTL_TX_EVENT - all data frames allowed*/
374 WLANTL_STARxAuth, /* WLANTL_RX_EVENT - all data frames can be rx */
375 } },
376
377 /* WLANTL_STA_DISCONNECTED */
378 { {
379 WLANTL_STATxDisc, /* WLANTL_TX_EVENT - do nothing */
380 WLANTL_STARxDisc, /* WLANTL_RX_EVENT - frames will still be fwd-ed*/
381 } }
382};
383
384/*---------------------------------------------------------------------------
385 Reordering information
386---------------------------------------------------------------------------*/
387
388#define WLANTL_MAX_WINSIZE 64
389#define WLANTL_MAX_BA_SESSION 40
390
391typedef struct
392{
393 v_BOOL_t isAvailable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700394 v_U64_t ullReplayCounter[WLANTL_MAX_WINSIZE];
Jeff Johnson295189b2012-06-20 16:38:30 -0700395 v_PVOID_t arrayBuffer[WLANTL_MAX_WINSIZE];
396} WLANTL_REORDER_BUFFER_T;
397
398
399/* To handle Frame Q aging, timer is needed
400 * After timer expired, Qed frames have to be routed to upper layer
401 * WLANTL_TIMER_EXPIER_UDATA_T is user data type for timer callback
402 */
403typedef struct
404{
405 /* Global contect, HAL, HDD need this */
406 v_PVOID_t pAdapter;
407
408 /* TL context handle */
409 v_PVOID_t pTLHandle;
410
411 /* Current STAID, to know STA context */
412 v_U32_t STAID;
413
414 v_U8_t TID;
415} WLANTL_TIMER_EXPIER_UDATA_T;
416
417typedef struct
418{
419 /*specifies if re-order session exists*/
420 v_U8_t ucExists;
421
422 /* Current Index */
423 v_U32_t ucCIndex;
424
425 /* Count of the total packets in list*/
426 v_U16_t usCount;
427
428 /* vos ttimer to handle Qed frames aging */
429 vos_timer_t agingTimer;
430
431 /* Q windoe size */
432 v_U32_t winSize;
433
434 /* Available RX frame buffer size */
435 v_U32_t bufferSize;
436
437 /* Start Sequence number */
438 v_U32_t SSN;
439
440 /* BA session ID, generate by HAL */
441 v_U32_t sessionID;
442
443 v_U32_t currentESN;
444
445 v_U32_t pendingFramesCount;
446
447 vos_lock_t reorderLock;
448
449 /* Aging timer callback user data */
450 WLANTL_TIMER_EXPIER_UDATA_T timerUdata;
451
452 WLANTL_REORDER_BUFFER_T *reorderBuffer;
Madan Mohan Koyyalamudi31e4cad2013-08-21 20:21:14 +0530453
454 v_U16_t LastSN;
Jeff Johnson295189b2012-06-20 16:38:30 -0700455}WLANTL_BAReorderType;
456
457
458/*---------------------------------------------------------------------------
459 UAPSD information
460---------------------------------------------------------------------------*/
461typedef struct
462{
463 /* flag set when a UAPSD session with triggers generated in fw is being set*/
464 v_U8_t ucSet;
465}WLANTL_UAPSDInfoType;
466
467/*---------------------------------------------------------------------------
Mihir Sheteb7337272014-04-11 15:53:08 +0530468 per-STA cache info
469---------------------------------------------------------------------------*/
470typedef struct
471{
472 v_U16_t cacheSize;
473 v_TIME_t cacheInitTime;
474 v_TIME_t cacheDoneTime;
475 v_TIME_t cacheClearTime;
476}WLANTL_CacheInfoType;
477
478/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700479 STA Client type
480---------------------------------------------------------------------------*/
481typedef struct
482{
483 /* Flag that keeps track of registration; only one STA with unique
484 ID allowed */
485 v_U8_t ucExists;
486
487 /*The flag controls the Rx path for the station - as long as there are
488 packets at sta level that need to be fwd-ed the Rx path will be blocked,
489 it will become unblocked only when the cached frames were fwd-ed;
490 while the rx path is blocked all rx-ed frames for that STA will be cached
491 */
492 v_U8_t ucRxBlocked;
493
494 /* Function pointer to the receive packet handler from HDD */
495 WLANTL_STARxCBType pfnSTARx;
496
497 /* Function pointer to the transmit complete confirmation handler
498 from HDD */
499 WLANTL_TxCompCBType pfnSTATxComp;
500
501 /* Function pointer to the packet retrieval routine in HDD */
502 WLANTL_STAFetchPktCBType pfnSTAFetchPkt;
503
504 /* Reordering information for the STA */
505 WLANTL_BAReorderType atlBAReorderInfo[WLAN_MAX_TID];
506
507 /* STA Descriptor, contains information related to the new added STA */
508 WLAN_STADescType wSTADesc;
509
510 /* Current connectivity state of the STA */
511 WLANTL_STAStateType tlState;
512
513 /* Station priority */
514 WLANTL_STAPriorityType tlPri;
515
516 /* Value of the averaged RSSI for this station */
517 v_S7_t rssiAvg;
518
519 /* Value of the averaged RSSI for this station in BMPS */
520 v_S7_t rssiAvgBmps;
521
Shailender Karmuchi13c0d082013-03-26 14:41:39 -0700522 /* Value of the Alpha to calculate RSSI average */
523 v_S7_t rssiAlpha;
524
Jeff Johnson295189b2012-06-20 16:38:30 -0700525 /* Value of the averaged RSSI for this station */
526 v_U32_t uLinkQualityAvg;
527
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530528 /* Sum of SNR for snrIdx number of consecutive frames */
529 v_U32_t snrSum;
530
531 /* Number of consecutive frames over which snrSum is calculated */
532 v_S7_t snrIdx;
533
534 /* Average SNR of previous 20 frames */
535 v_S7_t prevSnrAvg;
536
537 /* Average SNR returned by fw */
538 v_S7_t snrAvgBmps;
539
Jeff Johnson295189b2012-06-20 16:38:30 -0700540 /* Tx packet count per station per TID */
541 v_U32_t auTxCount[WLAN_MAX_TID];
542
543 /* Rx packet count per station per TID */
544 v_U32_t auRxCount[WLAN_MAX_TID];
545
546 /* Suspend flag */
547 v_U8_t ucTxSuspended;
548
549 /* Pointer to the AMSDU chain maintained by the AMSDU de-aggregation
550 completion sub-module */
551 vos_pkt_t* vosAMSDUChainRoot;
552
553 /* Pointer to the root of the chain */
554 vos_pkt_t* vosAMSDUChain;
555
556 /* Used for saving/restoring frame header for 802.3/11 AMSDU sub-frames */
557 v_U8_t aucMPDUHeader[WLANTL_MPDU_HEADER_LEN];
558
559 /* length of the header */
560 v_U8_t ucMPDUHeaderLen;
561
562 /* Enabled ACs currently serviced by TL (automatic setup in TL)*/
563 v_U8_t aucACMask[WLANTL_MAX_AC];
564
565 /* Current AC to be retrieved */
566 WLANTL_ACEnumType ucCurrentAC;
567
568 /*Packet pending flag - set if tx is pending for the station*/
569 v_U8_t ucPktPending;
Jeff Johnson017fdc32013-02-27 09:22:30 -0800570
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700571 /*EAPOL Packet pending flag - set if EAPOL packet is pending for the station*/
572 v_U8_t ucEapolPktPending;
573
Jeff Johnson017fdc32013-02-27 09:22:30 -0800574 /*used on tx packet to signal when there is no more data to tx for the
Jeff Johnson295189b2012-06-20 16:38:30 -0700575 moment=> packets can be passed to BAL */
576 v_U8_t ucNoMoreData;
577
578 /* Last serviced AC to be retrieved */
579 WLANTL_ACEnumType ucServicedAC;
580
581 /* Current weight for the AC */
582 v_U8_t ucCurrentWeight;
583
584 /* Info used for UAPSD trigger frame generation */
585 WLANTL_UAPSDInfoType wUAPSDInfo[WLANTL_MAX_AC];
586
587 /* flag to signal if a trigger frames is pending */
588 v_U8_t ucPendingTrigFrm;
589
590 WLANTL_TRANSFER_STA_TYPE trafficStatistics;
591
592 /*Members needed for packet caching in TL*/
593 /*Begining of the cached packets chain*/
594 vos_pkt_t* vosBegCachedFrame;
595
596 /*Begining of the cached packets chain*/
597 vos_pkt_t* vosEndCachedFrame;
598
Mihir Sheteb7337272014-04-11 15:53:08 +0530599 WLANTL_CacheInfoType tlCacheInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700600 /* LWM related fields */
601
602 //current station is slow. LWM mode is enabled.
603 v_BOOL_t ucLwmModeEnabled;
604 //LWM events is reported when LWM mode is on. Able to send more traffic
605 //under the constraints of uBuffThresholdMax
606 v_BOOL_t ucLwmEventReported;
607
608 //v_U8_t uLwmEventReported;
609
610 /* Flow control fields */
611 //memory used in previous round
612 v_U8_t bmuMemConsumed;
613
614 //the number packets injected in this round
615 v_U32_t uIngress_length;
616
617 //number of packets allowed in current round beforing receiving new FW memory updates
618 v_U32_t uBuffThresholdMax;
619
620
621 // v_U32_t uEgress_length;
622
623 // v_U32_t uIngress_length;
624
625 // v_U32_t uBuffThresholdMax;
626
627 // v_U32_t uBuffThresholdUsed;
628
629 /* Value used to set LWM in FW. Initialized to 1/3* WLAN_STA_BMU_THRESHOLD_MAX
630 In the future, it can be dynamically adjusted if we find the reason to implement
631 such algorithm. */
632 v_U32_t uLwmThreshold;
633
634 //tx disable forced by Riva software
635 v_U16_t fcStaTxDisabled;
636
637 /** HDD buffer status for packet scheduling. Once HDD
638 * stores a new packet in a previously empty queue, it
639 * will call TL interface to set the fields. The fields
640 * will be cleaned by TL when TL can't fetch more packets
641 * from the queue. */
642 // the fields are ucPktPending and ucACMask;
643
644 /* Queue to keep unicast station management frame */
645 vos_list_t pStaManageQ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700646
Jeff Johnson295189b2012-06-20 16:38:30 -0700647 /* 1 means replay check is needed for the station,
648 * 0 means replay check is not needed for the station*/
649 v_BOOL_t ucIsReplayCheckValid;
650
651 /* It contains 48-bit replay counter per TID*/
652 v_U64_t ullReplayCounter[WLANTL_MAX_TID];
653
654 /* It contains no of replay packets found per STA.
655 It is for debugging purpose only.*/
656 v_U32_t ulTotalReplayPacketsDetected;
Jeff Johnson295189b2012-06-20 16:38:30 -0700657
Gopichand Nakkala8b54e912013-03-11 10:44:21 +0530658 /* Set when pairwise key is installed, if ptkInstalled is
659 1 then we have to encrypt the data irrespective of TL
660 state (CONNECTED/AUTHENTICATED) */
661 v_U8_t ptkInstalled;
Gopichand Nakkala8a2b1442013-05-29 15:33:14 +0530662
663 v_U32_t linkCapacity;
Jeff Johnson295189b2012-06-20 16:38:30 -0700664}WLANTL_STAClientType;
665
666/*---------------------------------------------------------------------------
667 BAP Client type
668---------------------------------------------------------------------------*/
669typedef struct
670{
671 /* flag that keeps track of registration; only one non-data BT-AMP client
672 allowed */
673 v_U8_t ucExists;
674
675 /* pointer to the receive processing routine for non-data BT-AMP frames */
676 WLANTL_BAPRxCBType pfnTlBAPRx;
677
678 /* pointer to the flush call back complete function */
679 WLANTL_FlushOpCompCBType pfnFlushOpCompleteCb;
680
681 /* pointer to the non-data BT-AMP frame pending transmission */
682 vos_pkt_t* vosPendingDataBuff;
683
684 /* BAP station ID */
685 v_U8_t ucBAPSTAId;
686}WLANTL_BAPClientType;
687
688
689/*---------------------------------------------------------------------------
690 Management Frame Client type
691---------------------------------------------------------------------------*/
692typedef struct
693{
694 /* flag that keeps track of registration; only one management frame
695 client allowed */
696 v_U8_t ucExists;
697
698 /* pointer to the receive processing routine for management frames */
699 WLANTL_MgmtFrmRxCBType pfnTlMgmtFrmRx;
700
701 /* pointer to the management frame pending transmission */
702 vos_pkt_t* vosPendingDataBuff;
703}WLANTL_MgmtFrmClientType;
704
705typedef struct
706{
707 WLANTL_TrafficStatusChangedCBType trafficCB;
708 WLANTL_HO_TRAFFIC_STATUS_TYPE trafficStatus;
709 v_U32_t idleThreshold;
710 v_U32_t measurePeriod;
711 v_U32_t rtRXFrameCount;
712 v_U32_t rtTXFrameCount;
713 v_U32_t nrtRXFrameCount;
714 v_U32_t nrtTXFrameCount;
715 vos_timer_t trafficTimer;
716 v_PVOID_t usrCtxt;
717} WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE;
718
719typedef struct
720{
721 v_S7_t rssiValue;
722 v_U8_t triggerEvent[WLANTL_HS_NUM_CLIENT];
723 v_PVOID_t usrCtxt[WLANTL_HS_NUM_CLIENT];
724 v_U8_t whoIsClient[WLANTL_HS_NUM_CLIENT];
725 WLANTL_RSSICrossThresholdCBType crossCBFunction[WLANTL_HS_NUM_CLIENT];
726 v_U8_t numClient;
727} WLANTL_HO_RSSI_INDICATION_TYPE;
728
729typedef struct
730{
731 v_U8_t numThreshold;
732 v_U8_t regionNumber;
733 v_S7_t historyRSSI;
734 v_U8_t alpha;
735 v_U32_t sampleTime;
736 v_U32_t fwNotification;
737} WLANTL_CURRENT_HO_STATE_TYPE;
738
739typedef struct
740{
741 WLANTL_HO_RSSI_INDICATION_TYPE registeredInd[WLANTL_MAX_AVAIL_THRESHOLD];
742 WLANTL_CURRENT_HO_STATE_TYPE currentHOState;
743 WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE currentTraffic;
744 v_PVOID_t macCtxt;
745 vos_lock_t hosLock;
746} WLANTL_HO_SUPPORT_TYPE;
747
748/*---------------------------------------------------------------------------
749 TL control block type
750---------------------------------------------------------------------------*/
751typedef struct
752{
753 /* TL configuration information */
754 WLANTL_ConfigInfoType tlConfigInfo;
755
756 /* list of the active stations */
Madan Mohan Koyylamudi3b8400c2013-01-24 17:47:01 +0530757 WLANTL_STAClientType* atlSTAClients[WLAN_MAX_STA_COUNT];
758
Jeff Johnson295189b2012-06-20 16:38:30 -0700759
760 /* information on the management frame client */
761 WLANTL_MgmtFrmClientType tlMgmtFrmClient;
762
763 /* information on the BT AMP client */
764 WLANTL_BAPClientType tlBAPClient;
765
766 /* number of packets sent to BAL waiting for tx complete confirmation */
767 v_U16_t usPendingTxCompleteCount;
768
769 /* global suspend flag */
770 v_U8_t ucTxSuspended;
771
772 /* resource flag */
773 v_U32_t uResCount;
774
775 /* dummy vos buffer - used for chains */
776 vos_pkt_t* vosDummyBuf;
777
778 /* temporary buffer for storing the packet that no longer fits */
779 vos_pkt_t* vosTempBuf;
780
781 /* The value of the station id and AC for the cached buffer */
782 v_U8_t ucCachedSTAId;
783 v_U8_t ucCachedAC;
784
785 /* Last registered STA - until multiple sta support is added this will
786 be used always for tx */
787 v_U8_t ucRegisteredStaId;
788
789 /*Current TL STA used for TX*/
790 v_U8_t ucCurrentSTA;
791
792 WLANTL_REORDER_BUFFER_T *reorderBufferPool; /* Allocate memory for [WLANTL_MAX_BA_SESSION] sessions */
793
794 WLANTL_HO_SUPPORT_TYPE hoSupport;
795
796 v_BOOL_t bUrgent;
797
Jeff Johnson295189b2012-06-20 16:38:30 -0700798
799 /* resource flag */
800 v_U32_t bd_pduResCount;
801
802 /* time interval to evaluate LWM mode*/
803 //vos_timer_t tThresholdSamplingTimer;
804
805#if 0
806 //information fields for flow control
807 tFcTxParams_type tlFCInfo;
808#endif
809
810 vos_pkt_t* vosTxFCBuf;
811
812 /* LWM mode is enabled or not for each station. Bit-wise operation.32 station maximum. */
813 // v_U32_t uStaLwmMask;
814
815 /* LWM event is reported by FW. */
816 // v_U32_t uStaLwmEventReported;
817
818 /** Multiple Station Scheduling and TL queue management.
819 4 HDD BC/MC data packet queue status is specified as Station 0's status. Weights used
820 in WFQ algorith are initialized in WLANTL_OPEN and contained in tlConfigInfo field.
821 Each station has fields of ucPktPending and AC mask to tell whether a AC has traffic
822 or not.
823
824 Stations are served in a round-robin fashion from highest priority to lowest priority.
825 The number of round-robin times of each prioirty equals to the WFQ weights and differetiates
826 the traffic of different prioirty. As such, stations can not provide low priority packets if
827 high priority packets are all served.
828 */
829
830 /* Currently served station id. Reuse ucCurrentSTA field. */
831 //v_U8_t uCurStaId;
832
833 /* Current served station ID in round-robin method to traverse all stations.*/
834 WLANTL_ACEnumType uCurServedAC;
835
836 /* How many weights have not been served in current AC. */
837 v_U8_t ucCurLeftWeight;
838
839 /* BC/MC management queue. Current implementation uses queue size 1. Will check whether
840 size N is supported. */
841 vos_list_t pMCBCManageQ;
842
843 v_U32_t sendFCFrame;
844
845 v_U8_t done_once;
846 v_U8_t uFramesProcThres;
Sunil Ravid5406f22013-01-22 00:18:31 -0800847#ifdef FEATURE_WLAN_TDLS
848 /*number of total TDLS peers registered to TL
849 Incremented at WLANTL_RegisterSTAClient(staType == WLAN_STA_TDLS)
850 Decremented at WLANTL_ClearSTAClient(staType == WLAN_STA_TDLS) */
851 v_U8_t ucTdlsPeerCount;
852#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700853 /*whether we are in BMPS/UAPSD/WOWL mode, since the latter 2 need to be BMPS first*/
854 v_BOOL_t isBMPS;
Gopichand Nakkala11acd112012-12-31 16:04:04 -0800855 /* Whether WDA_DS_TX_START_XMIT msg is pending or not */
856 v_BOOL_t isTxTranmitMsgPending;
Jeff Johnson295189b2012-06-20 16:38:30 -0700857}WLANTL_CbType;
858
859/*==========================================================================
860
861 FUNCTION WLANTL_GetFrames
862
863 DESCRIPTION
864
865 BAL calls this function at the request of the lower bus interface.
866 When this request is being received TL will retrieve packets from HDD
867 in accordance with the priority rules and the count supplied by BAL.
868
869 DEPENDENCIES
870
871 HDD must have registered with TL at least one STA before this function
872 can be called.
873
874 PARAMETERS
875
876 IN
877 pAdapter: pointer to the global adapter context; a handle to TL's
878 or BAL's control block can be extracted from its context
879 uSize: maximum size accepted by the lower layer
Jeff Johnson017fdc32013-02-27 09:22:30 -0800880 uFlowMask TX flow control mask. Each bit is defined as
Jeff Johnson295189b2012-06-20 16:38:30 -0700881 WDA_TXFlowEnumType
882
883 OUT
884 vosDataBuff: it will contain a pointer to the first buffer supplied
885 by TL, if there is more than one packet supplied, TL
886 will chain them through vOSS buffers
887
888 RETURN VALUE
889
890 The result code associated with performing the operation
891
892 1 or more: number of required resources if there are still frames to fetch
893 For Volans, it's BD/PDU numbers. For Prima, it's free DXE descriptors.
894 0 : error or HDD queues are drained
895
896 SIDE EFFECTS
897
898============================================================================*/
899v_U32_t
900WLANTL_GetFrames
901(
902 v_PVOID_t pAdapter,
903 vos_pkt_t **ppFrameDataBuff,
904 v_U32_t uSize,
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 v_U8_t uFlowMask,
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 v_BOOL_t* pbUrgent
907);
908
909/*==========================================================================
910
911 FUNCTION WLANTL_TxComp
912
913 DESCRIPTION
914 It is being called by BAL upon asynchronous notification of the packet
915 or packets being sent over the bus.
916
917 DEPENDENCIES
918 Tx complete cannot be called without a previous transmit.
919
920 PARAMETERS
921
922 IN
923 pAdapter: pointer to the global adapter context; a handle to TL's
924 or BAL's control block can be extracted from its context
925 vosDataBuff: it will contain a pointer to the first buffer for which
926 the BAL report is being made, if there is more then one
927 packet they will be chained using vOSS buffers.
928 wTxSTAtus: the status of the transmitted packet, see above chapter
929 on HDD interaction for a list of possible values
930
931 RETURN VALUE
932 The result code associated with performing the operation
933
934 SIDE EFFECTS
935
936============================================================================*/
937VOS_STATUS
938WLANTL_TxComp
939(
940 v_PVOID_t pAdapter,
941 vos_pkt_t *pFrameDataBuff,
942 VOS_STATUS wTxStatus
943);
944
945/*==========================================================================
946
947 FUNCTION WLANTL_RxFrames
948
949 DESCRIPTION
950 Callback registered by TL and called by BAL when a packet is received
951 over the bus. Upon the call of this function TL will make the necessary
952 decision with regards to the forwarding or queuing of this packet and
953 the layer it needs to be delivered to.
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 pAdapter: pointer to the global adapter context; a handle to TL's
964 or BAL's control block can be extracted from its context
965
966 vosDataBuff: it will contain a pointer to the first buffer received,
967 if there is more then one packet they will be chained
968 using vOSS buffers.
969
970 RETURN VALUE
971 The result code associated with performing the operation
972
973 SIDE EFFECTS
974
975============================================================================*/
976VOS_STATUS
977WLANTL_RxFrames
978(
979 v_PVOID_t pAdapter,
980 vos_pkt_t *pFrameDataBuff
981);
982
983/*==========================================================================
984
985 FUNCTION WLANTL_RxCachedFrames
986
987 DESCRIPTION
988 Utility function used by TL to forward the cached frames to a particular
989 station;
990
991 DEPENDENCIES
992 TL must be initiailized before this function gets called.
993 If the frame carried is a data frame then the station for which it is
994 destined to must have been previously registered with TL.
995
996 PARAMETERS
997
998 IN
999 pTLCb: pointer to TL handle
1000
1001 ucSTAId: station for which we need to forward the packets
1002
1003 vosDataBuff: it will contain a pointer to the first cached buffer
1004 received, if there is more then one packet they will be
1005 chained using vOSS buffers.
1006
1007 RETURN VALUE
1008 The result code associated with performing the operation
1009
1010 VOS_STATUS_E_INVAL: Input parameters are invalid
1011 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1012 page fault
1013 VOS_STATUS_SUCCESS: Everything is good :)
1014
1015 SIDE EFFECTS
1016
1017============================================================================*/
1018VOS_STATUS
1019WLANTL_RxCachedFrames
1020(
1021 WLANTL_CbType* pTLCb,
1022 v_U8_t ucSTAId,
1023 vos_pkt_t* vosDataBuff
1024);
1025
1026/*==========================================================================
1027 FUNCTION WLANTL_ResourceCB
1028
1029 DESCRIPTION
1030 Called by the TL when it has packets available for transmission.
1031
1032 DEPENDENCIES
1033 The TL must be registered with BAL before this function can be called.
1034
1035 PARAMETERS
1036
1037 IN
1038 pAdapter: pointer to the global adapter context; a handle to TL's
1039 or BAL's control block can be extracted from its context
1040 uCount: avail resource count obtained from hw
1041
1042 RETURN VALUE
1043 The result code associated with performing the operation
1044
1045 SIDE EFFECTS
1046
1047============================================================================*/
1048VOS_STATUS
1049WLANTL_ResourceCB
1050(
1051 v_PVOID_t pAdapter,
1052 v_U32_t uCount
1053);
1054
1055
1056/*==========================================================================
1057 FUNCTION WLANTL_ProcessMainMessage
1058
1059 DESCRIPTION
1060 Called by VOSS when a message was serialized for TL through the
1061 main thread/task.
1062
1063 DEPENDENCIES
1064 The TL must be initialized before this function can be called.
1065
1066 PARAMETERS
1067
1068 IN
1069 pAdapter: pointer to the global adapter context; a handle to TL's
1070 control block can be extracted from its context
1071 message: type and content of the message
1072
1073
1074 RETURN VALUE
1075 The result code associated with performing the operation
1076
1077 SIDE EFFECTS
1078
1079============================================================================*/
1080VOS_STATUS
1081WLANTL_ProcessMainMessage
1082(
1083 v_PVOID_t pAdapter,
1084 vos_msg_t* message
1085);
1086
1087/*==========================================================================
1088 FUNCTION WLANTL_ProcessTxMessage
1089
1090 DESCRIPTION
1091 Called by VOSS when a message was serialized for TL through the
1092 tx thread/task.
1093
1094 DEPENDENCIES
1095 The TL must be initialized before this function can be called.
1096
1097 PARAMETERS
1098
1099 IN
1100 pAdapter: pointer to the global adapter context; a handle to TL's
1101 control block can be extracted from its context
1102 message: type and content of the message
1103
1104
1105 RETURN VALUE
1106
1107 The result code associated with performing the operation
1108 VOS_STATUS_SUCCESS: Everything is good :)
1109
1110
1111 SIDE EFFECTS
1112
1113============================================================================*/
1114VOS_STATUS
1115WLANTL_ProcessTxMessage
1116(
1117 v_PVOID_t pAdapter,
1118 vos_msg_t* message
1119);
1120
1121/*==========================================================================
1122 FUNCTION WLAN_TLGetNextTxIds
1123
1124 DESCRIPTION
1125 Gets the next station and next AC in the list
1126
1127 DEPENDENCIES
1128
1129 PARAMETERS
1130
1131 OUT
1132 pucSTAId: STAtion ID
1133
1134 RETURN VALUE
1135 The result code associated with performing the operation
1136
1137 SIDE EFFECTS
1138
1139============================================================================*/
1140VOS_STATUS
1141WLAN_TLGetNextTxIds
1142(
1143 v_PVOID_t pAdapter,
1144 v_U8_t* pucSTAId
1145);
1146
1147/*==========================================================================
1148
1149 FUNCTION WLANTL_CleanCb
1150
1151 DESCRIPTION
1152 Cleans TL control block
1153
1154 DEPENDENCIES
1155
1156 PARAMETERS
1157
1158 IN
1159 pTLCb: pointer to TL's control block
1160 ucEmpty: set if TL has to clean up the queues and release pedning pkts
1161
1162 RETURN VALUE
1163 The result code associated with performing the operation
1164
1165 SIDE EFFECTS
1166
1167============================================================================*/
1168VOS_STATUS
1169WLANTL_CleanCB
1170(
1171 WLANTL_CbType* pTLCb,
1172 v_U8_t ucEmpty
1173);
1174
1175/*==========================================================================
1176
1177 FUNCTION WLANTL_CleanSTA
1178
1179 DESCRIPTION
1180 Cleans a station control block.
1181
1182 DEPENDENCIES
1183
1184 PARAMETERS
1185
1186 IN
1187 pAdapter: pointer to the global adapter context; a handle to TL's
1188 control block can be extracted from its context
1189 ucEmpty: if set the queues and pending pkts will be emptyed
1190
1191 RETURN VALUE
1192 The result code associated with performing the operation
1193
1194 SIDE EFFECTS
1195
1196============================================================================*/
1197VOS_STATUS
1198WLANTL_CleanSTA
1199(
1200 WLANTL_STAClientType* ptlSTAClient,
1201 v_U8_t ucEmpty
1202);
1203
1204/*==========================================================================
1205 FUNCTION WLANTL_GetTxResourcesCB
1206
1207 DESCRIPTION
1208 Processing function for Resource needed signal. A request will be issued
1209 to BAL to get mor tx resources.
1210
1211 DEPENDENCIES
1212 The TL must be initialized before this function can be called.
1213
1214 PARAMETERS
1215
1216 IN
1217 pvosGCtx: pointer to the global vos context; a handle to TL's
1218 control block can be extracted from its context
1219
1220
1221 RETURN VALUE
1222 The result code associated with performing the operation
1223
1224 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1225 page fault
1226 VOS_STATUS_SUCCESS: Everything is good :)
1227
1228 Other values can be returned as a result of a function call, please check
1229 corresponding API for more info.
1230 SIDE EFFECTS
1231
1232============================================================================*/
1233VOS_STATUS
1234WLANTL_GetTxResourcesCB
1235(
1236 v_PVOID_t pvosGCtx
1237);
1238
1239/*==========================================================================
1240 FUNCTION WLANTL_PrepareBDHeader
1241
1242 DESCRIPTION
1243 Callback function for serializing Suspend signal through Tx thread
1244
1245 DEPENDENCIES
1246 Just notify HAL that suspend in TL is complete.
1247
1248 PARAMETERS
1249
1250 IN
1251 pAdapter: pointer to the global adapter context; a handle to TL's
1252 control block can be extracted from its context
1253 pUserData: user data sent with the callback
1254
1255 RETURN VALUE
1256 The result code associated with performing the operation
1257
1258 SIDE EFFECTS
1259
1260============================================================================*/
1261void
1262WLANTL_PrepareBDHeader
1263(
1264 vos_pkt_t* vosDataBuff,
1265 v_PVOID_t* ppvBDHeader,
1266 v_MACADDR_t* pvDestMacAdddr,
1267 v_U8_t ucDisableFrmXtl,
1268 VOS_STATUS* pvosSTAtus,
1269 v_U16_t* usPktLen,
1270 v_U8_t ucQosEnabled,
1271 v_U8_t ucWDSEnabled,
1272 v_U8_t extraHeadSpace
1273);
1274
1275/*==========================================================================
1276 FUNCTION WLANTL_Translate8023To80211Header
1277
1278 DESCRIPTION
1279 Inline function for translating and 802.3 header into an 802.11 header.
1280
1281 DEPENDENCIES
1282
1283
1284 PARAMETERS
1285
1286 IN
1287 pTLCb: TL control block
Kiran Venkatappaa044eb92012-12-17 15:48:49 -08001288
1289 *pucStaId Station ID. In case of TDLS, this return the actual
1290 station index used to transmit.
Jeff Johnson295189b2012-06-20 16:38:30 -07001291
1292 IN/OUT
1293 vosDataBuff: vos data buffer, will contain the new header on output
1294
1295 OUT
1296 pvosStatus: status of the operation
1297
1298 RETURN VALUE
1299 No return.
1300
1301 SIDE EFFECTS
1302
1303============================================================================*/
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001304VOS_STATUS
1305WLANTL_Translate8023To80211Header
1306(
1307 vos_pkt_t* vosDataBuff,
1308 VOS_STATUS* pvosStatus,
1309 WLANTL_CbType* pTLCb,
1310 v_U8_t *pucStaId,
Ravi Joshid0699502013-07-08 15:48:47 -07001311 WLANTL_MetaInfoType* pTlMetaInfo,
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001312 v_U8_t *ucWDSEnabled,
1313 v_U8_t *extraHeadSpace
1314);
Jeff Johnson295189b2012-06-20 16:38:30 -07001315/*==========================================================================
1316 FUNCTION WLANTL_Translate80211To8023Header
1317
1318 DESCRIPTION
1319 Inline function for translating and 802.11 header into an 802.3 header.
1320
1321 DEPENDENCIES
1322
1323
1324 PARAMETERS
1325
1326 IN
1327 pTLCb: TL control block
1328 ucStaId: station ID
1329 ucHeaderLen: Length of the header from BD
1330 ucActualHLen: Length of header including padding or any other trailers
1331
1332 IN/OUT
1333 vosDataBuff: vos data buffer, will contain the new header on output
1334
1335 OUT
1336 pvosStatus: status of the operation
1337
1338 RETURN VALUE
1339 Status of the operation
1340
1341 SIDE EFFECTS
1342
1343============================================================================*/
1344VOS_STATUS
1345WLANTL_Translate80211To8023Header
1346(
1347 vos_pkt_t* vosDataBuff,
1348 VOS_STATUS* pvosStatus,
Jeff Johnson017fdc32013-02-27 09:22:30 -08001349 v_U16_t usActualHLen,
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 v_U8_t ucHeaderLen,
1351 WLANTL_CbType* pTLCb,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001352 v_U8_t ucSTAId,
1353 v_BOOL_t bForwardIAPPwithLLC
Jeff Johnson295189b2012-06-20 16:38:30 -07001354);
1355
1356/*==========================================================================
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -08001357 FUNCTION WLANTL_FindFrameTypeBcMcUc
1358
1359 DESCRIPTION
1360 Utility function to find whether received frame is broadcast, multicast
1361 or unicast.
1362
1363 DEPENDENCIES
1364 The STA must be registered with TL before this function can be called.
1365
1366 PARAMETERS
1367
1368 IN
1369 pTLCb: pointer to the TL's control block
1370 ucSTAId: identifier of the station being processed
1371 vosDataBuff: pointer to the vos buffer
1372
1373 IN/OUT
1374 pucBcMcUc: pointer to buffer, will contain frame type on return
1375
1376 RETURN VALUE
1377 The result code associated with performing the operation
1378
1379 VOS_STATUS_E_INVAL: invalid input parameters
1380 VOS_STATUS_E_BADMSG: failed to extract info from data buffer
1381 VOS_STATUS_SUCCESS: success
1382
1383 SIDE EFFECTS
1384 None.
1385============================================================================*/
1386VOS_STATUS
1387WLANTL_FindFrameTypeBcMcUc
1388(
1389 WLANTL_CbType *pTLCb,
1390 v_U8_t ucSTAId,
1391 vos_pkt_t *vosDataBuff,
1392 v_U8_t *pucBcMcUc
1393);
1394
1395/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -07001396
1397 FUNCTION WLANTL_MgmtFrmRxDefaultCb
1398
1399 DESCRIPTION
1400 Default Mgmt Frm rx callback: asserts all the time. If this function gets
1401 called it means there is no registered rx cb pointer for Mgmt Frm.
1402
1403 DEPENDENCIES
1404
1405 PARAMETERS
1406
1407 Not used.
1408
1409 RETURN VALUE
1410 Always FAILURE.
1411
1412============================================================================*/
1413VOS_STATUS
1414WLANTL_MgmtFrmRxDefaultCb
1415(
1416 v_PVOID_t pAdapter,
1417 v_PVOID_t vosBuff
1418);
1419
1420/*==========================================================================
1421
1422 FUNCTION WLANTL_STARxDefaultCb
1423
1424 DESCRIPTION
1425 Default BAP rx callback: asserts all the time. If this function gets
1426 called it means there is no registered rx cb pointer for BAP.
1427
1428 DEPENDENCIES
1429
1430 PARAMETERS
1431
1432 Not used.
1433
1434 RETURN VALUE
1435 Always FAILURE.
1436
1437============================================================================*/
1438VOS_STATUS
1439WLANTL_BAPRxDefaultCb
1440(
1441 v_PVOID_t pAdapter,
1442 vos_pkt_t* vosDataBuff,
1443 WLANTL_BAPFrameEnumType frameType
1444);
1445
1446/*==========================================================================
1447
1448 FUNCTION WLANTL_STARxDefaultCb
1449
1450 DESCRIPTION
1451 Default STA rx callback: asserts all the time. If this function gets
1452 called it means there is no registered rx cb pointer for station.
1453 (Mem corruption most likely, it should never happen)
1454
1455 DEPENDENCIES
1456
1457 PARAMETERS
1458
1459 Not used.
1460
1461 RETURN VALUE
1462 Always FAILURE.
1463
1464============================================================================*/
1465VOS_STATUS
1466WLANTL_STARxDefaultCb
1467(
1468 v_PVOID_t pAdapter,
1469 vos_pkt_t* vosDataBuff,
1470 v_U8_t ucSTAId,
1471 WLANTL_RxMetaInfoType* pRxMetaInfo
1472);
1473
1474/*==========================================================================
1475
1476 FUNCTION WLANTL_STAFetchPktDefaultCb
1477
1478 DESCRIPTION
1479 Default fetch callback: asserts all the time. If this function gets
1480 called it means there is no registered fetch cb pointer for station.
1481 (Mem corruption most likely, it should never happen)
1482
1483 DEPENDENCIES
1484
1485 PARAMETERS
1486
1487 Not used.
1488
1489 RETURN VALUE
1490 Always FAILURE.
1491
1492============================================================================*/
1493VOS_STATUS
1494WLANTL_STAFetchPktDefaultCb
1495(
1496 v_PVOID_t pAdapter,
1497 v_U8_t* pucSTAId,
1498 WLANTL_ACEnumType ucAC,
1499 vos_pkt_t** vosDataBuff,
1500 WLANTL_MetaInfoType* tlMetaInfo
1501);
1502
1503/*==========================================================================
1504
1505 FUNCTION WLANTL_TxCompDefaultCb
1506
1507 DESCRIPTION
1508 Default tx complete handler. It will release the completed pkt to
1509 prevent memory leaks.
1510
1511 PARAMETERS
1512
1513 IN
1514 pAdapter: pointer to the global adapter context; a handle to
1515 TL/HAL/PE/BAP/HDD control block can be extracted from
1516 its context
1517 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1518 wTxSTAtus: status of the transmission
1519
1520
1521 RETURN VALUE
1522 The result code associated with performing the operation; please
1523 check vos_pkt_return_pkt for possible error codes.
1524
1525============================================================================*/
1526VOS_STATUS
1527WLANTL_TxCompDefaultCb
1528(
1529 v_PVOID_t pAdapter,
1530 vos_pkt_t* vosDataBuff,
1531 VOS_STATUS wTxSTAtus
1532);
1533
1534/*==========================================================================
1535
1536 FUNCTION WLANTL_PackUpTriggerFrame
1537
1538 DESCRIPTION
1539 Packs up a trigger frame and places it in TL's cache for tx and notifies
1540 BAL
1541
1542 DEPENDENCIES
1543
1544 PARAMETERS
1545
1546 IN
1547 pTLCb: pointer to the TL control block
1548 pfnSTATxComp: Tx Complete Cb to be used when frame is received
1549 ucSTAId: station id
1550 ucAC: access category
1551
1552 RETURN VALUE
1553 None
1554
1555 SIDE EFFECTS
1556
1557============================================================================*/
1558VOS_STATUS
1559WLANTL_PackUpTriggerFrame
1560(
1561 WLANTL_CbType* pTLCb,
1562 WLANTL_TxCompCBType pfnSTATxComp,
1563 v_U8_t ucSTAId,
1564 WLANTL_ACEnumType ucAC
1565);
1566
1567/*==========================================================================
1568
1569 FUNCTION WLANTL_TxCompTriggFrameSI
1570
1571 DESCRIPTION
1572 Tx complete handler for the service interval trigger frame.
1573 It will restart the SI timer.
1574
1575 PARAMETERS
1576
1577 IN
1578 pvosGCtx: pointer to the global vos context; a handle to
1579 TL/HAL/PE/BAP/HDD control block can be extracted from
1580 its context
1581 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1582 wTxSTAtus: status of the transmission
1583
1584
1585 RETURN VALUE
1586 The result code associated with performing the operation
1587
1588 ============================================================================*/
1589VOS_STATUS
1590WLANTL_TxCompTriggFrameSI
1591(
1592 v_PVOID_t pvosGCtx,
1593 vos_pkt_t* vosDataBuff,
1594 VOS_STATUS wTxSTAtus
1595);
1596
1597/*==========================================================================
1598
1599 FUNCTION WLANTL_TxCompTriggFrameSI
1600
1601 DESCRIPTION
1602 Tx complete handler for the service interval trigger frame.
1603 It will restart the SI timer.
1604
1605 PARAMETERS
1606
1607 IN
1608 pvosGCtx: pointer to the global vos context; a handle to
1609 TL/HAL/PE/BAP/HDD control block can be extracted from
1610 its context
1611 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1612 wTxSTAtus: status of the transmission
1613
1614
1615 RETURN VALUE
1616 The result code associated with performing the operation
1617
1618============================================================================*/
1619VOS_STATUS
1620WLANTL_TxCompTriggFrameDI
1621(
1622 v_PVOID_t pvosGCtx,
1623 vos_pkt_t* vosDataBuff,
1624 VOS_STATUS wTxSTAtus
1625);
1626
1627/*==========================================================================
1628
1629 FUNCTION
1630
1631 DESCRIPTION Read RSSI value out of a RX BD
1632
1633 PARAMETERS: Caller must validate all parameters
1634
1635 RETURN VALUE
1636
1637============================================================================*/
1638VOS_STATUS WLANTL_ReadRSSI
1639(
1640 v_PVOID_t pAdapter,
1641 v_PVOID_t pBDHeader,
1642 v_U8_t STAid
1643);
1644
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301645/*==========================================================================
1646
1647 FUNCTION
1648
1649 DESCRIPTION Read SNR value out of a RX BD
1650
1651 PARAMETERS: Caller must validate all parameters
1652
1653 RETURN VALUE
1654
1655============================================================================*/
1656VOS_STATUS WLANTL_ReadSNR
1657(
1658 v_PVOID_t pAdapter,
1659 v_PVOID_t pBDHeader,
1660 v_U8_t STAid
1661);
Jeff Johnson295189b2012-06-20 16:38:30 -07001662
1663
1664void WLANTL_PowerStateChangedCB
1665(
1666 v_PVOID_t pAdapter,
1667 tPmcState newState
1668);
1669
Jeff Johnson295189b2012-06-20 16:38:30 -07001670/*==========================================================================
Jeff Johnson017fdc32013-02-27 09:22:30 -08001671 FUNCTION WLANTL_FwdPktToHDD
Jeff Johnson295189b2012-06-20 16:38:30 -07001672
1673 DESCRIPTION
1674 Determine the Destation Station ID and route the Frame to Upper Layer
1675
1676 DEPENDENCIES
1677
1678 PARAMETERS
1679
1680 IN
1681 pvosGCtx: pointer to the global vos context; a handle to TL's
1682 control block can be extracted from its context
1683 ucSTAId: identifier of the station being processed
1684 vosDataBuff: pointer to the rx vos buffer
1685
1686 RETURN VALUE
1687 The result code associated with performing the operation
1688
1689 VOS_STATUS_E_INVAL: invalid input parameters
1690 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1691 page fault
1692 VOS_STATUS_SUCCESS: Everything is good :)
1693
1694 SIDE EFFECTS
1695
1696============================================================================*/
1697
1698VOS_STATUS
1699WLANTL_FwdPktToHDD
1700(
1701 v_PVOID_t pvosGCtx,
1702 vos_pkt_t* pvosDataBuff,
1703 v_U8_t ucSTAId
1704);
1705
Jeff Johnson295189b2012-06-20 16:38:30 -07001706#endif /* #ifndef WLAN_QCT_TLI_H */