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