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