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