Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 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 | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 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 | /*=========================================================================== |
| 29 | |
| 30 | b a p A p i I n f o . C |
| 31 | |
| 32 | OVERVIEW: |
| 33 | |
| 34 | This software unit holds the implementation of the WLAN BAP modules |
| 35 | Information functions. |
| 36 | |
| 37 | The functions externalized by this module are to be called ONLY by other |
| 38 | WLAN modules (HDD) that properly register with the BAP Layer initially. |
| 39 | |
| 40 | DEPENDENCIES: |
| 41 | |
| 42 | Are listed for each API below. |
| 43 | |
| 44 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | ===========================================================================*/ |
| 46 | |
| 47 | /*=========================================================================== |
| 48 | |
| 49 | EDIT HISTORY FOR FILE |
| 50 | |
| 51 | |
| 52 | This section contains comments describing changes made to the module. |
| 53 | Notice that changes are listed in reverse chronological order. |
| 54 | |
| 55 | |
| 56 | $Header: /cygdrive/c/Dropbox/M7201JSDCAAPAD52240B/WM/platform/msm7200/Src/Drivers/SD/ClientDrivers/WLAN/QCT_BTAMP_PAL/CORE/BAP/src/bapApiInfo.c,v 1.2 2008/11/10 22:55:24 jzmuda Exp jzmuda $$DateTime$$Author: jzmuda $ |
| 57 | |
| 58 | |
| 59 | when who what, where, why |
| 60 | ---------- --- -------------------------------------------------------- |
| 61 | 2008-09-15 jez Created module |
| 62 | |
| 63 | ===========================================================================*/ |
| 64 | |
| 65 | /*---------------------------------------------------------------------------- |
| 66 | * Include Files |
| 67 | * -------------------------------------------------------------------------*/ |
| 68 | //#include "wlan_qct_tl.h" |
| 69 | #include "vos_trace.h" |
| 70 | #include "sme_Api.h" |
| 71 | /* BT-AMP PAL API header file */ |
| 72 | #include "bapApi.h" |
| 73 | #include "bapInternal.h" |
| 74 | |
| 75 | //#define BAP_DEBUG |
| 76 | /*---------------------------------------------------------------------------- |
| 77 | * Preprocessor Definitions and Constants |
| 78 | * -------------------------------------------------------------------------*/ |
| 79 | |
| 80 | |
| 81 | /*---------------------------------------------------------------------------- |
| 82 | * Type Declarations |
| 83 | * -------------------------------------------------------------------------*/ |
| 84 | |
| 85 | /*---------------------------------------------------------------------------- |
| 86 | * Global Data Definitions |
| 87 | * -------------------------------------------------------------------------*/ |
| 88 | |
| 89 | /*---------------------------------------------------------------------------- |
| 90 | * Static Variable Definitions |
| 91 | * -------------------------------------------------------------------------*/ |
| 92 | |
| 93 | /*---------------------------------------------------------------------------- |
| 94 | * Static Function Declarations and Definitions |
| 95 | * -------------------------------------------------------------------------*/ |
| 96 | |
| 97 | /*---------------------------------------------------------------------------- |
| 98 | * Externalized Function Definitions |
| 99 | * -------------------------------------------------------------------------*/ |
| 100 | |
| 101 | /*---------------------------------------------------------------------------- |
| 102 | * Function Declarations and Documentation |
| 103 | * -------------------------------------------------------------------------*/ |
| 104 | |
| 105 | |
| 106 | /* Informational Parameters */ |
| 107 | |
| 108 | /*---------------------------------------------------------------------------- |
| 109 | |
| 110 | FUNCTION WLAN_BAPReadLocalVersionInfo() |
| 111 | |
| 112 | DESCRIPTION |
| 113 | Implements the actual HCI Read Local Version Info command. There |
| 114 | is no need for a callback because when this call returns the action |
| 115 | has been completed. |
| 116 | |
| 117 | DEPENDENCIES |
| 118 | NA. |
| 119 | |
| 120 | PARAMETERS |
| 121 | |
| 122 | IN |
| 123 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 124 | // There are really no input parameters in this command. |
| 125 | // Just the command opcode itself is sufficient. |
| 126 | |
| 127 | IN/OUT |
| 128 | pBapHCIEvent: Return event value for the command complete event. |
| 129 | (The caller of this routine is responsible for sending |
| 130 | the Command Complete event up the HCI interface.) |
| 131 | |
| 132 | RETURN VALUE |
| 133 | The result code associated with performing the operation |
| 134 | |
| 135 | VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalVersionInfo is NULL |
| 136 | VOS_STATUS_SUCCESS: Success |
| 137 | |
| 138 | SIDE EFFECTS |
| 139 | |
| 140 | ----------------------------------------------------------------------------*/ |
| 141 | VOS_STATUS |
| 142 | WLAN_BAPReadLocalVersionInfo |
| 143 | ( |
| 144 | ptBtampHandle btampHandle, |
| 145 | tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ |
| 146 | /* Including "Read" Command Complete*/ |
| 147 | ) |
| 148 | { |
| 149 | |
| 150 | /* Validate params */ |
| 151 | if (btampHandle == NULL) { |
| 152 | return VOS_STATUS_E_FAULT; |
| 153 | } |
| 154 | |
| 155 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 156 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 157 | |
| 158 | |
| 159 | /* Format the command complete event to return... */ |
| 160 | pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; |
| 161 | pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; |
| 162 | pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; |
| 163 | pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode |
| 164 | = BTAMP_TLV_HCI_READ_LOCAL_VERSION_INFO_CMD; |
| 165 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.status |
| 166 | = WLANBAP_STATUS_SUCCESS; |
| 167 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_HCI_Version |
| 168 | = WLANBAP_HCI_VERSION; |
| 169 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_HCI_Revision |
| 170 | = WLANBAP_HCI_REVISION; |
| 171 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_PAL_Version |
| 172 | = WLANBAP_PAL_VERSION; |
| 173 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_Manufac_Name |
| 174 | = WLANBAP_QUALCOMM_COMPANY_ID; |
| 175 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_PAL_Sub_Version |
| 176 | = WLANBAP_PAL_SUBVERSION; |
| 177 | |
| 178 | return VOS_STATUS_SUCCESS; |
| 179 | } /* WLAN_BAPReadLocalVersionInfo */ |
| 180 | |
| 181 | /*---------------------------------------------------------------------------- |
| 182 | |
| 183 | FUNCTION WLAN_BAPReadLocalSupportedCmds() |
| 184 | |
| 185 | DESCRIPTION |
| 186 | Implements the actual HCI Read Local Supported Commands. There |
| 187 | is no need for a callback because when this call returns the action |
| 188 | has been completed. |
| 189 | |
| 190 | DEPENDENCIES |
| 191 | NA. |
| 192 | |
| 193 | PARAMETERS |
| 194 | |
| 195 | IN |
| 196 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 197 | // There are really no input parameters in this command. |
| 198 | // Just the command opcode itself is sufficient. |
| 199 | |
| 200 | IN/OUT |
| 201 | pBapHCIEvent: Return event value for the command complete event. |
| 202 | (The caller of this routine is responsible for sending |
| 203 | the Command Complete event up the HCI interface.) |
| 204 | |
| 205 | RETURN VALUE |
| 206 | The result code associated with performing the operation |
| 207 | |
| 208 | VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalSupportedCmds is NULL |
| 209 | VOS_STATUS_SUCCESS: Success |
| 210 | |
| 211 | SIDE EFFECTS |
| 212 | |
| 213 | ----------------------------------------------------------------------------*/ |
| 214 | VOS_STATUS |
| 215 | WLAN_BAPReadLocalSupportedCmds |
| 216 | ( |
| 217 | ptBtampHandle btampHandle, |
| 218 | tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ |
| 219 | /* Including "Read" Command Complete*/ |
| 220 | ) |
| 221 | { |
| 222 | v_U8_t supportedCmds[] = WLANBAP_PAL_SUPPORTED_HCI_CMDS; |
| 223 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 224 | |
| 225 | |
| 226 | /* Validate params */ |
| 227 | if (btampHandle == NULL) { |
| 228 | return VOS_STATUS_E_FAULT; |
| 229 | } |
| 230 | |
| 231 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 232 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 233 | |
| 234 | |
| 235 | /* Format the command complete event to return... */ |
| 236 | pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; |
| 237 | pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; |
| 238 | pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; |
| 239 | pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode |
| 240 | = BTAMP_TLV_HCI_READ_LOCAL_SUPPORTED_CMDS_CMD; |
| 241 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Supported_Cmds.status |
| 242 | = WLANBAP_STATUS_SUCCESS; |
| 243 | /* Return the supported commands bitmask */ |
| 244 | vos_mem_copy( |
| 245 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Supported_Cmds.HC_Support_Cmds, |
| 246 | supportedCmds, |
| 247 | sizeof( supportedCmds)); |
| 248 | |
| 249 | return VOS_STATUS_SUCCESS; |
| 250 | } /* WLAN_BAPReadLocalSupportedCmds */ |
| 251 | |
| 252 | /*---------------------------------------------------------------------------- |
| 253 | |
| 254 | FUNCTION WLAN_BAPReadBufferSize() |
| 255 | |
| 256 | DESCRIPTION |
| 257 | Implements the actual HCI Read Buffer Size command. There |
| 258 | is no need for a callback because when this call returns the action |
| 259 | has been completed. |
| 260 | |
| 261 | DEPENDENCIES |
| 262 | NA. |
| 263 | |
| 264 | PARAMETERS |
| 265 | |
| 266 | IN |
| 267 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 268 | pBapHCIReadBufferSize: pointer to the "HCI Read Buffer Size" Structure. |
| 269 | |
| 270 | IN/OUT |
| 271 | pBapHCIEvent: Return event value for the command complete event. |
| 272 | (The caller of this routine is responsible for sending |
| 273 | the Command Complete event up the HCI interface.) |
| 274 | |
| 275 | RETURN VALUE |
| 276 | The result code associated with performing the operation |
| 277 | |
| 278 | VOS_STATUS_E_FAULT: pointer to pBapHCIReadBufferSize is NULL |
| 279 | VOS_STATUS_SUCCESS: Success |
| 280 | |
| 281 | SIDE EFFECTS |
| 282 | |
| 283 | ----------------------------------------------------------------------------*/ |
| 284 | VOS_STATUS |
| 285 | WLAN_BAPReadBufferSize |
| 286 | ( |
| 287 | ptBtampHandle btampHandle, |
| 288 | tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ |
| 289 | /* Including "Read" Command Complete*/ |
| 290 | ) |
| 291 | { |
| 292 | /* Validate params */ |
| 293 | if (btampHandle == NULL) { |
| 294 | return VOS_STATUS_E_FAULT; |
| 295 | } |
| 296 | |
| 297 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 298 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | |
| 300 | |
| 301 | /* Format the command complete event to return... */ |
| 302 | pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; |
| 303 | pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; |
| 304 | pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; |
| 305 | pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode |
| 306 | = BTAMP_TLV_HCI_READ_BUFFER_SIZE_CMD; |
| 307 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.status |
| 308 | = WLANBAP_STATUS_SUCCESS; |
| 309 | /* Return the supported Buffer sizes */ |
| 310 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_ACL_Data_Packet_Length |
| 311 | = WLANBAP_MAX_80211_PAL_PDU_SIZE; |
| 312 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_SCO_Packet_Length |
| 313 | = 0; /* Invalid assignment to Uint8, makes 0 */ |
| 314 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_Total_Num_ACL_Packets |
| 315 | = 16; |
| 316 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_Total_Num_SCO_Packets |
| 317 | = 0; |
| 318 | |
| 319 | return VOS_STATUS_SUCCESS; |
| 320 | } /* WLAN_BAPReadBufferSize */ |
| 321 | |
| 322 | /*---------------------------------------------------------------------------- |
| 323 | |
| 324 | FUNCTION WLAN_BAPReadDataBlockSize() |
| 325 | |
| 326 | DESCRIPTION |
| 327 | Implements the actual HCI Read Data Block Size command. There |
| 328 | is no need for a callback because when this call returns the action |
| 329 | has been completed. |
| 330 | |
| 331 | DEPENDENCIES |
| 332 | NA. |
| 333 | |
| 334 | PARAMETERS |
| 335 | |
| 336 | IN |
| 337 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 338 | |
| 339 | IN/OUT |
| 340 | pBapHCIEvent: Return event value for the command complete event. |
| 341 | (The caller of this routine is responsible for sending |
| 342 | the Command Complete event up the HCI interface.) |
| 343 | |
| 344 | RETURN VALUE |
| 345 | The result code associated with performing the operation |
| 346 | |
| 347 | VOS_STATUS_E_FAULT: pointer to pBapHCIReadDataBlockSize is NULL |
| 348 | VOS_STATUS_SUCCESS: Success |
| 349 | |
| 350 | SIDE EFFECTS |
| 351 | |
| 352 | ----------------------------------------------------------------------------*/ |
| 353 | VOS_STATUS |
| 354 | WLAN_BAPReadDataBlockSize |
| 355 | ( |
| 356 | ptBtampHandle btampHandle, |
| 357 | tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ |
| 358 | /* Including "Read" Command Complete*/ |
| 359 | ) |
| 360 | { |
| 361 | /* Validate params */ |
| 362 | if ((btampHandle == NULL) || (NULL == pBapHCIEvent)) |
| 363 | { |
| 364 | return VOS_STATUS_E_FAULT; |
| 365 | } |
| 366 | |
| 367 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 368 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | |
| 370 | |
| 371 | /* Format the command complete event to return... */ |
| 372 | pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; |
| 373 | pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; |
| 374 | pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; |
| 375 | pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode |
| 376 | = BTAMP_TLV_HCI_READ_DATA_BLOCK_SIZE_CMD; |
| 377 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.status |
| 378 | = WLANBAP_STATUS_SUCCESS; |
| 379 | /* Return the supported Block sizes */ |
| 380 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.HC_Data_Block_Length |
| 381 | = WLANBAP_MAX_80211_PAL_PDU_SIZE; |
| 382 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.HC_Max_ACL_Data_Packet_Length |
| 383 | = WLANBAP_MAX_80211_PAL_PDU_SIZE; |
| 384 | pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.HC_Total_Num_Data_Blocks |
| 385 | = 16; |
| 386 | |
| 387 | return VOS_STATUS_SUCCESS; |
| 388 | } /* WLAN_BAPReadDataBlockSize */ |
| 389 | |
| 390 | |
| 391 | /*---------------------------------------------------------------------------- |
| 392 | |
| 393 | FUNCTION WLAN_BAPSetConfig() |
| 394 | |
| 395 | DESCRIPTION |
| 396 | The function updates some configuration for BAP module in SME during SMEs |
| 397 | close -> open sequence. |
| 398 | |
| 399 | BAP applies the new configuration at the next transaction. |
| 400 | |
| 401 | |
| 402 | DEPENDENCIES |
| 403 | NA. |
| 404 | |
| 405 | PARAMETERS |
| 406 | |
| 407 | IN |
| 408 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 409 | pBapHCIReadRSSI: pointer to the "HCI Read RSSI" structure. |
| 410 | |
| 411 | IN |
| 412 | pConfig: a pointer to a caller allocated object of typedef struct WLANBAP_ConfigType. |
| 413 | |
| 414 | RETURN VALUE |
| 415 | The result code associated with performing the operation |
| 416 | |
| 417 | VOS_STATUS_E_FAULT: pConfig or btampHandle is NULL |
| 418 | VOS_STATUS_SUCCESS: Success |
| 419 | |
| 420 | SIDE EFFECTS |
| 421 | |
| 422 | ----------------------------------------------------------------------------*/ |
| 423 | VOS_STATUS |
| 424 | WLAN_BAPSetConfig |
| 425 | ( |
| 426 | ptBtampHandle btampHandle, |
| 427 | WLANBAP_ConfigType *pConfig |
| 428 | ) |
| 429 | { |
| 430 | ptBtampContext btampContext; |
| 431 | /* Validate params */ |
| 432 | if ((NULL == btampHandle)|| (NULL == pConfig)) |
| 433 | { |
| 434 | return VOS_STATUS_E_FAULT; |
| 435 | } |
| 436 | btampContext = (ptBtampContext) btampHandle; /* btampContext value */ |
| 437 | |
| 438 | btampContext->config.ucPreferredChannel = pConfig->ucPreferredChannel; |
| 439 | return VOS_STATUS_SUCCESS; |
| 440 | } |
| 441 | |
| 442 | /*---------------------------------------------------------------------------- |
| 443 | |
| 444 | FUNCTION WLAN_BAPGetMask() |
| 445 | |
| 446 | DESCRIPTION |
| 447 | The function gets the updated event mask from BAP core. |
| 448 | |
| 449 | |
| 450 | |
| 451 | DEPENDENCIES |
| 452 | NA. |
| 453 | |
| 454 | PARAMETERS |
| 455 | |
| 456 | IN |
| 457 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 458 | |
| 459 | |
| 460 | IN |
| 461 | pEvent_mask_page_2: a pointer to a caller allocated object of 8 bytes. |
| 462 | |
| 463 | RETURN VALUE |
| 464 | The result code associated with performing the operation |
| 465 | |
| 466 | VOS_STATUS_E_FAULT: pEvent_mask_page_2 or btampHandle is NULL |
| 467 | VOS_STATUS_SUCCESS: Success |
| 468 | |
| 469 | SIDE EFFECTS |
| 470 | |
| 471 | ----------------------------------------------------------------------------*/ |
| 472 | VOS_STATUS |
| 473 | WLAN_BAPGetMask( ptBtampHandle btampHandle, |
| 474 | v_U8_t *pEvent_mask_page_2) |
| 475 | { |
| 476 | ptBtampContext btampContext; |
| 477 | /* Validate params */ |
| 478 | if ((NULL == btampHandle)|| (NULL == pEvent_mask_page_2)) |
| 479 | { |
| 480 | return VOS_STATUS_E_FAULT; |
| 481 | } |
| 482 | btampContext = (ptBtampContext) btampHandle; /* btampContext value */ |
| 483 | |
| 484 | vos_mem_copy( pEvent_mask_page_2, |
| 485 | btampContext->event_mask_page_2, |
| 486 | 8 ); |
| 487 | return VOS_STATUS_SUCCESS; |
| 488 | } |
| 489 | |
| 490 | /*---------------------------------------------------------------------------- |
| 491 | |
| 492 | FUNCTION WLAN_BAPDisconnect() |
| 493 | |
| 494 | DESCRIPTION |
| 495 | The function to request to BAP core to disconnect currecnt AMP connection. |
| 496 | |
| 497 | |
| 498 | |
| 499 | DEPENDENCIES |
| 500 | NA. |
| 501 | |
| 502 | PARAMETERS |
| 503 | |
| 504 | IN |
| 505 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 506 | |
| 507 | |
| 508 | RETURN VALUE |
| 509 | The result code associated with performing the operation |
| 510 | |
| 511 | VOS_STATUS_E_FAULT: btampHandle is NULL |
| 512 | VOS_STATUS_SUCCESS: Success |
| 513 | |
| 514 | SIDE EFFECTS |
| 515 | |
| 516 | ----------------------------------------------------------------------------*/ |
| 517 | VOS_STATUS |
| 518 | WLAN_BAPDisconnect |
| 519 | ( |
| 520 | ptBtampHandle btampHandle |
| 521 | ) |
| 522 | { |
| 523 | ptBtampContext btampContext = (ptBtampContext) btampHandle; |
| 524 | tWLAN_BAPEvent bapEvent; /* State machine event */ |
| 525 | v_U8_t status; /* return the BT-AMP status here */ |
| 526 | VOS_STATUS vosStatus; |
| 527 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 528 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 529 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | |
| 531 | /* Validate params */ |
| 532 | if (btampHandle == NULL) |
| 533 | { |
| 534 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 535 | "btampHandle is NULL in %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | |
| 537 | return VOS_STATUS_E_FAULT; |
| 538 | } |
| 539 | |
| 540 | /* Fill in the event structure */ |
| 541 | bapEvent.event = eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION; |
| 542 | bapEvent.params = NULL; |
| 543 | |
| 544 | |
| 545 | /* Handle event */ |
| 546 | vosStatus = btampFsm(btampContext, &bapEvent, &status); |
| 547 | |
| 548 | |
| 549 | /* Fill in the event structure */ |
| 550 | bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; |
| 551 | bapEvent.params = NULL; |
| 552 | |
| 553 | /* Handle event */ |
| 554 | vosStatus = btampFsm(btampContext, &bapEvent, &status); |
| 555 | |
| 556 | |
| 557 | return VOS_STATUS_SUCCESS; |
| 558 | } |
| 559 | |
| 560 | /*---------------------------------------------------------------------------- |
| 561 | |
| 562 | FUNCTION WLAN_BAPSessionOn() |
| 563 | |
| 564 | DESCRIPTION |
| 565 | The function to check from BAP core if AMP connection is up right now. |
| 566 | |
| 567 | |
| 568 | |
| 569 | DEPENDENCIES |
| 570 | NA. |
| 571 | |
| 572 | PARAMETERS |
| 573 | |
| 574 | IN |
| 575 | btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. |
| 576 | |
| 577 | |
| 578 | RETURN VALUE |
| 579 | The result code associated with performing the operation |
| 580 | |
| 581 | VOS_TRUE: AMP connection is on |
| 582 | VOS_FALSE: AMP connection is not on |
| 583 | |
| 584 | SIDE EFFECTS |
| 585 | |
| 586 | ----------------------------------------------------------------------------*/ |
| 587 | v_BOOL_t WLAN_BAPSessionOn |
| 588 | ( |
| 589 | ptBtampHandle btampHandle |
| 590 | ) |
| 591 | { |
| 592 | ptBtampContext btampContext = (ptBtampContext) btampHandle; |
| 593 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 594 | |
Jeff Johnson | 2bbc029 | 2017-09-19 08:38:56 -0700 | [diff] [blame] | 595 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 596 | |
| 597 | /* Validate params */ |
| 598 | if (btampHandle == NULL) |
| 599 | { |
| 600 | VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 601 | "btampHandle is NULL in %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 602 | |
| 603 | //?? shall we say true or false |
| 604 | return VOS_FALSE; |
| 605 | } |
| 606 | |
| 607 | return btampContext->btamp_session_on; |
| 608 | } |