blob: 27b547cd283d50fc3810a8fbd8525116972bf595 [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
42/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
44 \file ccmApi.h
45
46 \brief Exports and types for the Common Config Module (CCM)
47
48 $Id$
49
50
51 Copyright (C) 2006 Airgo Networks, Incorporated
52
53 This file contains all the interfaces for thge Platform Abstration Layer
54 functions. It is intended to be included in all modules that are using
55 the PAL interfaces.
56
57 ========================================================================== */
58#ifndef CCMAPI_H__
59#define CCMAPI_H__
60
61//#include "wniCfgAp.h" /* CFG_PARAM_MAX_NUM */
62#include "wniCfgSta.h"
63#include "halTypes.h"
64
65#define CCM_11B_CHANNEL_END 14
66
67#define CCM_IS_RESULT_SUCCESS(result) (WNI_CFG_SUCCESS == (result) ||\
68 WNI_CFG_NEED_RESTART == (result) || \
69 WNI_CFG_NEED_RELOAD == (result))
70
71#define CCM_INTEGER_TYPE 0
72#define CCM_STRING_TYPE 1
73
74typedef void (*tCcmCfgSetCallback)(tHalHandle hHal, tANI_S32 result) ;
75
76typedef enum {
77 eCCM_STOPPED,
78 eCCM_STARTED,
79 eCCM_REQ_SENT,
80 eCCM_REQ_QUEUED,
81 eCCM_REQ_DONE,
82} eCcmState ;
83
84/* We do not use Linux's list facility */
85typedef struct cfgreq {
86 struct cfgreq *next ;
87 tANI_U16 cfgId ;
88 tANI_U8 type ;
89 tANI_U8 state : 7 ;
90 tANI_U8 toBeSaved : 1 ;
91 tANI_S32 length ;
92 void *ccmPtr;
93 tANI_U32 ccmValue;
94 tCcmCfgSetCallback callback;
95 void *done ;
96} tCfgReq ;
97
98typedef struct {
99 tANI_U16 started : 1 ;
100 tANI_U16 in_progress : 1 ;
101 tANI_U16 reserved : 14 ;
102 tANI_S16 nr_param ;
103 tANI_U32 result ;
104 tCcmCfgSetCallback callback ;
105 void *done ;
106} tCfgReplay ;
107
108struct ccmlink {
109 tCfgReq *head;
110 tCfgReq *tail;
111} ;
112
113typedef struct {
114 struct ccmlink reqQ ;
115 eCcmState state ;
116 tCfgReq * comp[CFG_PARAM_MAX_NUM] ;
117 tCfgReplay replay ;
118 void *lock;
119} tCcm ;
120
121void ccmCfgCnfMsgHandler(tHalHandle hHal, void *msg) ;
122eHalStatus ccmOpen(tHalHandle hHal) ;
123eHalStatus ccmClose(tHalHandle hHal) ;
124void ccmStart(tHalHandle hHal) ;
125void ccmStop(tHalHandle hHal) ;
126//If callback is NULL, the API is not serialized for the CFGs
127eHalStatus ccmCfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, tCcmCfgSetCallback callback, eAniBoolean toBeSaved) ;
128//If callback is NULL, the API is not serialized for the CFGs
129eHalStatus ccmCfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, tANI_U32 length, tCcmCfgSetCallback callback, eAniBoolean toBeSaved) ;
130eHalStatus ccmCfgUpdate(tHalHandle hHal, tCcmCfgSetCallback callback) ;
131eHalStatus ccmCfgGetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 *pValue) ;
132eHalStatus ccmCfgGetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pBuf, tANI_U32 *pLength) ;
133
134void ccmDumpInit(tHalHandle hHal);
135
136#endif /*CCMAPI_H__*/