blob: da5f3e41d58bad137d86f9c3aedcef570207852b [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
522 /* Reordering information for the STA */
523 WLANTL_BAReorderType atlBAReorderInfo[WLAN_MAX_TID];
524
525 /* STA Descriptor, contains information related to the new added STA */
526 WLAN_STADescType wSTADesc;
527
528 /* Current connectivity state of the STA */
529 WLANTL_STAStateType tlState;
530
531 /* Station priority */
532 WLANTL_STAPriorityType tlPri;
533
534 /* Value of the averaged RSSI for this station */
535 v_S7_t rssiAvg;
536
537 /* Value of the averaged RSSI for this station in BMPS */
538 v_S7_t rssiAvgBmps;
539
Shailender Karmuchi13c0d082013-03-26 14:41:39 -0700540 /* Value of the Alpha to calculate RSSI average */
541 v_S7_t rssiAlpha;
542
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 /* Value of the averaged RSSI for this station */
544 v_U32_t uLinkQualityAvg;
545
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530546 /* Sum of SNR for snrIdx number of consecutive frames */
547 v_U32_t snrSum;
548
549 /* Number of consecutive frames over which snrSum is calculated */
550 v_S7_t snrIdx;
551
552 /* Average SNR of previous 20 frames */
553 v_S7_t prevSnrAvg;
554
555 /* Average SNR returned by fw */
556 v_S7_t snrAvgBmps;
557
Jeff Johnson295189b2012-06-20 16:38:30 -0700558 /* Tx packet count per station per TID */
559 v_U32_t auTxCount[WLAN_MAX_TID];
560
561 /* Rx packet count per station per TID */
562 v_U32_t auRxCount[WLAN_MAX_TID];
563
564 /* Suspend flag */
565 v_U8_t ucTxSuspended;
566
567 /* Pointer to the AMSDU chain maintained by the AMSDU de-aggregation
568 completion sub-module */
569 vos_pkt_t* vosAMSDUChainRoot;
570
571 /* Pointer to the root of the chain */
572 vos_pkt_t* vosAMSDUChain;
573
574 /* Used for saving/restoring frame header for 802.3/11 AMSDU sub-frames */
575 v_U8_t aucMPDUHeader[WLANTL_MPDU_HEADER_LEN];
576
577 /* length of the header */
578 v_U8_t ucMPDUHeaderLen;
579
580 /* Enabled ACs currently serviced by TL (automatic setup in TL)*/
581 v_U8_t aucACMask[WLANTL_MAX_AC];
582
583 /* Current AC to be retrieved */
584 WLANTL_ACEnumType ucCurrentAC;
585
586 /*Packet pending flag - set if tx is pending for the station*/
587 v_U8_t ucPktPending;
Jeff Johnson017fdc32013-02-27 09:22:30 -0800588
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700589 /*EAPOL Packet pending flag - set if EAPOL packet is pending for the station*/
590 v_U8_t ucEapolPktPending;
591
Jeff Johnson017fdc32013-02-27 09:22:30 -0800592 /*used on tx packet to signal when there is no more data to tx for the
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 moment=> packets can be passed to BAL */
594 v_U8_t ucNoMoreData;
595
596 /* Last serviced AC to be retrieved */
597 WLANTL_ACEnumType ucServicedAC;
598
599 /* Current weight for the AC */
600 v_U8_t ucCurrentWeight;
601
602 /* Info used for UAPSD trigger frame generation */
603 WLANTL_UAPSDInfoType wUAPSDInfo[WLANTL_MAX_AC];
604
605 /* flag to signal if a trigger frames is pending */
606 v_U8_t ucPendingTrigFrm;
607
608 WLANTL_TRANSFER_STA_TYPE trafficStatistics;
609
610 /*Members needed for packet caching in TL*/
611 /*Begining of the cached packets chain*/
612 vos_pkt_t* vosBegCachedFrame;
613
614 /*Begining of the cached packets chain*/
615 vos_pkt_t* vosEndCachedFrame;
616
Mihir Sheteb7337272014-04-11 15:53:08 +0530617 WLANTL_CacheInfoType tlCacheInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700618 /* LWM related fields */
619
Katya Nigam63902932014-06-26 19:04:23 +0530620 v_BOOL_t enableCaching;
621
Jeff Johnson295189b2012-06-20 16:38:30 -0700622 //current station is slow. LWM mode is enabled.
623 v_BOOL_t ucLwmModeEnabled;
624 //LWM events is reported when LWM mode is on. Able to send more traffic
625 //under the constraints of uBuffThresholdMax
626 v_BOOL_t ucLwmEventReported;
627
628 //v_U8_t uLwmEventReported;
629
630 /* Flow control fields */
631 //memory used in previous round
632 v_U8_t bmuMemConsumed;
633
634 //the number packets injected in this round
635 v_U32_t uIngress_length;
636
637 //number of packets allowed in current round beforing receiving new FW memory updates
638 v_U32_t uBuffThresholdMax;
639
640
641 // v_U32_t uEgress_length;
642
643 // v_U32_t uIngress_length;
644
645 // v_U32_t uBuffThresholdMax;
646
647 // v_U32_t uBuffThresholdUsed;
648
649 /* Value used to set LWM in FW. Initialized to 1/3* WLAN_STA_BMU_THRESHOLD_MAX
650 In the future, it can be dynamically adjusted if we find the reason to implement
651 such algorithm. */
652 v_U32_t uLwmThreshold;
653
654 //tx disable forced by Riva software
655 v_U16_t fcStaTxDisabled;
656
657 /** HDD buffer status for packet scheduling. Once HDD
658 * stores a new packet in a previously empty queue, it
659 * will call TL interface to set the fields. The fields
660 * will be cleaned by TL when TL can't fetch more packets
661 * from the queue. */
662 // the fields are ucPktPending and ucACMask;
663
664 /* Queue to keep unicast station management frame */
665 vos_list_t pStaManageQ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700666
Jeff Johnson295189b2012-06-20 16:38:30 -0700667 /* 1 means replay check is needed for the station,
668 * 0 means replay check is not needed for the station*/
669 v_BOOL_t ucIsReplayCheckValid;
670
671 /* It contains 48-bit replay counter per TID*/
672 v_U64_t ullReplayCounter[WLANTL_MAX_TID];
673
674 /* It contains no of replay packets found per STA.
675 It is for debugging purpose only.*/
676 v_U32_t ulTotalReplayPacketsDetected;
Jeff Johnson295189b2012-06-20 16:38:30 -0700677
Gopichand Nakkala8b54e912013-03-11 10:44:21 +0530678 /* Set when pairwise key is installed, if ptkInstalled is
679 1 then we have to encrypt the data irrespective of TL
680 state (CONNECTED/AUTHENTICATED) */
681 v_U8_t ptkInstalled;
Gopichand Nakkala8a2b1442013-05-29 15:33:14 +0530682
683 v_U32_t linkCapacity;
Dino Mycle3b9536d2014-07-09 22:05:24 +0530684
685#ifdef WLAN_FEATURE_LINK_LAYER_STATS
686
687 /* Value of the averaged Data RSSI for this station */
688 v_S7_t rssiDataAvg;
689
690 /* Value of the averaged Data RSSI for this station in BMPS */
691 v_S7_t rssiDataAvgBmps;
692
693 /* Value of the Alpha to calculate Data RSSI average */
694 v_S7_t rssiDataAlpha;
695
696 WLANTL_InterfaceStatsType interfaceStats;
697#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700698}WLANTL_STAClientType;
699
700/*---------------------------------------------------------------------------
701 BAP Client type
702---------------------------------------------------------------------------*/
703typedef struct
704{
705 /* flag that keeps track of registration; only one non-data BT-AMP client
706 allowed */
707 v_U8_t ucExists;
708
709 /* pointer to the receive processing routine for non-data BT-AMP frames */
710 WLANTL_BAPRxCBType pfnTlBAPRx;
711
712 /* pointer to the flush call back complete function */
713 WLANTL_FlushOpCompCBType pfnFlushOpCompleteCb;
714
715 /* pointer to the non-data BT-AMP frame pending transmission */
716 vos_pkt_t* vosPendingDataBuff;
717
718 /* BAP station ID */
719 v_U8_t ucBAPSTAId;
720}WLANTL_BAPClientType;
721
722
723/*---------------------------------------------------------------------------
724 Management Frame Client type
725---------------------------------------------------------------------------*/
726typedef struct
727{
728 /* flag that keeps track of registration; only one management frame
729 client allowed */
730 v_U8_t ucExists;
731
732 /* pointer to the receive processing routine for management frames */
733 WLANTL_MgmtFrmRxCBType pfnTlMgmtFrmRx;
734
735 /* pointer to the management frame pending transmission */
736 vos_pkt_t* vosPendingDataBuff;
737}WLANTL_MgmtFrmClientType;
738
739typedef struct
740{
741 WLANTL_TrafficStatusChangedCBType trafficCB;
742 WLANTL_HO_TRAFFIC_STATUS_TYPE trafficStatus;
743 v_U32_t idleThreshold;
744 v_U32_t measurePeriod;
745 v_U32_t rtRXFrameCount;
746 v_U32_t rtTXFrameCount;
747 v_U32_t nrtRXFrameCount;
748 v_U32_t nrtTXFrameCount;
749 vos_timer_t trafficTimer;
750 v_PVOID_t usrCtxt;
751} WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE;
752
753typedef struct
754{
755 v_S7_t rssiValue;
756 v_U8_t triggerEvent[WLANTL_HS_NUM_CLIENT];
757 v_PVOID_t usrCtxt[WLANTL_HS_NUM_CLIENT];
758 v_U8_t whoIsClient[WLANTL_HS_NUM_CLIENT];
759 WLANTL_RSSICrossThresholdCBType crossCBFunction[WLANTL_HS_NUM_CLIENT];
760 v_U8_t numClient;
761} WLANTL_HO_RSSI_INDICATION_TYPE;
762
763typedef struct
764{
765 v_U8_t numThreshold;
766 v_U8_t regionNumber;
767 v_S7_t historyRSSI;
768 v_U8_t alpha;
769 v_U32_t sampleTime;
770 v_U32_t fwNotification;
771} WLANTL_CURRENT_HO_STATE_TYPE;
772
773typedef struct
774{
775 WLANTL_HO_RSSI_INDICATION_TYPE registeredInd[WLANTL_MAX_AVAIL_THRESHOLD];
776 WLANTL_CURRENT_HO_STATE_TYPE currentHOState;
777 WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE currentTraffic;
778 v_PVOID_t macCtxt;
779 vos_lock_t hosLock;
780} WLANTL_HO_SUPPORT_TYPE;
781
782/*---------------------------------------------------------------------------
783 TL control block type
784---------------------------------------------------------------------------*/
785typedef struct
786{
787 /* TL configuration information */
788 WLANTL_ConfigInfoType tlConfigInfo;
789
790 /* list of the active stations */
Madan Mohan Koyylamudi3b8400c2013-01-24 17:47:01 +0530791 WLANTL_STAClientType* atlSTAClients[WLAN_MAX_STA_COUNT];
792
Jeff Johnson295189b2012-06-20 16:38:30 -0700793
794 /* information on the management frame client */
795 WLANTL_MgmtFrmClientType tlMgmtFrmClient;
796
797 /* information on the BT AMP client */
798 WLANTL_BAPClientType tlBAPClient;
799
800 /* number of packets sent to BAL waiting for tx complete confirmation */
801 v_U16_t usPendingTxCompleteCount;
802
803 /* global suspend flag */
804 v_U8_t ucTxSuspended;
805
806 /* resource flag */
807 v_U32_t uResCount;
808
809 /* dummy vos buffer - used for chains */
810 vos_pkt_t* vosDummyBuf;
811
812 /* temporary buffer for storing the packet that no longer fits */
813 vos_pkt_t* vosTempBuf;
814
815 /* The value of the station id and AC for the cached buffer */
816 v_U8_t ucCachedSTAId;
817 v_U8_t ucCachedAC;
818
819 /* Last registered STA - until multiple sta support is added this will
820 be used always for tx */
821 v_U8_t ucRegisteredStaId;
822
823 /*Current TL STA used for TX*/
824 v_U8_t ucCurrentSTA;
825
826 WLANTL_REORDER_BUFFER_T *reorderBufferPool; /* Allocate memory for [WLANTL_MAX_BA_SESSION] sessions */
827
828 WLANTL_HO_SUPPORT_TYPE hoSupport;
829
830 v_BOOL_t bUrgent;
831
Jeff Johnson295189b2012-06-20 16:38:30 -0700832
833 /* resource flag */
834 v_U32_t bd_pduResCount;
835
836 /* time interval to evaluate LWM mode*/
837 //vos_timer_t tThresholdSamplingTimer;
838
839#if 0
840 //information fields for flow control
841 tFcTxParams_type tlFCInfo;
842#endif
843
844 vos_pkt_t* vosTxFCBuf;
845
846 /* LWM mode is enabled or not for each station. Bit-wise operation.32 station maximum. */
847 // v_U32_t uStaLwmMask;
848
849 /* LWM event is reported by FW. */
850 // v_U32_t uStaLwmEventReported;
851
852 /** Multiple Station Scheduling and TL queue management.
853 4 HDD BC/MC data packet queue status is specified as Station 0's status. Weights used
854 in WFQ algorith are initialized in WLANTL_OPEN and contained in tlConfigInfo field.
855 Each station has fields of ucPktPending and AC mask to tell whether a AC has traffic
856 or not.
857
858 Stations are served in a round-robin fashion from highest priority to lowest priority.
859 The number of round-robin times of each prioirty equals to the WFQ weights and differetiates
860 the traffic of different prioirty. As such, stations can not provide low priority packets if
861 high priority packets are all served.
862 */
863
864 /* Currently served station id. Reuse ucCurrentSTA field. */
865 //v_U8_t uCurStaId;
866
867 /* Current served station ID in round-robin method to traverse all stations.*/
868 WLANTL_ACEnumType uCurServedAC;
869
Siddharth Bhal4551b102014-10-09 21:36:36 +0530870 WLANTL_SpoofMacAddr spoofMacAddr;
871
Jeff Johnson295189b2012-06-20 16:38:30 -0700872 /* How many weights have not been served in current AC. */
873 v_U8_t ucCurLeftWeight;
874
875 /* BC/MC management queue. Current implementation uses queue size 1. Will check whether
876 size N is supported. */
877 vos_list_t pMCBCManageQ;
878
879 v_U32_t sendFCFrame;
880
881 v_U8_t done_once;
882 v_U8_t uFramesProcThres;
Sunil Ravid5406f22013-01-22 00:18:31 -0800883#ifdef FEATURE_WLAN_TDLS
884 /*number of total TDLS peers registered to TL
885 Incremented at WLANTL_RegisterSTAClient(staType == WLAN_STA_TDLS)
886 Decremented at WLANTL_ClearSTAClient(staType == WLAN_STA_TDLS) */
887 v_U8_t ucTdlsPeerCount;
888#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700889 /*whether we are in BMPS/UAPSD/WOWL mode, since the latter 2 need to be BMPS first*/
890 v_BOOL_t isBMPS;
Gopichand Nakkala11acd112012-12-31 16:04:04 -0800891 /* Whether WDA_DS_TX_START_XMIT msg is pending or not */
892 v_BOOL_t isTxTranmitMsgPending;
Jeff Johnson295189b2012-06-20 16:38:30 -0700893}WLANTL_CbType;
894
895/*==========================================================================
896
897 FUNCTION WLANTL_GetFrames
898
899 DESCRIPTION
900
901 BAL calls this function at the request of the lower bus interface.
902 When this request is being received TL will retrieve packets from HDD
903 in accordance with the priority rules and the count supplied by BAL.
904
905 DEPENDENCIES
906
907 HDD must have registered with TL at least one STA before this function
908 can be called.
909
910 PARAMETERS
911
912 IN
913 pAdapter: pointer to the global adapter context; a handle to TL's
914 or BAL's control block can be extracted from its context
915 uSize: maximum size accepted by the lower layer
Jeff Johnson017fdc32013-02-27 09:22:30 -0800916 uFlowMask TX flow control mask. Each bit is defined as
Jeff Johnson295189b2012-06-20 16:38:30 -0700917 WDA_TXFlowEnumType
918
919 OUT
920 vosDataBuff: it will contain a pointer to the first buffer supplied
921 by TL, if there is more than one packet supplied, TL
922 will chain them through vOSS buffers
923
924 RETURN VALUE
925
926 The result code associated with performing the operation
927
928 1 or more: number of required resources if there are still frames to fetch
929 For Volans, it's BD/PDU numbers. For Prima, it's free DXE descriptors.
930 0 : error or HDD queues are drained
931
932 SIDE EFFECTS
933
934============================================================================*/
935v_U32_t
936WLANTL_GetFrames
937(
938 v_PVOID_t pAdapter,
939 vos_pkt_t **ppFrameDataBuff,
940 v_U32_t uSize,
Jeff Johnson295189b2012-06-20 16:38:30 -0700941 v_U8_t uFlowMask,
Jeff Johnson295189b2012-06-20 16:38:30 -0700942 v_BOOL_t* pbUrgent
943);
944
945/*==========================================================================
946
947 FUNCTION WLANTL_TxComp
948
949 DESCRIPTION
950 It is being called by BAL upon asynchronous notification of the packet
951 or packets being sent over the bus.
952
953 DEPENDENCIES
954 Tx complete cannot be called without a previous transmit.
955
956 PARAMETERS
957
958 IN
959 pAdapter: pointer to the global adapter context; a handle to TL's
960 or BAL's control block can be extracted from its context
961 vosDataBuff: it will contain a pointer to the first buffer for which
962 the BAL report is being made, if there is more then one
963 packet they will be chained using vOSS buffers.
964 wTxSTAtus: the status of the transmitted packet, see above chapter
965 on HDD interaction for a list of possible values
966
967 RETURN VALUE
968 The result code associated with performing the operation
969
970 SIDE EFFECTS
971
972============================================================================*/
973VOS_STATUS
974WLANTL_TxComp
975(
976 v_PVOID_t pAdapter,
977 vos_pkt_t *pFrameDataBuff,
978 VOS_STATUS wTxStatus
979);
980
981/*==========================================================================
982
983 FUNCTION WLANTL_RxFrames
984
985 DESCRIPTION
986 Callback registered by TL and called by BAL when a packet is received
987 over the bus. Upon the call of this function TL will make the necessary
988 decision with regards to the forwarding or queuing of this packet and
989 the layer it needs to be delivered to.
990
991 DEPENDENCIES
992 TL must be initiailized before this function gets called.
993 If the frame carried is a data frame then the station for which it is
994 destined to must have been previously registered with TL.
995
996 PARAMETERS
997
998 IN
999 pAdapter: pointer to the global adapter context; a handle to TL's
1000 or BAL's control block can be extracted from its context
1001
1002 vosDataBuff: it will contain a pointer to the first buffer received,
1003 if there is more then one packet they will be chained
1004 using vOSS buffers.
1005
1006 RETURN VALUE
1007 The result code associated with performing the operation
1008
1009 SIDE EFFECTS
1010
1011============================================================================*/
1012VOS_STATUS
1013WLANTL_RxFrames
1014(
1015 v_PVOID_t pAdapter,
1016 vos_pkt_t *pFrameDataBuff
1017);
1018
1019/*==========================================================================
1020
1021 FUNCTION WLANTL_RxCachedFrames
1022
1023 DESCRIPTION
1024 Utility function used by TL to forward the cached frames to a particular
1025 station;
1026
1027 DEPENDENCIES
1028 TL must be initiailized before this function gets called.
1029 If the frame carried is a data frame then the station for which it is
1030 destined to must have been previously registered with TL.
1031
1032 PARAMETERS
1033
1034 IN
1035 pTLCb: pointer to TL handle
1036
1037 ucSTAId: station for which we need to forward the packets
1038
1039 vosDataBuff: it will contain a pointer to the first cached buffer
1040 received, if there is more then one packet they will be
1041 chained using vOSS buffers.
1042
1043 RETURN VALUE
1044 The result code associated with performing the operation
1045
1046 VOS_STATUS_E_INVAL: Input parameters are invalid
1047 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1048 page fault
1049 VOS_STATUS_SUCCESS: Everything is good :)
1050
1051 SIDE EFFECTS
1052
1053============================================================================*/
1054VOS_STATUS
1055WLANTL_RxCachedFrames
1056(
1057 WLANTL_CbType* pTLCb,
1058 v_U8_t ucSTAId,
1059 vos_pkt_t* vosDataBuff
1060);
1061
1062/*==========================================================================
1063 FUNCTION WLANTL_ResourceCB
1064
1065 DESCRIPTION
1066 Called by the TL when it has packets available for transmission.
1067
1068 DEPENDENCIES
1069 The TL must be registered with BAL before this function can be called.
1070
1071 PARAMETERS
1072
1073 IN
1074 pAdapter: pointer to the global adapter context; a handle to TL's
1075 or BAL's control block can be extracted from its context
1076 uCount: avail resource count obtained from hw
1077
1078 RETURN VALUE
1079 The result code associated with performing the operation
1080
1081 SIDE EFFECTS
1082
1083============================================================================*/
1084VOS_STATUS
1085WLANTL_ResourceCB
1086(
1087 v_PVOID_t pAdapter,
1088 v_U32_t uCount
1089);
1090
1091
1092/*==========================================================================
1093 FUNCTION WLANTL_ProcessMainMessage
1094
1095 DESCRIPTION
1096 Called by VOSS when a message was serialized for TL through the
1097 main thread/task.
1098
1099 DEPENDENCIES
1100 The TL must be initialized before this function can be called.
1101
1102 PARAMETERS
1103
1104 IN
1105 pAdapter: pointer to the global adapter context; a handle to TL's
1106 control block can be extracted from its context
1107 message: type and content of the message
1108
1109
1110 RETURN VALUE
1111 The result code associated with performing the operation
1112
1113 SIDE EFFECTS
1114
1115============================================================================*/
1116VOS_STATUS
1117WLANTL_ProcessMainMessage
1118(
1119 v_PVOID_t pAdapter,
1120 vos_msg_t* message
1121);
1122
1123/*==========================================================================
1124 FUNCTION WLANTL_ProcessTxMessage
1125
1126 DESCRIPTION
1127 Called by VOSS when a message was serialized for TL through the
1128 tx thread/task.
1129
1130 DEPENDENCIES
1131 The TL must be initialized before this function can be called.
1132
1133 PARAMETERS
1134
1135 IN
1136 pAdapter: pointer to the global adapter context; a handle to TL's
1137 control block can be extracted from its context
1138 message: type and content of the message
1139
1140
1141 RETURN VALUE
1142
1143 The result code associated with performing the operation
1144 VOS_STATUS_SUCCESS: Everything is good :)
1145
1146
1147 SIDE EFFECTS
1148
1149============================================================================*/
1150VOS_STATUS
1151WLANTL_ProcessTxMessage
1152(
1153 v_PVOID_t pAdapter,
1154 vos_msg_t* message
1155);
1156
1157/*==========================================================================
1158 FUNCTION WLAN_TLGetNextTxIds
1159
1160 DESCRIPTION
1161 Gets the next station and next AC in the list
1162
1163 DEPENDENCIES
1164
1165 PARAMETERS
1166
1167 OUT
1168 pucSTAId: STAtion ID
1169
1170 RETURN VALUE
1171 The result code associated with performing the operation
1172
1173 SIDE EFFECTS
1174
1175============================================================================*/
1176VOS_STATUS
1177WLAN_TLGetNextTxIds
1178(
1179 v_PVOID_t pAdapter,
1180 v_U8_t* pucSTAId
1181);
1182
1183/*==========================================================================
1184
1185 FUNCTION WLANTL_CleanCb
1186
1187 DESCRIPTION
1188 Cleans TL control block
1189
1190 DEPENDENCIES
1191
1192 PARAMETERS
1193
1194 IN
1195 pTLCb: pointer to TL's control block
1196 ucEmpty: set if TL has to clean up the queues and release pedning pkts
1197
1198 RETURN VALUE
1199 The result code associated with performing the operation
1200
1201 SIDE EFFECTS
1202
1203============================================================================*/
1204VOS_STATUS
1205WLANTL_CleanCB
1206(
1207 WLANTL_CbType* pTLCb,
1208 v_U8_t ucEmpty
1209);
1210
1211/*==========================================================================
1212
1213 FUNCTION WLANTL_CleanSTA
1214
1215 DESCRIPTION
1216 Cleans a station control block.
1217
1218 DEPENDENCIES
1219
1220 PARAMETERS
1221
1222 IN
1223 pAdapter: pointer to the global adapter context; a handle to TL's
1224 control block can be extracted from its context
1225 ucEmpty: if set the queues and pending pkts will be emptyed
1226
1227 RETURN VALUE
1228 The result code associated with performing the operation
1229
1230 SIDE EFFECTS
1231
1232============================================================================*/
1233VOS_STATUS
1234WLANTL_CleanSTA
1235(
1236 WLANTL_STAClientType* ptlSTAClient,
1237 v_U8_t ucEmpty
1238);
1239
1240/*==========================================================================
1241 FUNCTION WLANTL_GetTxResourcesCB
1242
1243 DESCRIPTION
1244 Processing function for Resource needed signal. A request will be issued
1245 to BAL to get mor tx resources.
1246
1247 DEPENDENCIES
1248 The TL must be initialized before this function can be called.
1249
1250 PARAMETERS
1251
1252 IN
1253 pvosGCtx: pointer to the global vos context; a handle to TL's
1254 control block can be extracted from its context
1255
1256
1257 RETURN VALUE
1258 The result code associated with performing the operation
1259
1260 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1261 page fault
1262 VOS_STATUS_SUCCESS: Everything is good :)
1263
1264 Other values can be returned as a result of a function call, please check
1265 corresponding API for more info.
1266 SIDE EFFECTS
1267
1268============================================================================*/
1269VOS_STATUS
1270WLANTL_GetTxResourcesCB
1271(
1272 v_PVOID_t pvosGCtx
1273);
1274
1275/*==========================================================================
1276 FUNCTION WLANTL_PrepareBDHeader
1277
1278 DESCRIPTION
1279 Callback function for serializing Suspend signal through Tx thread
1280
1281 DEPENDENCIES
1282 Just notify HAL that suspend in TL is complete.
1283
1284 PARAMETERS
1285
1286 IN
1287 pAdapter: pointer to the global adapter context; a handle to TL's
1288 control block can be extracted from its context
1289 pUserData: user data sent with the callback
1290
1291 RETURN VALUE
1292 The result code associated with performing the operation
1293
1294 SIDE EFFECTS
1295
1296============================================================================*/
1297void
1298WLANTL_PrepareBDHeader
1299(
1300 vos_pkt_t* vosDataBuff,
1301 v_PVOID_t* ppvBDHeader,
1302 v_MACADDR_t* pvDestMacAdddr,
1303 v_U8_t ucDisableFrmXtl,
1304 VOS_STATUS* pvosSTAtus,
1305 v_U16_t* usPktLen,
1306 v_U8_t ucQosEnabled,
1307 v_U8_t ucWDSEnabled,
1308 v_U8_t extraHeadSpace
1309);
1310
1311/*==========================================================================
1312 FUNCTION WLANTL_Translate8023To80211Header
1313
1314 DESCRIPTION
1315 Inline function for translating and 802.3 header into an 802.11 header.
1316
1317 DEPENDENCIES
1318
1319
1320 PARAMETERS
1321
1322 IN
1323 pTLCb: TL control block
Kiran Venkatappaa044eb92012-12-17 15:48:49 -08001324
1325 *pucStaId Station ID. In case of TDLS, this return the actual
1326 station index used to transmit.
Jeff Johnson295189b2012-06-20 16:38:30 -07001327
1328 IN/OUT
1329 vosDataBuff: vos data buffer, will contain the new header on output
1330
1331 OUT
1332 pvosStatus: status of the operation
1333
1334 RETURN VALUE
1335 No return.
1336
1337 SIDE EFFECTS
1338
1339============================================================================*/
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001340VOS_STATUS
1341WLANTL_Translate8023To80211Header
1342(
1343 vos_pkt_t* vosDataBuff,
1344 VOS_STATUS* pvosStatus,
1345 WLANTL_CbType* pTLCb,
1346 v_U8_t *pucStaId,
Ravi Joshid0699502013-07-08 15:48:47 -07001347 WLANTL_MetaInfoType* pTlMetaInfo,
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001348 v_U8_t *ucWDSEnabled,
1349 v_U8_t *extraHeadSpace
1350);
Jeff Johnson295189b2012-06-20 16:38:30 -07001351/*==========================================================================
1352 FUNCTION WLANTL_Translate80211To8023Header
1353
1354 DESCRIPTION
1355 Inline function for translating and 802.11 header into an 802.3 header.
1356
1357 DEPENDENCIES
1358
1359
1360 PARAMETERS
1361
1362 IN
1363 pTLCb: TL control block
1364 ucStaId: station ID
1365 ucHeaderLen: Length of the header from BD
1366 ucActualHLen: Length of header including padding or any other trailers
1367
1368 IN/OUT
1369 vosDataBuff: vos data buffer, will contain the new header on output
1370
1371 OUT
1372 pvosStatus: status of the operation
1373
1374 RETURN VALUE
1375 Status of the operation
1376
1377 SIDE EFFECTS
1378
1379============================================================================*/
1380VOS_STATUS
1381WLANTL_Translate80211To8023Header
1382(
1383 vos_pkt_t* vosDataBuff,
1384 VOS_STATUS* pvosStatus,
Jeff Johnson017fdc32013-02-27 09:22:30 -08001385 v_U16_t usActualHLen,
Jeff Johnson295189b2012-06-20 16:38:30 -07001386 v_U8_t ucHeaderLen,
1387 WLANTL_CbType* pTLCb,
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001388 v_U8_t ucSTAId,
1389 v_BOOL_t bForwardIAPPwithLLC
Jeff Johnson295189b2012-06-20 16:38:30 -07001390);
1391
1392/*==========================================================================
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -08001393 FUNCTION WLANTL_FindFrameTypeBcMcUc
1394
1395 DESCRIPTION
1396 Utility function to find whether received frame is broadcast, multicast
1397 or unicast.
1398
1399 DEPENDENCIES
1400 The STA must be registered with TL before this function can be called.
1401
1402 PARAMETERS
1403
1404 IN
1405 pTLCb: pointer to the TL's control block
1406 ucSTAId: identifier of the station being processed
1407 vosDataBuff: pointer to the vos buffer
1408
1409 IN/OUT
1410 pucBcMcUc: pointer to buffer, will contain frame type on return
1411
1412 RETURN VALUE
1413 The result code associated with performing the operation
1414
1415 VOS_STATUS_E_INVAL: invalid input parameters
1416 VOS_STATUS_E_BADMSG: failed to extract info from data buffer
1417 VOS_STATUS_SUCCESS: success
1418
1419 SIDE EFFECTS
1420 None.
1421============================================================================*/
1422VOS_STATUS
1423WLANTL_FindFrameTypeBcMcUc
1424(
1425 WLANTL_CbType *pTLCb,
1426 v_U8_t ucSTAId,
1427 vos_pkt_t *vosDataBuff,
1428 v_U8_t *pucBcMcUc
1429);
1430
1431/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -07001432
1433 FUNCTION WLANTL_MgmtFrmRxDefaultCb
1434
1435 DESCRIPTION
1436 Default Mgmt Frm rx callback: asserts all the time. If this function gets
1437 called it means there is no registered rx cb pointer for Mgmt Frm.
1438
1439 DEPENDENCIES
1440
1441 PARAMETERS
1442
1443 Not used.
1444
1445 RETURN VALUE
1446 Always FAILURE.
1447
1448============================================================================*/
1449VOS_STATUS
1450WLANTL_MgmtFrmRxDefaultCb
1451(
1452 v_PVOID_t pAdapter,
1453 v_PVOID_t vosBuff
1454);
1455
1456/*==========================================================================
1457
1458 FUNCTION WLANTL_STARxDefaultCb
1459
1460 DESCRIPTION
1461 Default BAP rx callback: asserts all the time. If this function gets
1462 called it means there is no registered rx cb pointer for BAP.
1463
1464 DEPENDENCIES
1465
1466 PARAMETERS
1467
1468 Not used.
1469
1470 RETURN VALUE
1471 Always FAILURE.
1472
1473============================================================================*/
1474VOS_STATUS
1475WLANTL_BAPRxDefaultCb
1476(
1477 v_PVOID_t pAdapter,
1478 vos_pkt_t* vosDataBuff,
1479 WLANTL_BAPFrameEnumType frameType
1480);
1481
1482/*==========================================================================
1483
1484 FUNCTION WLANTL_STARxDefaultCb
1485
1486 DESCRIPTION
1487 Default STA rx callback: asserts all the time. If this function gets
1488 called it means there is no registered rx cb pointer for station.
1489 (Mem corruption most likely, it should never happen)
1490
1491 DEPENDENCIES
1492
1493 PARAMETERS
1494
1495 Not used.
1496
1497 RETURN VALUE
1498 Always FAILURE.
1499
1500============================================================================*/
1501VOS_STATUS
1502WLANTL_STARxDefaultCb
1503(
1504 v_PVOID_t pAdapter,
1505 vos_pkt_t* vosDataBuff,
1506 v_U8_t ucSTAId,
1507 WLANTL_RxMetaInfoType* pRxMetaInfo
1508);
1509
1510/*==========================================================================
1511
1512 FUNCTION WLANTL_STAFetchPktDefaultCb
1513
1514 DESCRIPTION
1515 Default fetch callback: asserts all the time. If this function gets
1516 called it means there is no registered fetch cb pointer for station.
1517 (Mem corruption most likely, it should never happen)
1518
1519 DEPENDENCIES
1520
1521 PARAMETERS
1522
1523 Not used.
1524
1525 RETURN VALUE
1526 Always FAILURE.
1527
1528============================================================================*/
1529VOS_STATUS
1530WLANTL_STAFetchPktDefaultCb
1531(
1532 v_PVOID_t pAdapter,
1533 v_U8_t* pucSTAId,
1534 WLANTL_ACEnumType ucAC,
1535 vos_pkt_t** vosDataBuff,
1536 WLANTL_MetaInfoType* tlMetaInfo
1537);
1538
1539/*==========================================================================
1540
1541 FUNCTION WLANTL_TxCompDefaultCb
1542
1543 DESCRIPTION
1544 Default tx complete handler. It will release the completed pkt to
1545 prevent memory leaks.
1546
1547 PARAMETERS
1548
1549 IN
1550 pAdapter: pointer to the global adapter context; a handle to
1551 TL/HAL/PE/BAP/HDD control block can be extracted from
1552 its context
1553 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1554 wTxSTAtus: status of the transmission
1555
1556
1557 RETURN VALUE
1558 The result code associated with performing the operation; please
1559 check vos_pkt_return_pkt for possible error codes.
1560
1561============================================================================*/
1562VOS_STATUS
1563WLANTL_TxCompDefaultCb
1564(
1565 v_PVOID_t pAdapter,
1566 vos_pkt_t* vosDataBuff,
1567 VOS_STATUS wTxSTAtus
1568);
1569
1570/*==========================================================================
1571
1572 FUNCTION WLANTL_PackUpTriggerFrame
1573
1574 DESCRIPTION
1575 Packs up a trigger frame and places it in TL's cache for tx and notifies
1576 BAL
1577
1578 DEPENDENCIES
1579
1580 PARAMETERS
1581
1582 IN
1583 pTLCb: pointer to the TL control block
1584 pfnSTATxComp: Tx Complete Cb to be used when frame is received
1585 ucSTAId: station id
1586 ucAC: access category
1587
1588 RETURN VALUE
1589 None
1590
1591 SIDE EFFECTS
1592
1593============================================================================*/
1594VOS_STATUS
1595WLANTL_PackUpTriggerFrame
1596(
1597 WLANTL_CbType* pTLCb,
1598 WLANTL_TxCompCBType pfnSTATxComp,
1599 v_U8_t ucSTAId,
1600 WLANTL_ACEnumType ucAC
1601);
1602
1603/*==========================================================================
1604
1605 FUNCTION WLANTL_TxCompTriggFrameSI
1606
1607 DESCRIPTION
1608 Tx complete handler for the service interval trigger frame.
1609 It will restart the SI timer.
1610
1611 PARAMETERS
1612
1613 IN
1614 pvosGCtx: pointer to the global vos context; a handle to
1615 TL/HAL/PE/BAP/HDD control block can be extracted from
1616 its context
1617 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1618 wTxSTAtus: status of the transmission
1619
1620
1621 RETURN VALUE
1622 The result code associated with performing the operation
1623
1624 ============================================================================*/
1625VOS_STATUS
1626WLANTL_TxCompTriggFrameSI
1627(
1628 v_PVOID_t pvosGCtx,
1629 vos_pkt_t* vosDataBuff,
1630 VOS_STATUS wTxSTAtus
1631);
1632
1633/*==========================================================================
1634
1635 FUNCTION WLANTL_TxCompTriggFrameSI
1636
1637 DESCRIPTION
1638 Tx complete handler for the service interval trigger frame.
1639 It will restart the SI timer.
1640
1641 PARAMETERS
1642
1643 IN
1644 pvosGCtx: pointer to the global vos context; a handle to
1645 TL/HAL/PE/BAP/HDD control block can be extracted from
1646 its context
1647 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1648 wTxSTAtus: status of the transmission
1649
1650
1651 RETURN VALUE
1652 The result code associated with performing the operation
1653
1654============================================================================*/
1655VOS_STATUS
1656WLANTL_TxCompTriggFrameDI
1657(
1658 v_PVOID_t pvosGCtx,
1659 vos_pkt_t* vosDataBuff,
1660 VOS_STATUS wTxSTAtus
1661);
1662
1663/*==========================================================================
1664
1665 FUNCTION
1666
1667 DESCRIPTION Read RSSI value out of a RX BD
1668
1669 PARAMETERS: Caller must validate all parameters
1670
1671 RETURN VALUE
1672
1673============================================================================*/
1674VOS_STATUS WLANTL_ReadRSSI
1675(
1676 v_PVOID_t pAdapter,
1677 v_PVOID_t pBDHeader,
1678 v_U8_t STAid
1679);
1680
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301681/*==========================================================================
1682
1683 FUNCTION
1684
1685 DESCRIPTION Read SNR value out of a RX BD
1686
1687 PARAMETERS: Caller must validate all parameters
1688
1689 RETURN VALUE
1690
1691============================================================================*/
1692VOS_STATUS WLANTL_ReadSNR
1693(
1694 v_PVOID_t pAdapter,
1695 v_PVOID_t pBDHeader,
1696 v_U8_t STAid
1697);
Jeff Johnson295189b2012-06-20 16:38:30 -07001698
1699
1700void WLANTL_PowerStateChangedCB
1701(
1702 v_PVOID_t pAdapter,
1703 tPmcState newState
1704);
1705
Jeff Johnson295189b2012-06-20 16:38:30 -07001706/*==========================================================================
Jeff Johnson017fdc32013-02-27 09:22:30 -08001707 FUNCTION WLANTL_FwdPktToHDD
Jeff Johnson295189b2012-06-20 16:38:30 -07001708
1709 DESCRIPTION
1710 Determine the Destation Station ID and route the Frame to Upper Layer
1711
1712 DEPENDENCIES
1713
1714 PARAMETERS
1715
1716 IN
1717 pvosGCtx: pointer to the global vos context; a handle to TL's
1718 control block can be extracted from its context
1719 ucSTAId: identifier of the station being processed
1720 vosDataBuff: pointer to the rx vos buffer
1721
1722 RETURN VALUE
1723 The result code associated with performing the operation
1724
1725 VOS_STATUS_E_INVAL: invalid input parameters
1726 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1727 page fault
1728 VOS_STATUS_SUCCESS: Everything is good :)
1729
1730 SIDE EFFECTS
1731
1732============================================================================*/
1733
1734VOS_STATUS
1735WLANTL_FwdPktToHDD
1736(
1737 v_PVOID_t pvosGCtx,
1738 vos_pkt_t* pvosDataBuff,
1739 v_U8_t ucSTAId
1740);
1741
Jeff Johnson295189b2012-06-20 16:38:30 -07001742#endif /* #ifndef WLAN_QCT_TLI_H */