blob: 58c14687f888aa4f3be9292609af58753bba2c56 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson2bbc0292017-09-19 08:38:56 -07002 * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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 Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
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 Johnson295189b2012-06-20 16:38:30 -070028/*===========================================================================
29
30 b a p A p i H C B B . C
31
32 OVERVIEW:
33
34 This software unit holds the implementation of the WLAN BAP modules
35 Host Controller and Baseband 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 Johnson295189b2012-06-20 16:38:30 -070045===========================================================================*/
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: /prj/qct/asw/engbuilds/scl/users02/jzmuda/Android/ampBlueZ_6/CORE/BAP/src/bapApiHCBB.c,v 1.7 2011/05/06 00:59:27 jzmuda Exp jzmuda $$DateTime$$Author: jzmuda $
57
58
59 when who what, where, why
60---------- --- --------------------------------------------------------
612008-09-15 jez Created module
62
63===========================================================================*/
64
65/*----------------------------------------------------------------------------
66 * Include Files
67 * -------------------------------------------------------------------------*/
68#include "vos_trace.h"
69
70// Pick up the sme callback registration API
71#include "sme_Api.h"
72
73/* BT-AMP PAL API header file */
74#include "bapApi.h"
75#include "bapInternal.h"
76
77//#define BAP_DEBUG
78/*----------------------------------------------------------------------------
79 * Preprocessor Definitions and Constants
80 * -------------------------------------------------------------------------*/
81
82
83/*----------------------------------------------------------------------------
84 * Type Declarations
85 * -------------------------------------------------------------------------*/
86
87/*----------------------------------------------------------------------------
88 * Global Data Definitions
89 * -------------------------------------------------------------------------*/
90
91/*----------------------------------------------------------------------------
92 * Static Variable Definitions
93 * -------------------------------------------------------------------------*/
94
95/*----------------------------------------------------------------------------
96 * Static Function Declarations and Definitions
97 * -------------------------------------------------------------------------*/
98
99/*----------------------------------------------------------------------------
100 * Externalized Function Definitions
101* -------------------------------------------------------------------------*/
102
103/*----------------------------------------------------------------------------
104 * Function Declarations and Documentation
105 * -------------------------------------------------------------------------*/
106
107
108/* Host Controller and Baseband Commands */
109
110/*----------------------------------------------------------------------------
111
112 FUNCTION WLAN_BAPReset()
113
114 DESCRIPTION
115 Implements the actual HCI Reset command.
116 Produces an asynchronous command complete event. Through the
117 command complete callback. (I.E., (*tpWLAN_BAPEventCB).)
118
119 DEPENDENCIES
120 NA.
121
122 PARAMETERS
123
124 IN
125 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
126
127 RETURN VALUE
128 The result code associated with performing the operation
129
130 VOS_STATUS_SUCCESS: Success
131
132 SIDE EFFECTS
133
134----------------------------------------------------------------------------*/
135VOS_STATUS
136WLAN_BAPReset
137(
138 ptBtampHandle btampHandle
139)
140{
141 VOS_STATUS vosStatus;
142 tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */
143 ptBtampContext btampContext = (ptBtampContext) btampHandle;
144 tHalHandle hHal = NULL;
145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
146
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700147 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700148
149 /* Validate params */
150 if (btampHandle == NULL)
151 {
152 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700153 "btampHandle is NULL in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700154
155 return VOS_STATUS_E_FAULT;
156 }
157
158 /* Perform a "reset" */
159 hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx);
160 if (NULL == hHal)
161 {
162 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700163 "hHal is NULL in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700164
165 return VOS_STATUS_E_FAULT;
166 }
167
168 //csrRoamDisconnect();
Jeff Johnson43971f52012-07-17 12:26:56 -0700169 /* To avoid sending Disassoc on STA interface */
170 if( TRUE == btampContext->isBapSessionOpen )
171 {
172 sme_RoamDisconnect(hHal,
Jeff Johnson295189b2012-06-20 16:38:30 -0700173 btampContext->sessionId,
174 // Danlin, where are the richer reason codes?
175 // I want to be able to convey everything 802.11 supports...
176 eCSR_DISCONNECT_REASON_UNSPECIFIED);
Jeff Johnson43971f52012-07-17 12:26:56 -0700177 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700178
179 /* Need to reset the timers as well*/
180 /* Connection Accept Timer interval*/
181 btampContext->bapConnectionAcceptTimerInterval = WLANBAP_CONNECTION_ACCEPT_TIMEOUT;
182 /* Link Supervision Timer interval*/
183 btampContext->bapLinkSupervisionTimerInterval = WLANBAP_LINK_SUPERVISION_TIMEOUT;
184 /* Logical Link Accept Timer interval*/
185 btampContext->bapLogicalLinkAcceptTimerInterval = WLANBAP_LOGICAL_LINK_ACCEPT_TIMEOUT;
186 /* Best Effort Flush timer interval*/
187 btampContext->bapBEFlushTimerInterval = WLANBAP_BE_FLUSH_TIMEOUT;
188
189
190 /* Form and immediately return the command complete event... */
191 bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
192 bapHCIEvent.u.btampCommandCompleteEvent.present = 1;
193 bapHCIEvent.u.btampCommandCompleteEvent.num_hci_command_packets = 1;
194 bapHCIEvent.u.btampCommandCompleteEvent.command_opcode
195 = BTAMP_TLV_HCI_RESET_CMD;
196 bapHCIEvent.u.btampCommandCompleteEvent.cc_event.Reset.status
197 = WLANBAP_STATUS_SUCCESS;
198
199 vosStatus = (*btampContext->pBapHCIEventCB)
200 (
201 //btampContext->pHddHdl, /* this refers to the BSL per connection context */
202 btampContext->pAppHdl, /* this refers the BSL per application context */
203 &bapHCIEvent, /* This now encodes ALL event types */
204 VOS_FALSE /* Flag to indicate assoc-specific event */
205 );
206
207 return vosStatus;
208} /* WLAN_BAPReset */
209
210/*----------------------------------------------------------------------------
211
212 FUNCTION WLAN_BAPSetEventMask()
213
214 DESCRIPTION
215 Implements the actual HCI Set Event Mask command. There is no need for
216 a callback because when this call returns the action has been completed.
217
218 DEPENDENCIES
219 NA.
220
221 PARAMETERS
222
223 IN
224 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
225 pBapHCISetEventMask: pointer to the "HCI Set Event Mask" Structure.
226
227 IN/OUT
228 pBapHCIEvent: Return event value for the command complete event.
229 (The caller of this routine is responsible for sending
230 the Command Complete event up the HCI interface.)
231
232 RETURN VALUE
233 The result code associated with performing the operation
234
235 VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMask is NULL
236 VOS_STATUS_SUCCESS: Success
237
238 SIDE EFFECTS
239
240----------------------------------------------------------------------------*/
241VOS_STATUS
242WLAN_BAPSetEventMask
243(
244 ptBtampHandle btampHandle,
245 tBtampTLVHCI_Set_Event_Mask_Cmd *pBapHCISetEventMask,
246 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
247 /* Including Command Complete and Command Status*/
248)
249{
250
251 return VOS_STATUS_SUCCESS;
252} /* WLAN_BAPSetEventMask */
253
254/*----------------------------------------------------------------------------
255
256 FUNCTION WLAN_BAPFlush()
257
258 DESCRIPTION
259 Implements the actual HCI Flush command
260 Produces an asynchronous command complete event. Through the
261 event callback. And an asynchronous Flush occurred event. Also through the
262 event callback.
263
264 DEPENDENCIES
265 NA.
266
267 PARAMETERS
268
269 IN
270 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
271 pBapHCIFlush: pointer to the "HCI Flush" Structure.
272
273 RETURN VALUE
274 The result code associated with performing the operation
275
276 VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL
277 VOS_STATUS_SUCCESS: Success
278
279 SIDE EFFECTS
280
281----------------------------------------------------------------------------*/
282VOS_STATUS
283WLAN_BAPFlush
284(
285 ptBtampHandle btampHandle,
286 tBtampTLVHCI_Flush_Cmd *pBapHCIFlush
287)
288{
289 VOS_STATUS vosStatus;
290 tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */
291 ptBtampContext btampContext = (ptBtampContext) btampHandle;
292 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
293
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700294 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700295
296 /* Validate params */
297 if (btampHandle == NULL) {
298 return VOS_STATUS_E_FAULT;
299 }
300
301 /* Form and immediately return the command complete event... */
302 bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
303 bapHCIEvent.u.btampCommandCompleteEvent.present = 1;
304 bapHCIEvent.u.btampCommandCompleteEvent.num_hci_command_packets = 1;
305 bapHCIEvent.u.btampCommandCompleteEvent.command_opcode
306 = BTAMP_TLV_HCI_FLUSH_CMD;
307 bapHCIEvent.u.btampCommandCompleteEvent.cc_event.Flush.status
308 = WLANBAP_STATUS_SUCCESS;
309
310 vosStatus = (*btampContext->pBapHCIEventCB)
311 (
312 //btampContext->pHddHdl, /* this refers to the BSL per connection context */
313 btampContext->pAppHdl, /* this refers the BSL per application context */
314 &bapHCIEvent, /* This now encodes ALL event types */
315 VOS_FALSE /* Flag to indicate assoc-specific event */
316 );
317
318 return vosStatus;
319} /* WLAN_BAPFlush */
320
321/*----------------------------------------------------------------------------
322
323 FUNCTION WLAN_EnhancedBAPFlush()
324
325 DESCRIPTION
326 Implements the actual HCI Enhanced Flush command
327 Produces an asynchronous command complete event. Through the command status
328 event callback. And an asynchronous Enhanced Flush Complete event.
329
330 DEPENDENCIES
331 NA.
332
333 PARAMETERS
334
335 IN
336 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
337 pBapHCIFlush: pointer to the "HCI Enhanced Flush" Structure.
338 IN/OUT
339 pBapHCIEvent: Return event value for the command complete event.
340 (The caller of this routine is responsible for sending
341 the Command Complete event up the HCI interface.)
342
343 RETURN VALUE
344 The result code associated with performing the operation
345
346 VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL
347 VOS_STATUS_SUCCESS: Success
348
349 SIDE EFFECTS
350
351----------------------------------------------------------------------------*/
352VOS_STATUS
353WLAN_EnhancedBAPFlush
354(
355 ptBtampHandle btampHandle,
356 tBtampTLVHCI_Enhanced_Flush_Cmd *pBapHCIFlush,
357 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
358 /* Including Command Complete and Command Status*/
359
360)
361{
362 VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
363 tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */
364 ptBtampContext btampContext;
365 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
366
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700367 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700368
369 /* Validate params */
370 /* Validate params */
371 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
372 {
373 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700374 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700375 return VOS_STATUS_E_FAULT;
376 }
377
378 btampContext = (ptBtampContext) btampHandle;
379 /* Form and return the command status event... */
380 bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT;
381 bapHCIEvent.u.btampCommandStatusEvent.present = 1;
382 bapHCIEvent.u.btampCommandStatusEvent.num_hci_command_packets = 1;
383 bapHCIEvent.u.btampCommandStatusEvent.command_opcode
384 = BTAMP_TLV_HCI_ENHANCED_FLUSH_CMD;
385 bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS;
386
387 /* Form and immediately return the command complete event... */
388 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_ENHANCED_FLUSH_COMPLETE_EVENT;
389 pBapHCIEvent->u.btampEnhancedFlushCompleteEvent.present = 1;
390 pBapHCIEvent->u.btampEnhancedFlushCompleteEvent.log_link_handle =
391 pBapHCIFlush->log_link_handle;
392
393 vosStatus = (*btampContext->pBapHCIEventCB)
394 (
395 //btampContext->pHddHdl, /* this refers to the BSL per connection context */
396 btampContext->pAppHdl, /* this refers the BSL per application context */
397 &bapHCIEvent, /* This now encodes ALL event types */
398 VOS_FALSE /* Flag to indicate assoc-specific event */
399 );
400
401 return vosStatus;
402} /* WLAN_EnhancedBAPFlush */
403
404/*----------------------------------------------------------------------------
405
406 FUNCTION WLAN_BAPReadConnectionAcceptTimeout()
407
408 DESCRIPTION
409 Implements the actual HCI Read Connection Accept Timeout command. There
410 is no need for a callback because when this call returns the action
411 has been completed.
412
413 DEPENDENCIES
414 NA.
415
416 PARAMETERS
417
418 IN
419 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
420
421 IN/OUT
422 pBapHCIEvent: Return event value for the command complete event.
423 (The caller of this routine is responsible for sending
424 the Command Complete event up the HCI interface.)
425
426 RETURN VALUE
427 The result code associated with performing the operation
428
429 VOS_STATUS_E_FAULT: pointer to pBapHCIReadConnectionAcceptTimeout is NULL
430 VOS_STATUS_SUCCESS: Success
431
432 SIDE EFFECTS
433
434----------------------------------------------------------------------------*/
435VOS_STATUS
436WLAN_BAPReadConnectionAcceptTimeout
437(
438 ptBtampHandle btampHandle,
439 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
440 /* Including "Read" Command Complete */
441)
442{
443 ptBtampContext btampContext = (ptBtampContext) btampHandle;
444 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
445
446 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700447 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700448
449 /* Validate params */
450 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
451 {
452 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700453 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700454 return VOS_STATUS_E_FAULT;
455 }
456
457 /* Fill in the parameters for command complete event... */
458 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
459 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
460 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
461 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
462 = BTAMP_TLV_HCI_READ_CONNECTION_ACCEPT_TIMEOUT_CMD;
463 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Connection_Accept_TO.status
464 = WLANBAP_STATUS_SUCCESS;
465 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Connection_Accept_TO.connection_accept_timeout
466 = btampContext->bapConnectionAcceptTimerInterval;
467
468 return VOS_STATUS_SUCCESS;
469} /* WLAN_BAPReadConnectionAcceptTimeout */
470
471/*----------------------------------------------------------------------------
472
473 FUNCTION WLAN_BAPWriteConnectionAcceptTimeout()
474
475 DESCRIPTION
476 Implements the actual HCI Write Connection Accept Timeout command. There
477 is no need for a callback because when this call returns the action
478 has been completed.
479
480 DEPENDENCIES
481 NA.
482
483 PARAMETERS
484
485 IN
486 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
487 pBapHCIWriteConnectionAcceptTimeout: pointer to the "HCI Connection Accept Timeout" Structure.
488
489 IN/OUT
490 pBapHCIEvent: Return event value for the command complete event.
491 (The caller of this routine is responsible for sending
492 the Command Complete event up the HCI interface.)
493
494 RETURN VALUE
495 The result code associated with performing the operation
496
497 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteConnectionAcceptTimeout is NULL
498 VOS_STATUS_SUCCESS: Success
499
500 SIDE EFFECTS
501
502----------------------------------------------------------------------------*/
503VOS_STATUS
504WLAN_BAPWriteConnectionAcceptTimeout
505(
506 ptBtampHandle btampHandle,
507 tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *pBapHCIWriteConnectionAcceptTimeout,
508 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
509 /* Including Command Complete and Command Status*/
510)
511{
512 ptBtampContext btampContext = (ptBtampContext) btampHandle;
513 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
514
515 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700516 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700517
518 /* Validate params */
519 if ((NULL == btampHandle) || (NULL == pBapHCIWriteConnectionAcceptTimeout)
520 || (NULL == pBapHCIEvent))
521 {
522 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700523 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700524 return VOS_STATUS_E_FAULT;
525 }
526
527 /* Validate the allowed timeout interval range */
528 if ((pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout >
529 WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) ||
530 (pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout <
531 WLANBAP_CON_ACCEPT_TIMEOUT_MIN_RANGE))
532 {
533 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
534 "Out of range for connection accept timeout parameters in %s",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700535 __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700536 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Connection_Accept_TO.status
537 = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM;
538 }
539 else
540 {
541 /* Save the Physical link connection accept timeout value */
542 btampContext->bapConnectionAcceptTimerInterval =
543 pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout;
544
545 /* Return status for command complete event */
546 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Connection_Accept_TO.status
547 = WLANBAP_STATUS_SUCCESS;
548 }
549
550 /* Fill in the parameters for command complete event... */
551 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
552 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
553 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
554 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
555 = BTAMP_TLV_HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT_CMD;
556
557 return VOS_STATUS_SUCCESS;
558} /* WLAN_BAPWriteConnectionAcceptTimeout */
559
560
561/*----------------------------------------------------------------------------
562
563 FUNCTION WLAN_BAPReadLinkSupervisionTimeout()
564
565 DESCRIPTION
566 Implements the actual HCI Read Link Supervision Timeout command. There
567 is no need for a callback because when this call returns the action
568 has been completed.
569
570 DEPENDENCIES
571 NA.
572
573 PARAMETERS
574
575 IN
576 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
577
578 IN/OUT
579 pBapHCIEvent: Return event value for the command complete event.
580 (The caller of this routine is responsible for sending
581 the Command Complete event up the HCI interface.)
582
583 RETURN VALUE
584 The result code associated with performing the operation
585
586 VOS_STATUS_E_FAULT: pointer to pBapHCIReadLinkSupervisionTimeout is NULL
587 VOS_STATUS_SUCCESS: Success
588
589 SIDE EFFECTS
590
591----------------------------------------------------------------------------*/
592VOS_STATUS
593WLAN_BAPReadLinkSupervisionTimeout
594(
595 ptBtampHandle btampHandle,
596 /* Only 8 bits (phy_link_handle) of this log_link_handle are valid. */
597 tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *pBapHCIReadLinkSupervisionTimeout,
598 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
599 /* Including "Read" Command Complete*/
600)
601{
602 ptBtampContext btampContext = (ptBtampContext) btampHandle;
603 v_U8_t phyLinkHandle;
604 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
605
606 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700607 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700608
609 /* Validate params */
610 if ((NULL == btampHandle) || (NULL == pBapHCIReadLinkSupervisionTimeout) ||
611 (NULL == pBapHCIEvent))
612 {
613 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700614 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700615 return VOS_STATUS_E_FAULT;
616 }
617
618 /* Validate the phyiscal link handle extracted from
619 logical link handle (lower byte valid) */
620 phyLinkHandle = (v_U8_t) pBapHCIReadLinkSupervisionTimeout->log_link_handle;
621
622 if (phyLinkHandle != btampContext->phy_link_handle)
623 {
624 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700625 "Invalid Physical link handle in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700626 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.link_supervision_timeout
627 = 0x00; /* Invalid value */
628 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.log_link_handle
629 = pBapHCIReadLinkSupervisionTimeout->log_link_handle;
630 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.status
631 = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM;
632 }
633 else
634 {
635 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.link_supervision_timeout
636 = btampContext->bapLinkSupervisionTimerInterval;
637 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.log_link_handle
638 = pBapHCIReadLinkSupervisionTimeout->log_link_handle;
639 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Link_Supervision_TO.status
640 = WLANBAP_STATUS_SUCCESS;
641 }
642
643 /* Fill in the parameters for command complete event... */
644 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
645 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
646 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
647 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
648 = BTAMP_TLV_HCI_READ_LINK_SUPERVISION_TIMEOUT_CMD;
649
650 return VOS_STATUS_SUCCESS;
651} /* WLAN_BAPReadLinkSupervisionTimeout */
652
653/*----------------------------------------------------------------------------
654
655 FUNCTION WLAN_BAPWriteLinkSupervisionTimeout()
656
657 DESCRIPTION
658 Implements the actual HCI Write Link Supervision Timeout command. There
659 is no need for a callback because when this call returns the action
660 has been completed.
661
662 DEPENDENCIES
663 NA.
664
665 PARAMETERS
666
667 IN
668 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
669 pBapHCIWriteLinkSupervisionTimeout: pointer to the "HCI Link Supervision Timeout" Structure.
670
671 IN/OUT
672 pBapHCIEvent: Return event value for the command complete event.
673 (The caller of this routine is responsible for sending
674 the Command Complete event up the HCI interface.)
675
676 RETURN VALUE
677 The result code associated with performing the operation
678
679 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLinkSupervisionTimeout is NULL
680 VOS_STATUS_SUCCESS: Success
681
682 SIDE EFFECTS
683
684----------------------------------------------------------------------------*/
685VOS_STATUS
686WLAN_BAPWriteLinkSupervisionTimeout
687(
688 ptBtampHandle btampHandle,
689 tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *pBapHCIWriteLinkSupervisionTimeout,
690 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
691 /* Including Command Complete and Command Status*/
692)
693{
694 ptBtampContext btampContext = (ptBtampContext) btampHandle;
695 v_U8_t phyLinkHandle;
696 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
697
698 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700699 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700700
701 /* Validate params */
702 if ((NULL == btampHandle) || (NULL == pBapHCIWriteLinkSupervisionTimeout) ||
703 (NULL == pBapHCIEvent))
704 {
705 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700706 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700707 return VOS_STATUS_E_FAULT;
708 }
709
710 /* Validate the phyiscal link handle extracted from
711 logical link handle (lower byte valid) */
712 phyLinkHandle = (v_U8_t) pBapHCIWriteLinkSupervisionTimeout->log_link_handle;
713
714 if (phyLinkHandle != btampContext->phy_link_handle)
715 {
716 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700717 "Invalid Physical link handle in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700718 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Link_Supervision_TO.log_link_handle
719 = pBapHCIWriteLinkSupervisionTimeout->log_link_handle;
720 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Link_Supervision_TO.status
721 = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM;
722 }
723 else
724 {
725 /* Save the LS timeout interval */
726 btampContext->bapLinkSupervisionTimerInterval =
727 pBapHCIWriteLinkSupervisionTimeout->link_supervision_timeout;
728
729 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Link_Supervision_TO.log_link_handle
730 = pBapHCIWriteLinkSupervisionTimeout->log_link_handle;
731 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Link_Supervision_TO.status
732 = WLANBAP_STATUS_SUCCESS;
733 }
734
735 /* Fill in the parameters for command complete event... */
736 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
737 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
738 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
739 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
740 = BTAMP_TLV_HCI_WRITE_LINK_SUPERVISION_TIMEOUT_CMD;
741
742 return VOS_STATUS_SUCCESS;
743} /* WLAN_BAPWriteLinkSupervisionTimeout */
744
745/* v3.0 Host Controller and Baseband Commands */
746
747
748/*----------------------------------------------------------------------------
749
750 FUNCTION WLAN_BAPReadLogicalLinkAcceptTimeout()
751
752 DESCRIPTION
753 Implements the actual HCI Read Logical Link Accept Timeout command. There
754 is no need for a callback because when this call returns the action
755 has been completed.
756
757 DEPENDENCIES
758 NA.
759
760 PARAMETERS
761
762 IN
763 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
764
765 IN/OUT
766 pBapHCIEvent: Return event value for the command complete event.
767 (The caller of this routine is responsible for sending
768 the Command Complete event up the HCI interface.)
769
770 RETURN VALUE
771 The result code associated with performing the operation
772
773 VOS_STATUS_E_FAULT: pointer to pBapHCIReadLogicalLinkAcceptTimeout is NULL
774 VOS_STATUS_SUCCESS: Success
775
776 SIDE EFFECTS
777
778----------------------------------------------------------------------------*/
779VOS_STATUS
780WLAN_BAPReadLogicalLinkAcceptTimeout
781(
782 ptBtampHandle btampHandle,
783 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
784 /* Including "Read" Command Complete*/
785)
786{
787 ptBtampContext btampContext = (ptBtampContext) btampHandle;
788 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
789
790 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700791 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700792
793 /* Validate params */
794 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
795 {
796 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700797 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700798 return VOS_STATUS_E_FAULT;
799 }
800
801 /* Fill in the parameters for command complete event... */
802 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
803 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
804 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
805 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
806 = BTAMP_TLV_HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_CMD;
807 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Logical_Link_Accept_TO.status
808 = WLANBAP_STATUS_SUCCESS;
809 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Logical_Link_Accept_TO.logical_link_accept_timeout
810 = btampContext->bapLogicalLinkAcceptTimerInterval;
811
812 return VOS_STATUS_SUCCESS;
813} /* WLAN_BAPReadLogicalLinkAcceptTimeout */
814
815/*----------------------------------------------------------------------------
816
817 FUNCTION WLAN_BAPWriteLogicalLinkAcceptTimeout()
818
819 DESCRIPTION
820 Implements the actual HCI Write Logical Link Accept Timeout command. There
821 is no need for a callback because when this call returns the action
822 has been completed.
823
824 DEPENDENCIES
825 NA.
826
827 PARAMETERS
828
829 IN
830 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
831 pBapHCIWriteLogicalLinkAcceptTimeout: pointer to the "HCI Logical Link Accept Timeout" Structure.
832
833 IN/OUT
834 pBapHCIEvent: Return event value for the command complete event.
835 (The caller of this routine is responsible for sending
836 the Command Complete event up the HCI interface.)
837
838 RETURN VALUE
839 The result code associated with performing the operation
840
841 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLogicalLinkAcceptTimeout is NULL
842 VOS_STATUS_SUCCESS: Success
843
844 SIDE EFFECTS
845
846----------------------------------------------------------------------------*/
847VOS_STATUS
848WLAN_BAPWriteLogicalLinkAcceptTimeout
849(
850 ptBtampHandle btampHandle,
851 tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *pBapHCIWriteLogicalLinkAcceptTimeout,
852 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
853 /* Including Command Complete and Command Status*/
854)
855{
856 ptBtampContext btampContext = (ptBtampContext) btampHandle;
857 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
858
859 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700860 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700861
862 /* Validate params */
863 if ((NULL == btampHandle) || (NULL == pBapHCIWriteLogicalLinkAcceptTimeout)
864 || (NULL == pBapHCIEvent))
865 {
866 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700867 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700868 return VOS_STATUS_E_FAULT;
869 }
870
871 /* Validate the allowed timeout interval range */
872 if ((pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout >
873 WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) ||
874 (pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout <
875 WLANBAP_CON_ACCEPT_TIMEOUT_MIN_RANGE))
876 {
877 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
878 "Out of range for logical connection accept timeout parameters in %s",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700879 __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700880 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Logical_Link_Accept_TO.status
881 = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM;
882 }
883 else
884 {
885 /* Save the Physical link connection accept timeout value */
886 btampContext->bapLogicalLinkAcceptTimerInterval =
887 pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout;
888
889 /* Return status for command complete event */
890 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Logical_Link_Accept_TO.status
891 = WLANBAP_STATUS_SUCCESS;
892 }
893
894 /* Fill in the parameters for command complete event... */
895 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
896 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
897 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
898 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
899 = BTAMP_TLV_HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_CMD;
900
901 return VOS_STATUS_SUCCESS;
902} /* WLAN_BAPWriteLogicalLinkAcceptTimeout */
903
904/*----------------------------------------------------------------------------
905
906 FUNCTION WLAN_BAPSetEventMaskPage2()
907
908 DESCRIPTION
909 Implements the actual HCI Set Event Mask Page 2 command. There is no need for
910 a callback because when this call returns the action has been completed.
911
912 DEPENDENCIES
913 NA.
914
915 PARAMETERS
916
917 IN
918 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
919 pBapHCISetEventMaskPage2: pointer to the "HCI Set Event Mask Page 2" Structure.
920
921 IN/OUT
922 pBapHCIEvent: Return event value for the command complete event.
923 (The caller of this routine is responsible for sending
924 the Command Complete event up the HCI interface.)
925
926 RETURN VALUE
927 The result code associated with performing the operation
928
929 VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMaskPage2 is NULL
930 VOS_STATUS_SUCCESS: Success
931
932 SIDE EFFECTS
933
934----------------------------------------------------------------------------*/
935VOS_STATUS
936WLAN_BAPSetEventMaskPage2
937(
938 ptBtampHandle btampHandle,
939 tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *pBapHCISetEventMaskPage2,
940 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
941 /* Including Command Complete and Command Status*/
942)
943{
944 ptBtampContext btampContext = (ptBtampContext) btampHandle;
945 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
946
947 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -0700948 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -0700949
950 /* Validate params */
951 if ((NULL == btampHandle) || (NULL == pBapHCISetEventMaskPage2)
952 || (NULL == pBapHCIEvent))
953 {
954 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700955 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700956 return VOS_STATUS_E_FAULT;
957 }
958
959
960 /* Save away the event mask */
961 vos_mem_copy(
962 btampContext->event_mask_page_2,
963 pBapHCISetEventMaskPage2->event_mask_page_2,
964 8 );
965
966 /* Return status for command complete event */
967 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Set_Event_Mask_Page_2.status
968 = WLANBAP_STATUS_SUCCESS;
969
970 /* Fill in the parameters for command complete event... */
971 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
972 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
973 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
974 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
975 = BTAMP_TLV_HCI_SET_EVENT_MASK_PAGE_2_CMD;
976
977 return VOS_STATUS_SUCCESS;
978} /* WLAN_BAPSetEventMaskPage2 */
979
980/*----------------------------------------------------------------------------
981
982 FUNCTION WLAN_BAPReadLocationData()
983
984 DESCRIPTION
985 Implements the actual HCI Read Location Data command. There
986 is no need for a callback because when this call returns the action
987 has been completed.
988
989 DEPENDENCIES
990 NA.
991
992 PARAMETERS
993
994 IN
995 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
996
997 IN/OUT
998 pBapHCIEvent: Return event value for the command complete event.
999 (The caller of this routine is responsible for sending
1000 the Command Complete event up the HCI interface.)
1001
1002 RETURN VALUE
1003 The result code associated with performing the operation
1004
1005 VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocationData is NULL
1006 VOS_STATUS_SUCCESS: Success
1007
1008 SIDE EFFECTS
1009
1010----------------------------------------------------------------------------*/
1011VOS_STATUS
1012WLAN_BAPReadLocationData
1013(
1014 ptBtampHandle btampHandle,
1015 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1016 /* Including "Read" Command Complete*/
1017)
1018{
1019 ptBtampContext btampContext;
1020 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1021
1022 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001023 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001024
1025 /* Validate params */
1026 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
1027 {
1028 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001029 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001030 return VOS_STATUS_E_FAULT;
1031 }
1032
1033 btampContext = (ptBtampContext) btampHandle;
1034
1035 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.loc_domain_aware
1036 = btampContext->btamp_Location_Data_Info.loc_domain_aware;
1037
1038 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.loc_options
1039 = btampContext->btamp_Location_Data_Info.loc_options;
1040
1041 vos_mem_copy(
1042 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.loc_domain,
1043 btampContext->btamp_Location_Data_Info.loc_domain,
1044 3 );
1045
1046 /* Return status for command complete event */
1047 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.status
1048 = WLANBAP_STATUS_SUCCESS;
1049
1050 /* Fill in the parameters for command complete event... */
1051 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
1052 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
1053 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
1054 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
1055 = BTAMP_TLV_HCI_READ_LOCATION_DATA_CMD;
1056
1057 return VOS_STATUS_SUCCESS;
1058} /* WLAN_BAPReadLocationData */
1059
1060/*----------------------------------------------------------------------------
1061
1062 FUNCTION WLAN_BAPWriteLocationData()
1063
1064 DESCRIPTION
1065 Implements the actual HCI Write Location Data command. There
1066 is no need for a callback because when this call returns the action
1067 has been completed.
1068
1069 DEPENDENCIES
1070 NA.
1071
1072 PARAMETERS
1073
1074 IN
1075 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1076 pBapHCIWriteLocationData: pointer to the "HCI Write Location Data" Structure.
1077
1078 IN/OUT
1079 pBapHCIEvent: Return event value for the command complete event.
1080 (The caller of this routine is responsible for sending
1081 the Command Complete event up the HCI interface.)
1082
1083 RETURN VALUE
1084 The result code associated with performing the operation
1085
1086 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLocationData is NULL
1087 VOS_STATUS_SUCCESS: Success
1088
1089 SIDE EFFECTS
1090
1091----------------------------------------------------------------------------*/
1092VOS_STATUS
1093WLAN_BAPWriteLocationData
1094(
1095 ptBtampHandle btampHandle,
1096 tBtampTLVHCI_Write_Location_Data_Cmd *pBapHCIWriteLocationData,
1097 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1098 /* Including Command Complete and Command Status*/
1099)
1100{
1101 ptBtampContext btampContext;
1102 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1103
1104 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001105 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001106
1107 /* Validate params */
1108 if ((NULL == btampHandle) || (NULL == pBapHCIWriteLocationData)
1109 || (NULL == pBapHCIEvent))
1110 {
1111 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001112 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001113 return VOS_STATUS_E_FAULT;
1114 }
1115
1116 btampContext = (ptBtampContext) btampHandle;
1117
1118 btampContext->btamp_Location_Data_Info.loc_domain_aware =
1119 pBapHCIWriteLocationData->loc_domain_aware;
1120
1121 btampContext->btamp_Location_Data_Info.loc_options =
1122 pBapHCIWriteLocationData->loc_options;
1123
1124 vos_mem_copy(
1125 btampContext->btamp_Location_Data_Info.loc_domain,
1126 pBapHCIWriteLocationData->loc_domain,
1127 3 );
1128
1129 /* Return status for command complete event */
1130 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Location_Data.status
1131 = WLANBAP_STATUS_SUCCESS;
1132
1133 /* Fill in the parameters for command complete event... */
1134 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
1135 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
1136 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
1137 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
1138 = BTAMP_TLV_HCI_WRITE_LOCATION_DATA_CMD;
1139
1140 return VOS_STATUS_SUCCESS;
1141} /* WLAN_BAPWriteLocationData */
1142
1143
1144/*----------------------------------------------------------------------------
1145
1146 FUNCTION WLAN_BAPReadFlowControlMode()
1147
1148 DESCRIPTION
1149 Implements the actual HCI Read Flow Control Mode command. There
1150 is no need for a callback because when this call returns the action
1151 has been completed.
1152
1153 DEPENDENCIES
1154 NA.
1155
1156 PARAMETERS
1157
1158 IN
1159 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1160
1161 IN/OUT
1162 pBapHCIEvent: Return event value for the command complete event.
1163 (The caller of this routine is responsible for sending
1164 the Command Complete event up the HCI interface.)
1165
1166 RETURN VALUE
1167 The result code associated with performing the operation
1168
1169 VOS_STATUS_E_FAULT: pointer to pBapHCIReadFlowControlMode is NULL
1170 VOS_STATUS_SUCCESS: Success
1171
1172 SIDE EFFECTS
1173
1174----------------------------------------------------------------------------*/
1175VOS_STATUS
1176WLAN_BAPReadFlowControlMode
1177(
1178 ptBtampHandle btampHandle,
1179 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1180 /* Including "Read" Command Complete*/
1181)
1182{
1183 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1184
1185 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001186 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001187
1188 /* Validate params */
1189 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
1190 {
1191 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001192 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001193 return VOS_STATUS_E_FAULT;
1194 }
1195
1196 /* Fill in the parameters for command complete event... */
1197 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
1198 pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE;
1199 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
1200 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
1201 = BTAMP_TLV_HCI_READ_FLOW_CONTROL_MODE_CMD;
1202 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Flow_Control_Mode.status
1203 = WLANBAP_STATUS_SUCCESS;
1204 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Flow_Control_Mode.flow_control_mode
1205 = WLANBAP_FLOW_CONTROL_MODE_BLOCK_BASED;
1206
1207 return VOS_STATUS_SUCCESS;
1208} /* WLAN_BAPReadFlowControlMode */
1209
1210/*----------------------------------------------------------------------------
1211
1212 FUNCTION WLAN_BAPWriteFlowControlMode()
1213
1214 DESCRIPTION
1215 Implements the actual HCI Write Flow Control Mode command. There
1216 is no need for a callback because when this call returns the action
1217 has been completed.
1218
1219 DEPENDENCIES
1220 NA.
1221
1222 PARAMETERS
1223
1224 IN
1225 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1226 pBapHCIWriteFlowControlMode: pointer to the "HCI Write Flow Control Mode" Structure.
1227
1228 IN/OUT
1229 pBapHCIEvent: Return event value for the command complete event.
1230 (The caller of this routine is responsible for sending
1231 the Command Complete event up the HCI interface.)
1232
1233 RETURN VALUE
1234 The result code associated with performing the operation
1235
1236 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteFlowControlMode is NULL
1237 VOS_STATUS_SUCCESS: Success
1238
1239 SIDE EFFECTS
1240
1241----------------------------------------------------------------------------*/
1242VOS_STATUS
1243WLAN_BAPWriteFlowControlMode
1244(
1245 ptBtampHandle btampHandle,
1246 tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *pBapHCIWriteFlowControlMode,
1247 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1248 /* Including Command Complete and Command Status*/
1249)
1250{
1251
1252 return VOS_STATUS_SUCCESS;
1253} /* WLAN_BAPWriteFlowControlMode */
1254
1255/*----------------------------------------------------------------------------
1256
1257 FUNCTION WLAN_BAPReadBestEffortFlushTimeout()
1258
1259 DESCRIPTION
1260 Implements the actual HCI Read Best Effort Flush Timeout command. There
1261 is no need for a callback because when this call returns the action
1262 has been completed.
1263
1264 DEPENDENCIES
1265 NA.
1266
1267 PARAMETERS
1268
1269 IN
1270 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1271
1272 IN/OUT
1273 pBapHCIEvent: Return event value for the command complete event.
1274 (The caller of this routine is responsible for sending
1275 the Command Complete event up the HCI interface.)
1276
1277 RETURN VALUE
1278 The result code associated with performing the operation
1279
1280 VOS_STATUS_E_FAULT: pointer to pBapHCIReadBEFlushTO is NULL
1281 VOS_STATUS_SUCCESS: Success
1282
1283 SIDE EFFECTS
1284
1285----------------------------------------------------------------------------*/
1286VOS_STATUS
1287WLAN_BAPReadBestEffortFlushTimeout
1288(
1289 ptBtampHandle btampHandle,
1290 /* The log_link_hanlde identifies which logical link's BE TO*/
1291 tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *pBapHCIReadBEFlushTO,
1292 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1293 /* Including "Read" Command Complete*/
1294)
1295{
1296
1297 return VOS_STATUS_SUCCESS;
1298} /* WLAN_BAPReadBestEffortFlushTimeout */
1299
1300/*----------------------------------------------------------------------------
1301
1302 FUNCTION WLAN_BAPWriteBestEffortFlushTimeout()
1303
1304 DESCRIPTION
1305 Implements the actual HCI Write Best Effort Flush TO command. There
1306 is no need for a callback because when this call returns the action
1307 has been completed.
1308
1309 DEPENDENCIES
1310 NA.
1311
1312 PARAMETERS
1313
1314 IN
1315 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1316 pBapHCIWriteBEFlushTO: pointer to the "HCI Write BE Flush TO" Structure.
1317
1318 IN/OUT
1319 pBapHCIEvent: Return event value for the command complete event.
1320 (The caller of this routine is responsible for sending
1321 the Command Complete event up the HCI interface.)
1322
1323 RETURN VALUE
1324 The result code associated with performing the operation
1325
1326 VOS_STATUS_E_FAULT: pointer to pBapHCIWriteBEFlushTO is NULL
1327 VOS_STATUS_SUCCESS: Success
1328
1329 SIDE EFFECTS
1330
1331----------------------------------------------------------------------------*/
1332VOS_STATUS
1333WLAN_BAPWriteBestEffortFlushTimeout
1334(
1335 ptBtampHandle btampHandle,
1336 tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *pBapHCIWriteBEFlushTO,
1337 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1338 /* Including Command Complete and Command Status*/
1339)
1340{
1341
1342 return VOS_STATUS_SUCCESS;
1343} /* WLAN_BAPWriteBestEffortFlushTimeout */
1344
1345
1346/*----------------------------------------------------------------------------
1347
1348 FUNCTION WLAN_BAPSetShortRangeMode()
1349
1350 DESCRIPTION
1351 Implements the actual HCI Set Short Range Mode command. There is no need for
1352 a callback because when this call returns the action has been completed.
1353
1354 DEPENDENCIES
1355 NA.
1356
1357 PARAMETERS
1358
1359 IN
1360 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1361 pBapHCIShortRangeMode: pointer to the "HCI Set Short Range Mode" Structure.
1362
1363 IN/OUT
1364 pBapHCIEvent: Return event value for the command complete event.
1365 (The caller of this routine is responsible for sending
1366 the Command Complete event up the HCI interface.)
1367
1368 RETURN VALUE
1369 The result code associated with performing the operation
1370
1371 VOS_STATUS_E_FAULT: pointer to pBapHCIShortRangeMode is NULL
1372 VOS_STATUS_SUCCESS: Success
1373
1374 SIDE EFFECTS
1375
1376----------------------------------------------------------------------------*/
1377VOS_STATUS
1378WLAN_BAPSetShortRangeMode
1379(
1380 ptBtampHandle btampHandle,
1381 tBtampTLVHCI_Set_Short_Range_Mode_Cmd *pBapHCIShortRangeMode,
1382 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1383 /* Including Command Complete and Command Status*/
1384)
1385{
1386 ptBtampContext btampContext = (ptBtampContext) btampHandle;
1387 BTAMPFSM_INSTANCEDATA_T *instanceVar = &(btampContext->bapPhysLinkMachine);
1388 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1389
1390 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001391 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001392
1393 /* Validate params */
1394 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
1395 {
1396 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001397 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001398 return VOS_STATUS_E_FAULT;
1399 }
1400
1401 /* Validate the BAP state to accept the Short Range Mode set request;
1402 SRM set requests are allowed only in CONNECTED state */
1403
1404 /* Form and return the command status event... */
1405 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT;
1406 pBapHCIEvent->u.btampCommandStatusEvent.present = 1;
1407 pBapHCIEvent->u.btampCommandStatusEvent.num_hci_command_packets = 1;
1408 pBapHCIEvent->u.btampCommandStatusEvent.command_opcode
1409 = BTAMP_TLV_HCI_SET_SHORT_RANGE_MODE_CMD;
1410
1411 if (CONNECTED != instanceVar->stateVar)
1412 {
1413 /* Short Range Mode request in invalid state */
1414 pBapHCIEvent->u.btampCommandStatusEvent.status =
1415 WLANBAP_ERROR_CMND_DISALLOWED;
1416 return VOS_STATUS_SUCCESS;
1417 }
1418 else if (pBapHCIShortRangeMode->phy_link_handle != btampContext->phy_link_handle)
1419 {
1420 /* Invalid Physical link handle */
1421 pBapHCIEvent->u.btampCommandStatusEvent.status =
1422 WLANBAP_ERROR_NO_CNCT;
1423 return VOS_STATUS_SUCCESS;
1424 }
1425 else if (pBapHCIShortRangeMode->short_range_mode > 0x01)
1426 {
1427 /* Invalid mode requested */
1428 pBapHCIEvent->u.btampCommandStatusEvent.status =
1429 WLANBAP_ERROR_INVALID_HCI_CMND_PARAM;
1430 return VOS_STATUS_SUCCESS;
1431 }
1432
1433 pBapHCIEvent->u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS;
1434
1435 /* Send the Command Status event (success) here, since Change Complete is next */
1436 (*btampContext->pBapHCIEventCB)
1437 (
1438 btampContext->pHddHdl, /* this refers to the BSL per connection context */
1439 pBapHCIEvent, /* This now encodes ALL event types */
1440 VOS_FALSE /* Flag to indicate assoc-specific event */
1441 );
1442
1443 /* Format the Short Range Mode Complete event to return... */
1444 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_SHORT_RANGE_MODE_CHANGE_COMPLETE_EVENT;
1445 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.present = 1;
1446
1447 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.status =
1448 WLANBAP_STATUS_SUCCESS; /* Assumption for now */
1449
1450 /* The input parameters will go out in the CC Event */
1451 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.phy_link_handle =
1452 pBapHCIShortRangeMode->phy_link_handle;
1453
1454 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.short_range_mode =
1455 pBapHCIShortRangeMode->short_range_mode; /* Assumption for now */
1456
1457 /* If the requested setting is different from the current setting... */
1458 if (pBapHCIShortRangeMode->short_range_mode != btampContext->phy_link_srm)
1459 {
1460 /* ... then change the SRM according to the requested value.
1461 * If the attempt fails, the assumptions above need to be corrected.
1462 */
1463 #if 0
1464 // Suggested API, needs to be created
1465 if (VOS_STATUS_SUCCESS != HALSetShortRangeMode(pBapHCIShortRangeMode->short_range_mode))
1466 #else
1467 if (0)
1468 #endif
1469 {
1470 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.status =
1471 WLANBAP_ERROR_HARDWARE_FAILURE;
1472 pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.short_range_mode =
1473 btampContext->phy_link_srm; /* Switch back to current value */
1474 }
1475 else
1476 {
1477 /* Update the SRM setting for this physical link, since it worked */
1478 btampContext->phy_link_srm = pBapHCIShortRangeMode->short_range_mode;
1479 }
1480 }
1481
1482 return VOS_STATUS_SUCCESS;
1483} /* WLAN_BAPSetShortRangeMode */
1484
1485/*----------------------------------------------------------------------------
1486
1487 FUNCTION WLAN_BAPVendorSpecificCmd0()
1488
1489 DESCRIPTION
1490 Implements the actual HCI Vendor Specific Command 0 (OGF 0x3f, OCF 0x0000).
1491 There is no need for a callback because when this call returns the action has
1492 been completed.
1493
1494 The command is received when:
1495 - The A2MP Create Phy Link Response has been rx'd by the Bluetooth stack (initiator)
1496
1497 DEPENDENCIES
1498 NA.
1499
1500 PARAMETERS
1501
1502 IN
1503 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1504
1505 IN/OUT
1506 pBapHCIEvent: Return event value for the command complete event.
1507 (The caller of this routine is responsible for sending
1508 the Command Complete event up the HCI interface.)
1509
1510 RETURN VALUE
1511 The result code associated with performing the operation
1512
1513 VOS_STATUS_E_FAULT: pointer to pBapHCIEvent is NULL
1514 VOS_STATUS_SUCCESS: Success
1515
1516 SIDE EFFECTS
1517
1518----------------------------------------------------------------------------*/
1519VOS_STATUS
1520WLAN_BAPVendorSpecificCmd0
1521(
1522 ptBtampHandle btampHandle,
1523 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1524 /* Including Command Complete and Command Status*/
1525)
1526{
1527 ptBtampContext btampContext = (ptBtampContext) btampHandle;
1528 BTAMPFSM_INSTANCEDATA_T *instanceVar = &(btampContext->bapPhysLinkMachine);
1529 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1530
1531 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001532 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001533
1534 /* Validate params */
1535 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
1536 {
1537 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001538 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001539 return VOS_STATUS_E_FAULT;
1540 }
1541
1542 /* Validate the BAP state to accept the Vendor Specific Cmd 0:
1543 this is only allowed for the BT_INITIATOR in the CONNECTING state */
1544
1545 /* Form and return the command status event... */
1546 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT;
1547 pBapHCIEvent->u.btampCommandStatusEvent.present = 1;
1548 pBapHCIEvent->u.btampCommandStatusEvent.num_hci_command_packets = 1;
1549 pBapHCIEvent->u.btampCommandStatusEvent.command_opcode
1550 = BTAMP_TLV_HCI_VENDOR_SPECIFIC_CMD_0;
1551
1552 if ( (BT_INITIATOR != btampContext->BAPDeviceRole) ||
1553 (CONNECTING != instanceVar->stateVar) )
1554 {
1555 /* Vendor Specific Command 0 happened in invalid state */
1556 pBapHCIEvent->u.btampCommandStatusEvent.status =
1557 WLANBAP_ERROR_CMND_DISALLOWED;
1558 return VOS_STATUS_SUCCESS;
1559 }
1560
1561 /* Signal BT Coexistence code in firmware to prefer WLAN */
1562 WLANBAP_NeedBTCoexPriority(btampContext, 1);
1563
1564 pBapHCIEvent->u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS;
1565
1566 /* Send the Command Status event (success) here, since Command Complete is next */
1567 (*btampContext->pBapHCIEventCB)
1568 (
1569 btampContext->pHddHdl, /* this refers to the BSL per connection context */
1570 pBapHCIEvent, /* This now encodes ALL event types */
1571 VOS_FALSE /* Flag to indicate assoc-specific event */
1572 );
1573
1574 /* Format the Vendor Specific Command 0 Complete event to return... */
1575 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
1576 pBapHCIEvent->u.btampCommandCompleteEvent.present = 1;
1577 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
1578 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
1579 = BTAMP_TLV_HCI_VENDOR_SPECIFIC_CMD_0;
1580 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Vendor_Specific_Cmd_0.status
1581 = WLANBAP_STATUS_SUCCESS;
1582
1583 return VOS_STATUS_SUCCESS;
1584} /* WLAN_BAPVendorSpecificCmd0 */
1585
1586/*----------------------------------------------------------------------------
1587
1588 FUNCTION WLAN_BAPVendorSpecificCmd1()
1589
1590 DESCRIPTION
1591 Implements the actual HCI Vendor Specific Command 1 (OGF 0x3f, OCF 0x0001).
1592 There is no need for a callback because when this call returns the action has
1593 been completed.
1594
1595 The command is received when:
1596 - HCI wants to enable testability
1597
1598 DEPENDENCIES
1599 NA.
1600
1601 PARAMETERS
1602
1603 IN
1604 btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl.
1605
1606 IN/OUT
1607 pBapHCIEvent: Return event value for the command complete event.
1608 (The caller of this routine is responsible for sending
1609 the Command Complete event up the HCI interface.)
1610
1611 RETURN VALUE
1612 The result code associated with performing the operation
1613
1614 VOS_STATUS_E_FAULT: pointer to pBapHCIEvent is NULL
1615 VOS_STATUS_SUCCESS: Success
1616
1617 SIDE EFFECTS
1618
1619----------------------------------------------------------------------------*/
1620VOS_STATUS
1621WLAN_BAPVendorSpecificCmd1
1622(
1623 ptBtampHandle btampHandle,
1624 tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */
1625 /* Including Command Complete and Command Status*/
1626)
1627{
1628 ptBtampContext btampContext = (ptBtampContext) btampHandle;
1629 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1630
1631 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Jeff Johnson2bbc0292017-09-19 08:38:56 -07001632 "%s: btampHandle value: %pK", __func__, btampHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07001633
1634 /* Validate params */
1635 if ((NULL == btampHandle) || (NULL == pBapHCIEvent))
1636 {
1637 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH,
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001638 "Invalid input parameters in %s", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001639 return VOS_STATUS_E_FAULT;
1640 }
1641
1642
1643 btampContext->btamp_async_logical_link_create = TRUE;
1644
1645
1646 /* Format the Vendor Specific Command 1 Complete event to return... */
1647 pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT;
1648 pBapHCIEvent->u.btampCommandCompleteEvent.present = 1;
1649 pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1;
1650 pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode
1651 = BTAMP_TLV_HCI_VENDOR_SPECIFIC_CMD_1;
1652 pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Vendor_Specific_Cmd_1.status
1653 = WLANBAP_STATUS_SUCCESS;
1654
1655 return VOS_STATUS_SUCCESS;
1656} /* WLAN_BAPVendorSpecificCmd1 */
1657
1658/*----------------------------------------------------------------------------
1659
1660 DESCRIPTION
1661 Callback registered with TL for BAP, this is required in order for
1662 TL to inform BAP, that the flush operation requested has been completed.
1663
1664 The registered reception callback is being triggered by TL whenever a
1665 frame SIR_TL_HAL_FLUSH_AC_RSP is received by TL from HAL.
1666
1667 PARAMETERS
1668
1669 IN
1670 pvosGCtx: pointer to the global vos context; a handle to TL's
1671 or SME's control block can be extracted from its context
1672 ucStaId: station identifier for the requested value
1673 ucTid: identifier of the tspec
1674 status: status of the Flush operation
1675
1676 RETURN VALUE
1677 The result code associated with performing the operation
1678
1679----------------------------------------------------------------------------*/
1680VOS_STATUS WLANBAP_TLFlushCompCallback
1681(
1682 v_PVOID_t pvosGCtx,
1683 v_U8_t ucStaId,
1684 v_U8_t ucTID,
1685 v_U8_t status
1686)
1687{
1688
1689 return VOS_STATUS_SUCCESS;
1690} // WLANBAP_TLFlushCompCallback
1691
1692
1693/* End of v3.0 Host Controller and Baseband Commands */
1694
1695
1696
1697
1698