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