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