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