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