Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012, Code Aurora Forum. 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 | |
| 22 | /*=========================================================================== |
| 23 | |
| 24 | b a p A p i E x t . C |
| 25 | |
| 26 | OVERVIEW: |
| 27 | |
| 28 | This software unit holds the implementation of the external interfaces |
| 29 | required by the WLAN BAP module. It is currently a temporary |
| 30 | respository for API routines which should be furnished by CSR |
| 31 | or TL, but aren't yet implemented. |
| 32 | |
| 33 | The functions provide by this module are called by the rest of |
| 34 | the BT-AMP PAL module. |
| 35 | |
| 36 | DEPENDENCIES: |
| 37 | |
| 38 | Are listed for each API below. |
| 39 | |
| 40 | |
| 41 | Copyright (c) 2008 QUALCOMM Incorporated. |
| 42 | All Rights Reserved. |
| 43 | Qualcomm Confidential and Proprietary |
| 44 | ===========================================================================*/ |
| 45 | |
| 46 | /*=========================================================================== |
| 47 | |
| 48 | EDIT HISTORY FOR FILE |
| 49 | |
| 50 | |
| 51 | This section contains comments describing changes made to the module. |
| 52 | Notice that changes are listed in reverse chronological order. |
| 53 | |
| 54 | |
| 55 | $Header: /cygdrive/e/Builds/M7201JSDCAAPAD52240B/WM/platform/msm7200/Src/Drivers/SD/ClientDrivers/WLAN/QCT/CORE/BAP/src/bapApiExt.c,v 1.1 2008/11/21 20:28:18 jzmuda Exp jzmuda $$DateTime$$Author: jzmuda $ |
| 56 | |
| 57 | |
| 58 | when who what, where, why |
| 59 | ---------- --- -------------------------------------------------------- |
| 60 | 2008-10-22 jez Created module |
| 61 | |
| 62 | ===========================================================================*/ |
| 63 | |
| 64 | /*---------------------------------------------------------------------------- |
| 65 | * Include Files |
| 66 | * -------------------------------------------------------------------------*/ |
| 67 | // I think this pulls in everything |
| 68 | #include "bapApiExt.h" |
| 69 | |
| 70 | //#define BAP_DEBUG |
| 71 | /*---------------------------------------------------------------------------- |
| 72 | * Preprocessor Definitions and Constants |
| 73 | * -------------------------------------------------------------------------*/ |
| 74 | |
| 75 | /*---------------------------------------------------------------------------- |
| 76 | * Type Declarations |
| 77 | * -------------------------------------------------------------------------*/ |
| 78 | |
| 79 | /*---------------------------------------------------------------------------- |
| 80 | * Global Data Definitions |
| 81 | * -------------------------------------------------------------------------*/ |
| 82 | |
| 83 | /*---------------------------------------------------------------------------- |
| 84 | * External declarations for global context |
| 85 | * -------------------------------------------------------------------------*/ |
| 86 | |
| 87 | |
| 88 | /*---------------------------------------------------------------------------- |
| 89 | * Static Variable Definitions |
| 90 | * -------------------------------------------------------------------------*/ |
| 91 | |
| 92 | /*---------------------------------------------------------------------------- |
| 93 | * Static Function Declarations and Definitions |
| 94 | * -------------------------------------------------------------------------*/ |
| 95 | |
| 96 | /*---------------------------------------------------------------------------- |
| 97 | * Externalized Function Definitions |
| 98 | * -------------------------------------------------------------------------*/ |
| 99 | |
| 100 | /*---------------------------------------------------------------------------- |
| 101 | * Function Declarations and Documentation |
| 102 | * -------------------------------------------------------------------------*/ |
| 103 | |
| 104 | /*---------------------------------------------------------------------------- |
| 105 | * Utility Function implementations |
| 106 | * -------------------------------------------------------------------------*/ |
| 107 | |
| 108 | /*========================================================================== |
| 109 | |
| 110 | FUNCTION WLANBAP_GetCurrentChannel |
| 111 | |
| 112 | DESCRIPTION |
| 113 | Clear out all fields in the BAP context. |
| 114 | |
| 115 | DEPENDENCIES |
| 116 | |
| 117 | PARAMETERS |
| 118 | |
| 119 | IN |
| 120 | pBtampCtx: pointer to the BAP control block |
| 121 | channel: current configured channel number. |
| 122 | activeFlag: flag indicating whether there is an active link. |
| 123 | |
| 124 | RETURN VALUE |
| 125 | The result code associated with performing the operation |
| 126 | |
| 127 | VOS_STATUS_E_FAULT: pointer to return channel is NULL ; access would cause a page |
| 128 | fault |
| 129 | VOS_STATUS_SUCCESS: Everything is good :) |
| 130 | |
| 131 | SIDE EFFECTS |
| 132 | |
| 133 | ============================================================================*/ |
| 134 | VOS_STATUS |
| 135 | WLANBAP_GetCurrentChannel |
| 136 | ( |
| 137 | ptBtampContext pBtampCtx, |
| 138 | v_U32_t *channel, // return current channel here |
| 139 | v_U32_t *activeFlag // return active flag here |
| 140 | ) |
| 141 | { |
| 142 | //v_U32_t cb_enabled; |
| 143 | tHalHandle halHandle; |
| 144 | |
| 145 | /*------------------------------------------------------------------------ |
| 146 | Sanity check BAP control block |
| 147 | ------------------------------------------------------------------------*/ |
| 148 | |
| 149 | if (( NULL == pBtampCtx ) || (NULL == channel) || (NULL == activeFlag)) |
| 150 | { |
| 151 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, |
| 152 | "Invalid BAP pointer in %s", __FUNCTION__); |
| 153 | return VOS_STATUS_E_FAULT; |
| 154 | } |
| 155 | |
| 156 | halHandle = VOS_GET_HAL_CB(pBtampCtx->pvosGCtx); |
| 157 | |
| 158 | if(NULL == halHandle) |
| 159 | { |
| 160 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, |
| 161 | "halHandle is NULL in %s", __FUNCTION__); |
| 162 | return VOS_STATUS_E_FAULT; |
| 163 | } |
| 164 | |
| 165 | if (ccmCfgGetInt(halHandle, WNI_CFG_CURRENT_CHANNEL, channel) |
| 166 | != eHAL_STATUS_SUCCESS ) |
| 167 | { |
| 168 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, |
| 169 | "Get CFG failed in %s", __FUNCTION__); |
| 170 | return VOS_STATUS_E_FAULT; |
| 171 | } |
| 172 | |
| 173 | *activeFlag = FALSE; // return active flag here |
| 174 | |
| 175 | return VOS_STATUS_SUCCESS; |
| 176 | }/* WLANBAP_GetCurrentChannel */ |
| 177 | |
| 178 | |