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