blob: ef0802860eb34017976ac1a2370fcf73c45698a7 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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
22/** ------------------------------------------------------------------------- *
23 ------------------------------------------------------------------------- *
24 \file ccmApi.h
25
26 \brief Exports and types for the Common Config Module (CCM)
27
28 $Id$
29
30
31 Copyright (C) 2006 Airgo Networks, Incorporated
32
33 This file contains all the interfaces for thge Platform Abstration Layer
34 functions. It is intended to be included in all modules that are using
35 the PAL interfaces.
36
37 ========================================================================== */
38#ifndef CCMAPI_H__
39#define CCMAPI_H__
40
41//#include "wniCfgAp.h" /* CFG_PARAM_MAX_NUM */
42#include "wniCfgSta.h"
43#include "halTypes.h"
44
45#define CCM_11B_CHANNEL_END 14
46
47#define CCM_IS_RESULT_SUCCESS(result) (WNI_CFG_SUCCESS == (result) ||\
48 WNI_CFG_NEED_RESTART == (result) || \
49 WNI_CFG_NEED_RELOAD == (result))
50
51#define CCM_INTEGER_TYPE 0
52#define CCM_STRING_TYPE 1
53
54typedef void (*tCcmCfgSetCallback)(tHalHandle hHal, tANI_S32 result) ;
55
56typedef enum {
57 eCCM_STOPPED,
58 eCCM_STARTED,
59 eCCM_REQ_SENT,
60 eCCM_REQ_QUEUED,
61 eCCM_REQ_DONE,
62} eCcmState ;
63
64/* We do not use Linux's list facility */
65typedef struct cfgreq {
66 struct cfgreq *next ;
67 tANI_U16 cfgId ;
68 tANI_U8 type ;
69 tANI_U8 state : 7 ;
70 tANI_U8 toBeSaved : 1 ;
71 tANI_S32 length ;
72 void *ccmPtr;
73 tANI_U32 ccmValue;
74 tCcmCfgSetCallback callback;
75 void *done ;
76} tCfgReq ;
77
78typedef struct {
79 tANI_U16 started : 1 ;
80 tANI_U16 in_progress : 1 ;
81 tANI_U16 reserved : 14 ;
82 tANI_S16 nr_param ;
83 tANI_U32 result ;
84 tCcmCfgSetCallback callback ;
85 void *done ;
86} tCfgReplay ;
87
88struct ccmlink {
89 tCfgReq *head;
90 tCfgReq *tail;
91} ;
92
93typedef struct {
94 struct ccmlink reqQ ;
95 eCcmState state ;
96 tCfgReq * comp[CFG_PARAM_MAX_NUM] ;
97 tCfgReplay replay ;
98 void *lock;
99} tCcm ;
100
101void ccmCfgCnfMsgHandler(tHalHandle hHal, void *msg) ;
102eHalStatus ccmOpen(tHalHandle hHal) ;
103eHalStatus ccmClose(tHalHandle hHal) ;
104void ccmStart(tHalHandle hHal) ;
105void ccmStop(tHalHandle hHal) ;
106//If callback is NULL, the API is not serialized for the CFGs
107eHalStatus ccmCfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, tCcmCfgSetCallback callback, eAniBoolean toBeSaved) ;
108//If callback is NULL, the API is not serialized for the CFGs
109eHalStatus ccmCfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, tANI_U32 length, tCcmCfgSetCallback callback, eAniBoolean toBeSaved) ;
110eHalStatus ccmCfgUpdate(tHalHandle hHal, tCcmCfgSetCallback callback) ;
111eHalStatus ccmCfgGetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 *pValue) ;
112eHalStatus ccmCfgGetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pBuf, tANI_U32 *pLength) ;
113
114void ccmDumpInit(tHalHandle hHal);
115
116#endif /*CCMAPI_H__*/