blob: adf841a9da0f145d07833e53bc77ec2b5d13dd7b [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
250/* Check whether Rx frame is LS or EAPOL packet (other than data) */
251#define WLANTL_BAP_IS_NON_DATA_PKT_TYPE(usType) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800252 ((WLANTL_BT_AMP_TYPE_AR == usType) || (WLANTL_BT_AMP_TYPE_SEC == usType) || \
253 (WLANTL_BT_AMP_TYPE_LS_REQ == usType) || (WLANTL_BT_AMP_TYPE_LS_REP == usType))
Jeff Johnson295189b2012-06-20 16:38:30 -0700254
255/*---------------------------------------------------------------------------
256 TL signals for TX thread
257---------------------------------------------------------------------------*/
258typedef enum
259{
260 /*Suspend signal - following serialization of a HAL suspend request*/
261 WLANTL_TX_SIG_SUSPEND = 0,
262
263 /*Res need signal - triggered when all pending TxComp have been received
264 and TL is low on resources*/
265 WLANTL_TX_RES_NEEDED = 1,
266
267 /* Forwarding RX cached frames */
268 WLANTL_TX_FWD_CACHED = 2,
269
270 /* Serialized STAID AC Indication */
271 WLANTL_TX_STAID_AC_IND = 3,
272
273 /* Serialzie TX transmit request */
274 WLANTL_TX_START_XMIT = 4,
275
276 /* Serialzie Finish UL Authentication request */
277 WLANTL_FINISH_ULA = 5,
278
Madan Mohan Koyyalamudia96f5442013-05-10 11:32:06 +0530279 /* Serialized Snapshot request indication */
280 WLANTL_TX_SNAPSHOT = 6,
281
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 WLANTL_TX_MAX
283}WLANTL_TxSignalsType;
284
285/*---------------------------------------------------------------------------
286 STA Event type
287---------------------------------------------------------------------------*/
288typedef enum
289{
290 /* Transmit frame event */
291 WLANTL_TX_EVENT = 0,
292
293 /* Receive frame event */
294 WLANTL_RX_EVENT = 1,
295
296 WLANTL_MAX_EVENT
297}WLANTL_STAEventType;
298
299/*---------------------------------------------------------------------------
300
301 DESCRIPTION
302 State machine used by transport layer for receiving or transmitting
303 packets.
304
305 PARAMETERS
306
307 IN
308 pAdapter: pointer to the global adapter context; a handle to TL's
309 control block can be extracted from its context
310 ucSTAId: identifier of the station being processed
311 vosDataBuff: pointer to the tx/rx vos buffer
312
313 RETURN VALUE
314 The result code associated with performing the operation
315
316---------------------------------------------------------------------------*/
317typedef VOS_STATUS (*WLANTL_STAFuncType)( v_PVOID_t pAdapter,
318 v_U8_t ucSTAId,
319 vos_pkt_t** pvosDataBuff);
320
321/*---------------------------------------------------------------------------
322 STA FSM Entry type
323---------------------------------------------------------------------------*/
324typedef struct
325{
326 WLANTL_STAFuncType pfnSTATbl[WLANTL_MAX_EVENT];
327} WLANTL_STAFsmEntryType;
328
329/* Receive in connected state - only EAPOL or WAI*/
330VOS_STATUS WLANTL_STARxConn( v_PVOID_t pAdapter,
331 v_U8_t ucSTAId,
332 vos_pkt_t** pvosDataBuff );
333
334/* Transmit in connected state - only EAPOL or WAI*/
335VOS_STATUS WLANTL_STATxConn( v_PVOID_t pAdapter,
336 v_U8_t ucSTAId,
337 vos_pkt_t** pvosDataBuff );
338
339/* Receive in authenticated state - all data allowed*/
340VOS_STATUS WLANTL_STARxAuth( v_PVOID_t pAdapter,
341 v_U8_t ucSTAId,
342 vos_pkt_t** pvosDataBuff );
343
344/* Transmit in authenticated state - all data allowed*/
345VOS_STATUS WLANTL_STATxAuth( v_PVOID_t pAdapter,
346 v_U8_t ucSTAId,
347 vos_pkt_t** pvosDataBuff );
348
349/* Receive in disconnected state - no data allowed*/
350VOS_STATUS WLANTL_STARxDisc( v_PVOID_t pAdapter,
351 v_U8_t ucSTAId,
352 vos_pkt_t** pvosDataBuff );
353
354/* Transmit in disconnected state - no data allowed*/
355VOS_STATUS WLANTL_STATxDisc( v_PVOID_t pAdapter,
356 v_U8_t ucSTAId,
357 vos_pkt_t** pvosDataBuff );
358
359/* TL State Machine */
360STATIC const WLANTL_STAFsmEntryType tlSTAFsm[WLANTL_STA_MAX_STATE] =
361{
362 /* WLANTL_STA_INIT */
363 { {
364 NULL, /* WLANTL_TX_EVENT - no packets should get transmitted*/
365 NULL, /* WLANTL_RX_EVENT - no packets should be received - drop*/
366 } },
367
368 /* WLANTL_STA_CONNECTED */
369 { {
370 WLANTL_STATxConn, /* WLANTL_TX_EVENT - only EAPoL or WAI frames are allowed*/
371 WLANTL_STARxConn, /* WLANTL_RX_EVENT - only EAPoL or WAI frames can be rx*/
372 } },
373
374 /* WLANTL_STA_AUTHENTICATED */
375 { {
376 WLANTL_STATxAuth, /* WLANTL_TX_EVENT - all data frames allowed*/
377 WLANTL_STARxAuth, /* WLANTL_RX_EVENT - all data frames can be rx */
378 } },
379
380 /* WLANTL_STA_DISCONNECTED */
381 { {
382 WLANTL_STATxDisc, /* WLANTL_TX_EVENT - do nothing */
383 WLANTL_STARxDisc, /* WLANTL_RX_EVENT - frames will still be fwd-ed*/
384 } }
385};
386
387/*---------------------------------------------------------------------------
388 Reordering information
389---------------------------------------------------------------------------*/
390
391#define WLANTL_MAX_WINSIZE 64
392#define WLANTL_MAX_BA_SESSION 40
393
394typedef struct
395{
396 v_BOOL_t isAvailable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700397 v_U64_t ullReplayCounter[WLANTL_MAX_WINSIZE];
Jeff Johnson295189b2012-06-20 16:38:30 -0700398 v_PVOID_t arrayBuffer[WLANTL_MAX_WINSIZE];
399} WLANTL_REORDER_BUFFER_T;
400
401
402/* To handle Frame Q aging, timer is needed
403 * After timer expired, Qed frames have to be routed to upper layer
404 * WLANTL_TIMER_EXPIER_UDATA_T is user data type for timer callback
405 */
406typedef struct
407{
408 /* Global contect, HAL, HDD need this */
409 v_PVOID_t pAdapter;
410
411 /* TL context handle */
412 v_PVOID_t pTLHandle;
413
414 /* Current STAID, to know STA context */
415 v_U32_t STAID;
416
417 v_U8_t TID;
418} WLANTL_TIMER_EXPIER_UDATA_T;
419
420typedef struct
421{
422 /*specifies if re-order session exists*/
423 v_U8_t ucExists;
424
425 /* Current Index */
426 v_U32_t ucCIndex;
427
428 /* Count of the total packets in list*/
429 v_U16_t usCount;
430
431 /* vos ttimer to handle Qed frames aging */
432 vos_timer_t agingTimer;
433
434 /* Q windoe size */
435 v_U32_t winSize;
436
437 /* Available RX frame buffer size */
438 v_U32_t bufferSize;
439
440 /* Start Sequence number */
441 v_U32_t SSN;
442
443 /* BA session ID, generate by HAL */
444 v_U32_t sessionID;
445
446 v_U32_t currentESN;
447
448 v_U32_t pendingFramesCount;
449
450 vos_lock_t reorderLock;
451
452 /* Aging timer callback user data */
453 WLANTL_TIMER_EXPIER_UDATA_T timerUdata;
454
455 WLANTL_REORDER_BUFFER_T *reorderBuffer;
456}WLANTL_BAReorderType;
457
458
459/*---------------------------------------------------------------------------
460 UAPSD information
461---------------------------------------------------------------------------*/
462typedef struct
463{
464 /* flag set when a UAPSD session with triggers generated in fw is being set*/
465 v_U8_t ucSet;
466}WLANTL_UAPSDInfoType;
467
468/*---------------------------------------------------------------------------
469 STA Client type
470---------------------------------------------------------------------------*/
471typedef struct
472{
473 /* Flag that keeps track of registration; only one STA with unique
474 ID allowed */
475 v_U8_t ucExists;
476
477 /*The flag controls the Rx path for the station - as long as there are
478 packets at sta level that need to be fwd-ed the Rx path will be blocked,
479 it will become unblocked only when the cached frames were fwd-ed;
480 while the rx path is blocked all rx-ed frames for that STA will be cached
481 */
482 v_U8_t ucRxBlocked;
483
484 /* Function pointer to the receive packet handler from HDD */
485 WLANTL_STARxCBType pfnSTARx;
486
487 /* Function pointer to the transmit complete confirmation handler
488 from HDD */
489 WLANTL_TxCompCBType pfnSTATxComp;
490
491 /* Function pointer to the packet retrieval routine in HDD */
492 WLANTL_STAFetchPktCBType pfnSTAFetchPkt;
493
494 /* Reordering information for the STA */
495 WLANTL_BAReorderType atlBAReorderInfo[WLAN_MAX_TID];
496
497 /* STA Descriptor, contains information related to the new added STA */
498 WLAN_STADescType wSTADesc;
499
500 /* Current connectivity state of the STA */
501 WLANTL_STAStateType tlState;
502
503 /* Station priority */
504 WLANTL_STAPriorityType tlPri;
505
506 /* Value of the averaged RSSI for this station */
507 v_S7_t rssiAvg;
508
509 /* Value of the averaged RSSI for this station in BMPS */
510 v_S7_t rssiAvgBmps;
511
Shailender Karmuchi13c0d082013-03-26 14:41:39 -0700512 /* Value of the Alpha to calculate RSSI average */
513 v_S7_t rssiAlpha;
514
Jeff Johnson295189b2012-06-20 16:38:30 -0700515 /* Value of the averaged RSSI for this station */
516 v_U32_t uLinkQualityAvg;
517
518 /* Tx packet count per station per TID */
519 v_U32_t auTxCount[WLAN_MAX_TID];
520
521 /* Rx packet count per station per TID */
522 v_U32_t auRxCount[WLAN_MAX_TID];
523
524 /* Suspend flag */
525 v_U8_t ucTxSuspended;
526
527 /* Pointer to the AMSDU chain maintained by the AMSDU de-aggregation
528 completion sub-module */
529 vos_pkt_t* vosAMSDUChainRoot;
530
531 /* Pointer to the root of the chain */
532 vos_pkt_t* vosAMSDUChain;
533
534 /* Used for saving/restoring frame header for 802.3/11 AMSDU sub-frames */
535 v_U8_t aucMPDUHeader[WLANTL_MPDU_HEADER_LEN];
536
537 /* length of the header */
538 v_U8_t ucMPDUHeaderLen;
539
540 /* Enabled ACs currently serviced by TL (automatic setup in TL)*/
541 v_U8_t aucACMask[WLANTL_MAX_AC];
542
543 /* Current AC to be retrieved */
544 WLANTL_ACEnumType ucCurrentAC;
545
546 /*Packet pending flag - set if tx is pending for the station*/
547 v_U8_t ucPktPending;
Jeff Johnson017fdc32013-02-27 09:22:30 -0800548
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700549 /*EAPOL Packet pending flag - set if EAPOL packet is pending for the station*/
550 v_U8_t ucEapolPktPending;
551
Jeff Johnson017fdc32013-02-27 09:22:30 -0800552 /*used on tx packet to signal when there is no more data to tx for the
Jeff Johnson295189b2012-06-20 16:38:30 -0700553 moment=> packets can be passed to BAL */
554 v_U8_t ucNoMoreData;
555
556 /* Last serviced AC to be retrieved */
557 WLANTL_ACEnumType ucServicedAC;
558
559 /* Current weight for the AC */
560 v_U8_t ucCurrentWeight;
561
562 /* Info used for UAPSD trigger frame generation */
563 WLANTL_UAPSDInfoType wUAPSDInfo[WLANTL_MAX_AC];
564
565 /* flag to signal if a trigger frames is pending */
566 v_U8_t ucPendingTrigFrm;
567
568 WLANTL_TRANSFER_STA_TYPE trafficStatistics;
569
570 /*Members needed for packet caching in TL*/
571 /*Begining of the cached packets chain*/
572 vos_pkt_t* vosBegCachedFrame;
573
574 /*Begining of the cached packets chain*/
575 vos_pkt_t* vosEndCachedFrame;
576
Jeff Johnson295189b2012-06-20 16:38:30 -0700577
578 /* LWM related fields */
579
580 //current station is slow. LWM mode is enabled.
581 v_BOOL_t ucLwmModeEnabled;
582 //LWM events is reported when LWM mode is on. Able to send more traffic
583 //under the constraints of uBuffThresholdMax
584 v_BOOL_t ucLwmEventReported;
585
586 //v_U8_t uLwmEventReported;
587
588 /* Flow control fields */
589 //memory used in previous round
590 v_U8_t bmuMemConsumed;
591
592 //the number packets injected in this round
593 v_U32_t uIngress_length;
594
595 //number of packets allowed in current round beforing receiving new FW memory updates
596 v_U32_t uBuffThresholdMax;
597
598
599 // v_U32_t uEgress_length;
600
601 // v_U32_t uIngress_length;
602
603 // v_U32_t uBuffThresholdMax;
604
605 // v_U32_t uBuffThresholdUsed;
606
607 /* Value used to set LWM in FW. Initialized to 1/3* WLAN_STA_BMU_THRESHOLD_MAX
608 In the future, it can be dynamically adjusted if we find the reason to implement
609 such algorithm. */
610 v_U32_t uLwmThreshold;
611
612 //tx disable forced by Riva software
613 v_U16_t fcStaTxDisabled;
614
615 /** HDD buffer status for packet scheduling. Once HDD
616 * stores a new packet in a previously empty queue, it
617 * will call TL interface to set the fields. The fields
618 * will be cleaned by TL when TL can't fetch more packets
619 * from the queue. */
620 // the fields are ucPktPending and ucACMask;
621
622 /* Queue to keep unicast station management frame */
623 vos_list_t pStaManageQ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700624
Jeff Johnson295189b2012-06-20 16:38:30 -0700625 /* 1 means replay check is needed for the station,
626 * 0 means replay check is not needed for the station*/
627 v_BOOL_t ucIsReplayCheckValid;
628
629 /* It contains 48-bit replay counter per TID*/
630 v_U64_t ullReplayCounter[WLANTL_MAX_TID];
631
632 /* It contains no of replay packets found per STA.
633 It is for debugging purpose only.*/
634 v_U32_t ulTotalReplayPacketsDetected;
Jeff Johnson295189b2012-06-20 16:38:30 -0700635
Gopichand Nakkala8b54e912013-03-11 10:44:21 +0530636 /* Set when pairwise key is installed, if ptkInstalled is
637 1 then we have to encrypt the data irrespective of TL
638 state (CONNECTED/AUTHENTICATED) */
639 v_U8_t ptkInstalled;
Gopichand Nakkala8a2b1442013-05-29 15:33:14 +0530640
641 v_U32_t linkCapacity;
Jeff Johnson295189b2012-06-20 16:38:30 -0700642}WLANTL_STAClientType;
643
644/*---------------------------------------------------------------------------
645 BAP Client type
646---------------------------------------------------------------------------*/
647typedef struct
648{
649 /* flag that keeps track of registration; only one non-data BT-AMP client
650 allowed */
651 v_U8_t ucExists;
652
653 /* pointer to the receive processing routine for non-data BT-AMP frames */
654 WLANTL_BAPRxCBType pfnTlBAPRx;
655
656 /* pointer to the flush call back complete function */
657 WLANTL_FlushOpCompCBType pfnFlushOpCompleteCb;
658
659 /* pointer to the non-data BT-AMP frame pending transmission */
660 vos_pkt_t* vosPendingDataBuff;
661
662 /* BAP station ID */
663 v_U8_t ucBAPSTAId;
664}WLANTL_BAPClientType;
665
666
667/*---------------------------------------------------------------------------
668 Management Frame Client type
669---------------------------------------------------------------------------*/
670typedef struct
671{
672 /* flag that keeps track of registration; only one management frame
673 client allowed */
674 v_U8_t ucExists;
675
676 /* pointer to the receive processing routine for management frames */
677 WLANTL_MgmtFrmRxCBType pfnTlMgmtFrmRx;
678
679 /* pointer to the management frame pending transmission */
680 vos_pkt_t* vosPendingDataBuff;
681}WLANTL_MgmtFrmClientType;
682
683typedef struct
684{
685 WLANTL_TrafficStatusChangedCBType trafficCB;
686 WLANTL_HO_TRAFFIC_STATUS_TYPE trafficStatus;
687 v_U32_t idleThreshold;
688 v_U32_t measurePeriod;
689 v_U32_t rtRXFrameCount;
690 v_U32_t rtTXFrameCount;
691 v_U32_t nrtRXFrameCount;
692 v_U32_t nrtTXFrameCount;
693 vos_timer_t trafficTimer;
694 v_PVOID_t usrCtxt;
695} WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE;
696
697typedef struct
698{
699 v_S7_t rssiValue;
700 v_U8_t triggerEvent[WLANTL_HS_NUM_CLIENT];
701 v_PVOID_t usrCtxt[WLANTL_HS_NUM_CLIENT];
702 v_U8_t whoIsClient[WLANTL_HS_NUM_CLIENT];
703 WLANTL_RSSICrossThresholdCBType crossCBFunction[WLANTL_HS_NUM_CLIENT];
704 v_U8_t numClient;
705} WLANTL_HO_RSSI_INDICATION_TYPE;
706
707typedef struct
708{
709 v_U8_t numThreshold;
710 v_U8_t regionNumber;
711 v_S7_t historyRSSI;
712 v_U8_t alpha;
713 v_U32_t sampleTime;
714 v_U32_t fwNotification;
715} WLANTL_CURRENT_HO_STATE_TYPE;
716
717typedef struct
718{
719 WLANTL_HO_RSSI_INDICATION_TYPE registeredInd[WLANTL_MAX_AVAIL_THRESHOLD];
720 WLANTL_CURRENT_HO_STATE_TYPE currentHOState;
721 WLANTL_HO_TRAFFIC_STATUS_HANDLE_TYPE currentTraffic;
722 v_PVOID_t macCtxt;
723 vos_lock_t hosLock;
724} WLANTL_HO_SUPPORT_TYPE;
725
726/*---------------------------------------------------------------------------
727 TL control block type
728---------------------------------------------------------------------------*/
729typedef struct
730{
731 /* TL configuration information */
732 WLANTL_ConfigInfoType tlConfigInfo;
733
734 /* list of the active stations */
Madan Mohan Koyylamudi3b8400c2013-01-24 17:47:01 +0530735 WLANTL_STAClientType* atlSTAClients[WLAN_MAX_STA_COUNT];
736
Jeff Johnson295189b2012-06-20 16:38:30 -0700737
738 /* information on the management frame client */
739 WLANTL_MgmtFrmClientType tlMgmtFrmClient;
740
741 /* information on the BT AMP client */
742 WLANTL_BAPClientType tlBAPClient;
743
744 /* number of packets sent to BAL waiting for tx complete confirmation */
745 v_U16_t usPendingTxCompleteCount;
746
747 /* global suspend flag */
748 v_U8_t ucTxSuspended;
749
750 /* resource flag */
751 v_U32_t uResCount;
752
753 /* dummy vos buffer - used for chains */
754 vos_pkt_t* vosDummyBuf;
755
756 /* temporary buffer for storing the packet that no longer fits */
757 vos_pkt_t* vosTempBuf;
758
759 /* The value of the station id and AC for the cached buffer */
760 v_U8_t ucCachedSTAId;
761 v_U8_t ucCachedAC;
762
763 /* Last registered STA - until multiple sta support is added this will
764 be used always for tx */
765 v_U8_t ucRegisteredStaId;
766
767 /*Current TL STA used for TX*/
768 v_U8_t ucCurrentSTA;
769
770 WLANTL_REORDER_BUFFER_T *reorderBufferPool; /* Allocate memory for [WLANTL_MAX_BA_SESSION] sessions */
771
772 WLANTL_HO_SUPPORT_TYPE hoSupport;
773
774 v_BOOL_t bUrgent;
775
Jeff Johnson295189b2012-06-20 16:38:30 -0700776
777 /* resource flag */
778 v_U32_t bd_pduResCount;
779
780 /* time interval to evaluate LWM mode*/
781 //vos_timer_t tThresholdSamplingTimer;
782
783#if 0
784 //information fields for flow control
785 tFcTxParams_type tlFCInfo;
786#endif
787
788 vos_pkt_t* vosTxFCBuf;
789
790 /* LWM mode is enabled or not for each station. Bit-wise operation.32 station maximum. */
791 // v_U32_t uStaLwmMask;
792
793 /* LWM event is reported by FW. */
794 // v_U32_t uStaLwmEventReported;
795
796 /** Multiple Station Scheduling and TL queue management.
797 4 HDD BC/MC data packet queue status is specified as Station 0's status. Weights used
798 in WFQ algorith are initialized in WLANTL_OPEN and contained in tlConfigInfo field.
799 Each station has fields of ucPktPending and AC mask to tell whether a AC has traffic
800 or not.
801
802 Stations are served in a round-robin fashion from highest priority to lowest priority.
803 The number of round-robin times of each prioirty equals to the WFQ weights and differetiates
804 the traffic of different prioirty. As such, stations can not provide low priority packets if
805 high priority packets are all served.
806 */
807
808 /* Currently served station id. Reuse ucCurrentSTA field. */
809 //v_U8_t uCurStaId;
810
811 /* Current served station ID in round-robin method to traverse all stations.*/
812 WLANTL_ACEnumType uCurServedAC;
813
814 /* How many weights have not been served in current AC. */
815 v_U8_t ucCurLeftWeight;
816
817 /* BC/MC management queue. Current implementation uses queue size 1. Will check whether
818 size N is supported. */
819 vos_list_t pMCBCManageQ;
820
821 v_U32_t sendFCFrame;
822
823 v_U8_t done_once;
824 v_U8_t uFramesProcThres;
Sunil Ravid5406f22013-01-22 00:18:31 -0800825#ifdef FEATURE_WLAN_TDLS
826 /*number of total TDLS peers registered to TL
827 Incremented at WLANTL_RegisterSTAClient(staType == WLAN_STA_TDLS)
828 Decremented at WLANTL_ClearSTAClient(staType == WLAN_STA_TDLS) */
829 v_U8_t ucTdlsPeerCount;
830#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700831 /*whether we are in BMPS/UAPSD/WOWL mode, since the latter 2 need to be BMPS first*/
832 v_BOOL_t isBMPS;
Gopichand Nakkala11acd112012-12-31 16:04:04 -0800833 /* Whether WDA_DS_TX_START_XMIT msg is pending or not */
834 v_BOOL_t isTxTranmitMsgPending;
Jeff Johnson295189b2012-06-20 16:38:30 -0700835}WLANTL_CbType;
836
837/*==========================================================================
838
839 FUNCTION WLANTL_GetFrames
840
841 DESCRIPTION
842
843 BAL calls this function at the request of the lower bus interface.
844 When this request is being received TL will retrieve packets from HDD
845 in accordance with the priority rules and the count supplied by BAL.
846
847 DEPENDENCIES
848
849 HDD must have registered with TL at least one STA before this function
850 can be called.
851
852 PARAMETERS
853
854 IN
855 pAdapter: pointer to the global adapter context; a handle to TL's
856 or BAL's control block can be extracted from its context
857 uSize: maximum size accepted by the lower layer
Jeff Johnson017fdc32013-02-27 09:22:30 -0800858 uFlowMask TX flow control mask. Each bit is defined as
Jeff Johnson295189b2012-06-20 16:38:30 -0700859 WDA_TXFlowEnumType
860
861 OUT
862 vosDataBuff: it will contain a pointer to the first buffer supplied
863 by TL, if there is more than one packet supplied, TL
864 will chain them through vOSS buffers
865
866 RETURN VALUE
867
868 The result code associated with performing the operation
869
870 1 or more: number of required resources if there are still frames to fetch
871 For Volans, it's BD/PDU numbers. For Prima, it's free DXE descriptors.
872 0 : error or HDD queues are drained
873
874 SIDE EFFECTS
875
876============================================================================*/
877v_U32_t
878WLANTL_GetFrames
879(
880 v_PVOID_t pAdapter,
881 vos_pkt_t **ppFrameDataBuff,
882 v_U32_t uSize,
Jeff Johnson295189b2012-06-20 16:38:30 -0700883 v_U8_t uFlowMask,
Jeff Johnson295189b2012-06-20 16:38:30 -0700884 v_BOOL_t* pbUrgent
885);
886
887/*==========================================================================
888
889 FUNCTION WLANTL_TxComp
890
891 DESCRIPTION
892 It is being called by BAL upon asynchronous notification of the packet
893 or packets being sent over the bus.
894
895 DEPENDENCIES
896 Tx complete cannot be called without a previous transmit.
897
898 PARAMETERS
899
900 IN
901 pAdapter: pointer to the global adapter context; a handle to TL's
902 or BAL's control block can be extracted from its context
903 vosDataBuff: it will contain a pointer to the first buffer for which
904 the BAL report is being made, if there is more then one
905 packet they will be chained using vOSS buffers.
906 wTxSTAtus: the status of the transmitted packet, see above chapter
907 on HDD interaction for a list of possible values
908
909 RETURN VALUE
910 The result code associated with performing the operation
911
912 SIDE EFFECTS
913
914============================================================================*/
915VOS_STATUS
916WLANTL_TxComp
917(
918 v_PVOID_t pAdapter,
919 vos_pkt_t *pFrameDataBuff,
920 VOS_STATUS wTxStatus
921);
922
923/*==========================================================================
924
925 FUNCTION WLANTL_RxFrames
926
927 DESCRIPTION
928 Callback registered by TL and called by BAL when a packet is received
929 over the bus. Upon the call of this function TL will make the necessary
930 decision with regards to the forwarding or queuing of this packet and
931 the layer it needs to be delivered to.
932
933 DEPENDENCIES
934 TL must be initiailized before this function gets called.
935 If the frame carried is a data frame then the station for which it is
936 destined to must have been previously registered with TL.
937
938 PARAMETERS
939
940 IN
941 pAdapter: pointer to the global adapter context; a handle to TL's
942 or BAL's control block can be extracted from its context
943
944 vosDataBuff: it will contain a pointer to the first buffer received,
945 if there is more then one packet they will be chained
946 using vOSS buffers.
947
948 RETURN VALUE
949 The result code associated with performing the operation
950
951 SIDE EFFECTS
952
953============================================================================*/
954VOS_STATUS
955WLANTL_RxFrames
956(
957 v_PVOID_t pAdapter,
958 vos_pkt_t *pFrameDataBuff
959);
960
961/*==========================================================================
962
963 FUNCTION WLANTL_RxCachedFrames
964
965 DESCRIPTION
966 Utility function used by TL to forward the cached frames to a particular
967 station;
968
969 DEPENDENCIES
970 TL must be initiailized before this function gets called.
971 If the frame carried is a data frame then the station for which it is
972 destined to must have been previously registered with TL.
973
974 PARAMETERS
975
976 IN
977 pTLCb: pointer to TL handle
978
979 ucSTAId: station for which we need to forward the packets
980
981 vosDataBuff: it will contain a pointer to the first cached buffer
982 received, if there is more then one packet they will be
983 chained using vOSS buffers.
984
985 RETURN VALUE
986 The result code associated with performing the operation
987
988 VOS_STATUS_E_INVAL: Input parameters are invalid
989 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
990 page fault
991 VOS_STATUS_SUCCESS: Everything is good :)
992
993 SIDE EFFECTS
994
995============================================================================*/
996VOS_STATUS
997WLANTL_RxCachedFrames
998(
999 WLANTL_CbType* pTLCb,
1000 v_U8_t ucSTAId,
1001 vos_pkt_t* vosDataBuff
1002);
1003
1004/*==========================================================================
1005 FUNCTION WLANTL_ResourceCB
1006
1007 DESCRIPTION
1008 Called by the TL when it has packets available for transmission.
1009
1010 DEPENDENCIES
1011 The TL must be registered with BAL before this function can be called.
1012
1013 PARAMETERS
1014
1015 IN
1016 pAdapter: pointer to the global adapter context; a handle to TL's
1017 or BAL's control block can be extracted from its context
1018 uCount: avail resource count obtained from hw
1019
1020 RETURN VALUE
1021 The result code associated with performing the operation
1022
1023 SIDE EFFECTS
1024
1025============================================================================*/
1026VOS_STATUS
1027WLANTL_ResourceCB
1028(
1029 v_PVOID_t pAdapter,
1030 v_U32_t uCount
1031);
1032
1033
1034/*==========================================================================
1035 FUNCTION WLANTL_ProcessMainMessage
1036
1037 DESCRIPTION
1038 Called by VOSS when a message was serialized for TL through the
1039 main thread/task.
1040
1041 DEPENDENCIES
1042 The TL must be initialized before this function can be called.
1043
1044 PARAMETERS
1045
1046 IN
1047 pAdapter: pointer to the global adapter context; a handle to TL's
1048 control block can be extracted from its context
1049 message: type and content of the message
1050
1051
1052 RETURN VALUE
1053 The result code associated with performing the operation
1054
1055 SIDE EFFECTS
1056
1057============================================================================*/
1058VOS_STATUS
1059WLANTL_ProcessMainMessage
1060(
1061 v_PVOID_t pAdapter,
1062 vos_msg_t* message
1063);
1064
1065/*==========================================================================
1066 FUNCTION WLANTL_ProcessTxMessage
1067
1068 DESCRIPTION
1069 Called by VOSS when a message was serialized for TL through the
1070 tx thread/task.
1071
1072 DEPENDENCIES
1073 The TL must be initialized before this function can be called.
1074
1075 PARAMETERS
1076
1077 IN
1078 pAdapter: pointer to the global adapter context; a handle to TL's
1079 control block can be extracted from its context
1080 message: type and content of the message
1081
1082
1083 RETURN VALUE
1084
1085 The result code associated with performing the operation
1086 VOS_STATUS_SUCCESS: Everything is good :)
1087
1088
1089 SIDE EFFECTS
1090
1091============================================================================*/
1092VOS_STATUS
1093WLANTL_ProcessTxMessage
1094(
1095 v_PVOID_t pAdapter,
1096 vos_msg_t* message
1097);
1098
1099/*==========================================================================
1100 FUNCTION WLAN_TLGetNextTxIds
1101
1102 DESCRIPTION
1103 Gets the next station and next AC in the list
1104
1105 DEPENDENCIES
1106
1107 PARAMETERS
1108
1109 OUT
1110 pucSTAId: STAtion ID
1111
1112 RETURN VALUE
1113 The result code associated with performing the operation
1114
1115 SIDE EFFECTS
1116
1117============================================================================*/
1118VOS_STATUS
1119WLAN_TLGetNextTxIds
1120(
1121 v_PVOID_t pAdapter,
1122 v_U8_t* pucSTAId
1123);
1124
1125/*==========================================================================
1126
1127 FUNCTION WLANTL_CleanCb
1128
1129 DESCRIPTION
1130 Cleans TL control block
1131
1132 DEPENDENCIES
1133
1134 PARAMETERS
1135
1136 IN
1137 pTLCb: pointer to TL's control block
1138 ucEmpty: set if TL has to clean up the queues and release pedning pkts
1139
1140 RETURN VALUE
1141 The result code associated with performing the operation
1142
1143 SIDE EFFECTS
1144
1145============================================================================*/
1146VOS_STATUS
1147WLANTL_CleanCB
1148(
1149 WLANTL_CbType* pTLCb,
1150 v_U8_t ucEmpty
1151);
1152
1153/*==========================================================================
1154
1155 FUNCTION WLANTL_CleanSTA
1156
1157 DESCRIPTION
1158 Cleans a station control block.
1159
1160 DEPENDENCIES
1161
1162 PARAMETERS
1163
1164 IN
1165 pAdapter: pointer to the global adapter context; a handle to TL's
1166 control block can be extracted from its context
1167 ucEmpty: if set the queues and pending pkts will be emptyed
1168
1169 RETURN VALUE
1170 The result code associated with performing the operation
1171
1172 SIDE EFFECTS
1173
1174============================================================================*/
1175VOS_STATUS
1176WLANTL_CleanSTA
1177(
1178 WLANTL_STAClientType* ptlSTAClient,
1179 v_U8_t ucEmpty
1180);
1181
1182/*==========================================================================
1183 FUNCTION WLANTL_GetTxResourcesCB
1184
1185 DESCRIPTION
1186 Processing function for Resource needed signal. A request will be issued
1187 to BAL to get mor tx resources.
1188
1189 DEPENDENCIES
1190 The TL must be initialized before this function can be called.
1191
1192 PARAMETERS
1193
1194 IN
1195 pvosGCtx: pointer to the global vos context; a handle to TL's
1196 control block can be extracted from its context
1197
1198
1199 RETURN VALUE
1200 The result code associated with performing the operation
1201
1202 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1203 page fault
1204 VOS_STATUS_SUCCESS: Everything is good :)
1205
1206 Other values can be returned as a result of a function call, please check
1207 corresponding API for more info.
1208 SIDE EFFECTS
1209
1210============================================================================*/
1211VOS_STATUS
1212WLANTL_GetTxResourcesCB
1213(
1214 v_PVOID_t pvosGCtx
1215);
1216
1217/*==========================================================================
1218 FUNCTION WLANTL_PrepareBDHeader
1219
1220 DESCRIPTION
1221 Callback function for serializing Suspend signal through Tx thread
1222
1223 DEPENDENCIES
1224 Just notify HAL that suspend in TL is complete.
1225
1226 PARAMETERS
1227
1228 IN
1229 pAdapter: pointer to the global adapter context; a handle to TL's
1230 control block can be extracted from its context
1231 pUserData: user data sent with the callback
1232
1233 RETURN VALUE
1234 The result code associated with performing the operation
1235
1236 SIDE EFFECTS
1237
1238============================================================================*/
1239void
1240WLANTL_PrepareBDHeader
1241(
1242 vos_pkt_t* vosDataBuff,
1243 v_PVOID_t* ppvBDHeader,
1244 v_MACADDR_t* pvDestMacAdddr,
1245 v_U8_t ucDisableFrmXtl,
1246 VOS_STATUS* pvosSTAtus,
1247 v_U16_t* usPktLen,
1248 v_U8_t ucQosEnabled,
1249 v_U8_t ucWDSEnabled,
1250 v_U8_t extraHeadSpace
1251);
1252
1253/*==========================================================================
1254 FUNCTION WLANTL_Translate8023To80211Header
1255
1256 DESCRIPTION
1257 Inline function for translating and 802.3 header into an 802.11 header.
1258
1259 DEPENDENCIES
1260
1261
1262 PARAMETERS
1263
1264 IN
1265 pTLCb: TL control block
Kiran Venkatappaa044eb92012-12-17 15:48:49 -08001266
1267 *pucStaId Station ID. In case of TDLS, this return the actual
1268 station index used to transmit.
Jeff Johnson295189b2012-06-20 16:38:30 -07001269
1270 IN/OUT
1271 vosDataBuff: vos data buffer, will contain the new header on output
1272
1273 OUT
1274 pvosStatus: status of the operation
1275
1276 RETURN VALUE
1277 No return.
1278
1279 SIDE EFFECTS
1280
1281============================================================================*/
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001282VOS_STATUS
1283WLANTL_Translate8023To80211Header
1284(
1285 vos_pkt_t* vosDataBuff,
1286 VOS_STATUS* pvosStatus,
1287 WLANTL_CbType* pTLCb,
1288 v_U8_t *pucStaId,
Ravi Joshid0699502013-07-08 15:48:47 -07001289 WLANTL_MetaInfoType* pTlMetaInfo,
Kiran Venkatappacab0d352012-12-17 13:09:22 -08001290 v_U8_t *ucWDSEnabled,
1291 v_U8_t *extraHeadSpace
1292);
Jeff Johnson295189b2012-06-20 16:38:30 -07001293/*==========================================================================
1294 FUNCTION WLANTL_Translate80211To8023Header
1295
1296 DESCRIPTION
1297 Inline function for translating and 802.11 header into an 802.3 header.
1298
1299 DEPENDENCIES
1300
1301
1302 PARAMETERS
1303
1304 IN
1305 pTLCb: TL control block
1306 ucStaId: station ID
1307 ucHeaderLen: Length of the header from BD
1308 ucActualHLen: Length of header including padding or any other trailers
1309
1310 IN/OUT
1311 vosDataBuff: vos data buffer, will contain the new header on output
1312
1313 OUT
1314 pvosStatus: status of the operation
1315
1316 RETURN VALUE
1317 Status of the operation
1318
1319 SIDE EFFECTS
1320
1321============================================================================*/
1322VOS_STATUS
1323WLANTL_Translate80211To8023Header
1324(
1325 vos_pkt_t* vosDataBuff,
1326 VOS_STATUS* pvosStatus,
Jeff Johnson017fdc32013-02-27 09:22:30 -08001327 v_U16_t usActualHLen,
Jeff Johnson295189b2012-06-20 16:38:30 -07001328 v_U8_t ucHeaderLen,
1329 WLANTL_CbType* pTLCb,
1330 v_U8_t ucSTAId
1331);
1332
1333/*==========================================================================
Madan Mohan Koyyalamudia148e1e2012-11-30 14:52:59 -08001334 FUNCTION WLANTL_FindFrameTypeBcMcUc
1335
1336 DESCRIPTION
1337 Utility function to find whether received frame is broadcast, multicast
1338 or unicast.
1339
1340 DEPENDENCIES
1341 The STA must be registered with TL before this function can be called.
1342
1343 PARAMETERS
1344
1345 IN
1346 pTLCb: pointer to the TL's control block
1347 ucSTAId: identifier of the station being processed
1348 vosDataBuff: pointer to the vos buffer
1349
1350 IN/OUT
1351 pucBcMcUc: pointer to buffer, will contain frame type on return
1352
1353 RETURN VALUE
1354 The result code associated with performing the operation
1355
1356 VOS_STATUS_E_INVAL: invalid input parameters
1357 VOS_STATUS_E_BADMSG: failed to extract info from data buffer
1358 VOS_STATUS_SUCCESS: success
1359
1360 SIDE EFFECTS
1361 None.
1362============================================================================*/
1363VOS_STATUS
1364WLANTL_FindFrameTypeBcMcUc
1365(
1366 WLANTL_CbType *pTLCb,
1367 v_U8_t ucSTAId,
1368 vos_pkt_t *vosDataBuff,
1369 v_U8_t *pucBcMcUc
1370);
1371
1372/*==========================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -07001373
1374 FUNCTION WLANTL_MgmtFrmRxDefaultCb
1375
1376 DESCRIPTION
1377 Default Mgmt Frm rx callback: asserts all the time. If this function gets
1378 called it means there is no registered rx cb pointer for Mgmt Frm.
1379
1380 DEPENDENCIES
1381
1382 PARAMETERS
1383
1384 Not used.
1385
1386 RETURN VALUE
1387 Always FAILURE.
1388
1389============================================================================*/
1390VOS_STATUS
1391WLANTL_MgmtFrmRxDefaultCb
1392(
1393 v_PVOID_t pAdapter,
1394 v_PVOID_t vosBuff
1395);
1396
1397/*==========================================================================
1398
1399 FUNCTION WLANTL_STARxDefaultCb
1400
1401 DESCRIPTION
1402 Default BAP rx callback: asserts all the time. If this function gets
1403 called it means there is no registered rx cb pointer for BAP.
1404
1405 DEPENDENCIES
1406
1407 PARAMETERS
1408
1409 Not used.
1410
1411 RETURN VALUE
1412 Always FAILURE.
1413
1414============================================================================*/
1415VOS_STATUS
1416WLANTL_BAPRxDefaultCb
1417(
1418 v_PVOID_t pAdapter,
1419 vos_pkt_t* vosDataBuff,
1420 WLANTL_BAPFrameEnumType frameType
1421);
1422
1423/*==========================================================================
1424
1425 FUNCTION WLANTL_STARxDefaultCb
1426
1427 DESCRIPTION
1428 Default STA rx callback: asserts all the time. If this function gets
1429 called it means there is no registered rx cb pointer for station.
1430 (Mem corruption most likely, it should never happen)
1431
1432 DEPENDENCIES
1433
1434 PARAMETERS
1435
1436 Not used.
1437
1438 RETURN VALUE
1439 Always FAILURE.
1440
1441============================================================================*/
1442VOS_STATUS
1443WLANTL_STARxDefaultCb
1444(
1445 v_PVOID_t pAdapter,
1446 vos_pkt_t* vosDataBuff,
1447 v_U8_t ucSTAId,
1448 WLANTL_RxMetaInfoType* pRxMetaInfo
1449);
1450
1451/*==========================================================================
1452
1453 FUNCTION WLANTL_STAFetchPktDefaultCb
1454
1455 DESCRIPTION
1456 Default fetch callback: asserts all the time. If this function gets
1457 called it means there is no registered fetch cb pointer for station.
1458 (Mem corruption most likely, it should never happen)
1459
1460 DEPENDENCIES
1461
1462 PARAMETERS
1463
1464 Not used.
1465
1466 RETURN VALUE
1467 Always FAILURE.
1468
1469============================================================================*/
1470VOS_STATUS
1471WLANTL_STAFetchPktDefaultCb
1472(
1473 v_PVOID_t pAdapter,
1474 v_U8_t* pucSTAId,
1475 WLANTL_ACEnumType ucAC,
1476 vos_pkt_t** vosDataBuff,
1477 WLANTL_MetaInfoType* tlMetaInfo
1478);
1479
1480/*==========================================================================
1481
1482 FUNCTION WLANTL_TxCompDefaultCb
1483
1484 DESCRIPTION
1485 Default tx complete handler. It will release the completed pkt to
1486 prevent memory leaks.
1487
1488 PARAMETERS
1489
1490 IN
1491 pAdapter: pointer to the global adapter context; a handle to
1492 TL/HAL/PE/BAP/HDD control block can be extracted from
1493 its context
1494 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1495 wTxSTAtus: status of the transmission
1496
1497
1498 RETURN VALUE
1499 The result code associated with performing the operation; please
1500 check vos_pkt_return_pkt for possible error codes.
1501
1502============================================================================*/
1503VOS_STATUS
1504WLANTL_TxCompDefaultCb
1505(
1506 v_PVOID_t pAdapter,
1507 vos_pkt_t* vosDataBuff,
1508 VOS_STATUS wTxSTAtus
1509);
1510
1511/*==========================================================================
1512
1513 FUNCTION WLANTL_PackUpTriggerFrame
1514
1515 DESCRIPTION
1516 Packs up a trigger frame and places it in TL's cache for tx and notifies
1517 BAL
1518
1519 DEPENDENCIES
1520
1521 PARAMETERS
1522
1523 IN
1524 pTLCb: pointer to the TL control block
1525 pfnSTATxComp: Tx Complete Cb to be used when frame is received
1526 ucSTAId: station id
1527 ucAC: access category
1528
1529 RETURN VALUE
1530 None
1531
1532 SIDE EFFECTS
1533
1534============================================================================*/
1535VOS_STATUS
1536WLANTL_PackUpTriggerFrame
1537(
1538 WLANTL_CbType* pTLCb,
1539 WLANTL_TxCompCBType pfnSTATxComp,
1540 v_U8_t ucSTAId,
1541 WLANTL_ACEnumType ucAC
1542);
1543
1544/*==========================================================================
1545
1546 FUNCTION WLANTL_TxCompTriggFrameSI
1547
1548 DESCRIPTION
1549 Tx complete handler for the service interval trigger frame.
1550 It will restart the SI timer.
1551
1552 PARAMETERS
1553
1554 IN
1555 pvosGCtx: pointer to the global vos context; a handle to
1556 TL/HAL/PE/BAP/HDD control block can be extracted from
1557 its context
1558 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1559 wTxSTAtus: status of the transmission
1560
1561
1562 RETURN VALUE
1563 The result code associated with performing the operation
1564
1565 ============================================================================*/
1566VOS_STATUS
1567WLANTL_TxCompTriggFrameSI
1568(
1569 v_PVOID_t pvosGCtx,
1570 vos_pkt_t* vosDataBuff,
1571 VOS_STATUS wTxSTAtus
1572);
1573
1574/*==========================================================================
1575
1576 FUNCTION WLANTL_TxCompTriggFrameSI
1577
1578 DESCRIPTION
1579 Tx complete handler for the service interval trigger frame.
1580 It will restart the SI timer.
1581
1582 PARAMETERS
1583
1584 IN
1585 pvosGCtx: pointer to the global vos context; a handle to
1586 TL/HAL/PE/BAP/HDD control block can be extracted from
1587 its context
1588 vosDataBuff: pointer to the VOSS data buffer that was transmitted
1589 wTxSTAtus: status of the transmission
1590
1591
1592 RETURN VALUE
1593 The result code associated with performing the operation
1594
1595============================================================================*/
1596VOS_STATUS
1597WLANTL_TxCompTriggFrameDI
1598(
1599 v_PVOID_t pvosGCtx,
1600 vos_pkt_t* vosDataBuff,
1601 VOS_STATUS wTxSTAtus
1602);
1603
1604/*==========================================================================
1605
1606 FUNCTION
1607
1608 DESCRIPTION Read RSSI value out of a RX BD
1609
1610 PARAMETERS: Caller must validate all parameters
1611
1612 RETURN VALUE
1613
1614============================================================================*/
1615VOS_STATUS WLANTL_ReadRSSI
1616(
1617 v_PVOID_t pAdapter,
1618 v_PVOID_t pBDHeader,
1619 v_U8_t STAid
1620);
1621
1622
1623
1624void WLANTL_PowerStateChangedCB
1625(
1626 v_PVOID_t pAdapter,
1627 tPmcState newState
1628);
1629
Jeff Johnson295189b2012-06-20 16:38:30 -07001630/*==========================================================================
Jeff Johnson017fdc32013-02-27 09:22:30 -08001631 FUNCTION WLANTL_FwdPktToHDD
Jeff Johnson295189b2012-06-20 16:38:30 -07001632
1633 DESCRIPTION
1634 Determine the Destation Station ID and route the Frame to Upper Layer
1635
1636 DEPENDENCIES
1637
1638 PARAMETERS
1639
1640 IN
1641 pvosGCtx: pointer to the global vos context; a handle to TL's
1642 control block can be extracted from its context
1643 ucSTAId: identifier of the station being processed
1644 vosDataBuff: pointer to the rx vos buffer
1645
1646 RETURN VALUE
1647 The result code associated with performing the operation
1648
1649 VOS_STATUS_E_INVAL: invalid input parameters
1650 VOS_STATUS_E_FAULT: pointer to TL cb is NULL ; access would cause a
1651 page fault
1652 VOS_STATUS_SUCCESS: Everything is good :)
1653
1654 SIDE EFFECTS
1655
1656============================================================================*/
1657
1658VOS_STATUS
1659WLANTL_FwdPktToHDD
1660(
1661 v_PVOID_t pvosGCtx,
1662 vos_pkt_t* pvosDataBuff,
1663 v_U8_t ucSTAId
1664);
1665
Jeff Johnson295189b2012-06-20 16:38:30 -07001666#endif /* #ifndef WLAN_QCT_TLI_H */