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