blob: ebb039c7e56b3fb817300ff8c51a2ef59d0a928e [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala9c070ad2013-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
42/*
43 *
44 * Airgo Networks, Inc proprietary. All rights reserved.
45 * This file limSerDesUtils.h contains the utility definitions
46 * LIM uses while processing messages from upper layer software
47 * modules
48 * Author: Chandra Modumudi
49 * Date: 10/20/02
50 * History:-
51 * Date Modified by Modification Information
52 * --------------------------------------------------------------------
53 */
54#ifndef __LIM_SERDES_UTILS_H
55#define __LIM_SERDES_UTILS_H
56
57#include "sirApi.h"
58#include "aniSystemDefs.h"
59#include "sirMacProtDef.h"
60#include "utilsApi.h"
61#include "limTypes.h"
62#include "limPropExtsUtils.h"
63
64tSirRetStatus limStartBssReqSerDes(tpAniSirGlobal, tpSirSmeStartBssReq, tANI_U8 *);
65tSirRetStatus limStopBssReqSerDes(tpAniSirGlobal, tpSirSmeStopBssReq, tANI_U8 *);
66tSirRetStatus limJoinReqSerDes(tpAniSirGlobal, tpSirSmeJoinReq, tANI_U8 *);
67void limAssocIndSerDes(tpAniSirGlobal, tpLimMlmAssocInd, tANI_U8 *, tpPESession);
68void limReassocIndSerDes(tpAniSirGlobal, tpLimMlmReassocInd, tANI_U8 *, tpPESession psessionEntry);
69tSirRetStatus limAssocCnfSerDes(tpAniSirGlobal, tpSirSmeAssocCnf, tANI_U8 *);
70tSirRetStatus limDisassocCnfSerDes(tpAniSirGlobal, tpSirSmeDisassocCnf, tANI_U8 *);
71tSirRetStatus limSetContextReqSerDes(tpAniSirGlobal, tpSirSmeSetContextReq, tANI_U8 *);
72tSirRetStatus limDisassocReqSerDes(tpAniSirGlobal, tSirSmeDisassocReq *, tANI_U8 *);
73tSirRetStatus limDeauthReqSerDes(tpAniSirGlobal, tSirSmeDeauthReq *, tANI_U8 *);
74void limAuthIndSerDes(tpAniSirGlobal, tpLimMlmAuthInd, tANI_U8 *);
75void limStatSerDes(tpAniSirGlobal, tpAniStaStatStruct, tANI_U8 *);
76void limGetSessionInfo(tpAniSirGlobal pMac, tANI_U8 *, tANI_U8 *, tANI_U16 *);
77
Jeff Johnson295189b2012-06-20 16:38:30 -070078
79void limPackBkgndScanFailNotify(tpAniSirGlobal, tSirSmeStatusChangeCode,
80 tpSirBackgroundScanInfo, tSirSmeWmStatusChangeNtf *, tANI_U8);
81
Jeff Johnson295189b2012-06-20 16:38:30 -070082
83tSirRetStatus limRemoveKeyReqSerDes(tpAniSirGlobal pMac, tpSirSmeRemoveKeyReq pRemoveKeyReq, tANI_U8 * pBuf);
84
Jeff Johnson295189b2012-06-20 16:38:30 -070085tANI_BOOLEAN limIsSmeGetAssocSTAsReqValid(tpAniSirGlobal pMac, tpSirSmeGetAssocSTAsReq pGetAssocSTAsReq, tANI_U8 *pBuf);
86tSirRetStatus limTkipCntrMeasReqSerDes(tpAniSirGlobal pMac, tpSirSmeTkipCntrMeasReq ptkipCntrMeasReq, tANI_U8 *pBuf);
87
88tSirRetStatus limUpdateAPWPSIEsReqSerDes(tpAniSirGlobal pMac, tpSirUpdateAPWPSIEsReq pUpdateAPWPSIEsReq, tANI_U8 *pBuf);
89tSirRetStatus limUpdateAPWPARSNIEsReqSerDes(tpAniSirGlobal pMac, tpSirUpdateAPWPARSNIEsReq pUpdateAPWPARSNIEsReq, tANI_U8 *pBuf);
Jeff Johnson295189b2012-06-20 16:38:30 -070090
Jeff Johnson295189b2012-06-20 16:38:30 -070091
92// Byte String <--> tANI_U16/tANI_U32 copy functions
93static inline void limCopyU16(tANI_U8 *ptr, tANI_U16 u16Val)
94{
Jeff Johnson8347b442013-03-07 08:15:44 -080095#if ((defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
96 (defined(ANI_OS_TYPE_ANDROID) && defined(ANI_LITTLE_BYTE_ENDIAN)))
Jeff Johnson295189b2012-06-20 16:38:30 -070097 *ptr++ = (tANI_U8) (u16Val & 0xff);
98 *ptr = (tANI_U8) ((u16Val >> 8) & 0xff);
99#else
100#error "Unknown combination of OS Type and endianess"
101#endif
102}
103
104static inline tANI_U16 limGetU16(tANI_U8 *ptr)
105{
Jeff Johnson8347b442013-03-07 08:15:44 -0800106#if ((defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
107 (defined(ANI_OS_TYPE_ANDROID) && defined(ANI_LITTLE_BYTE_ENDIAN)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700108 return (((tANI_U16) (*(ptr+1) << 8)) |
109 ((tANI_U16) (*ptr)));
110#else
111#error "Unknown combination of OS Type and endianess"
112#endif
113}
114
115static inline void limCopyU32(tANI_U8 *ptr, tANI_U32 u32Val)
116{
Jeff Johnson8347b442013-03-07 08:15:44 -0800117#if ((defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
118 (defined(ANI_OS_TYPE_ANDROID) && defined(ANI_LITTLE_BYTE_ENDIAN)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700119 *ptr++ = (tANI_U8) (u32Val & 0xff);
120 *ptr++ = (tANI_U8) ((u32Val >> 8) & 0xff);
121 *ptr++ = (tANI_U8) ((u32Val >> 16) & 0xff);
122 *ptr = (tANI_U8) ((u32Val >> 24) & 0xff);
123#else
124#error "Unknown combination of OS Type and endianess"
125#endif
126}
127
128static inline tANI_U32 limGetU32(tANI_U8 *ptr)
129{
Jeff Johnson8347b442013-03-07 08:15:44 -0800130#if ((defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
131 (defined(ANI_OS_TYPE_ANDROID) && defined(ANI_LITTLE_BYTE_ENDIAN)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 return ((*(ptr+3) << 24) |
133 (*(ptr+2) << 16) |
134 (*(ptr+1) << 8) |
135 (*(ptr)));
136#else
137#error "Unknown combination of OS Type and endianess"
138#endif
139}
140
141#endif /* __LIM_SERDES_UTILS_H */
142