Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Prakash Dhavali | 2e9ffc8 | 2014-02-19 21:16:20 -0800 | [diff] [blame] | 2 | * Copyright (c) 2014 The Linux Foundation. All rights reserved. |
AnjaneeDevi Kapparapu | 24b52ff | 2014-02-18 18:44:02 -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 | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
AnjaneeDevi Kapparapu | 24b52ff | 2014-02-18 18:44:02 -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 | #include "wlan_hdd_includes.h" |
| 29 | |
| 30 | |
| 31 | static inline v_VOID_t mibGetDot11DesiredBssType( hdd_adapter_t *pAdapter, eMib_dot11DesiredBssType *pDot11DesiredBssType ) |
| 32 | { |
| 33 | *pDot11DesiredBssType = pAdapter->hdd_mib.mibDot11DesiredBssType; |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | static inline VOS_STATUS mibSetDot11DesiredBssType( hdd_adapter_t *pAdapter, eMib_dot11DesiredBssType mibDot11DesiredBssType ) |
| 38 | { |
| 39 | pAdapter->hdd_mib.mibDot11DesiredBssType = mibDot11DesiredBssType; |
| 40 | return( VOS_STATUS_SUCCESS ); |
| 41 | } |
| 42 | |
| 43 | v_BOOL_t mibIsDot11DesiredBssTypeInfrastructure( hdd_adapter_t *pAdapter ) |
| 44 | { |
| 45 | eMib_dot11DesiredBssType mibDot11DesiredBssType; |
| 46 | mibGetDot11DesiredBssType( pAdapter, &mibDot11DesiredBssType ); |
| 47 | |
| 48 | return( eMib_dot11DesiredBssType_infrastructure == mibDot11DesiredBssType ); |
| 49 | } |
| 50 | |
| 51 | |
| 52 | static inline v_BOOL_t mibIsDot11DesiredBssTypeIndependent( hdd_adapter_t *pAdapter ) |
| 53 | { |
| 54 | eMib_dot11DesiredBssType mibDot11DesiredBssType; |
| 55 | mibGetDot11DesiredBssType( pAdapter, &mibDot11DesiredBssType ); |
| 56 | |
| 57 | return( eMib_dot11DesiredBssType_independent == mibDot11DesiredBssType ); |
| 58 | } |
| 59 | |
| 60 | static inline v_VOID_t mibGetDot11IbssJoinOnly( hdd_adapter_t *pAdapter, v_BOOL_t *pdot11IbssJoinOnly ) |
| 61 | { |
| 62 | *pdot11IbssJoinOnly = pAdapter->hdd_mib.dot11IbssJoinOnly; |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | static inline VOS_STATUS mibSetDot11IbssJoinOnly( hdd_adapter_t *pAdapter, v_BOOL_t dot11IbssJoinOnly ) |
| 67 | { |
| 68 | pAdapter->hdd_mib.dot11IbssJoinOnly = dot11IbssJoinOnly; |
| 69 | return( VOS_STATUS_SUCCESS ); |
| 70 | } |
| 71 | |
| 72 | static inline VOS_STATUS mibSetDot11NICPowerState( hdd_adapter_t *pAdapter, eMib_dot11NICPowerState *pMibDot11NICPowerState ) |
| 73 | { |
| 74 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 75 | |
| 76 | pAdapter->hdd_mib.mibDot11NICPowerState = *pMibDot11NICPowerState; |
| 77 | |
| 78 | return( status ); |
| 79 | } |
| 80 | |
| 81 | static inline VOS_STATUS mibSetDot11NICPowerStateOff( hdd_adapter_t *pAdapter ) |
| 82 | { |
| 83 | eMib_dot11NICPowerState dot11NICPowerState = eMib_dot11NICPowerState_OFF; |
| 84 | return( mibSetDot11NICPowerState( pAdapter, &dot11NICPowerState ) ); |
| 85 | } |
| 86 | |
| 87 | static inline void mibGetDot11NICPowerState( hdd_adapter_t *pAdapter, eMib_dot11NICPowerState *pMibDot11NICPowerState ) |
| 88 | { |
| 89 | *pMibDot11NICPowerState = pAdapter->hdd_mib.mibDot11NICPowerState; |
| 90 | |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | static inline v_BOOL_t mibIsDot11NICPowerStateOn( hdd_adapter_t *pAdapter ) |
| 95 | { |
| 96 | eMib_dot11NICPowerState dot11NICPowerState; |
| 97 | |
| 98 | mibGetDot11NICPowerState( pAdapter, &dot11NICPowerState ); |
| 99 | |
| 100 | return( eMib_dot11NICPowerState_ON == dot11NICPowerState ); |
| 101 | } |
| 102 | |
| 103 | static inline v_BOOL_t mibIsDot11NICPowerStateOff( hdd_adapter_t *pAdapter ) |
| 104 | { |
| 105 | return( !mibIsDot11NICPowerStateOn( pAdapter ) ); |
| 106 | } |
| 107 | |
| 108 | static inline VOS_STATUS mibSetDot11DesiredSsidList( hdd_adapter_t *pAdapter, sMib_dot11DesiredSsidList *pDot11DesiredSsidList ) |
| 109 | { |
| 110 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 111 | |
| 112 | if ( pDot11DesiredSsidList->cEntries > MIB_DOT11_DESIRED_SSID_LIST_MAX_COUNT ) |
| 113 | |
| 114 | pAdapter->hdd_mib.mibDot11DesiredSsidList = *pDot11DesiredSsidList ; |
| 115 | |
| 116 | return( status ); |
| 117 | } |
| 118 | |
| 119 | static inline VOS_STATUS mibSetDot11DesiredBssidList( hdd_adapter_t *pAdapter, sMib_dot11DesiredBssidList *pDot11DesiredBssidList ) |
| 120 | { |
| 121 | pAdapter->hdd_mib.mibDot11DesiredBssidList = *pDot11DesiredBssidList; |
| 122 | |
| 123 | return( VOS_STATUS_SUCCESS ); |
| 124 | } |
| 125 | |
| 126 | |
| 127 | static inline v_VOID_t mibGetDot11DesiredBssidList( hdd_adapter_t *pAdapter, sMib_dot11DesiredBssidList *pMibDot11DesiredBssidList ) |
| 128 | { |
| 129 | *pMibDot11DesiredBssidList = pAdapter->hdd_mib.mibDot11DesiredBssidList; |
| 130 | |
| 131 | return; |
| 132 | } |
| 133 | |
| 134 | |
| 135 | static inline v_VOID_t mibGetDot11DesiredSsidList( hdd_adapter_t *pAdapter, sMib_dot11DesiredSsidList *pMibDot11DesiredSsidList ) |
| 136 | { |
| 137 | *pMibDot11DesiredSsidList = pAdapter->hdd_mib.mibDot11DesiredSsidList; |
| 138 | |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | |
| 143 | static inline VOS_STATUS mibSetDot11AutoConfigEnabled( hdd_adapter_t *pAdapter, eMib_dot11AutoConfigEnabled *pMibDot11AutoConfigEnabled ) |
| 144 | { |
| 145 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 146 | |
| 147 | pAdapter->hdd_mib.mibDot11AutoConfigEnabled = *pMibDot11AutoConfigEnabled; |
| 148 | |
| 149 | return( status ); |
| 150 | } |
| 151 | |
| 152 | |
| 153 | static inline v_VOID_t mibGetDot11AutoConfigEnabled( hdd_adapter_t *pAdapter, eMib_dot11AutoConfigEnabled *pMibDot11AutoConfigEnabled ) |
| 154 | { |
| 155 | *pMibDot11AutoConfigEnabled = pAdapter->hdd_mib.mibDot11AutoConfigEnabled; |
| 156 | |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | static inline VOS_STATUS mibSetDot11MacExcludeList( hdd_adapter_t *pAdapter, sMib_dot11MacExcludeList *pDot11MacExcludeList ) |
| 161 | { |
| 162 | pAdapter->hdd_mib.mibDot11MacExcludeList = *pDot11MacExcludeList; |
| 163 | |
| 164 | return( VOS_STATUS_SUCCESS ); |
| 165 | } |
| 166 | |
| 167 | static inline VOS_STATUS mibGetDot11MacExcludeList( hdd_adapter_t *pAdapter, sMib_dot11MacExcludeList *pDot11MacExcludeList ) |
| 168 | { |
| 169 | *pDot11MacExcludeList = pAdapter->hdd_mib.mibDot11MacExcludeList; |
| 170 | |
| 171 | return( VOS_STATUS_SUCCESS ); |
| 172 | } |
| 173 | |
| 174 | static inline void mibSetDefaultDot11MacExcludeList( hdd_adapter_t *pAdapter ) |
| 175 | { |
| 176 | pAdapter->hdd_mib.mibDot11MacExcludeList.cEntries = 0; |
| 177 | } |
| 178 | |
| 179 | static inline VOS_STATUS mibSetDot11HardwarePHYState( hdd_adapter_t *pAdapter, eMib_dot11HardwarePHYState *pMibDot11HardwarePHYState ) |
| 180 | { |
| 181 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 182 | |
| 183 | pAdapter->hdd_mib.mibDot11HardwarePHYState = *pMibDot11HardwarePHYState; |
| 184 | |
| 185 | return( status ); |
| 186 | } |
| 187 | |
| 188 | |
| 189 | static inline void mibGetDot11HardwarePHYState( hdd_adapter_t *pAdapter, eMib_dot11HardwarePHYState *pMibDot11HardwarePHYState ) |
| 190 | { |
| 191 | *pMibDot11HardwarePHYState = pAdapter->hdd_mib.mibDot11HardwarePHYState; |
| 192 | |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | static inline void mibSetDefaultDot11PrivacyExemptionList( hdd_adapter_t *pAdapter ) |
| 197 | { |
| 198 | pAdapter->hdd_mib.mibDot11PrivacyExemptionList.cEntries = 0; |
| 199 | } |
| 200 | |
| 201 | |
| 202 | static inline void mibGetDot11PowerSavingLevel( hdd_adapter_t *pAdapter, eMib_dot11PowerSavingLevel *pMibDot11PowerSavingLevel ) |
| 203 | { |
| 204 | *pMibDot11PowerSavingLevel = pAdapter->hdd_mib.mibDot11PowerSavingLevel; |
| 205 | |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | |
| 210 | static inline void mibGetDevicePowerState( hdd_adapter_t *pAdapter, eMib_DevicePowerState *pMibDevicePowerState ) |
| 211 | { |
| 212 | *pMibDevicePowerState = pAdapter->hdd_mib.mibDevicePowerState; |
| 213 | |
| 214 | return; |
| 215 | } |
| 216 | |
| 217 | |