blob: 32819d2df8341a6af9fca23eebd7b4d913bd572c [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Abhishek Singh7cd040e2016-01-07 10:51:04 +05302 * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
Kiet Lam1ed83fc2014-02-19 01:15:45 -08003 *
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-------- --- ----------------------------------------------------------
Abhishek Singh7cd040e2016-01-07 10:51:04 +05306108/19/13 rajekuma Added RMC support in TL
Jeff Johnson295189b2012-06-20 16:38:30 -07006202/19/10 bad Fixed 802.11 to 802.3 ft issues with WAPI
6301/14/10 rnair Fixed the byte order for the WAI packet type.
6401/08/10 lti Added TL Data Caching
6510/09/09 rnair Add support for WAPI
6602/02/09 sch Add Handoff support
6712/09/08 lti Fixes for AMSS compilation
6812/02/08 lti Fix fo trigger frame generation
6910/31/08 lti Fix fo TL tx suspend
7010/01/08 lti Merged in fixes from reordering
7109/05/08 lti Fixes following QOS unit testing
7208/06/08 lti Added QOS support
7307/18/08 lti Fixes following integration
74 Added frame translation
7506/26/08 lti Fixes following unit testing
7605/05/08 lti Created module.
77
78===========================================================================*/
79
80
81
82/*===========================================================================
83
84 INCLUDE FILES FOR MODULE
85
86===========================================================================*/
87
88/*----------------------------------------------------------------------------
89 * Include Files
90 * -------------------------------------------------------------------------*/
91#include "vos_packet.h"
92#include "vos_api.h"
93#include "vos_timer.h"
94#include "vos_mq.h"
95#include "vos_list.h"
96#include "wlan_qct_tl.h"
97#include "pmcApi.h"
98#include "wlan_qct_hal.h"
99
100
101#define STATIC static
Jeff Johnson295189b2012-06-20 16:38:30 -0700102/*----------------------------------------------------------------------------
103 * Preprocessor Definitions and Constants
104 * -------------------------------------------------------------------------*/
105
106/*Maximum number of TIDs */
107#define WLAN_MAX_TID 8
108
Jeff Johnson295189b2012-06-20 16:38:30 -0700109/*Offset of the OUI field inside the LLC/SNAP header*/
110#define WLANTL_LLC_OUI_OFFSET 3
111
112/*Size of the OUI type field inside the LLC/SNAP header*/
113#define WLANTL_LLC_OUI_SIZE 3
114
115/*Offset of the protocol type field inside the LLC/SNAP header*/
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800116#define WLANTL_LLC_PROTO_TYPE_OFFSET (WLANTL_LLC_OUI_OFFSET + WLANTL_LLC_OUI_SIZE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700117
118/*Size of the protocol type field inside the LLC/SNAP header*/
119#define WLANTL_LLC_PROTO_TYPE_SIZE 2
120
121/*802.1x protocol type */
122#define WLANTL_LLC_8021X_TYPE 0x888E
123
124/*WAPI protocol type */
125#define WLANTL_LLC_WAI_TYPE 0x88b4
Hanumantha Reddy Pothulaee001fc2015-05-26 15:21:53 +0530126#define WLANTL_ETHERTYPE_ARP 0x0806
Jeff Johnson295189b2012-06-20 16:38:30 -0700127
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800128#ifdef FEATURE_WLAN_TDLS
129#define WLANTL_LLC_TDLS_TYPE 0x890d
130#endif
131
Jeff Johnson295189b2012-06-20 16:38:30 -0700132/*Length offset inside the AMSDU sub-frame header*/
133#define WLANTL_AMSDU_SUBFRAME_LEN_OFFSET 12
134
135/*802.3 header definitions*/
136#define WLANTL_802_3_HEADER_LEN 14
137
138/* Offset of DA field in a 802.3 header*/
139#define WLANTL_802_3_HEADER_DA_OFFSET 0
140
141/*802.11 header definitions - header len without QOS ctrl field*/
142#define WLANTL_802_11_HEADER_LEN 24
143
144/*802.11 header length + QOS ctrl field*/
145#define WLANTL_MPDU_HEADER_LEN 32
146
147/*802.11 header definitions*/
148#define WLANTL_802_11_MAX_HEADER_LEN 40
149
150/*802.11 header definitions - qos ctrl field len*/
151#define WLANTL_802_11_HEADER_QOS_CTL 2
152
153/*802.11 header definitions - ht ctrl field len*/
154#define WLANTL_802_11_HEADER_HT_CTL 4
155
156/* Offset of Addr1 field in a 802.11 header*/
157#define WLANTL_802_11_HEADER_ADDR1_OFFSET 4
158
159/*802.11 ADDR4 MAC addr field len */
160#define WLANTL_802_11_HEADER_ADDR4_LEN VOS_MAC_ADDR_SIZE
161
162/* Length of an AMSDU sub-frame */
163#define TL_AMSDU_SUBFRM_HEADER_LEN 14
164
165/* Length of the LLC header*/
166#define WLANTL_LLC_HEADER_LEN 8
167
168/*As per 802.11 spec */
169#define WLANTL_MGMT_FRAME_TYPE 0x00
170#define WLANTL_CTRL_FRAME_TYPE 0x10
171#define WLANTL_DATA_FRAME_TYPE 0x20
172
Siddharth Bhal4551b102014-10-09 21:36:36 +0530173#define WLANTL_MGMT_PROBE_REQ_FRAME_TYPE 0x04
174
Jeff Johnson295189b2012-06-20 16:38:30 -0700175/*Value of the data type field in the 802.11 frame */
176#define WLANTL_80211_DATA_TYPE 0x02
177#define WLANTL_80211_DATA_QOS_SUBTYPE 0x08
178#define WLANTL_80211_NULL_QOS_SUBTYPE 0x0C
Dino Mycle3b9536d2014-07-09 22:05:24 +0530179#define WLANTL_80211_MGMT_ACTION_SUBTYPE 0x0D
180#define WLANTL_80211_MGMT_ACTION_NO_ACK_SUBTYPE 0x0E
Jeff Johnson295189b2012-06-20 16:38:30 -0700181
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -0800182/*Defines for internal utility functions */
183#define WLANTL_FRAME_TYPE_BCAST 0xff
184#define WLANTL_FRAME_TYPE_MCAST 0x01
185#define WLANTL_FRAME_TYPE_UCAST 0x00
186
Dino Mycle3b9536d2014-07-09 22:05:24 +0530187#define WLANTL_FRAME_TYPESUBTYPE_MASK 0x3F
Jeff Johnson295189b2012-06-20 16:38:30 -0700188
Abhishek Singh7cd040e2016-01-07 10:51:04 +0530189#ifdef WLAN_FEATURE_RMC
190#define WLANTL_RMC_HASH_TABLE_SIZE (32)
191#endif
192
Jeff Johnson295189b2012-06-20 16:38:30 -0700193/*-------------------------------------------------------------------------
194 BT-AMP related definition - !!! should probably be moved to BT-AMP header
195---------------------------------------------------------------------------*/
196
197/*-------------------------------------------------------------------------
198 Helper macros
199---------------------------------------------------------------------------*/
200 /*Checks STA index validity*/
201#define WLANTL_STA_ID_INVALID( _staid )( _staid >= WLAN_MAX_STA_COUNT )
202
203/*As per Libra behavior */
204#define WLANTL_STA_ID_BCAST 0xFF
205
206/*Checks TID validity*/
207#define WLANTL_TID_INVALID( _tid ) ( _tid >= WLAN_MAX_TID )
208
209/*Checks AC validity*/
210#define WLANTL_AC_INVALID( _tid ) ( _tid >= WLANTL_MAX_AC )
211
212/*Determines the addr field offset based on the frame xtl bit*/
213#define WLANTL_MAC_ADDR_ALIGN( _dxtl ) \
214 ( ( 0 == _dxtl ) ? \
215 WLANTL_802_3_HEADER_DA_OFFSET: WLANTL_802_11_HEADER_ADDR1_OFFSET )
216
217/*Determines the header len based on the disable xtl field*/
218#define WLANTL_MAC_HEADER_LEN( _dxtl) \
219 ( ( 0 == _dxtl )? \
220 WLANTL_802_3_HEADER_LEN:WLANTL_802_11_HEADER_LEN )
221
222/*Determines the necesary length of the BD header - in case
223 UMA translation is enabled enough room needs to be left in front of the
224 packet for the 802.11 header to be inserted*/
225#define WLANTL_BD_HEADER_LEN( _dxtl ) \
226 ( ( 0 == _dxtl )? \
227 (WLANHAL_TX_BD_HEADER_SIZE+WLANTL_802_11_MAX_HEADER_LEN): WLANHAL_TX_BD_HEADER_SIZE )
228
229
230#define WLAN_TL_CEIL( _a, _b) (( 0 != (_a)%(_b))? (_a)/(_b) + 1: (_a)/(_b))
231
232/*get TL control block from vos global context */
233#define VOS_GET_TL_CB(_pvosGCtx) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800234 ((WLANTL_CbType*)vos_get_context( VOS_MODULE_ID_TL, _pvosGCtx))
Jeff Johnson295189b2012-06-20 16:38:30 -0700235
236/* Check whether Rx frame is LS or EAPOL packet (other than data) */
237#define WLANTL_BAP_IS_NON_DATA_PKT_TYPE(usType) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800238 ((WLANTL_BT_AMP_TYPE_AR == usType) || (WLANTL_BT_AMP_TYPE_SEC == usType) || \
239 (WLANTL_BT_AMP_TYPE_LS_REQ == usType) || (WLANTL_BT_AMP_TYPE_LS_REP == usType))
Jeff Johnson295189b2012-06-20 16:38:30 -0700240
241/*get RSSI0 from a RX BD*/
242/* 7 bits in phystats represent -100dBm to +27dBm */
243#define WLAN_TL_RSSI_CORRECTION 100
244#define WLANTL_GETRSSI0(pBD) (WDA_GETRSSI0(pBD) - WLAN_TL_RSSI_CORRECTION)
245
246/*get RSSI1 from a RX BD*/
247#define WLANTL_GETRSSI1(pBD) (WDA_GETRSSI1(pBD) - WLAN_TL_RSSI_CORRECTION)
248
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530249#define WLANTL_GETSNR(pBD) WDA_GET_RX_SNR(pBD)
250
Jeff Johnson295189b2012-06-20 16:38:30 -0700251/* Check whether Rx frame is LS or EAPOL packet (other than data) */
252#define WLANTL_BAP_IS_NON_DATA_PKT_TYPE(usType) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800253 ((WLANTL_BT_AMP_TYPE_AR == usType) || (WLANTL_BT_AMP_TYPE_SEC == usType) || \
254 (WLANTL_BT_AMP_TYPE_LS_REQ == usType) || (WLANTL_BT_AMP_TYPE_LS_REP == usType))
Jeff Johnson295189b2012-06-20 16:38:30 -0700255
Mihir Sheteb7337272014-04-11 15:53:08 +0530256#define WLANTL_CACHE_TRACE_WATERMARK 100
Jeff Johnson295189b2012-06-20 16:38:30 -0700257/*---------------------------------------------------------------------------
258 TL signals for TX thread
259---------------------------------------------------------------------------*/
260typedef enum
261{
262 /*Suspend signal - following serialization of a HAL suspend request*/
263 WLANTL_TX_SIG_SUSPEND = 0,
264
265 /*Res need signal - triggered when all pending TxComp have been received
266 and TL is low on resources*/
267 WLANTL_TX_RES_NEEDED = 1,
268
Katya Nigam664f5032014-05-05 12:24:32 +0530269 /* Forwarding RX cached frames. This is not used anymore as it is
270 replaced by WLANTL_RX_FWD_CACHED in RX thread*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700271 WLANTL_TX_FWD_CACHED = 2,
272
273 /* Serialized STAID AC Indication */
274 WLANTL_TX_STAID_AC_IND = 3,
275
276 /* Serialzie TX transmit request */
277 WLANTL_TX_START_XMIT = 4,
278
279 /* Serialzie Finish UL Authentication request */
280 WLANTL_FINISH_ULA = 5,
281
Madan Mohan Koyyalamudia96f5442013-05-10 11:32:06 +0530282 /* Serialized Snapshot request indication */
283 WLANTL_TX_SNAPSHOT = 6,
284
Mihir Shetefd62d9d2014-08-06 15:08:21 +0530285 /* Detected a fatal error issue SSR */
286 WLANTL_TX_FATAL_ERROR = 7,
287
Mihir Shete327c2ab2014-11-13 15:17:02 +0530288 WLANTL_TX_FW_DEBUG = 8,
289
Sravan Kumar Kairam6eac7522015-11-27 23:37:02 +0530290 WLANTL_TX_KICKDXE = 9,
291
Jeff Johnson295189b2012-06-20 16:38:30 -0700292 WLANTL_TX_MAX
293}WLANTL_TxSignalsType;
294
Katya Nigam664f5032014-05-05 12:24:32 +0530295
296/*---------------------------------------------------------------------------
297 TL signals for RX thread
298---------------------------------------------------------------------------*/
299typedef enum
300{
301
302 /* Forwarding RX cached frames */
303 WLANTL_RX_FWD_CACHED = 0,
304
305}WLANTL_RxSignalsType;
306
Jeff Johnson295189b2012-06-20 16:38:30 -0700307/*---------------------------------------------------------------------------
308 STA Event type
309---------------------------------------------------------------------------*/
310typedef enum
311{
312 /* Transmit frame event */
313 WLANTL_TX_EVENT = 0,
314
315 /* Receive frame event */
316 WLANTL_RX_EVENT = 1,
317
318 WLANTL_MAX_EVENT
319}WLANTL_STAEventType;
320
321/*---------------------------------------------------------------------------
322
323 DESCRIPTION
324 State machine used by transport layer for receiving or transmitting
325 packets.
326
327 PARAMETERS
328
329 IN
330 pAdapter: pointer to the global adapter context; a handle to TL's
331 control block can be extracted from its context
332 ucSTAId: identifier of the station being processed
333 vosDataBuff: pointer to the tx/rx vos buffer
334
335 RETURN VALUE
336 The result code associated with performing the operation
337
338---------------------------------------------------------------------------*/
339typedef VOS_STATUS (*WLANTL_STAFuncType)( v_PVOID_t pAdapter,
340 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700341 vos_pkt_t** pvosDataBuff,
342 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700343
344/*---------------------------------------------------------------------------
345 STA FSM Entry type
346---------------------------------------------------------------------------*/
347typedef struct
348{
349 WLANTL_STAFuncType pfnSTATbl[WLANTL_MAX_EVENT];
350} WLANTL_STAFsmEntryType;
351
352/* Receive in connected state - only EAPOL or WAI*/
353VOS_STATUS WLANTL_STARxConn( 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/* Transmit in connected state - only EAPOL or WAI*/
359VOS_STATUS WLANTL_STATxConn( 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/* Receive in authenticated state - all data allowed*/
365VOS_STATUS WLANTL_STARxAuth( 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/* Transmit in authenticated state - all data allowed*/
371VOS_STATUS WLANTL_STATxAuth( v_PVOID_t pAdapter,
372 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700373 vos_pkt_t** pvosDataBuff,
374 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700375
376/* Receive in disconnected state - no data allowed*/
377VOS_STATUS WLANTL_STARxDisc( v_PVOID_t pAdapter,
378 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700379 vos_pkt_t** pvosDataBuff,
380 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700381
382/* Transmit in disconnected state - no data allowed*/
383VOS_STATUS WLANTL_STATxDisc( v_PVOID_t pAdapter,
384 v_U8_t ucSTAId,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700385 vos_pkt_t** pvosDataBuff,
386 v_BOOL_t bForwardIAPPwithLLC);
Jeff Johnson295189b2012-06-20 16:38:30 -0700387
388/* TL State Machine */
389STATIC const WLANTL_STAFsmEntryType tlSTAFsm[WLANTL_STA_MAX_STATE] =
390{
391 /* WLANTL_STA_INIT */
392 { {
393 NULL, /* WLANTL_TX_EVENT - no packets should get transmitted*/
394 NULL, /* WLANTL_RX_EVENT - no packets should be received - drop*/
395 } },
396
397 /* WLANTL_STA_CONNECTED */
398 { {
399 WLANTL_STATxConn, /* WLANTL_TX_EVENT - only EAPoL or WAI frames are allowed*/
400 WLANTL_STARxConn, /* WLANTL_RX_EVENT - only EAPoL or WAI frames can be rx*/
401 } },
402
403 /* WLANTL_STA_AUTHENTICATED */
404 { {
405 WLANTL_STATxAuth, /* WLANTL_TX_EVENT - all data frames allowed*/
406 WLANTL_STARxAuth, /* WLANTL_RX_EVENT - all data frames can be rx */
407 } },
408
409 /* WLANTL_STA_DISCONNECTED */
410 { {
411 WLANTL_STATxDisc, /* WLANTL_TX_EVENT - do nothing */
412 WLANTL_STARxDisc, /* WLANTL_RX_EVENT - frames will still be fwd-ed*/
413 } }
414};
415
416/*---------------------------------------------------------------------------
417 Reordering information
418---------------------------------------------------------------------------*/
419
420#define WLANTL_MAX_WINSIZE 64
421#define WLANTL_MAX_BA_SESSION 40
422
423typedef struct
424{
425 v_BOOL_t isAvailable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700426 v_U64_t ullReplayCounter[WLANTL_MAX_WINSIZE];
Jeff Johnson295189b2012-06-20 16:38:30 -0700427 v_PVOID_t arrayBuffer[WLANTL_MAX_WINSIZE];
428} WLANTL_REORDER_BUFFER_T;
429
430
431/* To handle Frame Q aging, timer is needed
432 * After timer expired, Qed frames have to be routed to upper layer
433 * WLANTL_TIMER_EXPIER_UDATA_T is user data type for timer callback
434 */
435typedef struct
436{
437 /* Global contect, HAL, HDD need this */
438 v_PVOID_t pAdapter;
439
440 /* TL context handle */
441 v_PVOID_t pTLHandle;
442
443 /* Current STAID, to know STA context */
444 v_U32_t STAID;
445
446 v_U8_t TID;
447} WLANTL_TIMER_EXPIER_UDATA_T;
448
449typedef struct
450{
451 /*specifies if re-order session exists*/
452 v_U8_t ucExists;
453
454 /* Current Index */
455 v_U32_t ucCIndex;
456
457 /* Count of the total packets in list*/
458 v_U16_t usCount;
459
460 /* vos ttimer to handle Qed frames aging */
461 vos_timer_t agingTimer;
462
463 /* Q windoe size */
464 v_U32_t winSize;
465
466 /* Available RX frame buffer size */
467 v_U32_t bufferSize;
468
469 /* Start Sequence number */
470 v_U32_t SSN;
471
472 /* BA session ID, generate by HAL */
473 v_U32_t sessionID;
474
475 v_U32_t currentESN;
476
477 v_U32_t pendingFramesCount;
478
479 vos_lock_t reorderLock;
480
481 /* Aging timer callback user data */
482 WLANTL_TIMER_EXPIER_UDATA_T timerUdata;
483
484 WLANTL_REORDER_BUFFER_T *reorderBuffer;
Madan Mohan Koyyalamudi31e4cad2013-08-21 20:21:14 +0530485
486 v_U16_t LastSN;
Jeff Johnson295189b2012-06-20 16:38:30 -0700487}WLANTL_BAReorderType;
488
489
490/*---------------------------------------------------------------------------
491 UAPSD information
492---------------------------------------------------------------------------*/
493typedef struct
494{
495 /* flag set when a UAPSD session with triggers generated in fw is being set*/
496 v_U8_t ucSet;
497}WLANTL_UAPSDInfoType;
498
Abhishek Singh7cd040e2016-01-07 10:51:04 +0530499#ifdef WLAN_FEATURE_RMC
500struct tTL_RMCList
501{
502 struct tTL_RMCList *next;
503 v_MACADDR_t rmcAddr;
504 v_U16_t mcSeqCtl;
505 v_U32_t rxMCDupcnt;
506};
507
508typedef struct tTL_RMCList WLANTL_RMC_SESSION;
509#endif
510
Jeff Johnson295189b2012-06-20 16:38:30 -0700511/*---------------------------------------------------------------------------
Mihir Sheteb7337272014-04-11 15:53:08 +0530512 per-STA cache info
513---------------------------------------------------------------------------*/
514typedef struct
515{
516 v_U16_t cacheSize;
517 v_TIME_t cacheInitTime;
518 v_TIME_t cacheDoneTime;
519 v_TIME_t cacheClearTime;
520}WLANTL_CacheInfoType;
521
Dino Mycle3b9536d2014-07-09 22:05:24 +0530522
Mihir Sheteb7337272014-04-11 15:53:08 +0530523/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700524 STA Client type
525---------------------------------------------------------------------------*/
526typedef struct
527{
528 /* Flag that keeps track of registration; only one STA with unique
529 ID allowed */
530 v_U8_t ucExists;
531
Jeff Johnson295189b2012-06-20 16:38:30 -0700532 /* Function pointer to the receive packet handler from HDD */
533 WLANTL_STARxCBType pfnSTARx;
534
535 /* Function pointer to the transmit complete confirmation handler
536 from HDD */
537 WLANTL_TxCompCBType pfnSTATxComp;
538
539 /* Function pointer to the packet retrieval routine in HDD */
540 WLANTL_STAFetchPktCBType pfnSTAFetchPkt;
541
542 /* Reordering information for the STA */
543 WLANTL_BAReorderType atlBAReorderInfo[WLAN_MAX_TID];
544
545 /* STA Descriptor, contains information related to the new added STA */
546 WLAN_STADescType wSTADesc;
547
548 /* Current connectivity state of the STA */
549 WLANTL_STAStateType tlState;
550
551 /* Station priority */
552 WLANTL_STAPriorityType tlPri;
553
554 /* Value of the averaged RSSI for this station */
555 v_S7_t rssiAvg;
556
557 /* Value of the averaged RSSI for this station in BMPS */
558 v_S7_t rssiAvgBmps;
559
Shailender Karmuchi13c0d082013-03-26 14:41:39 -0700560 /* Value of the Alpha to calculate RSSI average */
561 v_S7_t rssiAlpha;
562
Jeff Johnson295189b2012-06-20 16:38:30 -0700563 /* Value of the averaged RSSI for this station */
564 v_U32_t uLinkQualityAvg;
565
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530566 /* Sum of SNR for snrIdx number of consecutive frames */
567 v_U32_t snrSum;
568
569 /* Number of consecutive frames over which snrSum is calculated */
570 v_S7_t snrIdx;
571
572 /* Average SNR of previous 20 frames */
573 v_S7_t prevSnrAvg;
574
575 /* Average SNR returned by fw */
576 v_S7_t snrAvgBmps;
577
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 /* Tx packet count per station per TID */
579 v_U32_t auTxCount[WLAN_MAX_TID];
580
581 /* Rx packet count per station per TID */
582 v_U32_t auRxCount[WLAN_MAX_TID];
583
584 /* Suspend flag */
585 v_U8_t ucTxSuspended;
586
587 /* Pointer to the AMSDU chain maintained by the AMSDU de-aggregation
588 completion sub-module */
589 vos_pkt_t* vosAMSDUChainRoot;
590
591 /* Pointer to the root of the chain */
592 vos_pkt_t* vosAMSDUChain;
593
594 /* Used for saving/restoring frame header for 802.3/11 AMSDU sub-frames */
595 v_U8_t aucMPDUHeader[WLANTL_MPDU_HEADER_LEN];
596
597 /* length of the header */
598 v_U8_t ucMPDUHeaderLen;
599
600 /* Enabled ACs currently serviced by TL (automatic setup in TL)*/
Kanchanapally, Vidyullathaed969c62015-02-18 11:39:11 +0530601 v_U8_t aucACMask[WLANTL_NUM_TX_QUEUES];
Jeff Johnson295189b2012-06-20 16:38:30 -0700602
603 /* Current AC to be retrieved */
604 WLANTL_ACEnumType ucCurrentAC;
605
606 /*Packet pending flag - set if tx is pending for the station*/
607 v_U8_t ucPktPending;
Jeff Johnson017fdc32013-02-27 09:22:30 -0800608
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700609 /*EAPOL Packet pending flag - set if EAPOL packet is pending for the station*/
610 v_U8_t ucEapolPktPending;
611
Jeff Johnson017fdc32013-02-27 09:22:30 -0800612 /*used on tx packet to signal when there is no more data to tx for the
Jeff Johnson295189b2012-06-20 16:38:30 -0700613 moment=> packets can be passed to BAL */
614 v_U8_t ucNoMoreData;
615
616 /* Last serviced AC to be retrieved */
617 WLANTL_ACEnumType ucServicedAC;
618
619 /* Current weight for the AC */
620 v_U8_t ucCurrentWeight;
621
622 /* Info used for UAPSD trigger frame generation */
623 WLANTL_UAPSDInfoType wUAPSDInfo[WLANTL_MAX_AC];
624
625 /* flag to signal if a trigger frames is pending */
626 v_U8_t ucPendingTrigFrm;
627
628 WLANTL_TRANSFER_STA_TYPE trafficStatistics;
629
630 /*Members needed for packet caching in TL*/
631 /*Begining of the cached packets chain*/
632 vos_pkt_t* vosBegCachedFrame;
633
634 /*Begining of the cached packets chain*/
635 vos_pkt_t* vosEndCachedFrame;
636
Mihir Sheteb7337272014-04-11 15:53:08 +0530637 WLANTL_CacheInfoType tlCacheInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700638 /* LWM related fields */
639
Katya Nigam63902932014-06-26 19:04:23 +0530640 v_BOOL_t enableCaching;
641
Jeff Johnson295189b2012-06-20 16:38:30 -0700642 //current station is slow. LWM mode is enabled.
643 v_BOOL_t ucLwmModeEnabled;
644 //LWM events is reported when LWM mode is on. Able to send more traffic
645 //under the constraints of uBuffThresholdMax
646 v_BOOL_t ucLwmEventReported;
647
648 //v_U8_t uLwmEventReported;
649
650 /* Flow control fields */
651 //memory used in previous round
652 v_U8_t bmuMemConsumed;
653
654 //the number packets injected in this round
655 v_U32_t uIngress_length;
656
657 //number of packets allowed in current round beforing receiving new FW memory updates
658 v_U32_t uBuffThresholdMax;
659
660
661 // v_U32_t uEgress_length;
662
663 // v_U32_t uIngress_length;
664
665 // v_U32_t uBuffThresholdMax;
666
667 // v_U32_t uBuffThresholdUsed;
668
669 /* Value used to set LWM in FW. Initialized to 1/3* WLAN_STA_BMU_THRESHOLD_MAX
670 In the future, it can be dynamically adjusted if we find the reason to implement
671 such algorithm. */
672 v_U32_t uLwmThreshold;
673
674 //tx disable forced by Riva software
675 v_U16_t fcStaTxDisabled;
676
677 /** HDD buffer status for packet scheduling. Once HDD
678 * stores a new packet in a previously empty queue, it
679 * will call TL interface to set the fields. The fields
680 * will be cleaned by TL when TL can't fetch more packets
681 * from the queue. */
682 // the fields are ucPktPending and ucACMask;
683
684 /* Queue to keep unicast station management frame */
685 vos_list_t pStaManageQ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700686
Jeff Johnson295189b2012-06-20 16:38:30 -0700687 /* 1 means replay check is needed for the station,
688 * 0 means replay check is not needed for the station*/
689 v_BOOL_t ucIsReplayCheckValid;
690
691 /* It contains 48-bit replay counter per TID*/
692 v_U64_t ullReplayCounter[WLANTL_MAX_TID];
693
694 /* It contains no of replay packets found per STA.
695 It is for debugging purpose only.*/
696 v_U32_t ulTotalReplayPacketsDetected;
Jeff Johnson295189b2012-06-20 16:38:30 -0700697
Gopichand Nakkala8b54e912013-03-11 10:44:21 +0530698 /* Set when pairwise key is installed, if ptkInstalled is
699 1 then we have to encrypt the data irrespective of TL
700 state (CONNECTED/AUTHENTICATED) */
701 v_U8_t ptkInstalled;
Gopichand Nakkala8a2b1442013-05-29 15:33:14 +0530702
703 v_U32_t linkCapacity;
Dino Mycle3b9536d2014-07-09 22:05:24 +0530704
Abhishek Singh7cd040e2016-01-07 10:51:04 +0530705#ifdef WLAN_FEATURE_RMC
706 WLANTL_RMC_SESSION *mcastSession[WLANTL_RMC_HASH_TABLE_SIZE];
707 vos_lock_t mcLock;
708#endif
709
Dino Mycle3b9536d2014-07-09 22:05:24 +0530710#ifdef WLAN_FEATURE_LINK_LAYER_STATS
711
712 /* Value of the averaged Data RSSI for this station */
713 v_S7_t rssiDataAvg;
714
715 /* Value of the averaged Data RSSI for this station in BMPS */
716 v_S7_t rssiDataAvgBmps;
717
718 /* Value of the Alpha to calculate Data RSSI average */
719 v_S7_t rssiDataAlpha;
720
721 WLANTL_InterfaceStatsType interfaceStats;
722#endif
Hanumantha Reddy Pothulaee001fc2015-05-26 15:21:53 +0530723 /* BD Rate for transmitting ARP packets */
724 v_U8_t arpRate;
Hanumantha Reddy Pothulae5ab23d2015-09-14 18:08:24 +0530725 v_BOOL_t arpOnWQ5;
Jeff Johnson295189b2012-06-20 16:38:30 -0700726}WLANTL_STAClientType;
727
728/*---------------------------------------------------------------------------
729 BAP Client type
730---------------------------------------------------------------------------*/
731typedef struct
732{
733 /* flag that keeps track of registration; only one non-data BT-AMP client
734 allowed */
735 v_U8_t ucExists;
736
737 /* pointer to the receive processing routine for non-data BT-AMP frames */
738 WLANTL_BAPRxCBType pfnTlBAPRx;
739
740 /* pointer to the flush call back complete function */
741 WLANTL_FlushOpCompCBType pfnFlushOpCompleteCb;
742
743 /* pointer to the non-data BT-AMP frame pending transmission */
744 vos_pkt_t* vosPendingDataBuff;
745
746 /* BAP station ID */
747 v_U8_t ucBAPSTAId;
748}WLANTL_BAPClientType;
749
750
751/*---------------------------------------------------------------------------
752 Management Frame Client type
753---------------------------------------------------------------------------*/
754typedef struct
755{
756 /* flag that keeps track of registration; only one management frame
757 client allowed */
758 v_U8_t ucExists;
759
760 /* pointer to the receive processing routine for management frames */
761 WLANTL_MgmtFrmRxCBType pfnTlMgmtFrmRx;
762
763 /* pointer to the management frame pending transmission */
764 vos_pkt_t* vosPendingDataBuff;
765}WLANTL_MgmtFrmClientType;
766
767typedef struct
768{
769 WLANTL_TrafficStatusChangedCBType trafficCB;
770 WLANTL_HO_TRAFFIC_STATUS_TYPE trafficStatus;
771 v_U32_t idleThreshold;
772 v_U32_t measurePeriod;
773 v_U32_t rtRXFrameCount;
774 v_U32_t rtTXFrameCount;
775 v_U32_t nrtRXFrameCount;
776 v_U32_t nrtTXFrameCount;
777 vos_timer_t trafficTimer;
778 v_PVOID_t usrCtxt;
779} WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE;
780
781typedef struct
782{
783 v_S7_t rssiValue;
784 v_U8_t triggerEvent[WLANTL_HS_NUM_CLIENT];
785 v_PVOID_t usrCtxt[WLANTL_HS_NUM_CLIENT];
786 v_U8_t whoIsClient[WLANTL_HS_NUM_CLIENT];
787 WLANTL_RSSICrossThresholdCBType crossCBFunction[WLANTL_HS_NUM_CLIENT];
788 v_U8_t numClient;
789} WLANTL_HO_RSSI_INDICATION_TYPE;
790
791typedef struct
792{
793 v_U8_t numThreshold;
794 v_U8_t regionNumber;
795 v_S7_t historyRSSI;
796 v_U8_t alpha;
797 v_U32_t sampleTime;
798 v_U32_t fwNotification;
799} WLANTL_CURRENT_HO_STATE_TYPE;
800
801typedef struct
802{
803 WLANTL_HO_RSSI_INDICATION_TYPE registeredInd[WLANTL_MAX_AVAIL_THRESHOLD];
804 WLANTL_CURRENT_HO_STATE_TYPE currentHOState;
805 WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE currentTraffic;
806 v_PVOID_t macCtxt;
807 vos_lock_t hosLock;
808} WLANTL_HO_SUPPORT_TYPE;
809
810/*---------------------------------------------------------------------------
811 TL control block type
812---------------------------------------------------------------------------*/
813typedef struct
814{
815 /* TL configuration information */
816 WLANTL_ConfigInfoType tlConfigInfo;
817
818 /* list of the active stations */
Madan Mohan Koyylamudi3b8400c2013-01-24 17:47:01 +0530819 WLANTL_STAClientType* atlSTAClients[WLAN_MAX_STA_COUNT];
820
Jeff Johnson295189b2012-06-20 16:38:30 -0700821
822 /* information on the management frame client */
823 WLANTL_MgmtFrmClientType tlMgmtFrmClient;
824
825 /* information on the BT AMP client */
826 WLANTL_BAPClientType tlBAPClient;
827
828 /* number of packets sent to BAL waiting for tx complete confirmation */
829 v_U16_t usPendingTxCompleteCount;
830
831 /* global suspend flag */
832 v_U8_t ucTxSuspended;
833
834 /* resource flag */
835 v_U32_t uResCount;
836
837 /* dummy vos buffer - used for chains */
838 vos_pkt_t* vosDummyBuf;
839
840 /* temporary buffer for storing the packet that no longer fits */
841 vos_pkt_t* vosTempBuf;
842
843 /* The value of the station id and AC for the cached buffer */
844 v_U8_t ucCachedSTAId;
845 v_U8_t ucCachedAC;
846
847 /* Last registered STA - until multiple sta support is added this will
848 be used always for tx */
849 v_U8_t ucRegisteredStaId;
850
851 /*Current TL STA used for TX*/
852 v_U8_t ucCurrentSTA;
853
854 WLANTL_REORDER_BUFFER_T *reorderBufferPool; /* Allocate memory for [WLANTL_MAX_BA_SESSION] sessions */
855
856 WLANTL_HO_SUPPORT_TYPE hoSupport;
857
858 v_BOOL_t bUrgent;
859
Jeff Johnson295189b2012-06-20 16:38:30 -0700860
861 /* resource flag */
862 v_U32_t bd_pduResCount;
863
864 /* time interval to evaluate LWM mode*/
865 //vos_timer_t tThresholdSamplingTimer;
866
867#if 0
868 //information fields for flow control
869 tFcTxParams_type tlFCInfo;
870#endif
871
872 vos_pkt_t* vosTxFCBuf;
873
874 /* LWM mode is enabled or not for each station. Bit-wise operation.32 station maximum. */
875 // v_U32_t uStaLwmMask;
876
877 /* LWM event is reported by FW. */
878 // v_U32_t uStaLwmEventReported;
879
880 /** Multiple Station Scheduling and TL queue management.
881 4 HDD BC/MC data packet queue status is specified as Station 0's status. Weights used
882 in WFQ algorith are initialized in WLANTL_OPEN and contained in tlConfigInfo field.
883 Each station has fields of ucPktPending and AC mask to tell whether a AC has traffic
884 or not.
885
886 Stations are served in a round-robin fashion from highest priority to lowest priority.
887 The number of round-robin times of each prioirty equals to the WFQ weights and differetiates
888 the traffic of different prioirty. As such, stations can not provide low priority packets if
889 high priority packets are all served.
890 */
891
892 /* Currently served station id. Reuse ucCurrentSTA field. */
893 //v_U8_t uCurStaId;
894
895 /* Current served station ID in round-robin method to traverse all stations.*/
896 WLANTL_ACEnumType uCurServedAC;
897
Siddharth Bhal4551b102014-10-09 21:36:36 +0530898 WLANTL_SpoofMacAddr spoofMacAddr;
899
Jeff Johnson295189b2012-06-20 16:38:30 -0700900 /* How many weights have not been served in current AC. */
901 v_U8_t ucCurLeftWeight;
902
903 /* BC/MC management queue. Current implementation uses queue size 1. Will check whether
904 size N is supported. */
905 vos_list_t pMCBCManageQ;
906
907 v_U32_t sendFCFrame;
908
909 v_U8_t done_once;
910 v_U8_t uFramesProcThres;
Sunil Ravid5406f22013-01-22 00:18:31 -0800911#ifdef FEATURE_WLAN_TDLS
912 /*number of total TDLS peers registered to TL
913 Incremented at WLANTL_RegisterSTAClient(staType == WLAN_STA_TDLS)
914 Decremented at WLANTL_ClearSTAClient(staType == WLAN_STA_TDLS) */
915 v_U8_t ucTdlsPeerCount;
916#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700917 /*whether we are in BMPS/UAPSD/WOWL mode, since the latter 2 need to be BMPS first*/
918 v_BOOL_t isBMPS;
Gopichand Nakkala11acd112012-12-31 16:04:04 -0800919 /* Whether WDA_DS_TX_START_XMIT msg is pending or not */
920 v_BOOL_t isTxTranmitMsgPending;
Abhishek Singh7cd040e2016-01-07 10:51:04 +0530921
922#ifdef WLAN_FEATURE_RMC
923 WLANTL_RMC_SESSION *rmcSession[WLANTL_RMC_HASH_TABLE_SIZE];
924 vos_lock_t rmcLock;
925 v_U8_t multicastDuplicateDetectionEnabled;
926 v_U8_t rmcDataPathEnabled;
927 v_U32_t mcastDupCnt;
928#endif
Katya Nigame7b69a82015-04-28 15:24:06 +0530929 WLANTL_MonRxCBType pfnMonRx;
930 v_BOOL_t isConversionReq;
931
Jeff Johnson295189b2012-06-20 16:38:30 -0700932}WLANTL_CbType;
933
934/*==========================================================================
935
936 FUNCTION WLANTL_GetFrames
937
938 DESCRIPTION
939
940 BAL calls this function at the request of the lower bus interface.
941 When this request is being received TL will retrieve packets from HDD
942 in accordance with the priority rules and the count supplied by BAL.
943
944 DEPENDENCIES
945
946 HDD must have registered with TL at least one STA before this function
947 can be called.
948
949 PARAMETERS
950
951 IN
952 pAdapter: pointer to the global adapter context; a handle to TL's
953 or BAL's control block can be extracted from its context
954 uSize: maximum size accepted by the lower layer
Jeff Johnson017fdc32013-02-27 09:22:30 -0800955 uFlowMask TX flow control mask. Each bit is defined as
Jeff Johnson295189b2012-06-20 16:38:30 -0700956 WDA_TXFlowEnumType
957
958 OUT
959 vosDataBuff: it will contain a pointer to the first buffer supplied
960 by TL, if there is more than one packet supplied, TL
961 will chain them through vOSS buffers
962
963 RETURN VALUE
964
965 The result code associated with performing the operation
966
967 1 or more: number of required resources if there are still frames to fetch
968 For Volans, it's BD/PDU numbers. For Prima, it's free DXE descriptors.
969 0 : error or HDD queues are drained
970
971 SIDE EFFECTS
972
973============================================================================*/
974v_U32_t
975WLANTL_GetFrames
976(
977 v_PVOID_t pAdapter,
978 vos_pkt_t **ppFrameDataBuff,
979 v_U32_t uSize,
Jeff Johnson295189b2012-06-20 16:38:30 -0700980 v_U8_t uFlowMask,
Jeff Johnson295189b2012-06-20 16:38:30 -0700981 v_BOOL_t* pbUrgent
982);
983
984/*==========================================================================
985
986 FUNCTION WLANTL_TxComp
987
988 DESCRIPTION
989 It is being called by BAL upon asynchronous notification of the packet
990 or packets being sent over the bus.
991
992 DEPENDENCIES
993 Tx complete cannot be called without a previous transmit.
994
995 PARAMETERS
996
997 IN
998 pAdapter: pointer to the global adapter context; a handle to TL's
999 or BAL's control block can be extracted from its context
1000 vosDataBuff: it will contain a pointer to the first buffer for which
1001 the BAL report is being made, if there is more then one
1002 packet they will be chained using vOSS buffers.
1003 wTxSTAtus: the status of the transmitted packet, see above chapter
1004 on HDD interaction for a list of possible values
1005
1006 RETURN VALUE
1007 The result code associated with performing the operation
1008
1009 SIDE EFFECTS
1010
1011============================================================================*/
1012VOS_STATUS
1013WLANTL_TxComp
1014(
1015 v_PVOID_t pAdapter,
1016 vos_pkt_t *pFrameDataBuff,
1017 VOS_STATUS wTxStatus
1018);
1019
1020/*==========================================================================
1021
1022 FUNCTION WLANTL_RxFrames
1023
1024 DESCRIPTION
1025 Callback registered by TL and called by BAL when a packet is received
1026 over the bus. Upon the call of this function TL will make the necessary
1027 decision with regards to the forwarding or queuing of this packet and
1028 the layer it needs to be delivered to.
1029
1030 DEPENDENCIES
1031 TL must be initiailized before this function gets called.
1032 If the frame carried is a data frame then the station for which it is
1033 destined to must have been previously registered with TL.
1034
1035 PARAMETERS
1036
1037 IN
1038 pAdapter: pointer to the global adapter context; a handle to TL's
1039 or BAL's control block can be extracted from its context
1040
1041 vosDataBuff: it will contain a pointer to the first buffer received,
1042 if there is more then one packet they will be chained
1043 using vOSS buffers.
1044
1045 RETURN VALUE
1046 The result code associated with performing the operation
1047
1048 SIDE EFFECTS
1049
1050============================================================================*/
1051VOS_STATUS
1052WLANTL_RxFrames
1053(
1054 v_PVOID_t pAdapter,
1055 vos_pkt_t *pFrameDataBuff
1056);
1057
1058/*==========================================================================
1059
1060 FUNCTION WLANTL_RxCachedFrames
1061
1062 DESCRIPTION
1063 Utility function used by TL to forward the cached frames to a particular
1064 station;
1065
1066 DEPENDENCIES
1067 TL must be initiailized before this function gets called.
1068 If the frame carried is a data frame then the station for which it is
1069 destined to must have been previously registered with TL.
1070
1071 PARAMETERS
1072
1073 IN
1074 pTLCb: pointer to TL handle
1075
1076 ucSTAId: station for which we need to forward the packets
1077
1078 vosDataBuff: it will contain a pointer to the first cached buffer
1079 received, if there is more then one packet they will be
1080 chained using vOSS buffers.
1081
1082 RETURN VALUE
1083 The result code associated with performing the operation
1084
1085 VOS_STATUS_E_INVAL: Input parameters are invalid
1086 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1087 page fault
1088 VOS_STATUS_SUCCESS: Everything is good :)
1089
1090 SIDE EFFECTS
1091
1092============================================================================*/
1093VOS_STATUS
1094WLANTL_RxCachedFrames
1095(
1096 WLANTL_CbType* pTLCb,
1097 v_U8_t ucSTAId,
1098 vos_pkt_t* vosDataBuff
1099);
1100
1101/*==========================================================================
1102 FUNCTION WLANTL_ResourceCB
1103
1104 DESCRIPTION
1105 Called by the TL when it has packets available for transmission.
1106
1107 DEPENDENCIES
1108 The TL must be registered with BAL before this function can be called.
1109
1110 PARAMETERS
1111
1112 IN
1113 pAdapter: pointer to the global adapter context; a handle to TL's
1114 or BAL's control block can be extracted from its context
1115 uCount: avail resource count obtained from hw
1116
1117 RETURN VALUE
1118 The result code associated with performing the operation
1119
1120 SIDE EFFECTS
1121
1122============================================================================*/
1123VOS_STATUS
1124WLANTL_ResourceCB
1125(
1126 v_PVOID_t pAdapter,
1127 v_U32_t uCount
1128);
1129
1130
1131/*==========================================================================
1132 FUNCTION WLANTL_ProcessMainMessage
1133
1134 DESCRIPTION
1135 Called by VOSS when a message was serialized for TL through the
1136 main thread/task.
1137
1138 DEPENDENCIES
1139 The TL must be initialized before this function can be called.
1140
1141 PARAMETERS
1142
1143 IN
1144 pAdapter: pointer to the global adapter context; a handle to TL's
1145 control block can be extracted from its context
1146 message: type and content of the message
1147
1148
1149 RETURN VALUE
1150 The result code associated with performing the operation
1151
1152 SIDE EFFECTS
1153
1154============================================================================*/
1155VOS_STATUS
1156WLANTL_ProcessMainMessage
1157(
1158 v_PVOID_t pAdapter,
1159 vos_msg_t* message
1160);
1161
1162/*==========================================================================
1163 FUNCTION WLANTL_ProcessTxMessage
1164
1165 DESCRIPTION
1166 Called by VOSS when a message was serialized for TL through the
1167 tx thread/task.
1168
1169 DEPENDENCIES
1170 The TL must be initialized before this function can be called.
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 message: type and content of the message
1178
1179
1180 RETURN VALUE
1181
1182 The result code associated with performing the operation
1183 VOS_STATUS_SUCCESS: Everything is good :)
1184
1185
1186 SIDE EFFECTS
1187
1188============================================================================*/
1189VOS_STATUS
1190WLANTL_ProcessTxMessage
1191(
1192 v_PVOID_t pAdapter,
1193 vos_msg_t* message
1194);
1195
1196/*==========================================================================
1197 FUNCTION WLAN_TLGetNextTxIds
1198
1199 DESCRIPTION
1200 Gets the next station and next AC in the list
1201
1202 DEPENDENCIES
1203
1204 PARAMETERS
1205
1206 OUT
1207 pucSTAId: STAtion ID
1208
1209 RETURN VALUE
1210 The result code associated with performing the operation
1211
1212 SIDE EFFECTS
1213
1214============================================================================*/
1215VOS_STATUS
1216WLAN_TLGetNextTxIds
1217(
1218 v_PVOID_t pAdapter,
1219 v_U8_t* pucSTAId
1220);
1221
1222/*==========================================================================
1223
1224 FUNCTION WLANTL_CleanCb
1225
1226 DESCRIPTION
1227 Cleans TL control block
1228
1229 DEPENDENCIES
1230
1231 PARAMETERS
1232
1233 IN
1234 pTLCb: pointer to TL's control block
1235 ucEmpty: set if TL has to clean up the queues and release pedning pkts
1236
1237 RETURN VALUE
1238 The result code associated with performing the operation
1239
1240 SIDE EFFECTS
1241
1242============================================================================*/
1243VOS_STATUS
1244WLANTL_CleanCB
1245(
1246 WLANTL_CbType* pTLCb,
1247 v_U8_t ucEmpty
1248);
1249
1250/*==========================================================================
1251
1252 FUNCTION WLANTL_CleanSTA
1253
1254 DESCRIPTION
1255 Cleans a station control block.
1256
1257 DEPENDENCIES
1258
1259 PARAMETERS
1260
1261 IN
1262 pAdapter: pointer to the global adapter context; a handle to TL's
1263 control block can be extracted from its context
1264 ucEmpty: if set the queues and pending pkts will be emptyed
1265
1266 RETURN VALUE
1267 The result code associated with performing the operation
1268
1269 SIDE EFFECTS
1270
1271============================================================================*/
1272VOS_STATUS
1273WLANTL_CleanSTA
1274(
1275 WLANTL_STAClientType* ptlSTAClient,
1276 v_U8_t ucEmpty
1277);
1278
1279/*==========================================================================
1280 FUNCTION WLANTL_GetTxResourcesCB
1281
1282 DESCRIPTION
1283 Processing function for Resource needed signal. A request will be issued
1284 to BAL to get mor tx resources.
1285
1286 DEPENDENCIES
1287 The TL must be initialized before this function can be called.
1288
1289 PARAMETERS
1290
1291 IN
1292 pvosGCtx: pointer to the global vos context; a handle to TL's
1293 control block can be extracted from its context
1294
1295
1296 RETURN VALUE
1297 The result code associated with performing the operation
1298
1299 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1300 page fault
1301 VOS_STATUS_SUCCESS: Everything is good :)
1302
1303 Other values can be returned as a result of a function call, please check
1304 corresponding API for more info.
1305 SIDE EFFECTS
1306
1307============================================================================*/
1308VOS_STATUS
1309WLANTL_GetTxResourcesCB
1310(
1311 v_PVOID_t pvosGCtx
1312);
1313
1314/*==========================================================================
1315 FUNCTION WLANTL_PrepareBDHeader
1316
1317 DESCRIPTION
1318 Callback function for serializing Suspend signal through Tx thread
1319
1320 DEPENDENCIES
1321 Just notify HAL that suspend in TL is complete.
1322
1323 PARAMETERS
1324
1325 IN
1326 pAdapter: pointer to the global adapter context; a handle to TL's
1327 control block can be extracted from its context
1328 pUserData: user data sent with the callback
1329
1330 RETURN VALUE
1331 The result code associated with performing the operation
1332
1333 SIDE EFFECTS
1334
1335============================================================================*/
1336void
1337WLANTL_PrepareBDHeader
1338(
1339 vos_pkt_t* vosDataBuff,
1340 v_PVOID_t* ppvBDHeader,
1341 v_MACADDR_t* pvDestMacAdddr,
1342 v_U8_t ucDisableFrmXtl,
1343 VOS_STATUS* pvosSTAtus,
1344 v_U16_t* usPktLen,
1345 v_U8_t ucQosEnabled,
1346 v_U8_t ucWDSEnabled,
1347 v_U8_t extraHeadSpace
1348);
1349
1350/*==========================================================================
1351 FUNCTION WLANTL_Translate8023To80211Header
1352
1353 DESCRIPTION
1354 Inline function for translating and 802.3 header into an 802.11 header.
1355
1356 DEPENDENCIES
1357
1358
1359 PARAMETERS
1360
1361 IN
1362 pTLCb: TL control block
Kiran Venkatappaa044eb92012-12-17 15:48:49 -08001363
1364 *pucStaId Station ID. In case of TDLS, this return the actual
1365 station index used to transmit.
Jeff Johnson295189b2012-06-20 16:38:30 -07001366
1367 IN/OUT
1368 vosDataBuff: vos data buffer, will contain the new header on output
1369
1370 OUT
1371 pvosStatus: status of the operation
1372
1373 RETURN VALUE
1374 No return.
1375
1376 SIDE EFFECTS
1377
1378============================================================================*/
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001379VOS_STATUS
1380WLANTL_Translate8023To80211Header
1381(
1382 vos_pkt_t* vosDataBuff,
1383 VOS_STATUS* pvosStatus,
1384 WLANTL_CbType* pTLCb,
1385 v_U8_t *pucStaId,
Ravi Joshid0699502013-07-08 15:48:47 -07001386 WLANTL_MetaInfoType* pTlMetaInfo,
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001387 v_U8_t *ucWDSEnabled,
1388 v_U8_t *extraHeadSpace
1389);
Jeff Johnson295189b2012-06-20 16:38:30 -07001390/*==========================================================================
1391 FUNCTION WLANTL_Translate80211To8023Header
1392
1393 DESCRIPTION
1394 Inline function for translating and 802.11 header into an 802.3 header.
1395
1396 DEPENDENCIES
1397
1398
1399 PARAMETERS
1400
1401 IN
1402 pTLCb: TL control block
1403 ucStaId: station ID
1404 ucHeaderLen: Length of the header from BD
1405 ucActualHLen: Length of header including padding or any other trailers
1406
1407 IN/OUT
1408 vosDataBuff: vos data buffer, will contain the new header on output
1409
1410 OUT
1411 pvosStatus: status of the operation
1412
1413 RETURN VALUE
1414 Status of the operation
1415
1416 SIDE EFFECTS
1417
1418============================================================================*/
1419VOS_STATUS
1420WLANTL_Translate80211To8023Header
1421(
1422 vos_pkt_t* vosDataBuff,
1423 VOS_STATUS* pvosStatus,
Jeff Johnson017fdc32013-02-27 09:22:30 -08001424 v_U16_t usActualHLen,
Jeff Johnson295189b2012-06-20 16:38:30 -07001425 v_U8_t ucHeaderLen,
1426 WLANTL_CbType* pTLCb,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001427 v_U8_t ucSTAId,
Katya Nigame7b69a82015-04-28 15:24:06 +05301428 v_BOOL_t bForwardIAPPwithLLC
Jeff Johnson295189b2012-06-20 16:38:30 -07001429);
1430
Katya Nigame7b69a82015-04-28 15:24:06 +05301431VOS_STATUS
1432WLANTL_MonTranslate80211To8023Header
1433(
1434 vos_pkt_t* vosDataBuff,
1435 WLANTL_CbType* pTLCb
1436);
Jeff Johnson295189b2012-06-20 16:38:30 -07001437/*==========================================================================
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -08001438 FUNCTION WLANTL_FindFrameTypeBcMcUc
1439
1440 DESCRIPTION
1441 Utility function to find whether received frame is broadcast, multicast
1442 or unicast.
1443
1444 DEPENDENCIES
1445 The STA must be registered with TL before this function can be called.
1446
1447 PARAMETERS
1448
1449 IN
1450 pTLCb: pointer to the TL's control block
1451 ucSTAId: identifier of the station being processed
1452 vosDataBuff: pointer to the vos buffer
1453
1454 IN/OUT
1455 pucBcMcUc: pointer to buffer, will contain frame type on return
1456
1457 RETURN VALUE
1458 The result code associated with performing the operation
1459
1460 VOS_STATUS_E_INVAL: invalid input parameters
1461 VOS_STATUS_E_BADMSG: failed to extract info from data buffer
1462 VOS_STATUS_SUCCESS: success
1463
1464 SIDE EFFECTS
1465 None.
1466============================================================================*/
1467VOS_STATUS
1468WLANTL_FindFrameTypeBcMcUc
1469(
1470 WLANTL_CbType *pTLCb,
1471 v_U8_t ucSTAId,
1472 vos_pkt_t *vosDataBuff,
1473 v_U8_t *pucBcMcUc
1474);
1475
1476/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -07001477
1478 FUNCTION WLANTL_MgmtFrmRxDefaultCb
1479
1480 DESCRIPTION
1481 Default Mgmt Frm rx callback: asserts all the time. If this function gets
1482 called it means there is no registered rx cb pointer for Mgmt Frm.
1483
1484 DEPENDENCIES
1485
1486 PARAMETERS
1487
1488 Not used.
1489
1490 RETURN VALUE
1491 Always FAILURE.
1492
1493============================================================================*/
1494VOS_STATUS
1495WLANTL_MgmtFrmRxDefaultCb
1496(
1497 v_PVOID_t pAdapter,
1498 v_PVOID_t vosBuff
1499);
1500
1501/*==========================================================================
1502
1503 FUNCTION WLANTL_STARxDefaultCb
1504
1505 DESCRIPTION
1506 Default BAP rx callback: asserts all the time. If this function gets
1507 called it means there is no registered rx cb pointer for BAP.
1508
1509 DEPENDENCIES
1510
1511 PARAMETERS
1512
1513 Not used.
1514
1515 RETURN VALUE
1516 Always FAILURE.
1517
1518============================================================================*/
1519VOS_STATUS
1520WLANTL_BAPRxDefaultCb
1521(
1522 v_PVOID_t pAdapter,
1523 vos_pkt_t* vosDataBuff,
1524 WLANTL_BAPFrameEnumType frameType
1525);
1526
1527/*==========================================================================
1528
1529 FUNCTION WLANTL_STARxDefaultCb
1530
1531 DESCRIPTION
1532 Default STA rx callback: asserts all the time. If this function gets
1533 called it means there is no registered rx cb pointer for station.
1534 (Mem corruption most likely, it should never happen)
1535
1536 DEPENDENCIES
1537
1538 PARAMETERS
1539
1540 Not used.
1541
1542 RETURN VALUE
1543 Always FAILURE.
1544
1545============================================================================*/
1546VOS_STATUS
1547WLANTL_STARxDefaultCb
1548(
1549 v_PVOID_t pAdapter,
1550 vos_pkt_t* vosDataBuff,
1551 v_U8_t ucSTAId,
1552 WLANTL_RxMetaInfoType* pRxMetaInfo
1553);
1554
1555/*==========================================================================
1556
1557 FUNCTION WLANTL_STAFetchPktDefaultCb
1558
1559 DESCRIPTION
1560 Default fetch callback: asserts all the time. If this function gets
1561 called it means there is no registered fetch cb pointer for station.
1562 (Mem corruption most likely, it should never happen)
1563
1564 DEPENDENCIES
1565
1566 PARAMETERS
1567
1568 Not used.
1569
1570 RETURN VALUE
1571 Always FAILURE.
1572
1573============================================================================*/
1574VOS_STATUS
1575WLANTL_STAFetchPktDefaultCb
1576(
1577 v_PVOID_t pAdapter,
1578 v_U8_t* pucSTAId,
1579 WLANTL_ACEnumType ucAC,
1580 vos_pkt_t** vosDataBuff,
1581 WLANTL_MetaInfoType* tlMetaInfo
1582);
1583
1584/*==========================================================================
1585
1586 FUNCTION WLANTL_TxCompDefaultCb
1587
1588 DESCRIPTION
1589 Default tx complete handler. It will release the completed pkt to
1590 prevent memory leaks.
1591
1592 PARAMETERS
1593
1594 IN
1595 pAdapter: pointer to the global adapter context; a handle to
1596 TL/HAL/PE/BAP/HDD control block can be extracted from
1597 its context
1598 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1599 wTxSTAtus: status of the transmission
1600
1601
1602 RETURN VALUE
1603 The result code associated with performing the operation; please
1604 check vos_pkt_return_pkt for possible error codes.
1605
1606============================================================================*/
1607VOS_STATUS
1608WLANTL_TxCompDefaultCb
1609(
1610 v_PVOID_t pAdapter,
1611 vos_pkt_t* vosDataBuff,
1612 VOS_STATUS wTxSTAtus
1613);
1614
1615/*==========================================================================
1616
1617 FUNCTION WLANTL_PackUpTriggerFrame
1618
1619 DESCRIPTION
1620 Packs up a trigger frame and places it in TL's cache for tx and notifies
1621 BAL
1622
1623 DEPENDENCIES
1624
1625 PARAMETERS
1626
1627 IN
1628 pTLCb: pointer to the TL control block
1629 pfnSTATxComp: Tx Complete Cb to be used when frame is received
1630 ucSTAId: station id
1631 ucAC: access category
1632
1633 RETURN VALUE
1634 None
1635
1636 SIDE EFFECTS
1637
1638============================================================================*/
1639VOS_STATUS
1640WLANTL_PackUpTriggerFrame
1641(
1642 WLANTL_CbType* pTLCb,
1643 WLANTL_TxCompCBType pfnSTATxComp,
1644 v_U8_t ucSTAId,
1645 WLANTL_ACEnumType ucAC
1646);
1647
1648/*==========================================================================
1649
1650 FUNCTION WLANTL_TxCompTriggFrameSI
1651
1652 DESCRIPTION
1653 Tx complete handler for the service interval trigger frame.
1654 It will restart the SI timer.
1655
1656 PARAMETERS
1657
1658 IN
1659 pvosGCtx: pointer to the global vos context; a handle to
1660 TL/HAL/PE/BAP/HDD control block can be extracted from
1661 its context
1662 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1663 wTxSTAtus: status of the transmission
1664
1665
1666 RETURN VALUE
1667 The result code associated with performing the operation
1668
1669 ============================================================================*/
1670VOS_STATUS
1671WLANTL_TxCompTriggFrameSI
1672(
1673 v_PVOID_t pvosGCtx,
1674 vos_pkt_t* vosDataBuff,
1675 VOS_STATUS wTxSTAtus
1676);
1677
1678/*==========================================================================
1679
1680 FUNCTION WLANTL_TxCompTriggFrameSI
1681
1682 DESCRIPTION
1683 Tx complete handler for the service interval trigger frame.
1684 It will restart the SI timer.
1685
1686 PARAMETERS
1687
1688 IN
1689 pvosGCtx: pointer to the global vos context; a handle to
1690 TL/HAL/PE/BAP/HDD control block can be extracted from
1691 its context
1692 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1693 wTxSTAtus: status of the transmission
1694
1695
1696 RETURN VALUE
1697 The result code associated with performing the operation
1698
1699============================================================================*/
1700VOS_STATUS
1701WLANTL_TxCompTriggFrameDI
1702(
1703 v_PVOID_t pvosGCtx,
1704 vos_pkt_t* vosDataBuff,
1705 VOS_STATUS wTxSTAtus
1706);
1707
1708/*==========================================================================
1709
1710 FUNCTION
1711
1712 DESCRIPTION Read RSSI value out of a RX BD
1713
1714 PARAMETERS: Caller must validate all parameters
1715
1716 RETURN VALUE
1717
1718============================================================================*/
1719VOS_STATUS WLANTL_ReadRSSI
1720(
1721 v_PVOID_t pAdapter,
1722 v_PVOID_t pBDHeader,
1723 v_U8_t STAid
1724);
1725
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301726/*==========================================================================
1727
1728 FUNCTION
1729
1730 DESCRIPTION Read SNR value out of a RX BD
1731
1732 PARAMETERS: Caller must validate all parameters
1733
1734 RETURN VALUE
1735
1736============================================================================*/
1737VOS_STATUS WLANTL_ReadSNR
1738(
1739 v_PVOID_t pAdapter,
1740 v_PVOID_t pBDHeader,
1741 v_U8_t STAid
1742);
Jeff Johnson295189b2012-06-20 16:38:30 -07001743
1744
1745void WLANTL_PowerStateChangedCB
1746(
1747 v_PVOID_t pAdapter,
1748 tPmcState newState
1749);
1750
Jeff Johnson295189b2012-06-20 16:38:30 -07001751/*==========================================================================
Jeff Johnson017fdc32013-02-27 09:22:30 -08001752 FUNCTION WLANTL_FwdPktToHDD
Jeff Johnson295189b2012-06-20 16:38:30 -07001753
1754 DESCRIPTION
1755 Determine the Destation Station ID and route the Frame to Upper Layer
1756
1757 DEPENDENCIES
1758
1759 PARAMETERS
1760
1761 IN
1762 pvosGCtx: pointer to the global vos context; a handle to TL's
1763 control block can be extracted from its context
1764 ucSTAId: identifier of the station being processed
1765 vosDataBuff: pointer to the rx vos buffer
1766
1767 RETURN VALUE
1768 The result code associated with performing the operation
1769
1770 VOS_STATUS_E_INVAL: invalid input parameters
1771 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1772 page fault
1773 VOS_STATUS_SUCCESS: Everything is good :)
1774
1775 SIDE EFFECTS
1776
1777============================================================================*/
1778
1779VOS_STATUS
1780WLANTL_FwdPktToHDD
1781(
1782 v_PVOID_t pvosGCtx,
1783 vos_pkt_t* pvosDataBuff,
1784 v_U8_t ucSTAId
1785);
1786
Abhishek Singh7cd040e2016-01-07 10:51:04 +05301787#ifdef WLAN_FEATURE_RMC
1788VOS_STATUS WLANTL_RmcInit
1789(
1790 v_PVOID_t pAdapter
1791);
1792
1793VOS_STATUS WLANTL_RmcDeInit
1794(
1795 v_PVOID_t pAdapter
1796);
1797
1798
1799tANI_U8 WLANTL_RmcHashRmcSession ( v_MACADDR_t *pMcastAddr );
1800
1801
1802WLANTL_RMC_SESSION *WLANTL_RmcLookUpRmcSession
1803(
1804 WLANTL_RMC_SESSION *rmcSession[],
1805 v_MACADDR_t *pMcastAddr
1806);
1807
1808WLANTL_RMC_SESSION *WLANTL_RmcAddRmcSession
1809(
1810 WLANTL_RMC_SESSION *rmcSession[],
1811 v_MACADDR_t *pMcastAddr
1812);
1813
1814tANI_U8
1815WLANTL_RmcDeleteRmcSession
1816(
1817 WLANTL_RMC_SESSION *rmcSession[],
1818 v_MACADDR_t *pMcastAddr
1819);
1820
1821VOS_STATUS
1822WLANTL_ProcessRmcCommand
1823(
1824 WLANTL_CbType* pTLCb,
1825 v_MACADDR_t *pMcastAddr,
1826 tANI_U32 command
1827);
1828
1829/*=============================================================================
1830 FUNCTION WLANTL_IsDuplicateMcastFrm
1831
1832 DESCRIPTION
1833 This function checks for duplicast multicast frames and drops them.
1834
1835 DEPENDENCIES
1836
1837 PARAMETERS
1838
1839 IN
1840
1841 pClientSTA : Pointer to WLANTL_STAClientType
1842 aucBDHeader : Pointer to BD header
1843
1844 RETURN VALUE
1845
1846 VOS_FALSE: This frame is not a duplicate
1847
1848 VOS_TRUE: This frame is a duplicate
1849
1850==============================================================================*/
1851v_U8_t
1852WLANTL_IsDuplicateMcastFrm
1853(
1854 WLANTL_STAClientType *pClientSTA,
1855 vos_pkt_t* vosDataBuff
1856);
1857
1858/*=============================================================================
1859 FUNCTION WLANTL_McastDeleteAllEntries
1860
1861 DESCRIPTION
1862 This function removes all multicast entries used for duplicate detection
1863
1864 DEPENDENCIES
1865
1866 PARAMETERS
1867
1868 IN
1869
1870 pClientSTA : Pointer to WLANTL_STAClientType
1871
1872 RETURN VALUE
1873
1874 None
1875
1876==============================================================================*/
1877void
1878WLANTL_McastDeleteAllEntries(WLANTL_STAClientType * pClientSTA);
1879
1880#endif /*WLAN_FEATURE_RMC*/
1881
Jeff Johnson295189b2012-06-20 16:38:30 -07001882#endif /* #ifndef WLAN_QCT_TLI_H */