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