blob: 093e22f30f03769e9f7ed2ea721c11147a8038f5 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/**
23 * \file btampHCI.c
24 *
25 * \brief Structures, functions & definitions for
26 * working with 802.11 Frames
27 *
28 *
29 * Copyright (C) 2009 Airgo Networks, Incorporated.
30 *
31 *
32 * This file was automatically generated by 'framesc'
33 * Fri Feb 27 17:29:19 2009 from the following file(s):
34 *
35 * btampHCI.frms
36 *
37 * PLEASE DON'T EDIT THIS FILE BY HAND!
38 *
39 *
40 */
41
42#ifndef ANI_OS_TYPE_OSX
43#include <memory.h> /* For memcpy */
44//#include <stdio.h> /* For _vsnprintf */
45#include <stddef.h> /* For offsetof */
46#endif
47
48#define _vsnprintf vsnprintf
49
50#include "vos_api.h"
51#include "btampHCI.h"
52
53#if defined ( _MSC_VER )
54# pragma warning (disable: 4244)
55# pragma warning (disable: 4505)
56# pragma warning (disable: 4702)
57# pragma warning (disable: 4996) /* ... was declared deprecated */
58#endif /* Microsoft C/C++ */
59
60/*Length of the value field expected in a TLV of type Connected Channel in an
61 AMP Assoc*/
62#define WLAN_BAP_PAL_AMP_ASSOC_CONN_CH_TLV_MIN_LEN 3
63
64/*Length of the value field expected in a TLV of type Prefered Channel in an
65 AMP Assoc*/
66#define WLAN_BAP_PAL_AMP_ASSOC_PREF_CH_TLV_MIN_LEN 3
67
68/*Length of the value field expected in a TLV of type MAC Address*/
69#define WLAN_BAP_PAL_MAC_ADDR_TLV_LEN 6
70
71/*Length of the value field expected in a TLV of type Capabilities*/
72#define WLAN_BAP_PAL_CAPABILITIES_TLV_LEN 4
73
74/*Length of the value field expected in a TLV of type Version*/
75#define WLAN_BAP_PAL_VERSION_TLV_LEN 5
76
77/*Length of the value field expected in a TLV of type Accept Phy Link*/
78#define WLAN_BAP_PAL_ACC_PHY_LINK_TLV_MIN_LEN 3
79
80/*Length of the value field expected in a TLV of type Accept Log Link*/
81#define WLAN_BAP_PAL_ACC_LOG_LINK_TLV_LEN 37
82
83/*Length of the value field expected in a TLV of type Create Log Link*/
84#define WLAN_BAP_PAL_CREATE_LOG_LINK_TLV_LEN 37
85
86/*Length of the value field expected in a TLV of type Create Phy Link*/
87#define WLAN_BAP_PAL_CREATE_PHY_LINK_TLV_MIN_LEN 3
88
89/*Length of the value field expected in a TLV of type Disconnect Log Link*/
90#define WLAN_BAP_PAL_DISC_LOG_LINK_TLV_LEN 2
91
92/*Length of the value field expected in a TLV of type Disconnect Phy Link*/
93#define WLAN_BAP_PAL_DISC_PHY_LINK_TLV_LEN 2
94
95/*Length of the value field expected in a TLV of type Flow Spec Modify*/
96#define WLAN_BAP_PAL_FLOW_SPEC_MOD_TLV_LEN 34
97
98/*Length of the value field expected in a TLV of type Flush*/
99#define WLAN_BAP_PAL_FLUSH_TLV_LEN 2
100
101/*Length of the value field expected in a TLV of type enhanced Flush*/
102#define WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN 3
103
104/*Length of the value field expected in a TLV of type Cancel Log Link*/
105#define WLAN_BAP_PAL_CANCEL_LOG_LINK_TLV_LEN 2
106
107/*Length of the value field expected in a TLV of type Read Best Effort Flush
108 Timeout*/
109#define WLAN_BAP_PAL_READ_BE_FLUSH_TIMEOUT_TLV_LEN 2
110
111/*Length of the value field expected in a TLV of type Read Failed Contact
112 Counter*/
113#define WLAN_BAP_PAL_READ_FAILED_CONTACT_CNT_TLV_LEN 2
114
115/*Length of the value field expected in a TLV of type Link Quality*/
116#define WLAN_BAP_PAL_READ_LINK_QUALITY_TLV_LEN 2
117
118/*Length of the value field expected in a TLV of type Read Link Supervision
119 Timeout*/
120#define WLAN_BAP_PAL_READ_LINK_SVISISON_TIMEOUT_TLV_LEN 2
121
122/*Length of the value field expected in a TLV of type Read Local AMP Assoc*/
123#define WLAN_BAP_PAL_READ_LOCAL_AMP_ASSOC_TLV_LEN 5
124
125/*Length of the value field expected in a TLV of type Read RSSI*/
126#define WLAN_BAP_PAL_READ_RSSI_TLV_LEN 2
127
128/*Length of the value field expected in a TLV of type Reset Failed Contact
129 Counter*/
130#define WLAN_BAP_PAL_RESET_FAILED_CONTACT_CNT_TLV_LEN 2
131
132/*Length of the value field expected in a TLV of type Set Event Mask*/
133#define WLAN_BAP_PAL_SET_EVENT_MASK_TLV_LEN 8
134
135/*Length of the value field expected in a TLV of type Set Event Mask2*/
136#define WLAN_BAP_PAL_SET_EVENT_MASK2_TLV_LEN 8
137
138/*Length of the value field expected in a TLV of type Set SHort Range Mode*/
139#define WLAN_BAP_PAL_SET_SHORT_RANGE_MODE_TLV_LEN 2
140
141/*Length of the value field expected in a TLV of type Write Best Effort Flush
142 Timeout*/
143#define WLAN_BAP_PAL_WRITE_BE_FLUSH_TIMEOUT_TLV_LEN 6
144
145/*Length of the value field expected in a TLV of type Write Connection Accept
146 Timeout*/
147#define WLAN_BAP_PAL_WRITE_CON_ACC_TIMEOUT_TLV_LEN 2
148
149/*Length of the value field expected in a TLV of type Write Flow Control Mode*/
150#define WLAN_BAP_PAL_WRITE_FLOW_CTRL_MODE_TLV_LEN 1
151
152/*Length of the value field expected in a TLV of type Write Link Supervision
153 Timeout*/
154#define WLAN_BAP_PAL_WRITE_LINK_SVISION_TIMEOUT_TLV_LEN 4
155
156/*Length of the value field expected in a TLV of type Write Location Data*/
157#define WLAN_BAP_PAL_WRITE_LOCATION_DATA_CMD_TLV_LEN 5
158
159/*Length of the value field expected in a TLV of type Write LL Acc Timeout*/
160#define WLAN_BAP_PAL_WRITE_LOG_LINK_ACC_TIMEOUT_TLV_LEN 2
161
162/*Length of the value field expected in a TLV of type Write Loopback Mode*/
163#define WLAN_BAP_PAL_WRITE_LOOOPBACK_MODE_TLV_LEN 1
164
165/*Length of the value field expected in a TLV of type Write Remote AMP Assoc*/
166#define WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN 5
167
168/* As per AMP specification */
169/* Regulatory Extension Identifier for channel list */
170#define WLAN_BAP_PAL_REG_EXTN_ID_VAL 201
171
172/* Regulatory Class for channel list */
173#define WLAN_BAP_PAL_REG_CLASS_VAL 254
174
175/* Coverage ClASS for channel list */
176#define WLAN_BAP_PAL_COVERAGE_CLASS_VAL 0
177
178
179/* LOGGING and VALIDITY_CHECKING control */
180//#define WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
181//#define WLAN_BAPHCI_ENABLE_LOGGING
182
183typedef unsigned char tFRAMES_BOOL;
184typedef void (*pfnGeneric_t)(void);
185
186
187typedef struct sFFDefn {
188 v_U8_t size;
189 size_t offset;
190 v_U16_t sig;
191 pfnGeneric_t pfn;
192 const char *name;
193} tFFDefn;
194
195typedef struct sIEDefn {
196 v_U8_t eid;
197 v_U16_t minSize;
198 v_U16_t maxSize;
199 size_t offset;
200 size_t presenceOffset;
201 size_t countOffset;
202 v_U16_t arraybound;
203 unsigned char oui[5];
204 unsigned char noui;
205 v_U16_t sig;
206 pfnGeneric_t pfn;
207 const char *name;
208 tFRAMES_BOOL fMandatory;
209} tIEDefn;
210
211#if !defined(countof)
212#define countof(x) ( sizeof( (x) ) / sizeof( (x)[0] ) )
213#endif
214
215#if ! defined(BTAMP_MEMCPY)
216# define BTAMP_MEMCPY(ctx, dst, src, len) \
217 memcpy( (dst), (src), (len) ) \
218
219#endif
220
221#if ! defined(BTAMP_MEMCMP)
222# define BTAMP_MEMCMP(ctx, lhs, rhs, len) \
223 memcmp( (lhs), (rhs), (len) ) \
224
225#endif
226
227#ifndef BTAMP_HAVE_LOG_SEVERITIES
228# define FRLOG_OFF ( 0 )
229# define FRLOGP ( 1 )
230# define FRLOGE ( 2 )
231# define FRLOGW ( 3 )
232# define FRLOG1 ( 4 )
233# define FRLOG2 ( 5 )
234# define FRLOG3 ( 6 )
235# define FRLOG4 ( 7 )
236#endif
237
238#define FRFL(x) x
239
240#ifdef BTAMP_ENABLE_LOGGING
241
242#ifndef BTAMP_HAVE_LOG_MACROS
243
244#include <stdio.h>
245#include <stdarg.h>
246
247#ifndef BTAMP_LOG_GATE
248# define BTAMP_LOG_GATE FRLOGW
249#endif // BTAMP_LOG_GATE
250
251#ifdef WIN32
252
253#if defined ( _CONSOLE ) || defined ( _WINDOWS ) || defined ( _DLL ) || defined ( _LIB )
254#include <windows.h>
255#define DBGPRINT OutputDebugStringA
256#else /* Not User mode */
257#define DBGPRINT DbgPrint
258#endif /* User mode */
259
260
261
262static void framesLog(void * pCtx, int nSev,
263 const char *lpszFormat, ...)
264{
265 va_list val;
266 char buffer[1024];
267 (void)pCtx;
268 if ( nSev <= BTAMP_LOG_GATE )
269 {
270 va_start(val, lpszFormat);
271 _vsnprintf(buffer, 1024, lpszFormat, val);
272 va_end(val);
273 DBGPRINT(buffer);
274 }
275}
276static void framesDump(void * pCtx, int nSev, v_U8_t *pBuf, int nBuf)
277{
278 char buffer[35];
279 int i, offset;
280 pCtx;
281 offset = 0;
282 if ( nSev > BTAMP_LOG_GATE ) return;
283 for (i = 0; i < nBuf/8; ++i)
284 {
285 _snprintf(buffer, 35, "%08x: %02x %02x %02x %02x %02x %02x %02x %02x\n", offset, *pBuf, *(pBuf + 1), *(pBuf + 2), *(pBuf + 3), *(pBuf + 4), *(pBuf + 5), *(pBuf + 6), *(pBuf + 7));
286 pBuf += 8; offset += 8;
287 DBGPRINT(buffer);
288 }
289 _snprintf(buffer, 35, "%08x: ", offset);
290 DBGPRINT(buffer);
291 for (i = 0; i < nBuf % 8; ++i)
292 {
293 _snprintf(buffer, 35, "%02x ", *pBuf);
294 ++pBuf;
295 DBGPRINT(buffer);
296 }
297 DBGPRINT("\n");
298}
299
300#elif defined OS_X /* Not WIN32 */
301static void framesLog(void * pCtx, int nSev,
302 const char *lpszFormat, ...)
303{// To fill in when needed using IOLog
304
305}
306
307static void framesDump(void * pCtx, int nSev, v_U8_t *pBuf, int nBuf)
308{
309}
310
311#elif defined LINUX
312
313static void framesLog(void * pCtx, int nSev,
314 const char *lpszFormat, ...)
315{
316 va_list marker;
317 (void)pCtx;
318 if ( nSev <= BTAMP_LOG_GATE )
319 {
320 va_start( marker, lpszFormat );
321 vprintf(lpszFormat, marker);
322 va_end( marker );
323 }
324}
325
326static void framesDump(void * pCtx, int nSev, v_U8_t *pBuf, int nBuf)
327{
328 char buffer[35];
329 int i, offset;
330 (void)pCtx;
331 offset = 0;
332 if ( nSev > BTAMP_LOG_GATE ) return;
333 for (i = 0; i < nBuf/8; ++i)
334 {
335 printf("%08x: %02x %02x %02x %02x %02x %02x %02x %02x\n", offset, *pBuf, *(pBuf + 1), *(pBuf + 2), *(pBuf + 3), *(pBuf + 4), *(pBuf + 5), *(pBuf + 6), *(pBuf + 7));
336 pBuf += 8; offset += 8;
337 }
338 printf("%08x: ", offset);
339 for (i = 0; i < nBuf % 8; ++i)
340 {
341 printf("%02x ", *pBuf);
342 ++pBuf;
343 }
344 printf("\n");
345}
346
347#endif /* WIN32 */
348
349#define FRAMES_LOG0(ctx, sev, fmt) \
350 framesLog((ctx), (sev), (fmt));
351#define FRAMES_LOG1(ctx, sev, fmt, p1) \
352 framesLog((ctx), (sev), (fmt), (p1));
353#define FRAMES_LOG2(ctx, sev, fmt, p1, p2) \
354 framesLog((ctx), (sev), (fmt), (p1), (p2));
355#define FRAMES_LOG3(ctx, sev, fmt, p1, p2, p3) \
356 framesLog((ctx), (sev), (fmt), (p1), (p2), (p3));
357#define FRAMES_DUMP(ctx, sev, p, n) \
358 framesDump((ctx), (sev), (p), (n));
359#ifndef FRAMES_SEV_FOR_FRAME
360# define FRAMES_SEV_FOR_FRAME(ctx, sig) FRLOG3
361#endif
362
363#endif /* End BTAMP_HAVE_LOG_MACROS */
364
365#else // ! BTAMP_ENABLE_LOGGING
366# define FRAMES_LOG0(ctx, sev, fmt)
367# define FRAMES_LOG1(ctx, sev, fmt, p1)
368# define FRAMES_LOG2(ctx, sev, fmt, p1, p2)
369# define FRAMES_LOG3(ctx, sev, fmt, p1, p2, p3)
370# define FRAMES_DUMP(ctx, sev, p, n)
371# ifndef FRAMES_SEV_FOR_FRAME
372# define FRAMES_SEV_FOR_FRAME(ctx, sig) FRLOG3
373# endif
374#endif // BTAMP_ENABLE_LOGGING
375
376#if defined( BTAMP_ENABLE_DBG_BREAK ) && defined ( WIN32 )
377# define FRAMES_DBG_BREAK() { _asm int 3 }
378#else
379# define FRAMES_DBG_BREAK()
380#endif
381
382#if ! defined(BTAMP_PARAMETER_CHECK)
383# if defined (BTAMP_HAVE_WIN32_API)
384
385# define BTAMP_PARAMETER_CHECK(pBuf, nBuf, pFrm, nFrm) \
386 if (!pBuf || IsBadReadPtr(pBuf, nBuf)) return BTAMP_BAD_INPUT_BUFFER; \
387 if (!pFrm || IsBadWritePtr(pFrm, nFrm)) return BTAMP_BAD_OUTPUT_BUFFER \
388
389# define BTAMP_PARAMETER_CHECK2(pSrc, pBuf, nBuf, pnConsumed) \
390 if (!pSrc || IsBadReadPtr(pSrc, 4)) return BTAMP_BAD_INPUT_BUFFER; \
391 if (!pBuf || IsBadWritePtr(pBuf, nBuf)) return BTAMP_BAD_OUTPUT_BUFFER; \
392 if (!nBuf) return BTAMP_BAD_OUTPUT_BUFFER; \
393 if (IsBadWritePtr(pnConsumed, 4)) return BTAMP_BAD_OUTPUT_BUFFER \
394
395# else
396
397# define BTAMP_PARAMETER_CHECK(pBuf, nBuf, pFrm, nFrm) \
398 if (!pBuf) return BTAMP_BAD_INPUT_BUFFER; \
399 if (!pFrm) return BTAMP_BAD_OUTPUT_BUFFER \
400
401# define BTAMP_PARAMETER_CHECK2(pSrc, pBuf, nBuf, pnConsumed) \
402 if (!pSrc) return BTAMP_BAD_INPUT_BUFFER; \
403 if (!pBuf) return BTAMP_BAD_OUTPUT_BUFFER; \
404 if (!nBuf) return BTAMP_BAD_OUTPUT_BUFFER; \
405 if (!pnConsumed) return BTAMP_BAD_OUTPUT_BUFFER \
406
407# endif
408#endif
409
410static void framesntohs(void * pCtx,
411 v_U16_t *pOut,
412 v_U8_t *pIn,
413 tFRAMES_BOOL fMsb)
414{
415 (void)pCtx;
416# if defined ( BTAMP_LITTLE_ENDIAN_HOST )
417 if ( !fMsb )
418 {
419 BTAMP_MEMCPY(pCtx, ( v_U16_t* )pOut, pIn, 2);
420 }
421 else
422 {
423 *pOut = ( v_U16_t )( *pIn << 8 ) | *( pIn + 1 );
424 }
425# else
426 if ( !fMsb )
427 {
428 *pOut = ( v_U16_t )( *pIn | ( *( pIn + 1 ) << 8 ) );
429 }
430 else
431 {
432 BTAMP_MEMCPY(pCtx, ( v_U16_t* )pOut, pIn, 2);
433 }
434# endif
435}
436
437static void framesntohl(void * pCtx,
438 v_U32_t *pOut,
439 v_U8_t *pIn,
440 tFRAMES_BOOL fMsb)
441{
442 (void)pCtx;
443# if defined ( BTAMP_LITTLE_ENDIAN_HOST )
444 if ( !fMsb )
445 {
446 *pOut = * ( v_U32_t* )pIn;
447 }
448 else
449 {
450 *pOut = ( v_U32_t )( *pIn << 24 ) |
451 ( *( pIn + 1 ) << 16 ) |
452 ( *( pIn + 2 ) << 8 ) |
453 ( *( pIn + 3 ) );
454 }
455# else
456 if ( !fMsb )
457 {
458 *pOut = ( v_U32_t )( *( pIn + 3 ) << 24 ) |
459 ( *( pIn + 2 ) << 16 ) |
460 ( *( pIn + 1 ) << 8 ) |
461 ( *( pIn ) );
462 }
463 else
464 {
465 *pOut = * ( v_U32_t* )pIn;
466 }
467# endif
468}
469
470static void frameshtons(void * pCtx
471, v_U8_t *pOut,
472 v_U16_t pIn,
473 tFRAMES_BOOL fMsb)
474{
475 (void)pCtx;
476# if defined ( BTAMP_LITTLE_ENDIAN_HOST )
477 if ( !fMsb )
478 {
479 BTAMP_MEMCPY(pCtx, pOut, &pIn, 2);
480 }
481 else
482 {
483 *pOut = ( pIn & 0xff00 ) >> 8;
484 *( pOut + 1 ) = pIn & 0xff;
485 }
486# else
487 if ( !fMsb )
488 {
489 *pOut = pIn & 0xff;
490 *( pOut + 1 ) = ( pIn & 0xff00 ) >> 8;
491 }
492 else
493 {
494 BTAMP_MEMCPY(pCtx, pOut, &pIn, 2);
495 }
496# endif
497}
498
499static void frameshtonl(void * pCtx,
500 v_U8_t *pOut,
501 v_U32_t pIn,
502 tFRAMES_BOOL fMsb)
503{
504 (void)pCtx;
505# if defined ( BTAMP_LITTLE_ENDIAN_HOST )
506 if ( !fMsb )
507 {
508 BTAMP_MEMCPY(pCtx, pOut, &pIn, 4);
509 }
510 else
511 {
512 *pOut = ( pIn & 0xff000000 ) >> 24;
513 *( pOut + 1 ) = ( pIn & 0x00ff0000 ) >> 16;
514 *( pOut + 2 ) = ( pIn & 0x0000ff00 ) >> 8;
515 *( pOut + 3 ) = ( pIn & 0x000000ff );
516 }
517# else
518 if ( !fMsb )
519 {
520 *( pOut ) = ( pIn & 0x000000ff );
521 *( pOut + 1 ) = ( pIn & 0x0000ff00 ) >> 8;
522 *( pOut + 2 ) = ( pIn & 0x00ff0000 ) >> 16;
523 *( pOut + 3 ) = ( pIn & 0xff000000 ) >> 24;
524 }
525 else
526 {
527 BTAMP_MEMCPY(pCtx, pOut, &pIn, 4);
528 }
529# endif
530}
531
532typedef struct sTLVDefn {
533 v_U32_t id;
534 v_U32_t pec;
535 v_U32_t minSize;
536 v_U32_t maxSize;
537 size_t offset;
538 size_t presenceOffset;
539 v_U16_t sig;
540 pfnGeneric_t pfn;
541 const char * name;
542 v_U8_t fMandatory;
543} tTLVDefn;
544
545static tTLVDefn* FindTLVDefn( void * pCtx,
546 v_U8_t *pBuf,
547 v_U32_t nBuf,
548 tTLVDefn TLVs[ ] )
549{
550 tTLVDefn *pTlv;
551 v_U32_t sType, sLen;
552 v_U32_t pec;
553 v_U16_t id;
554
555 sType = 1;
556 sLen = 2;
557
558 (void)pCtx;
559
560 if (sType == 2)
561 framesntohs( pCtx, &id, pBuf, 2 );
562 else {
563 id = *pBuf;
564 }
565
566 pTlv = &( TLVs[ 0 ] );
567 while ( 0xffff != pTlv->id )
568 {
569 if ( id == pTlv->id )
570 {
571 if ( 0 == pTlv->pec ) return pTlv;
572
573 if( nBuf > 5 )
574 {
575 pec = ( ( * ( pBuf + 4 ) ) << 16 ) |
576 ( ( * ( pBuf + 5 ) ) << 8 ) |
577 * ( pBuf + 6 );
578 if ( pec == pTlv->pec )
579 {
580 return pTlv;
581 }
582 }
583 }
584
585 ++pTlv;
586 }
587
588 return NULL;
589}
590
591static v_U32_t UnpackTlvCore( void * pCtx,
592 v_U8_t *pBuf,
593 v_U32_t nBuf,
594 tTLVDefn TLVs[ ],
595 v_U8_t *pFrm,
596 size_t nFrm );
597static v_U32_t PackTlvCore(void * pCtx,
598 v_U8_t *pSrc,
599 v_U8_t *pBuf,
600 v_U32_t nBuf,
601 v_U32_t *pnConsumed,
602 tTLVDefn TLVs[],
603 v_U32_t *pidx);
604static v_U32_t GetPackedSizeTlvCore(void * pCtx,
605 v_U8_t *pFrm,
606 v_U32_t *pnNeeded,
607 tTLVDefn TLVs[]);
608
609v_U32_t btampUnpackTlvAMP_Assoc_Connected_Channel(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVAMP_Assoc_Connected_Channel *pDst)
610{
611 v_U32_t status = BTAMP_PARSE_SUCCESS;
612 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
613
614 /*-----------------------------------------------------------------------
615 TLV Sanity check
616 -------------------------------------------------------------------------*/
617 if ( WLAN_BAP_PAL_AMP_ASSOC_CONN_CH_TLV_MIN_LEN > tlvlen )
618 {
619#ifdef WLAN_BAPHCI_ENABLE_LOGGING
620 /*Log invalid len*/
621 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, "Invalid TLV len on %s", __FUNCTION__);
622#endif
623 return BTAMP_INVALID_TLV_LENGTH;
624 }
625
626 /*-----------------------------------------------------------------------
627 Parse TLV
628 -----------------------------------------------------------------------*/
629
630
631 pDst->present = 1;
632 BTAMP_MEMCPY(pCtx, pDst->country, pBuf, 3);
633 pBuf += 3;
634 tlvlen -= (v_U8_t)3;
635 if ( ! tlvlen )
636 {
637 pDst->num_triplets = 0U;
638 return 0U;
639 }
640 else
641 {
642 /* Maximum of 5 triplets allowed, based on size of triplets definition */
643 if (tlvlen / 3 > 5)
644 {
645 tlvlen = 15;
646 }
647 pDst->num_triplets = (v_U8_t)( tlvlen / 3 );
648
649 BTAMP_MEMCPY(pCtx, pDst->triplets, pBuf, ( tlvlen ) );
650 pBuf += ( tlvlen );
651 tlvlen -= ( tlvlen );
652 }
653 (void)pCtx;
654 return status;
655} /* End btampUnpackTlvAMP_Assoc_Connected_Channel. */
656
657typedef v_U32_t (*pfnUnpackTlvAMP_Assoc_Connected_Channel_t)(void *, v_U8_t*, v_U16_t, tBtampTLVAMP_Assoc_Connected_Channel*);
658
659#define SigUnpackTlvAMP_Assoc_Connected_Channel ( 0x0001 )
660
661
662v_U32_t btampUnpackTlvAMP_Assoc_MAC_Addr(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVAMP_Assoc_MAC_Addr *pDst)
663{
664 v_U32_t status = BTAMP_PARSE_SUCCESS;
665 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
666
667 /*-----------------------------------------------------------------------
668 TLV Sanity check
669 -------------------------------------------------------------------------*/
670 if ( WLAN_BAP_PAL_MAC_ADDR_TLV_LEN != tlvlen )
671 {
672#ifdef WLAN_BAPHCI_ENABLE_LOGGING
673 /*Log invalid len*/
674 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __FUNCTION__);
675#endif
676 return BTAMP_INVALID_TLV_LENGTH;
677 }
678
679 /*-----------------------------------------------------------------------
680 Parse TLV
681 -----------------------------------------------------------------------*/
682 pDst->present = 1;
683 BTAMP_MEMCPY(pCtx, pDst->mac_addr, pBuf, 6);
684 pBuf += 6;
685 tlvlen -= (v_U8_t)6;
686 (void)pCtx;
687 return status;
688} /* End btampUnpackTlvAMP_Assoc_MAC_Addr. */
689
690typedef v_U32_t (*pfnUnpackTlvAMP_Assoc_MAC_Addr_t)(void *, v_U8_t*, v_U16_t, tBtampTLVAMP_Assoc_MAC_Addr*);
691
692#define SigUnpackTlvAMP_Assoc_MAC_Addr ( 0x0002 )
693
694
695v_U32_t btampUnpackTlvAMP_Assoc_PAL_Capabilities(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVAMP_Assoc_PAL_Capabilities *pDst)
696{
697 v_U32_t status = BTAMP_PARSE_SUCCESS;
698 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
699
700 /*-----------------------------------------------------------------------
701 TLV Sanity check
702 -------------------------------------------------------------------------*/
703 if ( WLAN_BAP_PAL_CAPABILITIES_TLV_LEN != tlvlen )
704 {
705#ifdef WLAN_BAPHCI_ENABLE_LOGGING
706 /*Log invalid len*/
707 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __FUNCTION__);
708#endif
709 return BTAMP_INVALID_TLV_LENGTH;
710 }
711
712 /*-----------------------------------------------------------------------
713 Parse TLV
714 -----------------------------------------------------------------------*/
715 pDst->present = 1;
716 framesntohl(pCtx, &pDst->pal_capabilities, pBuf, 0);
717 pBuf += 4;
718 tlvlen -= (v_U8_t)4;
719 (void)pCtx;
720 return status;
721} /* End btampUnpackTlvAMP_Assoc_PAL_Capabilities. */
722
723typedef v_U32_t (*pfnUnpackTlvAMP_Assoc_PAL_Capabilities_t)(void *, v_U8_t*, v_U16_t, tBtampTLVAMP_Assoc_PAL_Capabilities*);
724
725#define SigUnpackTlvAMP_Assoc_PAL_Capabilities ( 0x0003 )
726
727
728v_U32_t btampUnpackTlvAMP_Assoc_PAL_Version(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVAMP_Assoc_PAL_Version *pDst)
729{
730 v_U32_t status = BTAMP_PARSE_SUCCESS;
731 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
732
733
734 /*-----------------------------------------------------------------------
735 TLV Sanity check
736 -------------------------------------------------------------------------*/
737 if ( WLAN_BAP_PAL_VERSION_TLV_LEN != tlvlen )
738 {
739#ifdef WLAN_BAPHCI_ENABLE_LOGGING
740 /*Log invalid len*/
741 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __FUNCTION__);
742#endif
743 return BTAMP_INVALID_TLV_LENGTH;
744 }
745
746 /*-----------------------------------------------------------------------
747 Parse TLV
748 -----------------------------------------------------------------------*/
749 pDst->present = 1;
750 pDst->pal_version = *pBuf;
751 pBuf += 1;
752 tlvlen -= (v_U8_t)1;
753 framesntohs(pCtx, &pDst->pal_CompanyID, pBuf, 0);
754 pBuf += 2;
755 tlvlen -= (v_U8_t)2;
756 framesntohs(pCtx, &pDst->pal_subversion, pBuf, 0);
757 pBuf += 2;
758 tlvlen -= (v_U8_t)2;
759 (void)pCtx;
760 return status;
761} /* End btampUnpackTlvAMP_Assoc_PAL_Version. */
762
763typedef v_U32_t (*pfnUnpackTlvAMP_Assoc_PAL_Version_t)(void *, v_U8_t*, v_U16_t, tBtampTLVAMP_Assoc_PAL_Version*);
764
765#define SigUnpackTlvAMP_Assoc_PAL_Version ( 0x0004 )
766
767
768v_U32_t btampUnpackTlvAMP_Assoc_Preferred_Channel_List(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVAMP_Assoc_Preferred_Channel_List *pDst)
769{
770 v_U32_t status = BTAMP_PARSE_SUCCESS;
771 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
772
773 /*-----------------------------------------------------------------------
774 TLV Sanity check
775 -------------------------------------------------------------------------*/
776 if ( WLAN_BAP_PAL_AMP_ASSOC_PREF_CH_TLV_MIN_LEN > tlvlen )
777 {
778#ifdef WLAN_BAPHCI_ENABLE_LOGGING
779 /*Log invalid len*/
780 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __FUNCTION__);
781#endif
782 return BTAMP_INVALID_TLV_LENGTH;
783 }
784
785 /*-----------------------------------------------------------------------
786 Parse TLV
787 -----------------------------------------------------------------------*/
788 pDst->present = 1;
789 /* Contry String - 3 bytes */
790 BTAMP_MEMCPY(pCtx, pDst->country, pBuf, 3);
791 pBuf += 3;
792 tlvlen -= (v_U8_t)3;
793
794 if ( ! tlvlen )
795 {
796 pDst->num_triplets = 0U;
797 return status;
798 }
799 else
800 {
801 /* Maximum of 5 triplets allowed, based on size of triplets definition */
802 if (tlvlen / 3 > 5)
803 {
804 tlvlen = 15;
805 }
806 pDst->num_triplets = (v_U8_t)( tlvlen / 3 );
807
808 BTAMP_MEMCPY(pCtx, pDst->triplets, pBuf, ( tlvlen ) );
809 pBuf += ( tlvlen );
810 tlvlen -= ( tlvlen );
811 }
812 return status;
813} /* End btampUnpackTlvAMP_Assoc_Preferred_Channel_List. */
814
815typedef v_U32_t (*pfnUnpackTlvAMP_Assoc_Preferred_Channel_List_t)(void *, v_U8_t*, v_U16_t, tBtampTLVAMP_Assoc_Preferred_Channel_List*);
816
817#define SigUnpackTlvAMP_Assoc_Preferred_Channel_List ( 0x0005 )
818
819
820v_U32_t btampUnpackTlvFlow_Spec(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVFlow_Spec *pDst)
821{
822 v_U32_t status = BTAMP_PARSE_SUCCESS;
823 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
824
825 /*-----------------------------------------------------------------------
826 TLV Sanity check
827 -------------------------------------------------------------------------*/
828 if ( WLAN_BAP_PAL_FLOW_SPEC_TLV_LEN != tlvlen )
829 {
830#ifdef WLAN_BAPHCI_ENABLE_LOGGING
831 /*Log invalid len*/
832 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
833 "Invalid TLV len on %s", __FUNCTION__);
834#endif
835 return BTAMP_INVALID_TLV_LENGTH;
836 }
837
838 /*-----------------------------------------------------------------------
839 Parse TLV
840 -----------------------------------------------------------------------*/
841 pDst->present = 1;
842 pDst->flow_spec_id = *pBuf;
843 pBuf += 1;
844 tlvlen -= (v_U8_t)1;
845 pDst->service_type = *pBuf;
846 pBuf += 1;
847 tlvlen -= (v_U8_t)1;
848 framesntohs(pCtx, &pDst->max_sdu, pBuf, 0);
849 pBuf += 2;
850 tlvlen -= (v_U8_t)2;
851 framesntohl(pCtx, &pDst->sdu_inter_arrival, pBuf, 0);
852 pBuf += 4;
853 tlvlen -= (v_U8_t)4;
854 framesntohl(pCtx, &pDst->access_latency, pBuf, 0);
855 pBuf += 4;
856 tlvlen -= (v_U8_t)4;
857 framesntohl(pCtx, &pDst->flush_timeout, pBuf, 0);
858 pBuf += 4;
859 tlvlen -= (v_U8_t)4;
860 (void)pCtx;
861 return status;
862} /* End btampUnpackTlvFlow_Spec. */
863
864typedef v_U32_t (*pfnUnpackTlvFlow_Spec_t)(void *, v_U8_t*, v_U16_t, tBtampTLVFlow_Spec*);
865
866#define SigUnpackTlvFlow_Spec ( 0x0006 )
867
868
869v_U32_t btampUnpackTlvHCI_Accept_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Accept_Logical_Link_Cmd *pDst)
870{
871 v_U32_t status = BTAMP_PARSE_SUCCESS;
872 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
873
874 /*-----------------------------------------------------------------------
875 TLV Sanity check
876 -------------------------------------------------------------------------*/
877#ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
878 if ( WLAN_BAP_PAL_ACC_LOG_LINK_TLV_LEN != tlvlen )
879 {
880#ifdef WLAN_BAPHCI_ENABLE_LOGGING
881 /*Log invalid len*/
882 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
883 "Invalid TLV len on %s", __FUNCTION__);
884#endif
885// return BTAMP_INVALID_TLV_LENGTH;
886 }
887#endif
888
889 /*-----------------------------------------------------------------------
890 Parse TLV
891 -----------------------------------------------------------------------*/
892
893 pDst->present = 1;
894 pDst->phy_link_handle = *pBuf;
895 pBuf += 1;
896 tlvlen -= (v_U8_t)1;
897 BTAMP_MEMCPY(pCtx, pDst->tx_flow_spec, pBuf, 18);
898 pBuf += 18;
899 tlvlen -= (v_U8_t)18;
900 BTAMP_MEMCPY(pCtx, pDst->rx_flow_spec, pBuf, 18);
901 pBuf += 18;
902 tlvlen -= (v_U8_t)18;
903 (void)pCtx;
904 return status;
905} /* End btampUnpackTlvHCI_Accept_Logical_Link_Cmd. */
906
907typedef v_U32_t (*pfnUnpackTlvHCI_Accept_Logical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Accept_Logical_Link_Cmd*);
908
909#define SigUnpackTlvHCI_Accept_Logical_Link_Cmd ( 0x0007 )
910
911
912v_U32_t btampUnpackTlvHCI_Accept_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Accept_Physical_Link_Cmd *pDst)
913{
914 v_U32_t status = BTAMP_PARSE_SUCCESS;
915 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
916
917 /*-----------------------------------------------------------------------
918 TLV Sanity check
919 -------------------------------------------------------------------------*/
920 if ( WLAN_BAP_PAL_ACC_PHY_LINK_TLV_MIN_LEN > tlvlen )
921 {
922#ifdef WLAN_BAPHCI_ENABLE_LOGGING
923 /*Log invalid len*/
924 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
925 "Invalid TLV len on %s", __FUNCTION__);
926#endif
927 return BTAMP_INVALID_TLV_LENGTH;
928 }
929
930 /*-----------------------------------------------------------------------
931 Parse TLV
932 -----------------------------------------------------------------------*/
933 pDst->present = 1;
934 pDst->phy_link_handle = *pBuf;
935 pBuf += 1;
936 tlvlen -= (v_U8_t)1;
937 pDst->key_length = *pBuf;
938 pBuf += 1;
939 tlvlen -= (v_U8_t)1;
940 pDst->key_type = *pBuf;
941 pBuf += 1;
942 tlvlen -= (v_U8_t)1;
943 if (pDst->key_length > 32){
944 pDst->present = 0;
945 return BTAMP_SKIPPED_BAD_IE;
946 }
947
948 BTAMP_MEMCPY(pCtx, pDst->key_material, pBuf, ( pDst->key_length ) );
949 pBuf += ( pDst->key_length );
950 tlvlen -= ( pDst->key_length );
951 (void)pCtx;
952 return status;
953} /* End btampUnpackTlvHCI_Accept_Physical_Link_Cmd. */
954
955typedef v_U32_t (*pfnUnpackTlvHCI_Accept_Physical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Accept_Physical_Link_Cmd*);
956
957#define SigUnpackTlvHCI_Accept_Physical_Link_Cmd ( 0x0008 )
958
959
960v_U32_t btampUnpackTlvHCI_Channel_Selected_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Channel_Selected_Event *pDst)
961{
962 v_U32_t status = BTAMP_PARSE_SUCCESS;
963 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
964 pDst->present = 1;
965 pDst->phy_link_handle = *pBuf;
966 pBuf += 1;
967 tlvlen -= (v_U8_t)1;
968 (void)pCtx;
969 return status;
970} /* End btampUnpackTlvHCI_Channel_Selected_Event. */
971
972typedef v_U32_t (*pfnUnpackTlvHCI_Channel_Selected_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Channel_Selected_Event*);
973
974#define SigUnpackTlvHCI_Channel_Selected_Event ( 0x0009 )
975
976
977v_U32_t btampUnpackTlvHCI_Command_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Command_Complete_Event *pDst)
978{
979 v_U32_t status = BTAMP_PARSE_SUCCESS;
980 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
981
982 pDst->present = 1;
983 pDst->num_hci_command_packets = *pBuf;
984 pBuf += 1;
985 tlvlen -= (v_U8_t)1;
986 framesntohs(pCtx, &pDst->command_opcode, pBuf, 0);
987 pBuf += 2;
988 tlvlen -= (v_U8_t)2;
989 switch (pDst->command_opcode)
990 {
991 case 0x0c03:
992 pDst->cc_event.Reset.status = *pBuf;
993 pBuf += 1;
994 tlvlen -= (v_U8_t)1;
995 break;
996 case 0x0c08:
997 pDst->cc_event.Flush.status = *pBuf;
998 pBuf += 1;
999 tlvlen -= (v_U8_t)1;
1000 framesntohs(pCtx, &pDst->cc_event.Flush.log_link_handle, pBuf, 0);
1001 pBuf += 2;
1002 tlvlen -= (v_U8_t)2;
1003 break;
1004 case 0x043b:
1005 pDst->cc_event.Logical_Link_Cancel.status = *pBuf;
1006 pBuf += 1;
1007 tlvlen -= (v_U8_t)1;
1008 pDst->cc_event.Logical_Link_Cancel.phy_link_handle = *pBuf;
1009 pBuf += 1;
1010 tlvlen -= (v_U8_t)1;
1011 pDst->cc_event.Logical_Link_Cancel.tx_flow_spec_id = *pBuf;
1012 pBuf += 1;
1013 tlvlen -= (v_U8_t)1;
1014 break;
1015 case 0x0c05:
1016 pDst->cc_event.Set_Event_Mask.status = *pBuf;
1017 pBuf += 1;
1018 tlvlen -= (v_U8_t)1;
1019 break;
1020 case 0x0c15:
1021 pDst->cc_event.Read_Connection_Accept_TO.status = *pBuf;
1022 pBuf += 1;
1023 tlvlen -= (v_U8_t)1;
1024 framesntohs(pCtx, &pDst->cc_event.Read_Connection_Accept_TO.connection_accept_timeout, pBuf, 0);
1025 pBuf += 2;
1026 tlvlen -= (v_U8_t)2;
1027 break;
1028 case 0x0c16:
1029 pDst->cc_event.Write_Connection_Accept_TO.status = *pBuf;
1030 pBuf += 1;
1031 tlvlen -= (v_U8_t)1;
1032 break;
1033 case 0x0c36:
1034 pDst->cc_event.Read_Link_Supervision_TO.status = *pBuf;
1035 pBuf += 1;
1036 tlvlen -= (v_U8_t)1;
1037 framesntohs(pCtx, &pDst->cc_event.Read_Link_Supervision_TO.log_link_handle, pBuf, 0);
1038 pBuf += 2;
1039 tlvlen -= (v_U8_t)2;
1040 framesntohs(pCtx, &pDst->cc_event.Read_Link_Supervision_TO.link_supervision_timeout, pBuf, 0);
1041 pBuf += 2;
1042 tlvlen -= (v_U8_t)2;
1043 break;
1044 case 0x0c37:
1045 pDst->cc_event.Write_Link_Supervision_TO.status = *pBuf;
1046 pBuf += 1;
1047 tlvlen -= (v_U8_t)1;
1048 framesntohs(pCtx, &pDst->cc_event.Write_Link_Supervision_TO.log_link_handle, pBuf, 0);
1049 pBuf += 2;
1050 tlvlen -= (v_U8_t)2;
1051 break;
1052 case 0x0c61:
1053 pDst->cc_event.Read_Logical_Link_Accept_TO.status = *pBuf;
1054 pBuf += 1;
1055 tlvlen -= (v_U8_t)1;
1056 framesntohs(pCtx, &pDst->cc_event.Read_Logical_Link_Accept_TO.logical_link_accept_timeout, pBuf, 0);
1057 pBuf += 2;
1058 tlvlen -= (v_U8_t)2;
1059 break;
1060 case 0x0c62:
1061 pDst->cc_event.Write_Logical_Link_Accept_TO.status = *pBuf;
1062 pBuf += 1;
1063 tlvlen -= (v_U8_t)1;
1064 break;
1065 case 0x0c63:
1066 pDst->cc_event.Set_Event_Mask_Page_2.status = *pBuf;
1067 pBuf += 1;
1068 tlvlen -= (v_U8_t)1;
1069 break;
1070 case 0x0c64:
1071 pDst->cc_event.Read_Location_Data.status = *pBuf;
1072 pBuf += 1;
1073 tlvlen -= (v_U8_t)1;
1074 pDst->cc_event.Read_Location_Data.loc_domain_aware = *pBuf;
1075 pBuf += 1;
1076 tlvlen -= (v_U8_t)1;
1077 BTAMP_MEMCPY(pCtx, pDst->cc_event.Read_Location_Data.loc_domain, pBuf, 3);
1078 pBuf += 3;
1079 tlvlen -= (v_U8_t)3;
1080 pDst->cc_event.Read_Location_Data.loc_options = *pBuf;
1081 pBuf += 1;
1082 tlvlen -= (v_U8_t)1;
1083 break;
1084 case 3173:
1085 pDst->cc_event.Write_Location_Data.status = *pBuf;
1086 pBuf += 1;
1087 tlvlen -= (v_U8_t)1;
1088 break;
1089 case 3174:
1090 pDst->cc_event.Read_Flow_Control_Mode.status = *pBuf;
1091 pBuf += 1;
1092 tlvlen -= (v_U8_t)1;
1093 pDst->cc_event.Read_Flow_Control_Mode.flow_control_mode = *pBuf;
1094 pBuf += 1;
1095 tlvlen -= (v_U8_t)1;
1096 break;
1097 case 3175:
1098 pDst->cc_event.Write_Flow_Control_Mode.status = *pBuf;
1099 pBuf += 1;
1100 tlvlen -= (v_U8_t)1;
1101 break;
1102 case 3177:
1103 pDst->cc_event.Read_BE_Flush_TO.status = *pBuf;
1104 pBuf += 1;
1105 tlvlen -= (v_U8_t)1;
1106 framesntohl(pCtx, &pDst->cc_event.Read_BE_Flush_TO.best_effort_flush_timeout, pBuf, 0);
1107 pBuf += 4;
1108 tlvlen -= (v_U8_t)4;
1109 break;
1110 case 3178:
1111 pDst->cc_event.Write_BE_Flush_TO.status = *pBuf;
1112 pBuf += 1;
1113 tlvlen -= (v_U8_t)1;
1114 break;
1115 case 3179:
1116 pDst->cc_event.Set_Short_Range_Mode.status = *pBuf;
1117 pBuf += 1;
1118 tlvlen -= (v_U8_t)1;
1119 break;
1120 case 4097:
1121 pDst->cc_event.Read_Local_Version_Info.status = *pBuf;
1122 pBuf += 1;
1123 tlvlen -= (v_U8_t)1;
1124 pDst->cc_event.Read_Local_Version_Info.HC_HCI_Version = *pBuf;
1125 pBuf += 1;
1126 tlvlen -= (v_U8_t)1;
1127 framesntohs(pCtx, &pDst->cc_event.Read_Local_Version_Info.HC_HCI_Revision, pBuf, 0);
1128 pBuf += 2;
1129 tlvlen -= (v_U8_t)2;
1130 pDst->cc_event.Read_Local_Version_Info.HC_PAL_Version = *pBuf;
1131 pBuf += 1;
1132 tlvlen -= (v_U8_t)1;
1133 framesntohs(pCtx, &pDst->cc_event.Read_Local_Version_Info.HC_Manufac_Name, pBuf, 0);
1134 pBuf += 2;
1135 tlvlen -= (v_U8_t)2;
1136 framesntohs(pCtx, &pDst->cc_event.Read_Local_Version_Info.HC_PAL_Sub_Version, pBuf, 0);
1137 pBuf += 2;
1138 tlvlen -= (v_U8_t)2;
1139 break;
1140 case 4098:
1141 pDst->cc_event.Read_Local_Supported_Cmds.status = *pBuf;
1142 pBuf += 1;
1143 tlvlen -= (v_U8_t)1;
1144 BTAMP_MEMCPY(pCtx, pDst->cc_event.Read_Local_Supported_Cmds.HC_Support_Cmds, pBuf, 64);
1145 pBuf += 64;
1146 tlvlen -= (v_U8_t)64;
1147 break;
1148 case 4101:
1149 pDst->cc_event.Read_Buffer_Size.status = *pBuf;
1150 pBuf += 1;
1151 tlvlen -= (v_U8_t)1;
1152 framesntohs(pCtx, &pDst->cc_event.Read_Buffer_Size.HC_ACL_Data_Packet_Length, pBuf, 0);
1153 pBuf += 2;
1154 tlvlen -= (v_U8_t)2;
1155 pDst->cc_event.Read_Buffer_Size.HC_SCO_Packet_Length = *pBuf;
1156 pBuf += 1;
1157 tlvlen -= (v_U8_t)1;
1158 framesntohs(pCtx, &pDst->cc_event.Read_Buffer_Size.HC_Total_Num_ACL_Packets, pBuf, 0);
1159 pBuf += 2;
1160 tlvlen -= (v_U8_t)2;
1161 framesntohs(pCtx, &pDst->cc_event.Read_Buffer_Size.HC_Total_Num_SCO_Packets, pBuf, 0);
1162 pBuf += 2;
1163 tlvlen -= (v_U8_t)2;
1164 break;
1165 case 4106:
1166 pDst->cc_event.Read_Data_Block_Size.status = *pBuf;
1167 pBuf += 1;
1168 tlvlen -= (v_U8_t)1;
1169 framesntohs(pCtx, &pDst->cc_event.Read_Data_Block_Size.HC_Max_ACL_Data_Packet_Length, pBuf, 0);
1170 pBuf += 2;
1171 tlvlen -= (v_U8_t)2;
1172 framesntohs(pCtx, &pDst->cc_event.Read_Data_Block_Size.HC_Data_Block_Length, pBuf, 0);
1173 pBuf += 2;
1174 tlvlen -= (v_U8_t)2;
1175 framesntohs(pCtx, &pDst->cc_event.Read_Data_Block_Size.HC_Total_Num_Data_Blocks, pBuf, 0);
1176 pBuf += 2;
1177 tlvlen -= (v_U8_t)2;
1178 break;
1179 case 5121:
1180 pDst->cc_event.Read_Failed_Contact_Counter.status = *pBuf;
1181 pBuf += 1;
1182 tlvlen -= (v_U8_t)1;
1183 framesntohs(pCtx, &pDst->cc_event.Read_Failed_Contact_Counter.log_link_handle, pBuf, 0);
1184 pBuf += 2;
1185 tlvlen -= (v_U8_t)2;
1186 framesntohs(pCtx, &pDst->cc_event.Read_Failed_Contact_Counter.failed_contact_counter, pBuf, 0);
1187 pBuf += 2;
1188 tlvlen -= (v_U8_t)2;
1189 break;
1190 case 5122:
1191 pDst->cc_event.Reset_Failed_Contact_Counter.status = *pBuf;
1192 pBuf += 1;
1193 tlvlen -= (v_U8_t)1;
1194 framesntohs(pCtx, &pDst->cc_event.Reset_Failed_Contact_Counter.log_link_handle, pBuf, 0);
1195 pBuf += 2;
1196 tlvlen -= (v_U8_t)2;
1197 break;
1198 case 5123:
1199 pDst->cc_event.Read_Link_Quality.status = *pBuf;
1200 pBuf += 1;
1201 tlvlen -= (v_U8_t)1;
1202 framesntohs(pCtx, &pDst->cc_event.Read_Link_Quality.log_link_handle, pBuf, 0);
1203 pBuf += 2;
1204 tlvlen -= (v_U8_t)2;
1205 pDst->cc_event.Read_Link_Quality.link_quality = *pBuf;
1206 pBuf += 1;
1207 tlvlen -= (v_U8_t)1;
1208 break;
1209 case 5125:
1210 pDst->cc_event.Read_RSSI.status = *pBuf;
1211 pBuf += 1;
1212 tlvlen -= (v_U8_t)1;
1213 pDst->cc_event.Read_RSSI.phy_link_handle = *pBuf;
1214 pBuf += 1;
1215 tlvlen -= (v_U8_t)1;
1216 pDst->cc_event.Read_RSSI.rssi = *pBuf;
1217 pBuf += 1;
1218 tlvlen -= (v_U8_t)1;
1219 break;
1220 case 5129:
1221 pDst->cc_event.Read_Local_AMP_Info.status = *pBuf;
1222 pBuf += 1;
1223 tlvlen -= (v_U8_t)1;
1224 pDst->cc_event.Read_Local_AMP_Info.HC_AMP_Status = *pBuf;
1225 pBuf += 1;
1226 tlvlen -= (v_U8_t)1;
1227 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_Total_BW, pBuf, 0);
1228 pBuf += 4;
1229 tlvlen -= (v_U8_t)4;
1230 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_Max_Guaranteed_BW, pBuf, 0);
1231 pBuf += 4;
1232 tlvlen -= (v_U8_t)4;
1233 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_Min_Latency, pBuf, 0);
1234 pBuf += 4;
1235 tlvlen -= (v_U8_t)4;
1236 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_Max_PDU_Size, pBuf, 0);
1237 pBuf += 4;
1238 tlvlen -= (v_U8_t)4;
1239 pDst->cc_event.Read_Local_AMP_Info.HC_Controller_Type = *pBuf;
1240 pBuf += 1;
1241 tlvlen -= (v_U8_t)1;
1242 framesntohs(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_PAL_Capabilities, pBuf, 0);
1243 pBuf += 2;
1244 tlvlen -= (v_U8_t)2;
1245 framesntohs(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_AMP_Assoc_Length, pBuf, 0);
1246 pBuf += 2;
1247 tlvlen -= (v_U8_t)2;
1248 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_Max_Flush_Timeout, pBuf, 0);
1249 pBuf += 4;
1250 tlvlen -= (v_U8_t)4;
1251 framesntohl(pCtx, &pDst->cc_event.Read_Local_AMP_Info.HC_BE_Flush_Timeout, pBuf, 0);
1252 pBuf += 4;
1253 tlvlen -= (v_U8_t)4;
1254 break;
1255 case 5130:
1256 pDst->cc_event.Read_Read_Local_AMP_Assoc.status = *pBuf;
1257 pBuf += 1;
1258 tlvlen -= (v_U8_t)1;
1259 pDst->cc_event.Read_Read_Local_AMP_Assoc.phy_link_handle = *pBuf;
1260 pBuf += 1;
1261 tlvlen -= (v_U8_t)1;
1262 framesntohs(pCtx, &pDst->cc_event.Read_Read_Local_AMP_Assoc.remaining_length, pBuf, 0);
1263 pBuf += 2;
1264 tlvlen -= (v_U8_t)2;
1265 if (pDst->cc_event.Read_Read_Local_AMP_Assoc.remaining_length > 248){
1266 // pDst->cc_event.Read_Read_Local_AMP_Assoc.present = 0;
1267 return BTAMP_SKIPPED_BAD_IE;
1268 }
1269
1270 BTAMP_MEMCPY(pCtx, pDst->cc_event.Read_Read_Local_AMP_Assoc.AMP_assoc_fragment, pBuf, ( pDst->cc_event.Read_Read_Local_AMP_Assoc.remaining_length ) );
1271 pBuf += ( pDst->cc_event.Read_Read_Local_AMP_Assoc.remaining_length );
1272 tlvlen -= ( pDst->cc_event.Read_Read_Local_AMP_Assoc.remaining_length );
1273 break;
1274 case 5131:
1275 pDst->cc_event.Write_Remote_AMP_Assoc.status = *pBuf;
1276 pBuf += 1;
1277 tlvlen -= (v_U8_t)1;
1278 pDst->cc_event.Write_Remote_AMP_Assoc.phy_link_handle = *pBuf;
1279 pBuf += 1;
1280 tlvlen -= (v_U8_t)1;
1281 break;
1282 case 6145:
1283 pDst->cc_event.Read_Loopback_Mode.status = *pBuf;
1284 pBuf += 1;
1285 tlvlen -= (v_U8_t)1;
1286 pDst->cc_event.Read_Loopback_Mode.loopback_mode = *pBuf;
1287 pBuf += 1;
1288 tlvlen -= (v_U8_t)1;
1289 break;
1290 case 6146:
1291 pDst->cc_event.Write_Loopback_Mode.status = *pBuf;
1292 pBuf += 1;
1293 tlvlen -= (v_U8_t)1;
1294 break;
1295 }
1296 (void)pCtx;
1297 return status;
1298} /* End btampUnpackTlvHCI_Command_Complete_Event. */
1299
1300typedef v_U32_t (*pfnUnpackTlvHCI_Command_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Command_Complete_Event*);
1301
1302#define SigUnpackTlvHCI_Command_Complete_Event ( 0x000a )
1303
1304
1305v_U32_t btampUnpackTlvHCI_Command_Status_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Command_Status_Event *pDst)
1306{
1307 v_U32_t status = BTAMP_PARSE_SUCCESS;
1308 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1309 pDst->present = 1;
1310 pDst->status = *pBuf;
1311 pBuf += 1;
1312 tlvlen -= (v_U8_t)1;
1313 pDst->num_hci_command_packets = *pBuf;
1314 pBuf += 1;
1315 tlvlen -= (v_U8_t)1;
1316 framesntohs(pCtx, &pDst->command_opcode, pBuf, 0);
1317 pBuf += 2;
1318 tlvlen -= (v_U8_t)2;
1319 (void)pCtx;
1320 return status;
1321} /* End btampUnpackTlvHCI_Command_Status_Event. */
1322
1323typedef v_U32_t (*pfnUnpackTlvHCI_Command_Status_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Command_Status_Event*);
1324
1325#define SigUnpackTlvHCI_Command_Status_Event ( 0x000b )
1326
1327
1328v_U32_t btampUnpackTlvHCI_Create_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Create_Logical_Link_Cmd *pDst)
1329{
1330 v_U32_t status = BTAMP_PARSE_SUCCESS;
1331 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1332
1333 /*-----------------------------------------------------------------------
1334 TLV Sanity check
1335 -------------------------------------------------------------------------*/
1336#ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
1337 if ( WLAN_BAP_PAL_CREATE_LOG_LINK_TLV_LEN != tlvlen )
1338 {
1339#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1340 /*Log invalid len*/
1341 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1342 "Invalid TLV len on %s", __FUNCTION__);
1343#endif
1344// return BTAMP_INVALID_TLV_LENGTH;
1345 }
1346#endif
1347 /*-----------------------------------------------------------------------
1348 Parse TLV
1349 -----------------------------------------------------------------------*/
1350 pDst->present = 1;
1351 pDst->phy_link_handle = *pBuf;
1352 pBuf += 1;
1353 tlvlen -= (v_U8_t)1;
1354 BTAMP_MEMCPY(pCtx, pDst->tx_flow_spec, pBuf, 18);
1355 pBuf += 18;
1356 tlvlen -= (v_U8_t)18;
1357 BTAMP_MEMCPY(pCtx, pDst->rx_flow_spec, pBuf, 18);
1358 pBuf += 18;
1359 tlvlen -= (v_U8_t)18;
1360 (void)pCtx;
1361 return status;
1362} /* End btampUnpackTlvHCI_Create_Logical_Link_Cmd. */
1363
1364typedef v_U32_t (*pfnUnpackTlvHCI_Create_Logical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Create_Logical_Link_Cmd*);
1365
1366#define SigUnpackTlvHCI_Create_Logical_Link_Cmd ( 0x000c )
1367
1368
1369v_U32_t btampUnpackTlvHCI_Create_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Create_Physical_Link_Cmd *pDst)
1370{
1371 v_U32_t status = BTAMP_PARSE_SUCCESS;
1372 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1373
1374 /*-----------------------------------------------------------------------
1375 TLV Sanity check
1376 -------------------------------------------------------------------------*/
1377 if ( WLAN_BAP_PAL_CREATE_PHY_LINK_TLV_MIN_LEN > tlvlen )
1378 {
1379#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1380 /*Log invalid len*/
1381 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1382 "Invalid TLV len on %s", __FUNCTION__);
1383#endif
1384 return BTAMP_INVALID_TLV_LENGTH;
1385 }
1386
1387 /*-----------------------------------------------------------------------
1388 Parse TLV
1389 -----------------------------------------------------------------------*/
1390 pDst->present = 1;
1391 pDst->phy_link_handle = *pBuf;
1392 pBuf += 1;
1393 tlvlen -= (v_U8_t)1;
1394 pDst->key_length = *pBuf;
1395 pBuf += 1;
1396 tlvlen -= (v_U8_t)1;
1397 pDst->key_type = *pBuf;
1398 pBuf += 1;
1399 tlvlen -= (v_U8_t)1;
1400 if (pDst->key_length > 32){
1401 pDst->present = 0;
1402 return BTAMP_SKIPPED_BAD_IE;
1403 }
1404
1405 BTAMP_MEMCPY(pCtx, pDst->key_material, pBuf, ( pDst->key_length ) );
1406 pBuf += ( pDst->key_length );
1407 tlvlen -= ( pDst->key_length );
1408 (void)pCtx;
1409 return status;
1410} /* End btampUnpackTlvHCI_Create_Physical_Link_Cmd. */
1411
1412typedef v_U32_t (*pfnUnpackTlvHCI_Create_Physical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Create_Physical_Link_Cmd*);
1413
1414#define SigUnpackTlvHCI_Create_Physical_Link_Cmd ( 0x000d )
1415
1416
1417v_U32_t btampUnpackTlvHCI_Data_Buffer_Overflow_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Data_Buffer_Overflow_Event *pDst)
1418{
1419 v_U32_t status = BTAMP_PARSE_SUCCESS;
1420 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1421 pDst->present = 1;
1422 pDst->link_type = *pBuf;
1423 pBuf += 1;
1424 tlvlen -= (v_U8_t)1;
1425 (void)pCtx;
1426 return status;
1427} /* End btampUnpackTlvHCI_Data_Buffer_Overflow_Event. */
1428
1429typedef v_U32_t (*pfnUnpackTlvHCI_Data_Buffer_Overflow_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Data_Buffer_Overflow_Event*);
1430
1431#define SigUnpackTlvHCI_Data_Buffer_Overflow_Event ( 0x000e )
1432
1433
1434v_U32_t btampUnpackTlvHCI_Disconnect_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Disconnect_Logical_Link_Cmd *pDst)
1435{
1436 v_U32_t status = BTAMP_PARSE_SUCCESS;
1437 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1438
1439 /*-----------------------------------------------------------------------
1440 TLV Sanity check
1441 -------------------------------------------------------------------------*/
1442 if ( WLAN_BAP_PAL_DISC_LOG_LINK_TLV_LEN != tlvlen )
1443 {
1444#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1445 /*Log invalid len*/
1446 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1447 "Invalid TLV len on %s", __FUNCTION__);
1448#endif
1449 return BTAMP_INVALID_TLV_LENGTH;
1450 }
1451
1452 /*-----------------------------------------------------------------------
1453 Parse TLV
1454 -----------------------------------------------------------------------*/
1455 pDst->present = 1;
1456 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1457 pBuf += 2;
1458 tlvlen -= (v_U8_t)2;
1459 (void)pCtx;
1460 return status;
1461} /* End btampUnpackTlvHCI_Disconnect_Logical_Link_Cmd. */
1462
1463typedef v_U32_t (*pfnUnpackTlvHCI_Disconnect_Logical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Disconnect_Logical_Link_Cmd*);
1464
1465#define SigUnpackTlvHCI_Disconnect_Logical_Link_Cmd ( 0x000f )
1466
1467
1468v_U32_t btampUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event *pDst)
1469{
1470 v_U32_t status = BTAMP_PARSE_SUCCESS;
1471 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1472 pDst->present = 1;
1473 pDst->status = *pBuf;
1474 pBuf += 1;
1475 tlvlen -= (v_U8_t)1;
1476 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1477 pBuf += 2;
1478 tlvlen -= (v_U8_t)2;
1479 pDst->reason = *pBuf;
1480 pBuf += 1;
1481 tlvlen -= (v_U8_t)1;
1482 (void)pCtx;
1483 return status;
1484} /* End btampUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event. */
1485
1486typedef v_U32_t (*pfnUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event*);
1487
1488#define SigUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event ( 0x0010 )
1489
1490
1491v_U32_t btampUnpackTlvHCI_Disconnect_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Disconnect_Physical_Link_Cmd *pDst)
1492{
1493 v_U32_t status = BTAMP_PARSE_SUCCESS;
1494 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1495
1496 /*-----------------------------------------------------------------------
1497 TLV Sanity check
1498 -------------------------------------------------------------------------*/
1499#ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
1500 if ( WLAN_BAP_PAL_DISC_PHY_LINK_TLV_LEN != tlvlen )
1501 {
1502#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1503 /*Log invalid len*/
1504 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1505 "Invalid TLV len on %s", __FUNCTION__);
1506#endif
1507// return BTAMP_INVALID_TLV_LENGTH;
1508 }
1509#endif
1510
1511 /*-----------------------------------------------------------------------
1512 Parse TLV
1513 -----------------------------------------------------------------------*/
1514 pDst->present = 1;
1515 pDst->phy_link_handle = *pBuf;
1516 pBuf += 1;
1517 tlvlen -= (v_U8_t)1;
1518 pDst->reason = *pBuf;
1519 pBuf += 1;
1520 tlvlen -= (v_U8_t)1;
1521 (void)pCtx;
1522 return status;
1523} /* End btampUnpackTlvHCI_Disconnect_Physical_Link_Cmd. */
1524
1525typedef v_U32_t (*pfnUnpackTlvHCI_Disconnect_Physical_Link_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Disconnect_Physical_Link_Cmd*);
1526
1527#define SigUnpackTlvHCI_Disconnect_Physical_Link_Cmd ( 0x0011 )
1528
1529
1530v_U32_t btampUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event *pDst)
1531{
1532 v_U32_t status = BTAMP_PARSE_SUCCESS;
1533 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1534 pDst->present = 1;
1535 pDst->status = *pBuf;
1536 pBuf += 1;
1537 tlvlen -= (v_U8_t)1;
1538 pDst->phy_link_handle = *pBuf;
1539 pBuf += 1;
1540 tlvlen -= (v_U8_t)1;
1541 pDst->reason = *pBuf;
1542 pBuf += 1;
1543 tlvlen -= (v_U8_t)1;
1544 (void)pCtx;
1545 return status;
1546} /* End btampUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event. */
1547
1548typedef v_U32_t (*pfnUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event*);
1549
1550#define SigUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event ( 0x0012 )
1551
1552
1553v_U32_t btampUnpackTlvHCI_Flow_Spec_Modify_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Flow_Spec_Modify_Cmd *pDst)
1554{
1555 v_U32_t status = BTAMP_PARSE_SUCCESS;
1556 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1557
1558 /*-----------------------------------------------------------------------
1559 TLV Sanity check
1560 -------------------------------------------------------------------------*/
1561 if ( WLAN_BAP_PAL_FLOW_SPEC_MOD_TLV_LEN != tlvlen )
1562 {
1563#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1564 /*Log invalid len*/
1565 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1566 "Invalid TLV len on %s", __FUNCTION__);
1567#endif
1568 return BTAMP_INVALID_TLV_LENGTH;
1569 }
1570
1571 /*-----------------------------------------------------------------------
1572 Parse TLV
1573 -----------------------------------------------------------------------*/
1574 pDst->present = 1;
1575 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1576 pBuf += 2;
1577 tlvlen -= (v_U8_t)2;
1578 pDst->be_aggr_counter = *pBuf;
1579 pBuf += 1;
1580 tlvlen -= (v_U8_t)1;
1581 BTAMP_MEMCPY(pCtx, pDst->tx_flow_spec, pBuf, 18);
1582 pBuf += 18;
1583 tlvlen -= (v_U8_t)18;
1584 BTAMP_MEMCPY(pCtx, pDst->rx_flow_spec, pBuf, 18);
1585 pBuf += 18;
1586 tlvlen -= (v_U8_t)18;
1587 (void)pCtx;
1588 return status;
1589} /* End btampUnpackTlvHCI_Flow_Spec_Modify_Cmd. */
1590
1591typedef v_U32_t (*pfnUnpackTlvHCI_Flow_Spec_Modify_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Flow_Spec_Modify_Cmd*);
1592
1593#define SigUnpackTlvHCI_Flow_Spec_Modify_Cmd ( 0x0013 )
1594
1595
1596v_U32_t btampUnpackTlvHCI_Flow_Spec_Modify_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Flow_Spec_Modify_Complete_Event *pDst)
1597{
1598 v_U32_t status = BTAMP_PARSE_SUCCESS;
1599 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1600 pDst->present = 1;
1601 pDst->status = *pBuf;
1602 pBuf += 1;
1603 tlvlen -= (v_U8_t)1;
1604 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1605 pBuf += 2;
1606 tlvlen -= (v_U8_t)2;
1607 (void)pCtx;
1608 return status;
1609} /* End btampUnpackTlvHCI_Flow_Spec_Modify_Complete_Event. */
1610
1611typedef v_U32_t (*pfnUnpackTlvHCI_Flow_Spec_Modify_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Flow_Spec_Modify_Complete_Event*);
1612
1613#define SigUnpackTlvHCI_Flow_Spec_Modify_Complete_Event ( 0x0014 )
1614
1615
1616v_U32_t btampUnpackTlvHCI_Flush_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Flush_Cmd *pDst)
1617{
1618 v_U32_t status = BTAMP_PARSE_SUCCESS;
1619 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1620
1621 /*-----------------------------------------------------------------------
1622 TLV Sanity check
1623 -------------------------------------------------------------------------*/
1624 if ( WLAN_BAP_PAL_FLUSH_TLV_LEN != tlvlen )
1625 {
1626#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1627 /*Log invalid len*/
1628 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1629 "Invalid TLV len on %s", __FUNCTION__);
1630#endif
1631 return BTAMP_INVALID_TLV_LENGTH;
1632 }
1633
1634 /*-----------------------------------------------------------------------
1635 Parse TLV
1636 -----------------------------------------------------------------------*/
1637 pDst->present = 1;
1638 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1639 pBuf += 2;
1640 tlvlen -= (v_U8_t)2;
1641 (void)pCtx;
1642 return status;
1643} /* End btampUnpackTlvHCI_Flush_Cmd. */
1644
1645typedef v_U32_t (*pfnUnpackTlvHCI_Flush_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Flush_Cmd*);
1646
1647#define SigUnpackTlvHCI_Flush_Cmd ( 0x0015 )
1648
1649
1650v_U32_t btampUnpackTlvHCI_Flush_Occurred_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Flush_Occurred_Event *pDst)
1651{
1652 v_U32_t status = BTAMP_PARSE_SUCCESS;
1653 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1654 pDst->present = 1;
1655 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1656 pBuf += 2;
1657 tlvlen -= (v_U8_t)2;
1658 (void)pCtx;
1659 return status;
1660} /* End btampUnpackTlvHCI_Flush_Occurred_Event. */
1661
1662typedef v_U32_t (*pfnUnpackTlvHCI_Flush_Occurred_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Flush_Occurred_Event*);
1663
1664#define SigUnpackTlvHCI_Flush_Occurred_Event ( 0x0016 )
1665
1666
1667v_U32_t btampUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event *pDst)
1668{
1669 v_U32_t status = BTAMP_PARSE_SUCCESS;
1670 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1671 pDst->present = 1;
1672 BTAMP_MEMCPY(pCtx, pDst->bd_addr, pBuf, 6);
1673 pBuf += 6;
1674 tlvlen -= (v_U8_t)6;
1675 BTAMP_MEMCPY(pCtx, pDst->generic_amp_link_key, pBuf, 32);
1676 pBuf += 32;
1677 tlvlen -= (v_U8_t)32;
1678 pDst->key_type = *pBuf;
1679 pBuf += 1;
1680 tlvlen -= (v_U8_t)1;
1681 (void)pCtx;
1682 return status;
1683} /* End btampUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event. */
1684
1685typedef v_U32_t (*pfnUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event*);
1686
1687#define SigUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event ( 0x0017 )
1688
1689
1690v_U32_t btampUnpackTlvHCI_Hardware_Error_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Hardware_Error_Event *pDst)
1691{
1692 v_U32_t status = BTAMP_PARSE_SUCCESS;
1693 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1694 pDst->present = 1;
1695 pDst->hardware_code = *pBuf;
1696 pBuf += 1;
1697 tlvlen -= (v_U8_t)1;
1698 (void)pCtx;
1699 return status;
1700} /* End btampUnpackTlvHCI_Hardware_Error_Event. */
1701
1702typedef v_U32_t (*pfnUnpackTlvHCI_Hardware_Error_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Hardware_Error_Event*);
1703
1704#define SigUnpackTlvHCI_Hardware_Error_Event ( 0x0018 )
1705
1706
1707v_U32_t btampUnpackTlvHCI_Logical_Link_Cancel_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Logical_Link_Cancel_Cmd *pDst)
1708{
1709 v_U32_t status = BTAMP_PARSE_SUCCESS;
1710 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1711
1712 /*-----------------------------------------------------------------------
1713 TLV Sanity check
1714 -------------------------------------------------------------------------*/
1715 if ( WLAN_BAP_PAL_CANCEL_LOG_LINK_TLV_LEN != tlvlen )
1716 {
1717#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1718 /*Log invalid len*/
1719 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1720 "Invalid TLV len on %s", __FUNCTION__);
1721#endif
1722 return BTAMP_INVALID_TLV_LENGTH;
1723 }
1724
1725 /*-----------------------------------------------------------------------
1726 Parse TLV
1727 -----------------------------------------------------------------------*/
1728 pDst->present = 1;
1729 pDst->phy_link_handle = *pBuf;
1730 pBuf += 1;
1731 tlvlen -= (v_U8_t)1;
1732 pDst->tx_flow_spec_id = *pBuf;
1733 pBuf += 1;
1734 tlvlen -= (v_U8_t)1;
1735 (void)pCtx;
1736 return status;
1737} /* End btampUnpackTlvHCI_Logical_Link_Cancel_Cmd. */
1738
1739typedef v_U32_t (*pfnUnpackTlvHCI_Logical_Link_Cancel_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Logical_Link_Cancel_Cmd*);
1740
1741#define SigUnpackTlvHCI_Logical_Link_Cancel_Cmd ( 0x0019 )
1742
1743
1744v_U32_t btampUnpackTlvHCI_Logical_Link_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Logical_Link_Complete_Event *pDst)
1745{
1746 v_U32_t status = BTAMP_PARSE_SUCCESS;
1747 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1748 pDst->present = 1;
1749 pDst->status = *pBuf;
1750 pBuf += 1;
1751 tlvlen -= (v_U8_t)1;
1752 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1753 pBuf += 2;
1754 tlvlen -= (v_U8_t)2;
1755 pDst->phy_link_handle = *pBuf;
1756 pBuf += 1;
1757 tlvlen -= (v_U8_t)1;
1758 (void)pCtx;
1759 return status;
1760} /* End btampUnpackTlvHCI_Logical_Link_Complete_Event. */
1761
1762typedef v_U32_t (*pfnUnpackTlvHCI_Logical_Link_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Logical_Link_Complete_Event*);
1763
1764#define SigUnpackTlvHCI_Logical_Link_Complete_Event ( 0x001a )
1765
1766
1767v_U32_t btampUnpackTlvHCI_Loopback_Command_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Loopback_Command_Event *pDst)
1768{
1769 v_U32_t status = BTAMP_PARSE_SUCCESS;
1770 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1771 pDst->present = 1;
1772 BTAMP_MEMCPY(pCtx, pDst->hci_command_packet, pBuf, 64);
1773 pBuf += 64;
1774 tlvlen -= (v_U8_t)64;
1775 (void)pCtx;
1776 return status;
1777} /* End btampUnpackTlvHCI_Loopback_Command_Event. */
1778
1779typedef v_U32_t (*pfnUnpackTlvHCI_Loopback_Command_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Loopback_Command_Event*);
1780
1781#define SigUnpackTlvHCI_Loopback_Command_Event ( 0x001b )
1782
1783
1784v_U32_t btampUnpackTlvHCI_Physical_Link_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Physical_Link_Complete_Event *pDst)
1785{
1786 v_U32_t status = BTAMP_PARSE_SUCCESS;
1787 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1788 pDst->present = 1;
1789 pDst->status = *pBuf;
1790 pBuf += 1;
1791 tlvlen -= (v_U8_t)1;
1792 pDst->phy_link_handle = *pBuf;
1793 pBuf += 1;
1794 tlvlen -= (v_U8_t)1;
1795 (void)pCtx;
1796 return status;
1797} /* End btampUnpackTlvHCI_Physical_Link_Complete_Event. */
1798
1799typedef v_U32_t (*pfnUnpackTlvHCI_Physical_Link_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Physical_Link_Complete_Event*);
1800
1801#define SigUnpackTlvHCI_Physical_Link_Complete_Event ( 0x001c )
1802
1803
1804v_U32_t btampUnpackTlvHCI_Physical_Link_Loss_Warning_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Physical_Link_Loss_Warning_Event *pDst)
1805{
1806 v_U32_t status = BTAMP_PARSE_SUCCESS;
1807 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1808 pDst->present = 1;
1809 pDst->phy_link_handle = *pBuf;
1810 pBuf += 1;
1811 tlvlen -= (v_U8_t)1;
1812 pDst->reason = *pBuf;
1813 pBuf += 1;
1814 tlvlen -= (v_U8_t)1;
1815 (void)pCtx;
1816 return status;
1817} /* End btampUnpackTlvHCI_Physical_Link_Loss_Warning_Event. */
1818
1819typedef v_U32_t (*pfnUnpackTlvHCI_Physical_Link_Loss_Warning_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Physical_Link_Loss_Warning_Event*);
1820
1821#define SigUnpackTlvHCI_Physical_Link_Loss_Warning_Event ( 0x001d )
1822
1823
1824v_U32_t btampUnpackTlvHCI_Physical_Link_Recovery_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Physical_Link_Recovery_Event *pDst)
1825{
1826 v_U32_t status = BTAMP_PARSE_SUCCESS;
1827 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1828 pDst->present = 1;
1829 pDst->phy_link_handle = *pBuf;
1830 pBuf += 1;
1831 tlvlen -= (v_U8_t)1;
1832 (void)pCtx;
1833 return status;
1834} /* End btampUnpackTlvHCI_Physical_Link_Recovery_Event. */
1835
1836typedef v_U32_t (*pfnUnpackTlvHCI_Physical_Link_Recovery_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Physical_Link_Recovery_Event*);
1837
1838#define SigUnpackTlvHCI_Physical_Link_Recovery_Event ( 0x001e )
1839
1840
1841v_U32_t btampUnpackTlvHCI_Qos_Violation_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Qos_Violation_Event *pDst)
1842{
1843 v_U32_t status = BTAMP_PARSE_SUCCESS;
1844 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1845 pDst->present = 1;
1846 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1847 pBuf += 2;
1848 tlvlen -= (v_U8_t)2;
1849 (void)pCtx;
1850 return status;
1851} /* End btampUnpackTlvHCI_Qos_Violation_Event. */
1852
1853typedef v_U32_t (*pfnUnpackTlvHCI_Qos_Violation_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Qos_Violation_Event*);
1854
1855#define SigUnpackTlvHCI_Qos_Violation_Event ( 0x001f )
1856
1857
1858v_U32_t btampUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *pDst)
1859{
1860 v_U32_t status = BTAMP_PARSE_SUCCESS;
1861 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1862
1863 /*-----------------------------------------------------------------------
1864 TLV Sanity check
1865 -------------------------------------------------------------------------*/
1866 if ( WLAN_BAP_PAL_READ_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen )
1867 {
1868#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1869 /*Log invalid len*/
1870 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1871 "Invalid TLV len on %s", __FUNCTION__);
1872#endif
1873 return BTAMP_INVALID_TLV_LENGTH;
1874 }
1875
1876 /*-----------------------------------------------------------------------
1877 Parse TLV
1878 -----------------------------------------------------------------------*/
1879 pDst->present = 1;
1880 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1881 pBuf += 2;
1882 tlvlen -= (v_U8_t)2;
1883 (void)pCtx;
1884 return status;
1885} /* End btampUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd. */
1886
1887typedef v_U32_t (*pfnUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd*);
1888
1889#define SigUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd ( 0x0020 )
1890
1891
1892v_U32_t btampUnpackTlvHCI_Read_Buffer_Size_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Buffer_Size_Cmd *pDst)
1893{
1894 v_U32_t status = BTAMP_PARSE_SUCCESS;
1895 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1896 pDst->present = 1;
1897 (void)pCtx;
1898 return status;
1899} /* End btampUnpackTlvHCI_Read_Buffer_Size_Cmd. */
1900
1901typedef v_U32_t (*pfnUnpackTlvHCI_Read_Buffer_Size_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Buffer_Size_Cmd*);
1902
1903#define SigUnpackTlvHCI_Read_Buffer_Size_Cmd ( 0x0021 )
1904
1905
1906v_U32_t btampUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd *pDst)
1907{
1908 v_U32_t status = BTAMP_PARSE_SUCCESS;
1909 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1910 pDst->present = 1;
1911 (void)pCtx;
1912 return status;
1913} /* End btampUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd. */
1914
1915typedef v_U32_t (*pfnUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd*);
1916
1917#define SigUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd ( 0x0022 )
1918
1919
1920v_U32_t btampUnpackTlvHCI_Read_Data_Block_Size_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Data_Block_Size_Cmd *pDst)
1921{
1922 v_U32_t status = BTAMP_PARSE_SUCCESS;
1923 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1924 pDst->present = 1;
1925 (void)pCtx;
1926 return status;
1927} /* End btampUnpackTlvHCI_Read_Data_Block_Size_Cmd. */
1928
1929typedef v_U32_t (*pfnUnpackTlvHCI_Read_Data_Block_Size_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Data_Block_Size_Cmd*);
1930
1931#define SigUnpackTlvHCI_Read_Data_Block_Size_Cmd ( 0x0023 )
1932
1933
1934v_U32_t btampUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd *pDst)
1935{
1936 v_U32_t status = BTAMP_PARSE_SUCCESS;
1937 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1938
1939 /*-----------------------------------------------------------------------
1940 TLV Sanity check
1941 -------------------------------------------------------------------------*/
1942 if ( WLAN_BAP_PAL_READ_FAILED_CONTACT_CNT_TLV_LEN != tlvlen )
1943 {
1944#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1945 /*Log invalid len*/
1946 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1947 "Invalid TLV len on %s", __FUNCTION__);
1948#endif
1949 return BTAMP_INVALID_TLV_LENGTH;
1950 }
1951
1952 /*-----------------------------------------------------------------------
1953 Parse TLV
1954 -----------------------------------------------------------------------*/
1955 pDst->present = 1;
1956 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
1957 pBuf += 2;
1958 tlvlen -= (v_U8_t)2;
1959 (void)pCtx;
1960 return status;
1961} /* End btampUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd. */
1962
1963typedef v_U32_t (*pfnUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd*);
1964
1965#define SigUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd ( 0x0024 )
1966
1967
1968v_U32_t btampUnpackTlvHCI_Read_Flow_Control_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Flow_Control_Mode_Cmd *pDst)
1969{
1970 v_U32_t status = BTAMP_PARSE_SUCCESS;
1971 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1972 pDst->present = 1;
1973 (void)pCtx;
1974 return status;
1975} /* End btampUnpackTlvHCI_Read_Flow_Control_Mode_Cmd. */
1976
1977typedef v_U32_t (*pfnUnpackTlvHCI_Read_Flow_Control_Mode_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Flow_Control_Mode_Cmd*);
1978
1979#define SigUnpackTlvHCI_Read_Flow_Control_Mode_Cmd ( 0x0025 )
1980
1981
1982v_U32_t btampUnpackTlvHCI_Read_Link_Quality_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Link_Quality_Cmd *pDst)
1983{
1984 v_U32_t status = BTAMP_PARSE_SUCCESS;
1985 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
1986
1987 /*-----------------------------------------------------------------------
1988 TLV Sanity check
1989 -------------------------------------------------------------------------*/
1990 if ( WLAN_BAP_PAL_READ_LINK_QUALITY_TLV_LEN != tlvlen )
1991 {
1992#ifdef WLAN_BAPHCI_ENABLE_LOGGING
1993 /*Log invalid len*/
1994 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
1995 "Invalid TLV len on %s", __FUNCTION__);
1996#endif
1997 return BTAMP_INVALID_TLV_LENGTH;
1998 }
1999
2000 /*-----------------------------------------------------------------------
2001 Parse TLV
2002 -----------------------------------------------------------------------*/
2003 pDst->present = 1;
2004 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2005 pBuf += 2;
2006 tlvlen -= (v_U8_t)2;
2007 (void)pCtx;
2008 return status;
2009} /* End btampUnpackTlvHCI_Read_Link_Quality_Cmd. */
2010
2011typedef v_U32_t (*pfnUnpackTlvHCI_Read_Link_Quality_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Link_Quality_Cmd*);
2012
2013#define SigUnpackTlvHCI_Read_Link_Quality_Cmd ( 0x0026 )
2014
2015
2016v_U32_t btampUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *pDst)
2017{
2018 v_U32_t status = BTAMP_PARSE_SUCCESS;
2019 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2020
2021 /*-----------------------------------------------------------------------
2022 TLV Sanity check
2023 -------------------------------------------------------------------------*/
2024 if ( WLAN_BAP_PAL_READ_LINK_SVISISON_TIMEOUT_TLV_LEN != tlvlen )
2025 {
2026#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2027 /*Log invalid len*/
2028 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2029 "Invalid TLV len on %s", __FUNCTION__);
2030#endif
2031 return BTAMP_INVALID_TLV_LENGTH;
2032 }
2033
2034 /*-----------------------------------------------------------------------
2035 Parse TLV
2036 -----------------------------------------------------------------------*/
2037 pDst->present = 1;
2038 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2039 pBuf += 2;
2040 tlvlen -= (v_U8_t)2;
2041 (void)pCtx;
2042 return status;
2043} /* End btampUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd. */
2044
2045typedef v_U32_t (*pfnUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd*);
2046
2047#define SigUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd ( 0x0027 )
2048
2049
2050v_U32_t btampUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd *pDst)
2051{
2052 v_U32_t status = BTAMP_PARSE_SUCCESS;
2053 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2054
2055 /*-----------------------------------------------------------------------
2056 TLV Sanity check
2057 -------------------------------------------------------------------------*/
2058 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2059 "Invalid TLV len on %s. tlvlen=%d.", __FUNCTION__, tlvlen);
2060
2061#ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
2062 if ( WLAN_BAP_PAL_READ_LOCAL_AMP_ASSOC_TLV_LEN != tlvlen )
2063 {
2064#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2065 /*Log invalid len*/
2066 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2067 "Invalid TLV len on %s", __FUNCTION__);
2068#endif
2069// return BTAMP_INVALID_TLV_LENGTH;
2070 }
2071#endif
2072
2073 /*-----------------------------------------------------------------------
2074 Parse TLV
2075 -----------------------------------------------------------------------*/
2076 pDst->present = 1;
2077 pDst->phy_link_handle = *pBuf;
2078 pBuf += 1;
2079 tlvlen -= (v_U8_t)1;
2080 framesntohs(pCtx, &pDst->length_so_far, pBuf, 0);
2081 pBuf += 2;
2082 tlvlen -= (v_U8_t)2;
2083 framesntohs(pCtx, &pDst->max_remote_amp_assoc_length, pBuf, 0);
2084 pBuf += 2;
2085 tlvlen -= (v_U8_t)2;
2086 (void)pCtx;
2087 return status;
2088} /* End btampUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd. */
2089
2090typedef v_U32_t (*pfnUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd*);
2091
2092#define SigUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd ( 0x0028 )
2093
2094
2095v_U32_t btampUnpackTlvHCI_Read_Local_AMP_Information_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Local_AMP_Information_Cmd *pDst)
2096{
2097 v_U32_t status = BTAMP_PARSE_SUCCESS;
2098 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2099 pDst->present = 1;
2100 (void)pCtx;
2101 return status;
2102} /* End btampUnpackTlvHCI_Read_Local_AMP_Information_Cmd. */
2103
2104typedef v_U32_t (*pfnUnpackTlvHCI_Read_Local_AMP_Information_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Local_AMP_Information_Cmd*);
2105
2106#define SigUnpackTlvHCI_Read_Local_AMP_Information_Cmd ( 0x0029 )
2107
2108
2109v_U32_t btampUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd *pDst)
2110{
2111 v_U32_t status = BTAMP_PARSE_SUCCESS;
2112 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2113 pDst->present = 1;
2114 (void)pCtx;
2115 return status;
2116} /* End btampUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd. */
2117
2118typedef v_U32_t (*pfnUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd*);
2119
2120#define SigUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd ( 0x002a )
2121
2122
2123v_U32_t btampUnpackTlvHCI_Read_Local_Version_Info_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Local_Version_Info_Cmd *pDst)
2124{
2125 v_U32_t status = BTAMP_PARSE_SUCCESS;
2126 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2127 pDst->present = 1;
2128 (void)pCtx;
2129 return status;
2130} /* End btampUnpackTlvHCI_Read_Local_Version_Info_Cmd. */
2131
2132typedef v_U32_t (*pfnUnpackTlvHCI_Read_Local_Version_Info_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Local_Version_Info_Cmd*);
2133
2134#define SigUnpackTlvHCI_Read_Local_Version_Info_Cmd ( 0x002b )
2135
2136
2137v_U32_t btampUnpackTlvHCI_Read_Location_Data_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Location_Data_Cmd *pDst)
2138{
2139 v_U32_t status = BTAMP_PARSE_SUCCESS;
2140 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2141 pDst->present = 1;
2142 (void)pCtx;
2143 return status;
2144} /* End btampUnpackTlvHCI_Read_Location_Data_Cmd. */
2145
2146typedef v_U32_t (*pfnUnpackTlvHCI_Read_Location_Data_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Location_Data_Cmd*);
2147
2148#define SigUnpackTlvHCI_Read_Location_Data_Cmd ( 0x002c )
2149
2150
2151v_U32_t btampUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd *pDst)
2152{
2153 v_U32_t status = BTAMP_PARSE_SUCCESS;
2154 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2155 pDst->present = 1;
2156 (void)pCtx;
2157 return status;
2158} /* End btampUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd. */
2159
2160typedef v_U32_t (*pfnUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd*);
2161
2162#define SigUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd ( 0x002d )
2163
2164
2165v_U32_t btampUnpackTlvHCI_Read_Loopback_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_Loopback_Mode_Cmd *pDst)
2166{
2167 v_U32_t status = BTAMP_PARSE_SUCCESS;
2168 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2169 pDst->present = 1;
2170 (void)pCtx;
2171 return status;
2172} /* End btampUnpackTlvHCI_Read_Loopback_Mode_Cmd. */
2173
2174typedef v_U32_t (*pfnUnpackTlvHCI_Read_Loopback_Mode_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_Loopback_Mode_Cmd*);
2175
2176#define SigUnpackTlvHCI_Read_Loopback_Mode_Cmd ( 0x002e )
2177
2178
2179v_U32_t btampUnpackTlvHCI_Read_RSSI_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Read_RSSI_Cmd *pDst)
2180{
2181 v_U32_t status = BTAMP_PARSE_SUCCESS;
2182 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2183
2184 /*-----------------------------------------------------------------------
2185 TLV Sanity check
2186 -------------------------------------------------------------------------*/
2187 if ( WLAN_BAP_PAL_READ_RSSI_TLV_LEN != tlvlen )
2188 {
2189#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2190 /*Log invalid len*/
2191 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2192 "Invalid TLV len on %s", __FUNCTION__);
2193#endif
2194 return BTAMP_INVALID_TLV_LENGTH;
2195 }
2196
2197 /*-----------------------------------------------------------------------
2198 Parse TLV
2199 -----------------------------------------------------------------------*/
2200 pDst->present = 1;
2201 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2202 pBuf += 2;
2203 tlvlen -= (v_U8_t)2;
2204 (void)pCtx;
2205 return status;
2206} /* End btampUnpackTlvHCI_Read_RSSI_Cmd. */
2207
2208typedef v_U32_t (*pfnUnpackTlvHCI_Read_RSSI_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Read_RSSI_Cmd*);
2209
2210#define SigUnpackTlvHCI_Read_RSSI_Cmd ( 0x002f )
2211
2212
2213v_U32_t btampUnpackTlvHCI_Reset_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Reset_Cmd *pDst)
2214{
2215 v_U32_t status = BTAMP_PARSE_SUCCESS;
2216 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2217 pDst->present = 1;
2218 (void)pCtx;
2219 return status;
2220} /* End btampUnpackTlvHCI_Reset_Cmd. */
2221
2222typedef v_U32_t (*pfnUnpackTlvHCI_Reset_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Reset_Cmd*);
2223
2224#define SigUnpackTlvHCI_Reset_Cmd ( 0x0030 )
2225
2226
2227v_U32_t btampUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd *pDst)
2228{
2229 v_U32_t status = BTAMP_PARSE_SUCCESS;
2230 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2231
2232 /*-----------------------------------------------------------------------
2233 TLV Sanity check
2234 -------------------------------------------------------------------------*/
2235 if ( WLAN_BAP_PAL_RESET_FAILED_CONTACT_CNT_TLV_LEN != tlvlen )
2236 {
2237#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2238 /*Log invalid len*/
2239 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2240 "Invalid TLV len on %s", __FUNCTION__);
2241#endif
2242 return BTAMP_INVALID_TLV_LENGTH;
2243 }
2244
2245 /*-----------------------------------------------------------------------
2246 Parse TLV
2247 -----------------------------------------------------------------------*/
2248 pDst->present = 1;
2249 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2250 pBuf += 2;
2251 tlvlen -= (v_U8_t)2;
2252 (void)pCtx;
2253 return status;
2254} /* End btampUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd. */
2255
2256typedef v_U32_t (*pfnUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd*);
2257
2258#define SigUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd ( 0x0031 )
2259
2260
2261v_U32_t btampUnpackTlvHCI_Set_Event_Mask_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Set_Event_Mask_Cmd *pDst)
2262{
2263 v_U32_t status = BTAMP_PARSE_SUCCESS;
2264 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2265
2266 /*-----------------------------------------------------------------------
2267 TLV Sanity check
2268 -------------------------------------------------------------------------*/
2269 if ( WLAN_BAP_PAL_SET_EVENT_MASK_TLV_LEN != tlvlen )
2270 {
2271#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2272 /*Log invalid len*/
2273 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2274 "Invalid TLV len on %s", __FUNCTION__);
2275#endif
2276 return BTAMP_INVALID_TLV_LENGTH;
2277 }
2278
2279 /*-----------------------------------------------------------------------
2280 Parse TLV
2281 -----------------------------------------------------------------------*/
2282 pDst->present = 1;
2283 BTAMP_MEMCPY(pCtx, pDst->event_mask, pBuf, 8);
2284 pBuf += 8;
2285 tlvlen -= (v_U8_t)8;
2286 (void)pCtx;
2287 return status;
2288} /* End btampUnpackTlvHCI_Set_Event_Mask_Cmd. */
2289
2290typedef v_U32_t (*pfnUnpackTlvHCI_Set_Event_Mask_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Set_Event_Mask_Cmd*);
2291
2292#define SigUnpackTlvHCI_Set_Event_Mask_Cmd ( 0x0032 )
2293
2294
2295v_U32_t btampUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *pDst)
2296{
2297 v_U32_t status = BTAMP_PARSE_SUCCESS;
2298 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2299
2300 /*-----------------------------------------------------------------------
2301 TLV Sanity check
2302 -------------------------------------------------------------------------*/
2303
2304 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2305 "Invalid TLV len on %s. tlvlen=%d.", __FUNCTION__, tlvlen);
2306#ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING
2307 if ( WLAN_BAP_PAL_SET_EVENT_MASK2_TLV_LEN != tlvlen )
2308 {
2309#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2310 /*Log invalid len*/
2311 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2312 "Invalid TLV len on %s", __FUNCTION__);
2313#endif
2314// return BTAMP_INVALID_TLV_LENGTH;
2315 }
2316#endif
2317
2318 /*-----------------------------------------------------------------------
2319 Parse TLV
2320 -----------------------------------------------------------------------*/
2321 pDst->present = 1;
2322 BTAMP_MEMCPY(pCtx, pDst->event_mask_page_2, pBuf, 8);
2323 pBuf += 8;
2324 tlvlen -= (v_U8_t)8;
2325 (void)pCtx;
2326 return status;
2327} /* End btampUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd. */
2328
2329typedef v_U32_t (*pfnUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd*);
2330
2331#define SigUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd ( 0x0033 )
2332
2333
2334v_U32_t btampUnpackTlvHCI_Set_Short_Range_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Set_Short_Range_Mode_Cmd *pDst)
2335{
2336 v_U32_t status = BTAMP_PARSE_SUCCESS;
2337 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2338
2339 /*-----------------------------------------------------------------------
2340 TLV Sanity check
2341 -------------------------------------------------------------------------*/
2342 if ( WLAN_BAP_PAL_SET_SHORT_RANGE_MODE_TLV_LEN != tlvlen )
2343 {
2344#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2345 /*Log invalid len*/
2346 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2347 "Invalid TLV len on %s", __FUNCTION__);
2348#endif
2349 return BTAMP_INVALID_TLV_LENGTH;
2350 }
2351
2352 /*-----------------------------------------------------------------------
2353 Parse TLV
2354 -----------------------------------------------------------------------*/
2355 pDst->present = 1;
2356 pDst->phy_link_handle = *pBuf;
2357 pBuf += 1;
2358 tlvlen -= (v_U8_t)1;
2359 pDst->short_range_mode = *pBuf;
2360 pBuf += 1;
2361 tlvlen -= (v_U8_t)1;
2362 (void)pCtx;
2363 return status;
2364} /* End btampUnpackTlvHCI_Set_Short_Range_Mode_Cmd. */
2365
2366typedef v_U32_t (*pfnUnpackTlvHCI_Set_Short_Range_Mode_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Set_Short_Range_Mode_Cmd*);
2367
2368#define SigUnpackTlvHCI_Set_Short_Range_Mode_Cmd ( 0x0034 )
2369
2370
2371v_U32_t btampUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event *pDst)
2372{
2373 v_U32_t status = BTAMP_PARSE_SUCCESS;
2374 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2375 pDst->present = 1;
2376 pDst->status = *pBuf;
2377 pBuf += 1;
2378 tlvlen -= (v_U8_t)1;
2379 pDst->phy_link_handle = *pBuf;
2380 pBuf += 1;
2381 tlvlen -= (v_U8_t)1;
2382 pDst->short_range_mode = *pBuf;
2383 pBuf += 1;
2384 tlvlen -= (v_U8_t)1;
2385 (void)pCtx;
2386 return status;
2387} /* End btampUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event. */
2388
2389typedef v_U32_t (*pfnUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event*);
2390
2391#define SigUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event ( 0x0035 )
2392
2393
2394v_U32_t btampUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *pDst)
2395{
2396 v_U32_t status = BTAMP_PARSE_SUCCESS;
2397 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2398
2399 /*-----------------------------------------------------------------------
2400 TLV Sanity check
2401 -------------------------------------------------------------------------*/
2402 if ( WLAN_BAP_PAL_WRITE_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen )
2403 {
2404#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2405 /*Log invalid len*/
2406 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2407 "Invalid TLV len on %s", __FUNCTION__);
2408#endif
2409 return BTAMP_INVALID_TLV_LENGTH;
2410 }
2411
2412 /*-----------------------------------------------------------------------
2413 Parse TLV
2414 -----------------------------------------------------------------------*/
2415 pDst->present = 1;
2416 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2417 pBuf += 2;
2418 tlvlen -= (v_U8_t)2;
2419 framesntohl(pCtx, &pDst->best_effort_flush_timeout, pBuf, 0);
2420 pBuf += 4;
2421 tlvlen -= (v_U8_t)4;
2422 (void)pCtx;
2423 return status;
2424} /* End btampUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd. */
2425
2426typedef v_U32_t (*pfnUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd*);
2427
2428#define SigUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd ( 0x0036 )
2429
2430
2431v_U32_t btampUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *pDst)
2432{
2433 v_U32_t status = BTAMP_PARSE_SUCCESS;
2434 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2435
2436 /*-----------------------------------------------------------------------
2437 TLV Sanity check
2438 -------------------------------------------------------------------------*/
2439 if ( WLAN_BAP_PAL_WRITE_CON_ACC_TIMEOUT_TLV_LEN != tlvlen )
2440 {
2441#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2442 /*Log invalid len*/
2443 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2444 "Invalid TLV len on %s", __FUNCTION__);
2445#endif
2446 return BTAMP_INVALID_TLV_LENGTH;
2447 }
2448
2449 /*-----------------------------------------------------------------------
2450 Parse TLV
2451 -----------------------------------------------------------------------*/
2452 pDst->present = 1;
2453 framesntohs(pCtx, &pDst->connection_accept_timeout, pBuf, 0);
2454 pBuf += 2;
2455 tlvlen -= (v_U8_t)2;
2456 (void)pCtx;
2457 return status;
2458} /* End btampUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd. */
2459
2460typedef v_U32_t (*pfnUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd*);
2461
2462#define SigUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd ( 0x0037 )
2463
2464
2465v_U32_t btampUnpackTlvHCI_Write_Flow_Control_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *pDst)
2466{
2467 v_U32_t status = BTAMP_PARSE_SUCCESS;
2468 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2469
2470 /*-----------------------------------------------------------------------
2471 TLV Sanity check
2472 -------------------------------------------------------------------------*/
2473 if ( WLAN_BAP_PAL_WRITE_FLOW_CTRL_MODE_TLV_LEN != tlvlen )
2474 {
2475#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2476 /*Log invalid len*/
2477 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2478 "Invalid TLV len on %s", __FUNCTION__);
2479#endif
2480 return BTAMP_INVALID_TLV_LENGTH;
2481 }
2482
2483 /*-----------------------------------------------------------------------
2484 Parse TLV
2485 -----------------------------------------------------------------------*/
2486 pDst->present = 1;
2487 pDst->flow_control_mode = *pBuf;
2488 pBuf += 1;
2489 tlvlen -= (v_U8_t)1;
2490 (void)pCtx;
2491 return status;
2492} /* End btampUnpackTlvHCI_Write_Flow_Control_Mode_Cmd. */
2493
2494typedef v_U32_t (*pfnUnpackTlvHCI_Write_Flow_Control_Mode_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd*);
2495
2496#define SigUnpackTlvHCI_Write_Flow_Control_Mode_Cmd ( 0x0038 )
2497
2498
2499v_U32_t btampUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *pDst)
2500{
2501 v_U32_t status = BTAMP_PARSE_SUCCESS;
2502 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2503 /*-----------------------------------------------------------------------
2504 TLV Sanity check
2505 -------------------------------------------------------------------------*/
2506 if ( WLAN_BAP_PAL_WRITE_LINK_SVISION_TIMEOUT_TLV_LEN != tlvlen )
2507 {
2508#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2509 /*Log invalid len*/
2510 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2511 "Invalid TLV len on %s", __FUNCTION__);
2512#endif
2513 return BTAMP_INVALID_TLV_LENGTH;
2514 }
2515
2516 /*-----------------------------------------------------------------------
2517 Parse TLV
2518 -----------------------------------------------------------------------*/
2519 pDst->present = 1;
2520 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2521 pBuf += 2;
2522 tlvlen -= (v_U8_t)2;
2523 framesntohs(pCtx, &pDst->link_supervision_timeout, pBuf, 0);
2524 pBuf += 2;
2525 tlvlen -= (v_U8_t)2;
2526 (void)pCtx;
2527 return status;
2528} /* End btampUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd. */
2529
2530typedef v_U32_t (*pfnUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd*);
2531
2532#define SigUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd ( 0x0039 )
2533
2534
2535v_U32_t btampUnpackTlvHCI_Write_Location_Data_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Location_Data_Cmd *pDst)
2536{
2537 v_U32_t status = BTAMP_PARSE_SUCCESS;
2538 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2539
2540 /*-----------------------------------------------------------------------
2541 TLV Sanity check
2542 -------------------------------------------------------------------------*/
2543 if ( WLAN_BAP_PAL_WRITE_LOCATION_DATA_CMD_TLV_LEN != tlvlen )
2544 {
2545#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2546 /*Log invalid len*/
2547 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2548 "Invalid TLV len on %s", __FUNCTION__);
2549#endif
2550 return BTAMP_INVALID_TLV_LENGTH;
2551 }
2552
2553 /*-----------------------------------------------------------------------
2554 Parse TLV
2555 -----------------------------------------------------------------------*/
2556 pDst->present = 1;
2557 pDst->loc_domain_aware = *pBuf;
2558 pBuf += 1;
2559 tlvlen -= (v_U8_t)1;
2560 BTAMP_MEMCPY(pCtx, pDst->loc_domain, pBuf, 3);
2561 pBuf += 3;
2562 tlvlen -= (v_U8_t)3;
2563 pDst->loc_options = *pBuf;
2564 pBuf += 1;
2565 tlvlen -= (v_U8_t)1;
2566 (void)pCtx;
2567 return status;
2568} /* End btampUnpackTlvHCI_Write_Location_Data_Cmd. */
2569
2570typedef v_U32_t (*pfnUnpackTlvHCI_Write_Location_Data_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Location_Data_Cmd*);
2571
2572#define SigUnpackTlvHCI_Write_Location_Data_Cmd ( 0x003a )
2573
2574
2575v_U32_t btampUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *pDst)
2576{
2577 v_U32_t status = BTAMP_PARSE_SUCCESS;
2578 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2579
2580 /*-----------------------------------------------------------------------
2581 TLV Sanity check
2582 -------------------------------------------------------------------------*/
2583 if ( WLAN_BAP_PAL_WRITE_LOG_LINK_ACC_TIMEOUT_TLV_LEN != tlvlen )
2584 {
2585#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2586 /*Log invalid len*/
2587 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2588 "Invalid TLV len on %s", __FUNCTION__);
2589#endif
2590 return BTAMP_INVALID_TLV_LENGTH;
2591 }
2592
2593 /*-----------------------------------------------------------------------
2594 Parse TLV
2595 -----------------------------------------------------------------------*/
2596 pDst->present = 1;
2597 framesntohs(pCtx, &pDst->logical_link_accept_timeout, pBuf, 0);
2598 pBuf += 2;
2599 tlvlen -= (v_U8_t)2;
2600 (void)pCtx;
2601 return status;
2602} /* End btampUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd. */
2603
2604typedef v_U32_t (*pfnUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd*);
2605
2606#define SigUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd ( 0x003b )
2607
2608
2609v_U32_t btampUnpackTlvHCI_Write_Loopback_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Loopback_Mode_Cmd *pDst)
2610{
2611 v_U32_t status = BTAMP_PARSE_SUCCESS;
2612 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2613
2614 /*-----------------------------------------------------------------------
2615 TLV Sanity check
2616 -------------------------------------------------------------------------*/
2617 if ( WLAN_BAP_PAL_WRITE_LOOOPBACK_MODE_TLV_LEN != tlvlen )
2618 {
2619#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2620 /*Log invalid len*/
2621 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2622 "Invalid TLV len on %s", __FUNCTION__);
2623#endif
2624 return BTAMP_INVALID_TLV_LENGTH;
2625 }
2626
2627 /*-----------------------------------------------------------------------
2628 Parse TLV
2629 -----------------------------------------------------------------------*/
2630 pDst->present = 1;
2631 pDst->loopback_mode = *pBuf;
2632 pBuf += 1;
2633 tlvlen -= (v_U8_t)1;
2634 (void)pCtx;
2635 return status;
2636} /* End btampUnpackTlvHCI_Write_Loopback_Mode_Cmd. */
2637
2638typedef v_U32_t (*pfnUnpackTlvHCI_Write_Loopback_Mode_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Loopback_Mode_Cmd*);
2639
2640#define SigUnpackTlvHCI_Write_Loopback_Mode_Cmd ( 0x003c )
2641
2642
2643v_U32_t btampUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pDst)
2644{
2645 v_U32_t status = BTAMP_PARSE_SUCCESS;
2646 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2647
2648 /*-----------------------------------------------------------------------
2649 TLV Sanity check
2650 -------------------------------------------------------------------------*/
2651 if ( WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN > tlvlen )
2652 {
2653#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2654 /*Log invalid len*/
2655 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2656 "Invalid TLV len on %s", __FUNCTION__);
2657#endif
2658 return BTAMP_INVALID_TLV_LENGTH;
2659 }
2660
2661 /*-----------------------------------------------------------------------
2662 Parse TLV
2663 -----------------------------------------------------------------------*/
2664 pDst->present = 1;
2665 pDst->phy_link_handle = *pBuf;
2666 pBuf += 1;
2667 tlvlen -= (v_U8_t)1;
2668 framesntohs(pCtx, &pDst->length_so_far, pBuf, 0);
2669 pBuf += 2;
2670 tlvlen -= (v_U8_t)2;
2671 framesntohs(pCtx, &pDst->amp_assoc_remaining_length, pBuf, 0);
2672 pBuf += 2;
2673 tlvlen -= (v_U8_t)2;
2674 if (pDst->amp_assoc_remaining_length > 248){
2675 pDst->present = 0;
2676 return BTAMP_SKIPPED_BAD_IE;
2677 }
2678
2679 BTAMP_MEMCPY(pCtx, pDst->amp_assoc_fragment, pBuf, ( pDst->amp_assoc_remaining_length ) );
2680 pBuf += ( pDst->amp_assoc_remaining_length );
2681 tlvlen -= ( pDst->amp_assoc_remaining_length );
2682 (void)pCtx;
2683 return status;
2684} /* End btampUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd. */
2685
2686typedef v_U32_t (*pfnUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd*);
2687
2688#define SigUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd ( 0x003d )
2689
2690v_U32_t btampUnpackTlvHCI_Enhanced_Flush_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Enhanced_Flush_Cmd *pDst)
2691{
2692 v_U32_t status = BTAMP_PARSE_SUCCESS;
2693 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2694
2695 /*-----------------------------------------------------------------------
2696 TLV Sanity check
2697 -------------------------------------------------------------------------*/
2698 if ( WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN != tlvlen )
2699 {
2700#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2701 /*Log invalid len*/
2702 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
2703 "Invalid TLV len on %s", __FUNCTION__);
2704#endif
2705 return BTAMP_INVALID_TLV_LENGTH;
2706 }
2707
2708 /*-----------------------------------------------------------------------
2709 Parse TLV
2710 -----------------------------------------------------------------------*/
2711 pDst->present = 1;
2712 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2713 pBuf += 2;
2714 tlvlen -= (v_U8_t)2;
2715 pDst->packet_type = *pBuf;
2716 pBuf += 1;
2717 tlvlen -= (v_U8_t)1;
2718 (void)pCtx;
2719 return status;
2720} /* End btampUnpackTlvHCI_Enhanced_Flush_Cmd. */
2721
2722typedef v_U32_t (*pfnUnpackTlvHCI_Enhanced_Flush_Cmd_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Enhanced_Flush_Cmd*);
2723
2724#define SigUnpackTlvHCI_Enhanced_Flush_Cmd ( 0x003e )
2725
2726
2727v_U32_t btampUnpackTlvHCI_Enhanced_Flush_Complete_Event(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtampTLVHCI_Enhanced_Flush_Complete_Event *pDst)
2728{
2729 v_U32_t status = BTAMP_PARSE_SUCCESS;
2730 (void)pBuf; (void)tlvlen; /* Shutup the compiler */
2731 pDst->present = 1;
2732 framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0);
2733 pBuf += 2;
2734 tlvlen -= (v_U8_t)2;
2735 (void)pCtx;
2736 return status;
2737} /* End btampUnpackTlvHCI_Enhanced_Flush_Completed_Event. */
2738
2739typedef v_U32_t (*pfnUnpackTlvHCI_Enhanced_Flush_Complete_Event_t)(void *, v_U8_t*, v_U16_t, tBtampTLVHCI_Enhanced_Flush_Complete_Event*);
2740
2741#define SigUnpackTlvHCI_Enhanced_Flush_Complete_Event ( 0x003f )
2742
2743
2744v_U32_t btampUnpackAMP_ASSOC(void * pCtx, v_U8_t *pBuf, v_U32_t nBuf, tBtampAMP_ASSOC *pFrm)
2745{
2746 v_U32_t i;
2747 static tTLVDefn TLVS[ ] = {
2748 {BTAMP_TLV_AMP_ASSOC_MAC_ADDR, 0, 9, 9, offsetof(tBtampAMP_ASSOC, AMP_Assoc_MAC_Addr), offsetof(tBtampTLVAMP_Assoc_MAC_Addr, present), SigUnpackTlvAMP_Assoc_MAC_Addr, (pfnGeneric_t)btampUnpackTlvAMP_Assoc_MAC_Addr, "AMP_Assoc_MAC_Addr", 1, },
2749 {BTAMP_TLV_AMP_ASSOC_PREFERRED_CHANNEL_LIST, 0, 9, 0xFF/*12*/, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Preferred_Channel_List), offsetof(tBtampTLVAMP_Assoc_Preferred_Channel_List, present), SigUnpackTlvAMP_Assoc_Preferred_Channel_List, (pfnGeneric_t)btampUnpackTlvAMP_Assoc_Preferred_Channel_List, "AMP_Assoc_Preferred_Channel_List", 1, },
2750 {BTAMP_TLV_AMP_ASSOC_CONNECTED_CHANNEL, 0, 9, 0xFF/*12*/, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Connected_Channel), offsetof(tBtampTLVAMP_Assoc_Connected_Channel, present), SigUnpackTlvAMP_Assoc_Connected_Channel, (pfnGeneric_t)btampUnpackTlvAMP_Assoc_Connected_Channel, "AMP_Assoc_Connected_Channel", 0, },
2751 {BTAMP_TLV_AMP_ASSOC_PAL_CAPABILITIES, 0, 7, 7, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Capabilities), offsetof(tBtampTLVAMP_Assoc_PAL_Capabilities, present), SigUnpackTlvAMP_Assoc_PAL_Capabilities, (pfnGeneric_t)btampUnpackTlvAMP_Assoc_PAL_Capabilities, "AMP_Assoc_PAL_Capabilities", 0, },
2752 {BTAMP_TLV_AMP_ASSOC_PAL_VERSION, 0, 8, 8, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Version), offsetof(tBtampTLVAMP_Assoc_PAL_Version, present), SigUnpackTlvAMP_Assoc_PAL_Version, (pfnGeneric_t)btampUnpackTlvAMP_Assoc_PAL_Version, "AMP_Assoc_PAL_Version", 1, },
2753 { 0xffff, 0 },
2754 };
2755
2756 v_U32_t status = 0;
2757#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2758 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2759 "In btampUnpackAMP_ASSOC. nBuf - %d\n", nBuf);
2760#endif
2761
2762 status |= UnpackTlvCore(pCtx,pBuf,nBuf,TLVS,(v_U8_t*)pFrm,sizeof(*pFrm));
2763
2764 (void)i;
2765# ifdef BTAMP_DUMP_FRAMES
2766 if (!BTAMP_FAILED(status))
2767 {
2768 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Unpacked the AMP_ASSOC:\n"));
2769 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), pBuf, nBuf);
2770 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("to:\n"));
2771 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_MAC_Addr:\n"));
2772 if (!pFrm->AMP_Assoc_MAC_Addr.present)
2773 {
2774 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
2775 }
2776 else
2777 {
2778 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_MAC_Addr.mac_addr, 6);
2779 }
2780 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_Preferred_Channel_List:\n"));
2781 if (!pFrm->AMP_Assoc_Preferred_Channel_List.present)
2782 {
2783 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
2784 }
2785 else
2786 {
2787 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_Preferred_Channel_List.country, 3);
2788 FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("num_triplets: %d.\n"), pFrm->AMP_Assoc_Preferred_Channel_List.num_triplets);
2789 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* ) pFrm->AMP_Assoc_Preferred_Channel_List.triplets, 3 * pFrm->AMP_Assoc_Preferred_Channel_List.num_triplets);
2790 }
2791 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_Connected_Channel:\n"));
2792 if (!pFrm->AMP_Assoc_Connected_Channel.present)
2793 {
2794 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
2795 }
2796 else
2797 {
2798 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_Connected_Channel.country, 3);
2799 FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("num_triplets: %d.\n"), pFrm->AMP_Assoc_Connected_Channel.num_triplets);
2800 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* ) pFrm->AMP_Assoc_Connected_Channel.triplets, 3 * pFrm->AMP_Assoc_Connected_Channel.num_triplets);
2801 }
2802 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_PAL_Capabilities:\n"));
2803 if (!pFrm->AMP_Assoc_PAL_Capabilities.present)
2804 {
2805 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
2806 }
2807 else
2808 {
2809 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Capabilities.pal_capabilities, 4);
2810 }
2811 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_PAL_Version:\n"));
2812 if (!pFrm->AMP_Assoc_PAL_Version.present)
2813 {
2814 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
2815 }
2816 else
2817 {
2818 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_version, 1);
2819 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_CompanyID, 2);
2820 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_subversion, 2);
2821 }
2822 }
2823# endif // BTAMP_DUMP_FRAMES
2824 return status;
2825
2826} /* End btampUnpackAMP_ASSOC. */
2827
2828static v_U32_t UnpackTlvCore( void * pCtx,
2829 v_U8_t *pBuf,
2830 v_U32_t nBuf,
2831 tTLVDefn TLVs[ ],
2832 v_U8_t *pFrm,
2833 size_t nFrm )
2834{
2835 tTLVDefn *pTlv;
2836 v_U32_t nBufRemaining, status, status2, npec;
2837 v_U32_t sType, sLen;
2838 v_U16_t id, len;
2839 v_U8_t *pBufRemaining, *pfFound;
2840
2841 (void)pCtx; // Shutup the compiler
2842 (void)nFrm;
2843 status = BTAMP_PARSE_SUCCESS;
2844 status2 = BTAMP_PARSE_SUCCESS;
2845 pBufRemaining = pBuf;
2846 nBufRemaining = nBuf;
2847#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2848 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2849 "In UnpackTlvCore, nBufRemaining - %d\n", nBufRemaining);
2850#endif
2851
2852 // While we have data...
2853 while ( nBufRemaining )
2854 {
2855 if ( 3 > nBufRemaining )
2856 {
2857 FRAMES_LOG0( pCtx, FRLOGE, FRFL( "This frame reports "
2858 "fewer three byte(s) remaining.\n" ) );
2859 status |= BTAMP_INCOMPLETE_TLV;
2860 FRAMES_DBG_BREAK();
2861 goto MandatoryCheck;
2862 }
2863
2864 npec = 0U;
2865#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2866 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2867 "Calling FindTLVDefn...\n", nBufRemaining);
2868#endif
2869
2870 // Look for a matching TLV definition,
2871 pTlv = FindTLVDefn( pCtx, pBufRemaining, nBufRemaining, TLVs );
2872 sType = 1;
2873 sLen = 2;
2874 // consume the type,
2875 if (sType == 2)
2876 framesntohs(pCtx, &id, pBufRemaining, 1);
2877 else {
2878 id = *pBufRemaining;
2879 }
2880 pBufRemaining += sType;
2881 nBufRemaining -= sType;
2882 // & length,
2883 framesntohs(pCtx, &len, pBufRemaining, 1);
2884 pBufRemaining += sLen;
2885 nBufRemaining -= sLen;
2886
2887 if ( pTlv && pTlv->pec )
2888 {
2889 npec = 3U;
2890 if ( 3 > nBufRemaining )
2891 {
2892#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2893 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2894 "3 > nBufRemaining\n");
2895#endif
2896
2897 FRAMES_LOG2(pCtx, FRLOGW, FRFL("TLV %d reports length"
2898 "%d, but it has a Private Enterprise Code (3 byte"
2899 "s.\n"), id, len);
2900 FRAMES_DUMP(pCtx, FRLOG1, pBuf, nBuf);
2901 FRAMES_LOG2(pCtx, FRLOG1, FRFL("We've parsed %d bytes"
2902 "of this buffer, and show %d left.\n"),
2903 pBufRemaining - pBuf, nBufRemaining);
2904 status |= BTAMP_INCOMPLETE_TLV;
2905 FRAMES_DBG_BREAK();
2906 goto MandatoryCheck;
2907 }
2908 pBufRemaining += 3;
2909 nBufRemaining -= 3;
2910 len -= 3;
2911 }
2912#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2913 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2914 "Len - %d nBufRemaining - %d\n", len, nBufRemaining);
2915#endif
2916
2917 // Whether we found a hit or not, we can validate the reported
2918 // length of this TLV:
2919 if ( len > nBufRemaining )
2920 {
2921 FRAMES_LOG3(pCtx, FRLOGW, FRFL("TLV %d reports length %"
2922 "d, but there are only %d bytes remaining in this f"
2923 "rame.\n"), id, len, nBufRemaining );
2924 FRAMES_DUMP( pCtx, FRLOG1, pBuf, nBuf );
2925 FRAMES_LOG2( pCtx, FRLOG1, FRFL( "We've parsed %d bytes"
2926 " of this buffer, and show %d left.\n"),
2927 pBufRemaining - pBuf, nBufRemaining);
2928 status |= BTAMP_INCOMPLETE_TLV;
2929 FRAMES_DBG_BREAK();
2930 goto MandatoryCheck;
2931 }
2932
2933 // Now, *if* we found a hit...
2934 if ( pTlv )
2935 {
2936 if ( nBufRemaining < pTlv->minSize - npec - (sType + sLen))
2937 {
2938 FRAMES_LOG3( pCtx, FRLOGW, FRFL("The IE %s must be "
2939 "at least %d bytes in size, but there are only "
2940 "%d bytes remaining in this frame.\n"),
2941 pTlv->name, pTlv->minSize, nBufRemaining );
2942 FRAMES_DUMP( pCtx, FRLOG1, pBuf, nBuf );
2943 status |= BTAMP_INCOMPLETE_TLV;
2944 FRAMES_DBG_BREAK( );
2945 goto MandatoryCheck;
2946 }
2947 else if ( len > pTlv->maxSize - npec - (sType + sLen))
2948 {
2949 FRAMES_LOG1( pCtx, FRLOGW, FRFL("The TLV %s reports "
2950 "an illegally large size; this TLV is presumably"
2951 "corrupt or otherwise invalid & will be skipped "
2952 "ipped.\n"), pTlv->name );
2953 FRAMES_DUMP( pCtx, FRLOG1, pBuf, nBuf );
2954 FRAMES_LOG2( pCtx, FRLOG1, FRFL("We've parsed %d by"
2955 "tes of this buffer, and show %d left.\n"),
2956 pBufRemaining - pBuf, nBufRemaining);
2957 FRAMES_DBG_BREAK();
2958 status |= BTAMP_SKIPPED_BAD_TLV;
2959 }
2960 else
2961 {
2962#ifdef WLAN_BAPHCI_ENABLE_LOGGING
2963 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
2964 "pTlv->sig - %d\n", pTlv->sig);
2965#endif
2966
2967 switch (pTlv->sig)
2968 {
2969 case SigUnpackTlvAMP_Assoc_Connected_Channel:
2970 status2 = ( (pfnUnpackTlvAMP_Assoc_Connected_Channel_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVAMP_Assoc_Connected_Channel* )(pFrm + pTlv->offset ));
2971 break;
2972 case SigUnpackTlvAMP_Assoc_MAC_Addr:
2973 status2 = ( (pfnUnpackTlvAMP_Assoc_MAC_Addr_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVAMP_Assoc_MAC_Addr* )(pFrm + pTlv->offset ));
2974 break;
2975 case SigUnpackTlvAMP_Assoc_PAL_Capabilities:
2976 status2 = ( (pfnUnpackTlvAMP_Assoc_PAL_Capabilities_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVAMP_Assoc_PAL_Capabilities* )(pFrm + pTlv->offset ));
2977 break;
2978 case SigUnpackTlvAMP_Assoc_PAL_Version:
2979 status2 = ( (pfnUnpackTlvAMP_Assoc_PAL_Version_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVAMP_Assoc_PAL_Version* )(pFrm + pTlv->offset ));
2980 break;
2981 case SigUnpackTlvAMP_Assoc_Preferred_Channel_List:
2982 status2 = ( (pfnUnpackTlvAMP_Assoc_Preferred_Channel_List_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVAMP_Assoc_Preferred_Channel_List* )(pFrm + pTlv->offset ));
2983 break;
2984 case SigUnpackTlvFlow_Spec:
2985 status2 = ( (pfnUnpackTlvFlow_Spec_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVFlow_Spec* )(pFrm + pTlv->offset ));
2986 break;
2987 case SigUnpackTlvHCI_Accept_Logical_Link_Cmd:
2988 status2 = ( (pfnUnpackTlvHCI_Accept_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Accept_Logical_Link_Cmd* )(pFrm + pTlv->offset ));
2989 break;
2990 case SigUnpackTlvHCI_Accept_Physical_Link_Cmd:
2991 status2 = ( (pfnUnpackTlvHCI_Accept_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Accept_Physical_Link_Cmd* )(pFrm + pTlv->offset ));
2992 break;
2993 case SigUnpackTlvHCI_Channel_Selected_Event:
2994 status2 = ( (pfnUnpackTlvHCI_Channel_Selected_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Channel_Selected_Event* )(pFrm + pTlv->offset ));
2995 break;
2996 case SigUnpackTlvHCI_Command_Complete_Event:
2997 status2 = ( (pfnUnpackTlvHCI_Command_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Command_Complete_Event* )(pFrm + pTlv->offset ));
2998 break;
2999 case SigUnpackTlvHCI_Command_Status_Event:
3000 status2 = ( (pfnUnpackTlvHCI_Command_Status_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Command_Status_Event* )(pFrm + pTlv->offset ));
3001 break;
3002 case SigUnpackTlvHCI_Create_Logical_Link_Cmd:
3003 status2 = ( (pfnUnpackTlvHCI_Create_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Create_Logical_Link_Cmd* )(pFrm + pTlv->offset ));
3004 break;
3005 case SigUnpackTlvHCI_Create_Physical_Link_Cmd:
3006 status2 = ( (pfnUnpackTlvHCI_Create_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Create_Physical_Link_Cmd* )(pFrm + pTlv->offset ));
3007 break;
3008 case SigUnpackTlvHCI_Data_Buffer_Overflow_Event:
3009 status2 = ( (pfnUnpackTlvHCI_Data_Buffer_Overflow_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Data_Buffer_Overflow_Event* )(pFrm + pTlv->offset ));
3010 break;
3011 case SigUnpackTlvHCI_Disconnect_Logical_Link_Cmd:
3012 status2 = ( (pfnUnpackTlvHCI_Disconnect_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Disconnect_Logical_Link_Cmd* )(pFrm + pTlv->offset ));
3013 break;
3014 case SigUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event:
3015 status2 = ( (pfnUnpackTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event* )(pFrm + pTlv->offset ));
3016 break;
3017 case SigUnpackTlvHCI_Disconnect_Physical_Link_Cmd:
3018 status2 = ( (pfnUnpackTlvHCI_Disconnect_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Disconnect_Physical_Link_Cmd* )(pFrm + pTlv->offset ));
3019 break;
3020 case SigUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event:
3021 status2 = ( (pfnUnpackTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event* )(pFrm + pTlv->offset ));
3022 break;
3023 case SigUnpackTlvHCI_Flow_Spec_Modify_Cmd:
3024 status2 = ( (pfnUnpackTlvHCI_Flow_Spec_Modify_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Flow_Spec_Modify_Cmd* )(pFrm + pTlv->offset ));
3025 break;
3026 case SigUnpackTlvHCI_Flow_Spec_Modify_Complete_Event:
3027 status2 = ( (pfnUnpackTlvHCI_Flow_Spec_Modify_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Flow_Spec_Modify_Complete_Event* )(pFrm + pTlv->offset ));
3028 break;
3029 case SigUnpackTlvHCI_Flush_Cmd:
3030 status2 = ( (pfnUnpackTlvHCI_Flush_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Flush_Cmd* )(pFrm + pTlv->offset ));
3031 break;
3032 case SigUnpackTlvHCI_Flush_Occurred_Event:
3033 status2 = ( (pfnUnpackTlvHCI_Flush_Occurred_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Flush_Occurred_Event* )(pFrm + pTlv->offset ));
3034 break;
3035 case SigUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event:
3036 status2 = ( (pfnUnpackTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event* )(pFrm + pTlv->offset ));
3037 break;
3038 case SigUnpackTlvHCI_Hardware_Error_Event:
3039 status2 = ( (pfnUnpackTlvHCI_Hardware_Error_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Hardware_Error_Event* )(pFrm + pTlv->offset ));
3040 break;
3041 case SigUnpackTlvHCI_Logical_Link_Cancel_Cmd:
3042 status2 = ( (pfnUnpackTlvHCI_Logical_Link_Cancel_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Logical_Link_Cancel_Cmd* )(pFrm + pTlv->offset ));
3043 break;
3044 case SigUnpackTlvHCI_Logical_Link_Complete_Event:
3045 status2 = ( (pfnUnpackTlvHCI_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Logical_Link_Complete_Event* )(pFrm + pTlv->offset ));
3046 break;
3047 case SigUnpackTlvHCI_Loopback_Command_Event:
3048 status2 = ( (pfnUnpackTlvHCI_Loopback_Command_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Loopback_Command_Event* )(pFrm + pTlv->offset ));
3049 break;
3050 case SigUnpackTlvHCI_Physical_Link_Complete_Event:
3051 status2 = ( (pfnUnpackTlvHCI_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Physical_Link_Complete_Event* )(pFrm + pTlv->offset ));
3052 break;
3053 case SigUnpackTlvHCI_Physical_Link_Loss_Warning_Event:
3054 status2 = ( (pfnUnpackTlvHCI_Physical_Link_Loss_Warning_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Physical_Link_Loss_Warning_Event* )(pFrm + pTlv->offset ));
3055 break;
3056 case SigUnpackTlvHCI_Physical_Link_Recovery_Event:
3057 status2 = ( (pfnUnpackTlvHCI_Physical_Link_Recovery_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Physical_Link_Recovery_Event* )(pFrm + pTlv->offset ));
3058 break;
3059 case SigUnpackTlvHCI_Qos_Violation_Event:
3060 status2 = ( (pfnUnpackTlvHCI_Qos_Violation_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Qos_Violation_Event* )(pFrm + pTlv->offset ));
3061 break;
3062 case SigUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd:
3063 status2 = ( (pfnUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd* )(pFrm + pTlv->offset ));
3064 break;
3065 case SigUnpackTlvHCI_Read_Buffer_Size_Cmd:
3066 status2 = ( (pfnUnpackTlvHCI_Read_Buffer_Size_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Buffer_Size_Cmd* )(pFrm + pTlv->offset ));
3067 break;
3068 case SigUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd:
3069 status2 = ( (pfnUnpackTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd* )(pFrm + pTlv->offset ));
3070 break;
3071 case SigUnpackTlvHCI_Read_Data_Block_Size_Cmd:
3072 status2 = ( (pfnUnpackTlvHCI_Read_Data_Block_Size_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Data_Block_Size_Cmd* )(pFrm + pTlv->offset ));
3073 break;
3074 case SigUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd:
3075 status2 = ( (pfnUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd* )(pFrm + pTlv->offset ));
3076 break;
3077 case SigUnpackTlvHCI_Read_Flow_Control_Mode_Cmd:
3078 status2 = ( (pfnUnpackTlvHCI_Read_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Flow_Control_Mode_Cmd* )(pFrm + pTlv->offset ));
3079 break;
3080 case SigUnpackTlvHCI_Read_Link_Quality_Cmd:
3081 status2 = ( (pfnUnpackTlvHCI_Read_Link_Quality_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Link_Quality_Cmd* )(pFrm + pTlv->offset ));
3082 break;
3083 case SigUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd:
3084 status2 = ( (pfnUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd* )(pFrm + pTlv->offset ));
3085 break;
3086 case SigUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd:
3087 status2 = ( (pfnUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd* )(pFrm + pTlv->offset ));
3088 break;
3089 case SigUnpackTlvHCI_Read_Local_AMP_Information_Cmd:
3090 status2 = ( (pfnUnpackTlvHCI_Read_Local_AMP_Information_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Local_AMP_Information_Cmd* )(pFrm + pTlv->offset ));
3091 break;
3092 case SigUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd:
3093 status2 = ( (pfnUnpackTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd* )(pFrm + pTlv->offset ));
3094 break;
3095 case SigUnpackTlvHCI_Read_Local_Version_Info_Cmd:
3096 status2 = ( (pfnUnpackTlvHCI_Read_Local_Version_Info_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Local_Version_Info_Cmd* )(pFrm + pTlv->offset ));
3097 break;
3098 case SigUnpackTlvHCI_Read_Location_Data_Cmd:
3099 status2 = ( (pfnUnpackTlvHCI_Read_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Location_Data_Cmd* )(pFrm + pTlv->offset ));
3100 break;
3101 case SigUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd:
3102 status2 = ( (pfnUnpackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd* )(pFrm + pTlv->offset ));
3103 break;
3104 case SigUnpackTlvHCI_Read_Loopback_Mode_Cmd:
3105 status2 = ( (pfnUnpackTlvHCI_Read_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_Loopback_Mode_Cmd* )(pFrm + pTlv->offset ));
3106 break;
3107 case SigUnpackTlvHCI_Read_RSSI_Cmd:
3108 status2 = ( (pfnUnpackTlvHCI_Read_RSSI_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Read_RSSI_Cmd* )(pFrm + pTlv->offset ));
3109 break;
3110 case SigUnpackTlvHCI_Reset_Cmd:
3111 status2 = ( (pfnUnpackTlvHCI_Reset_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Reset_Cmd* )(pFrm + pTlv->offset ));
3112 break;
3113 case SigUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd:
3114 status2 = ( (pfnUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd* )(pFrm + pTlv->offset ));
3115 break;
3116 case SigUnpackTlvHCI_Set_Event_Mask_Cmd:
3117 status2 = ( (pfnUnpackTlvHCI_Set_Event_Mask_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Set_Event_Mask_Cmd* )(pFrm + pTlv->offset ));
3118 break;
3119 case SigUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd:
3120 status2 = ( (pfnUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd* )(pFrm + pTlv->offset ));
3121 break;
3122 case SigUnpackTlvHCI_Set_Short_Range_Mode_Cmd:
3123 status2 = ( (pfnUnpackTlvHCI_Set_Short_Range_Mode_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Set_Short_Range_Mode_Cmd* )(pFrm + pTlv->offset ));
3124 break;
3125 case SigUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event:
3126 status2 = ( (pfnUnpackTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event* )(pFrm + pTlv->offset ));
3127 break;
3128 case SigUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd:
3129 status2 = ( (pfnUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd* )(pFrm + pTlv->offset ));
3130 break;
3131 case SigUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd:
3132 status2 = ( (pfnUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd* )(pFrm + pTlv->offset ));
3133 break;
3134 case SigUnpackTlvHCI_Write_Flow_Control_Mode_Cmd:
3135 status2 = ( (pfnUnpackTlvHCI_Write_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Flow_Control_Mode_Cmd* )(pFrm + pTlv->offset ));
3136 break;
3137 case SigUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd:
3138 status2 = ( (pfnUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd* )(pFrm + pTlv->offset ));
3139 break;
3140 case SigUnpackTlvHCI_Write_Location_Data_Cmd:
3141 status2 = ( (pfnUnpackTlvHCI_Write_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Location_Data_Cmd* )(pFrm + pTlv->offset ));
3142 break;
3143 case SigUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd:
3144 status2 = ( (pfnUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd* )(pFrm + pTlv->offset ));
3145 break;
3146 case SigUnpackTlvHCI_Write_Loopback_Mode_Cmd:
3147 status2 = ( (pfnUnpackTlvHCI_Write_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Loopback_Mode_Cmd* )(pFrm + pTlv->offset ));
3148 break;
3149 case SigUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd:
3150 status2 = ( (pfnUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(pTlv->pfn) )(pCtx, pBufRemaining, len, ( tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd* )(pFrm + pTlv->offset ));
3151 break;
3152 default:
3153 FRAMES_LOG1(pCtx, FRLOGE, FRFL("INTERNAL ERROR: I"
3154 " don't know about the TLV signature %d-- thi"
3155 "s is most likely a 'framesc' bug.\n"),
3156 pTlv->sig);
3157 FRAMES_DBG_BREAK();
3158 return BTAMP_INTERNAL_ERROR;
3159 } // End switch on sig.
3160 } // End if on length check.
3161
3162 status |= status2;
3163#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3164 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3165 "status - %x\n", status);
3166#endif
3167 }
3168 else
3169 {
3170 FRAMES_LOG2(pCtx, FRLOG3, FRFL("Skipping unknown TLV %d ("
3171 "length %d)\n"), id, len);
3172 FRAMES_DUMP(pCtx, FRLOG3, pBufRemaining - (sType + sLen), len);
3173 status |= BTAMP_UNKNOWN_TLVS;
3174 }
3175
3176 // Advance to the next TLV
3177 pBufRemaining += len;
3178#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3179 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3180 "len - %d nBufRemaining - %d\n", len, nBufRemaining);
3181#endif
3182
3183 if (len > nBufRemaining)
3184 {
3185 FRAMES_LOG0(pCtx, FRLOGW, FRFL("This TLV extends past th"
3186 "e buffer as it was defined to us. This could mean "
3187 "a corrupt frame, or just an incorrect length parame"
3188 "ter.\n"));
3189 FRAMES_DBG_BREAK();
3190 status |= BTAMP_LAST_TLV_TOO_LONG;
3191 goto MandatoryCheck;
3192 }
3193
3194 nBufRemaining -= len;
3195
3196 } // End iteration over TLVs.
3197
3198MandatoryCheck:
3199 pTlv = &TLVs[0];
3200#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3201 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3202 "pTlv->id - %x\n", pTlv->id);
3203#endif
3204
3205 while (0xffff != pTlv->id)
3206 {
3207 if (pTlv->fMandatory)
3208 {
3209 pfFound = (v_U8_t*)(pFrm + pTlv->offset +
3210 pTlv->presenceOffset);
3211 if (!*pfFound)
3212 {
3213 FRAMES_LOG1(pCtx, FRLOGW, FRFL("ERROR: The mandatory "
3214 "TLV %s wasn't seen.\n"),
3215 pTlv->name);
3216 FRAMES_DBG_BREAK();
3217 status |= BTAMP_MANDATORY_TLV_MISSING;
3218 }
3219
3220 }
3221 ++pTlv;
3222 }
3223
3224 return status;
3225} /* End UnpacTlvkCore. */
3226v_U32_t btampGetPackedTlvAMP_Assoc_Connected_Channel(void * pCtx, tBtampTLVAMP_Assoc_Connected_Channel *pTlv, v_U32_t *pnNeeded)
3227{
3228 v_U32_t status = BTAMP_PARSE_SUCCESS;
3229 (void)pCtx; (void)pTlv; (void)pnNeeded;
3230#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3231 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3232 "In btampGetPackedTlvAMP_Assoc_Connected_Channel\n");
3233#endif
3234
3235 while ( pTlv->present )
3236 {
3237 *pnNeeded += 3;
3238 if ( pTlv->num_triplets )
3239 {
3240 *pnNeeded += ( pTlv->num_triplets * 3 );
3241 }
3242 else break;
3243 break;
3244 }
3245 return status;
3246} /* End btampGetPackedTLVAMP_Assoc_Connected_Channel. */
3247
3248typedef v_U32_t (*pfnPackSizeTlvAMP_Assoc_Connected_Channel_t)(void *, tBtampTLVAMP_Assoc_Connected_Channel*, v_U32_t*);
3249#define SigPackSizeTlvAMP_Assoc_Connected_Channel ( 0x003e )
3250
3251v_U32_t btampGetPackedTlvAMP_Assoc_MAC_Addr(void * pCtx, tBtampTLVAMP_Assoc_MAC_Addr *pTlv, v_U32_t *pnNeeded)
3252{
3253 v_U32_t status = BTAMP_PARSE_SUCCESS;
3254 (void)pCtx; (void)pTlv; (void)pnNeeded;
3255#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3256 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3257 "In btampGetPackedTlvAMP_Assoc_MAC_Addr\n");
3258#endif
3259
3260 while ( pTlv->present )
3261 {
3262 *pnNeeded += 6;
3263 break;
3264 }
3265 return status;
3266} /* End btampGetPackedTLVAMP_Assoc_MAC_Addr. */
3267
3268typedef v_U32_t (*pfnPackSizeTlvAMP_Assoc_MAC_Addr_t)(void *, tBtampTLVAMP_Assoc_MAC_Addr*, v_U32_t*);
3269#define SigPackSizeTlvAMP_Assoc_MAC_Addr ( 0x003f )
3270
3271v_U32_t btampGetPackedTlvAMP_Assoc_PAL_Capabilities(void * pCtx, tBtampTLVAMP_Assoc_PAL_Capabilities *pTlv, v_U32_t *pnNeeded)
3272{
3273 v_U32_t status = BTAMP_PARSE_SUCCESS;
3274 (void)pCtx; (void)pTlv; (void)pnNeeded;
3275#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3276 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3277 "In btampGetPackedTlvAMP_Assoc_PAL_Capabilities\n");
3278#endif
3279
3280 while ( pTlv->present )
3281 {
3282 *pnNeeded += 4;
3283 break;
3284 }
3285 return status;
3286} /* End btampGetPackedTLVAMP_Assoc_PAL_Capabilities. */
3287
3288typedef v_U32_t (*pfnPackSizeTlvAMP_Assoc_PAL_Capabilities_t)(void *, tBtampTLVAMP_Assoc_PAL_Capabilities*, v_U32_t*);
3289#define SigPackSizeTlvAMP_Assoc_PAL_Capabilities ( 0x0040 )
3290
3291v_U32_t btampGetPackedTlvAMP_Assoc_PAL_Version(void * pCtx, tBtampTLVAMP_Assoc_PAL_Version *pTlv, v_U32_t *pnNeeded)
3292{
3293 v_U32_t status = BTAMP_PARSE_SUCCESS;
3294 (void)pCtx; (void)pTlv; (void)pnNeeded;
3295 while ( pTlv->present )
3296 {
3297 *pnNeeded += 1;
3298 *pnNeeded += 2;
3299 *pnNeeded += 2;
3300 break;
3301 }
3302 return status;
3303} /* End btampGetPackedTLVAMP_Assoc_PAL_Version. */
3304
3305typedef v_U32_t (*pfnPackSizeTlvAMP_Assoc_PAL_Version_t)(void *, tBtampTLVAMP_Assoc_PAL_Version*, v_U32_t*);
3306#define SigPackSizeTlvAMP_Assoc_PAL_Version ( 0x0041 )
3307
3308v_U32_t btampGetPackedTlvAMP_Assoc_Preferred_Channel_List(void * pCtx, tBtampTLVAMP_Assoc_Preferred_Channel_List *pTlv, v_U32_t *pnNeeded)
3309{
3310 v_U32_t status = BTAMP_PARSE_SUCCESS;
3311 (void)pCtx; (void)pTlv; (void)pnNeeded;
3312#ifdef WLAN_BAPHCI_ENABLE_LOGGING
3313 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
3314 "In btampGetPackedTlvAMP_Assoc_Preferred_Channel_List\n");
3315#endif
3316
3317 while ( pTlv->present )
3318 {
3319 *pnNeeded += 3;
3320 if ( pTlv->num_triplets )
3321 {
3322 *pnNeeded += ( pTlv->num_triplets * 3 );
3323 }
3324 else break;
3325 break;
3326 }
3327 return status;
3328} /* End btampGetPackedTLVAMP_Assoc_Preferred_Channel_List. */
3329
3330typedef v_U32_t (*pfnPackSizeTlvAMP_Assoc_Preferred_Channel_List_t)(void *, tBtampTLVAMP_Assoc_Preferred_Channel_List*, v_U32_t*);
3331#define SigPackSizeTlvAMP_Assoc_Preferred_Channel_List ( 0x0042 )
3332
3333v_U32_t btampGetPackedTlvFlow_Spec(void * pCtx, tBtampTLVFlow_Spec *pTlv, v_U32_t *pnNeeded)
3334{
3335 v_U32_t status = BTAMP_PARSE_SUCCESS;
3336 (void)pCtx; (void)pTlv; (void)pnNeeded;
3337 while ( pTlv->present )
3338 {
3339 *pnNeeded += 1;
3340 *pnNeeded += 1;
3341 *pnNeeded += 2;
3342 *pnNeeded += 4;
3343 *pnNeeded += 4;
3344 *pnNeeded += 4;
3345 break;
3346 }
3347 return status;
3348} /* End btampGetPackedTLVFlow_Spec. */
3349
3350typedef v_U32_t (*pfnPackSizeTlvFlow_Spec_t)(void *, tBtampTLVFlow_Spec*, v_U32_t*);
3351#define SigPackSizeTlvFlow_Spec ( 0x0043 )
3352
3353v_U32_t btampGetPackedTlvHCI_Accept_Logical_Link_Cmd(void * pCtx, tBtampTLVHCI_Accept_Logical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3354{
3355 v_U32_t status = BTAMP_PARSE_SUCCESS;
3356 (void)pCtx; (void)pTlv; (void)pnNeeded;
3357 while ( pTlv->present )
3358 {
3359 *pnNeeded += 1;
3360 *pnNeeded += 18;
3361 *pnNeeded += 18;
3362 break;
3363 }
3364 return status;
3365} /* End btampGetPackedTLVHCI_Accept_Logical_Link_Cmd. */
3366
3367typedef v_U32_t (*pfnPackSizeTlvHCI_Accept_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Accept_Logical_Link_Cmd*, v_U32_t*);
3368#define SigPackSizeTlvHCI_Accept_Logical_Link_Cmd ( 0x0044 )
3369
3370v_U32_t btampGetPackedTlvHCI_Accept_Physical_Link_Cmd(void * pCtx, tBtampTLVHCI_Accept_Physical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3371{
3372 v_U32_t status = BTAMP_PARSE_SUCCESS;
3373 (void)pCtx; (void)pTlv; (void)pnNeeded;
3374 while ( pTlv->present )
3375 {
3376 *pnNeeded += 1;
3377 *pnNeeded += 1;
3378 *pnNeeded += 1;
3379 *pnNeeded += pTlv->key_length;
3380 break;
3381 }
3382 return status;
3383} /* End btampGetPackedTLVHCI_Accept_Physical_Link_Cmd. */
3384
3385typedef v_U32_t (*pfnPackSizeTlvHCI_Accept_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Accept_Physical_Link_Cmd*, v_U32_t*);
3386#define SigPackSizeTlvHCI_Accept_Physical_Link_Cmd ( 0x0045 )
3387
3388v_U32_t btampGetPackedTlvHCI_Channel_Selected_Event(void * pCtx, tBtampTLVHCI_Channel_Selected_Event *pTlv, v_U32_t *pnNeeded)
3389{
3390 v_U32_t status = BTAMP_PARSE_SUCCESS;
3391 (void)pCtx; (void)pTlv; (void)pnNeeded;
3392 while ( pTlv->present )
3393 {
3394 *pnNeeded += 1;
3395 break;
3396 }
3397 return status;
3398} /* End btampGetPackedTLVHCI_Channel_Selected_Event. */
3399
3400typedef v_U32_t (*pfnPackSizeTlvHCI_Channel_Selected_Event_t)(void *, tBtampTLVHCI_Channel_Selected_Event*, v_U32_t*);
3401#define SigPackSizeTlvHCI_Channel_Selected_Event ( 0x0046 )
3402
3403v_U32_t btampGetPackedTlvHCI_Command_Complete_Event(void * pCtx, tBtampTLVHCI_Command_Complete_Event *pTlv, v_U32_t *pnNeeded)
3404{
3405 v_U32_t status = BTAMP_PARSE_SUCCESS;
3406 (void)pCtx; (void)pTlv; (void)pnNeeded;
3407 while ( pTlv->present )
3408 {
3409 *pnNeeded += 1;
3410 *pnNeeded += 2;
3411 switch (pTlv->command_opcode)
3412 {
3413 case 3075:
3414 *pnNeeded += 1;
3415 break;
3416 case 3080:
3417 *pnNeeded += 1;
3418 *pnNeeded += 2;
3419 break;
3420 case 1083:
3421 *pnNeeded += 1;
3422 *pnNeeded += 1;
3423 *pnNeeded += 1;
3424 break;
3425 case 3077:
3426 *pnNeeded += 1;
3427 break;
3428 case 3093:
3429 *pnNeeded += 1;
3430 *pnNeeded += 2;
3431 break;
3432 case 3094:
3433 *pnNeeded += 1;
3434 break;
3435 case 3126:
3436 *pnNeeded += 1;
3437 *pnNeeded += 2;
3438 *pnNeeded += 2;
3439 break;
3440 case 3127:
3441 *pnNeeded += 1;
3442 *pnNeeded += 2;
3443 break;
3444 case 3169:
3445 *pnNeeded += 1;
3446 *pnNeeded += 2;
3447 break;
3448 case 3170:
3449 *pnNeeded += 1;
3450 break;
3451 case 3171:
3452 *pnNeeded += 1;
3453 break;
3454 case 3172:
3455 *pnNeeded += 1;
3456 *pnNeeded += 1;
3457 *pnNeeded += 3;
3458 *pnNeeded += 1;
3459 break;
3460 case 3173:
3461 *pnNeeded += 1;
3462 break;
3463 case 3174:
3464 *pnNeeded += 1;
3465 *pnNeeded += 1;
3466 break;
3467 case 3175:
3468 *pnNeeded += 1;
3469 break;
3470 case 3177:
3471 *pnNeeded += 1;
3472 *pnNeeded += 4;
3473 break;
3474 case 3178:
3475 *pnNeeded += 1;
3476 break;
3477 case 3179:
3478 *pnNeeded += 1;
3479 break;
3480 case 4097:
3481 *pnNeeded += 1;
3482 *pnNeeded += 1;
3483 *pnNeeded += 2;
3484 *pnNeeded += 1;
3485 *pnNeeded += 2;
3486 *pnNeeded += 2;
3487 break;
3488 case 4098:
3489 *pnNeeded += 1;
3490 *pnNeeded += 64;
3491 break;
3492 case 4101:
3493 *pnNeeded += 1;
3494 *pnNeeded += 2;
3495 *pnNeeded += 1;
3496 *pnNeeded += 2;
3497 *pnNeeded += 2;
3498 break;
3499 case 4106:
3500 *pnNeeded += 1;
3501 *pnNeeded += 2;
3502 *pnNeeded += 2;
3503 *pnNeeded += 2;
3504 break;
3505 case 5121:
3506 *pnNeeded += 1;
3507 *pnNeeded += 2;
3508 *pnNeeded += 2;
3509 break;
3510 case 5122:
3511 *pnNeeded += 1;
3512 *pnNeeded += 2;
3513 break;
3514 case 5123:
3515 *pnNeeded += 1;
3516 *pnNeeded += 2;
3517 *pnNeeded += 1;
3518 break;
3519 case 5125:
3520 *pnNeeded += 1;
3521 *pnNeeded += 1;
3522 *pnNeeded += 1;
3523 break;
3524 case 5129:
3525 *pnNeeded += 1;
3526 *pnNeeded += 1;
3527 *pnNeeded += 4;
3528 *pnNeeded += 4;
3529 *pnNeeded += 4;
3530 *pnNeeded += 4;
3531 *pnNeeded += 1;
3532 *pnNeeded += 2;
3533 *pnNeeded += 2;
3534 *pnNeeded += 4;
3535 *pnNeeded += 4;
3536 break;
3537 case 5130:
3538 *pnNeeded += 1;
3539 *pnNeeded += 1;
3540 *pnNeeded += 2;
3541 *pnNeeded += pTlv->cc_event.Read_Read_Local_AMP_Assoc.remaining_length;
3542 break;
3543 case 5131:
3544 *pnNeeded += 1;
3545 *pnNeeded += 1;
3546 break;
3547 case 6145:
3548 *pnNeeded += 1;
3549 *pnNeeded += 1;
3550 break;
3551 case 6146:
3552 *pnNeeded += 1;
3553 break;
3554 }
3555 break;
3556 }
3557 return status;
3558} /* End btampGetPackedTLVHCI_Command_Complete_Event. */
3559
3560typedef v_U32_t (*pfnPackSizeTlvHCI_Command_Complete_Event_t)(void *, tBtampTLVHCI_Command_Complete_Event*, v_U32_t*);
3561#define SigPackSizeTlvHCI_Command_Complete_Event ( 0x0047 )
3562
3563v_U32_t btampGetPackedTlvHCI_Command_Status_Event(void * pCtx, tBtampTLVHCI_Command_Status_Event *pTlv, v_U32_t *pnNeeded)
3564{
3565 v_U32_t status = BTAMP_PARSE_SUCCESS;
3566 (void)pCtx; (void)pTlv; (void)pnNeeded;
3567 while ( pTlv->present )
3568 {
3569 *pnNeeded += 1;
3570 *pnNeeded += 1;
3571 *pnNeeded += 2;
3572 break;
3573 }
3574 return status;
3575} /* End btampGetPackedTLVHCI_Command_Status_Event. */
3576
3577typedef v_U32_t (*pfnPackSizeTlvHCI_Command_Status_Event_t)(void *, tBtampTLVHCI_Command_Status_Event*, v_U32_t*);
3578#define SigPackSizeTlvHCI_Command_Status_Event ( 0x0048 )
3579
3580v_U32_t btampGetPackedTlvHCI_Create_Logical_Link_Cmd(void * pCtx, tBtampTLVHCI_Create_Logical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3581{
3582 v_U32_t status = BTAMP_PARSE_SUCCESS;
3583 (void)pCtx; (void)pTlv; (void)pnNeeded;
3584 while ( pTlv->present )
3585 {
3586 *pnNeeded += 1;
3587 *pnNeeded += 18;
3588 *pnNeeded += 18;
3589 break;
3590 }
3591 return status;
3592} /* End btampGetPackedTLVHCI_Create_Logical_Link_Cmd. */
3593
3594typedef v_U32_t (*pfnPackSizeTlvHCI_Create_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Create_Logical_Link_Cmd*, v_U32_t*);
3595#define SigPackSizeTlvHCI_Create_Logical_Link_Cmd ( 0x0049 )
3596
3597v_U32_t btampGetPackedTlvHCI_Create_Physical_Link_Cmd(void * pCtx, tBtampTLVHCI_Create_Physical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3598{
3599 v_U32_t status = BTAMP_PARSE_SUCCESS;
3600 (void)pCtx; (void)pTlv; (void)pnNeeded;
3601 while ( pTlv->present )
3602 {
3603 *pnNeeded += 1;
3604 *pnNeeded += 1;
3605 *pnNeeded += 1;
3606 *pnNeeded += pTlv->key_length;
3607 break;
3608 }
3609 return status;
3610} /* End btampGetPackedTLVHCI_Create_Physical_Link_Cmd. */
3611
3612typedef v_U32_t (*pfnPackSizeTlvHCI_Create_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Create_Physical_Link_Cmd*, v_U32_t*);
3613#define SigPackSizeTlvHCI_Create_Physical_Link_Cmd ( 0x004a )
3614
3615v_U32_t btampGetPackedTlvHCI_Data_Buffer_Overflow_Event(void * pCtx, tBtampTLVHCI_Data_Buffer_Overflow_Event *pTlv, v_U32_t *pnNeeded)
3616{
3617 v_U32_t status = BTAMP_PARSE_SUCCESS;
3618 (void)pCtx; (void)pTlv; (void)pnNeeded;
3619 while ( pTlv->present )
3620 {
3621 *pnNeeded += 1;
3622 break;
3623 }
3624 return status;
3625} /* End btampGetPackedTLVHCI_Data_Buffer_Overflow_Event. */
3626
3627typedef v_U32_t (*pfnPackSizeTlvHCI_Data_Buffer_Overflow_Event_t)(void *, tBtampTLVHCI_Data_Buffer_Overflow_Event*, v_U32_t*);
3628#define SigPackSizeTlvHCI_Data_Buffer_Overflow_Event ( 0x004b )
3629
3630v_U32_t btampGetPackedTlvHCI_Disconnect_Logical_Link_Cmd(void * pCtx, tBtampTLVHCI_Disconnect_Logical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3631{
3632 v_U32_t status = BTAMP_PARSE_SUCCESS;
3633 (void)pCtx; (void)pTlv; (void)pnNeeded;
3634 while ( pTlv->present )
3635 {
3636 *pnNeeded += 2;
3637 break;
3638 }
3639 return status;
3640} /* End btampGetPackedTLVHCI_Disconnect_Logical_Link_Cmd. */
3641
3642typedef v_U32_t (*pfnPackSizeTlvHCI_Disconnect_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Disconnect_Logical_Link_Cmd*, v_U32_t*);
3643#define SigPackSizeTlvHCI_Disconnect_Logical_Link_Cmd ( 0x004c )
3644
3645v_U32_t btampGetPackedTlvHCI_Disconnect_Logical_Link_Complete_Event(void * pCtx, tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event *pTlv, v_U32_t *pnNeeded)
3646{
3647 v_U32_t status = BTAMP_PARSE_SUCCESS;
3648 (void)pCtx; (void)pTlv; (void)pnNeeded;
3649 while ( pTlv->present )
3650 {
3651 *pnNeeded += 1;
3652 *pnNeeded += 2;
3653 *pnNeeded += 1;
3654 break;
3655 }
3656 return status;
3657} /* End btampGetPackedTLVHCI_Disconnect_Logical_Link_Complete_Event. */
3658
3659typedef v_U32_t (*pfnPackSizeTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event*, v_U32_t*);
3660#define SigPackSizeTlvHCI_Disconnect_Logical_Link_Complete_Event ( 0x004d )
3661
3662v_U32_t btampGetPackedTlvHCI_Disconnect_Physical_Link_Cmd(void * pCtx, tBtampTLVHCI_Disconnect_Physical_Link_Cmd *pTlv, v_U32_t *pnNeeded)
3663{
3664 v_U32_t status = BTAMP_PARSE_SUCCESS;
3665 (void)pCtx; (void)pTlv; (void)pnNeeded;
3666 while ( pTlv->present )
3667 {
3668 *pnNeeded += 1;
3669 *pnNeeded += 1;
3670 break;
3671 }
3672 return status;
3673} /* End btampGetPackedTLVHCI_Disconnect_Physical_Link_Cmd. */
3674
3675typedef v_U32_t (*pfnPackSizeTlvHCI_Disconnect_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Disconnect_Physical_Link_Cmd*, v_U32_t*);
3676#define SigPackSizeTlvHCI_Disconnect_Physical_Link_Cmd ( 0x004e )
3677
3678v_U32_t btampGetPackedTlvHCI_Disconnect_Physical_Link_Complete_Event(void * pCtx, tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event *pTlv, v_U32_t *pnNeeded)
3679{
3680 v_U32_t status = BTAMP_PARSE_SUCCESS;
3681 (void)pCtx; (void)pTlv; (void)pnNeeded;
3682 while ( pTlv->present )
3683 {
3684 *pnNeeded += 1;
3685 *pnNeeded += 1;
3686 *pnNeeded += 1;
3687 break;
3688 }
3689 return status;
3690} /* End btampGetPackedTLVHCI_Disconnect_Physical_Link_Complete_Event. */
3691
3692typedef v_U32_t (*pfnPackSizeTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event*, v_U32_t*);
3693#define SigPackSizeTlvHCI_Disconnect_Physical_Link_Complete_Event ( 0x004f )
3694
3695v_U32_t btampGetPackedTlvHCI_Flow_Spec_Modify_Cmd(void * pCtx, tBtampTLVHCI_Flow_Spec_Modify_Cmd *pTlv, v_U32_t *pnNeeded)
3696{
3697 v_U32_t status = BTAMP_PARSE_SUCCESS;
3698 (void)pCtx; (void)pTlv; (void)pnNeeded;
3699 while ( pTlv->present )
3700 {
3701 *pnNeeded += 2;
3702 *pnNeeded += 1;
3703 *pnNeeded += 18;
3704 *pnNeeded += 18;
3705 break;
3706 }
3707 return status;
3708} /* End btampGetPackedTLVHCI_Flow_Spec_Modify_Cmd. */
3709
3710typedef v_U32_t (*pfnPackSizeTlvHCI_Flow_Spec_Modify_Cmd_t)(void *, tBtampTLVHCI_Flow_Spec_Modify_Cmd*, v_U32_t*);
3711#define SigPackSizeTlvHCI_Flow_Spec_Modify_Cmd ( 0x0050 )
3712
3713v_U32_t btampGetPackedTlvHCI_Flow_Spec_Modify_Complete_Event(void * pCtx, tBtampTLVHCI_Flow_Spec_Modify_Complete_Event *pTlv, v_U32_t *pnNeeded)
3714{
3715 v_U32_t status = BTAMP_PARSE_SUCCESS;
3716 (void)pCtx; (void)pTlv; (void)pnNeeded;
3717 while ( pTlv->present )
3718 {
3719 *pnNeeded += 1;
3720 *pnNeeded += 2;
3721 break;
3722 }
3723 return status;
3724} /* End btampGetPackedTLVHCI_Flow_Spec_Modify_Complete_Event. */
3725
3726typedef v_U32_t (*pfnPackSizeTlvHCI_Flow_Spec_Modify_Complete_Event_t)(void *, tBtampTLVHCI_Flow_Spec_Modify_Complete_Event*, v_U32_t*);
3727#define SigPackSizeTlvHCI_Flow_Spec_Modify_Complete_Event ( 0x0051 )
3728
3729v_U32_t btampGetPackedTlvHCI_Flush_Cmd(void * pCtx, tBtampTLVHCI_Flush_Cmd *pTlv, v_U32_t *pnNeeded)
3730{
3731 v_U32_t status = BTAMP_PARSE_SUCCESS;
3732 (void)pCtx; (void)pTlv; (void)pnNeeded;
3733 while ( pTlv->present )
3734 {
3735 *pnNeeded += 2;
3736 break;
3737 }
3738 return status;
3739} /* End btampGetPackedTLVHCI_Flush_Cmd. */
3740
3741typedef v_U32_t (*pfnPackSizeTlvHCI_Flush_Cmd_t)(void *, tBtampTLVHCI_Flush_Cmd*, v_U32_t*);
3742#define SigPackSizeTlvHCI_Flush_Cmd ( 0x0052 )
3743
3744v_U32_t btampGetPackedTlvHCI_Flush_Occurred_Event(void * pCtx, tBtampTLVHCI_Flush_Occurred_Event *pTlv, v_U32_t *pnNeeded)
3745{
3746 v_U32_t status = BTAMP_PARSE_SUCCESS;
3747 (void)pCtx; (void)pTlv; (void)pnNeeded;
3748 while ( pTlv->present )
3749 {
3750 *pnNeeded += 2;
3751 break;
3752 }
3753 return status;
3754} /* End btampGetPackedTLVHCI_Flush_Occurred_Event. */
3755
3756typedef v_U32_t (*pfnPackSizeTlvHCI_Flush_Occurred_Event_t)(void *, tBtampTLVHCI_Flush_Occurred_Event*, v_U32_t*);
3757#define SigPackSizeTlvHCI_Flush_Occurred_Event ( 0x0053 )
3758
3759v_U32_t btampGetPackedTlvHCI_Num_Completed_Pkts_Event(void * pCtx, tBtampTLVHCI_Num_Completed_Pkts_Event *pTlv, v_U32_t *pnNeeded)
3760{
3761 v_U32_t status = BTAMP_PARSE_SUCCESS;
3762 (void)pCtx; (void)pTlv; (void)pnNeeded;
3763// while ( pTlv->present )
3764 {
3765 *pnNeeded += 1;
3766 *pnNeeded += 2;
3767 *pnNeeded += 2;
3768#if 0
3769// New
3770 *pnNeeded += 2;
3771 *pnNeeded += 2;
3772 *pnNeeded += 2;
3773 *pnNeeded += 2;
3774 *pnNeeded += 2;
3775 *pnNeeded += 2;
3776// End of New
3777#endif
3778// break;
3779 }
3780 return status;
3781} /* End btampGetPackedTLVHCI_Num_Completed_Pkts_Event. */
3782
3783v_U32_t btampGetPackedTlvHCI_Num_Completed_Data_Blocks_Event(void * pCtx, tBtampTLVHCI_Num_Completed_Data_Blocks_Event *pTlv, v_U32_t *pnNeeded)
3784{
3785 v_U32_t status = BTAMP_PARSE_SUCCESS;
3786 (void)pCtx; (void)pTlv; (void)pnNeeded;
3787// while ( pTlv->present )
3788 {
3789 *pnNeeded += 2;
3790 *pnNeeded += 1;
3791 *pnNeeded += 2;
3792 *pnNeeded += 2;
3793 *pnNeeded += 2;
3794// break;
3795 }
3796 return status;
3797} /* End btampGetPackedTLVHCI_Num_Completed_Data_Blocks_Event. */
3798
3799//typedef v_U32_t (*pfnPackSizeTlvHCI_Num_Completed_Pkts_Event_t)(void *, tBtampTLVHCI_Command_Status_Event*, v_U32_t*);
3800//#define SigPackSizeTlvHCI_Num_Completed_Pkts_Event ( 0x0048 )
3801
3802v_U32_t btampGetPackedTlvHCI_Generic_AMP_Link_Key_Notification_Event(void * pCtx, tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event *pTlv, v_U32_t *pnNeeded)
3803{
3804 v_U32_t status = BTAMP_PARSE_SUCCESS;
3805 (void)pCtx; (void)pTlv; (void)pnNeeded;
3806 while ( pTlv->present )
3807 {
3808 *pnNeeded += 6;
3809 *pnNeeded += 32;
3810 *pnNeeded += 1;
3811 break;
3812 }
3813 return status;
3814} /* End btampGetPackedTLVHCI_Generic_AMP_Link_Key_Notification_Event. */
3815
3816typedef v_U32_t (*pfnPackSizeTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(void *, tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event*, v_U32_t*);
3817#define SigPackSizeTlvHCI_Generic_AMP_Link_Key_Notification_Event ( 0x0054 )
3818
3819v_U32_t btampGetPackedTlvHCI_Hardware_Error_Event(void * pCtx, tBtampTLVHCI_Hardware_Error_Event *pTlv, v_U32_t *pnNeeded)
3820{
3821 v_U32_t status = BTAMP_PARSE_SUCCESS;
3822 (void)pCtx; (void)pTlv; (void)pnNeeded;
3823 while ( pTlv->present )
3824 {
3825 *pnNeeded += 1;
3826 break;
3827 }
3828 return status;
3829} /* End btampGetPackedTLVHCI_Hardware_Error_Event. */
3830
3831typedef v_U32_t (*pfnPackSizeTlvHCI_Hardware_Error_Event_t)(void *, tBtampTLVHCI_Hardware_Error_Event*, v_U32_t*);
3832#define SigPackSizeTlvHCI_Hardware_Error_Event ( 0x0055 )
3833
3834v_U32_t btampGetPackedTlvHCI_Logical_Link_Cancel_Cmd(void * pCtx, tBtampTLVHCI_Logical_Link_Cancel_Cmd *pTlv, v_U32_t *pnNeeded)
3835{
3836 v_U32_t status = BTAMP_PARSE_SUCCESS;
3837 (void)pCtx; (void)pTlv; (void)pnNeeded;
3838 while ( pTlv->present )
3839 {
3840 *pnNeeded += 1;
3841 *pnNeeded += 1;
3842 break;
3843 }
3844 return status;
3845} /* End btampGetPackedTLVHCI_Logical_Link_Cancel_Cmd. */
3846
3847typedef v_U32_t (*pfnPackSizeTlvHCI_Logical_Link_Cancel_Cmd_t)(void *, tBtampTLVHCI_Logical_Link_Cancel_Cmd*, v_U32_t*);
3848#define SigPackSizeTlvHCI_Logical_Link_Cancel_Cmd ( 0x0056 )
3849
3850v_U32_t btampGetPackedTlvHCI_Logical_Link_Complete_Event(void * pCtx, tBtampTLVHCI_Logical_Link_Complete_Event *pTlv, v_U32_t *pnNeeded)
3851{
3852 v_U32_t status = BTAMP_PARSE_SUCCESS;
3853 (void)pCtx; (void)pTlv; (void)pnNeeded;
3854 while ( pTlv->present )
3855 {
3856 *pnNeeded += 1;
3857 *pnNeeded += 2;
3858 *pnNeeded += 1;
3859 *pnNeeded += 1;
3860 break;
3861 }
3862 return status;
3863} /* End btampGetPackedTLVHCI_Logical_Link_Complete_Event. */
3864
3865typedef v_U32_t (*pfnPackSizeTlvHCI_Logical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Logical_Link_Complete_Event*, v_U32_t*);
3866#define SigPackSizeTlvHCI_Logical_Link_Complete_Event ( 0x0057 )
3867
3868v_U32_t btampGetPackedTlvHCI_Loopback_Command_Event(void * pCtx, tBtampTLVHCI_Loopback_Command_Event *pTlv, v_U32_t *pnNeeded)
3869{
3870 v_U32_t status = BTAMP_PARSE_SUCCESS;
3871 (void)pCtx; (void)pTlv; (void)pnNeeded;
3872 while ( pTlv->present )
3873 {
3874 *pnNeeded += 64;
3875 break;
3876 }
3877 return status;
3878} /* End btampGetPackedTLVHCI_Loopback_Command_Event. */
3879
3880typedef v_U32_t (*pfnPackSizeTlvHCI_Loopback_Command_Event_t)(void *, tBtampTLVHCI_Loopback_Command_Event*, v_U32_t*);
3881#define SigPackSizeTlvHCI_Loopback_Command_Event ( 0x0058 )
3882
3883v_U32_t btampGetPackedTlvHCI_Physical_Link_Complete_Event(void * pCtx, tBtampTLVHCI_Physical_Link_Complete_Event *pTlv, v_U32_t *pnNeeded)
3884{
3885 v_U32_t status = BTAMP_PARSE_SUCCESS;
3886 (void)pCtx; (void)pTlv; (void)pnNeeded;
3887 while ( pTlv->present )
3888 {
3889 *pnNeeded += 1;
3890 *pnNeeded += 1;
3891 break;
3892 }
3893 return status;
3894} /* End btampGetPackedTLVHCI_Physical_Link_Complete_Event. */
3895
3896typedef v_U32_t (*pfnPackSizeTlvHCI_Physical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Physical_Link_Complete_Event*, v_U32_t*);
3897#define SigPackSizeTlvHCI_Physical_Link_Complete_Event ( 0x0059 )
3898
3899v_U32_t btampGetPackedTlvHCI_Physical_Link_Loss_Warning_Event(void * pCtx, tBtampTLVHCI_Physical_Link_Loss_Warning_Event *pTlv, v_U32_t *pnNeeded)
3900{
3901 v_U32_t status = BTAMP_PARSE_SUCCESS;
3902 (void)pCtx; (void)pTlv; (void)pnNeeded;
3903 while ( pTlv->present )
3904 {
3905 *pnNeeded += 1;
3906 *pnNeeded += 1;
3907 break;
3908 }
3909 return status;
3910} /* End btampGetPackedTLVHCI_Physical_Link_Loss_Warning_Event. */
3911
3912typedef v_U32_t (*pfnPackSizeTlvHCI_Physical_Link_Loss_Warning_Event_t)(void *, tBtampTLVHCI_Physical_Link_Loss_Warning_Event*, v_U32_t*);
3913#define SigPackSizeTlvHCI_Physical_Link_Loss_Warning_Event ( 0x005a )
3914
3915v_U32_t btampGetPackedTlvHCI_Physical_Link_Recovery_Event(void * pCtx, tBtampTLVHCI_Physical_Link_Recovery_Event *pTlv, v_U32_t *pnNeeded)
3916{
3917 v_U32_t status = BTAMP_PARSE_SUCCESS;
3918 (void)pCtx; (void)pTlv; (void)pnNeeded;
3919 while ( pTlv->present )
3920 {
3921 *pnNeeded += 1;
3922 break;
3923 }
3924 return status;
3925} /* End btampGetPackedTLVHCI_Physical_Link_Recovery_Event. */
3926
3927typedef v_U32_t (*pfnPackSizeTlvHCI_Physical_Link_Recovery_Event_t)(void *, tBtampTLVHCI_Physical_Link_Recovery_Event*, v_U32_t*);
3928#define SigPackSizeTlvHCI_Physical_Link_Recovery_Event ( 0x005b )
3929
3930v_U32_t btampGetPackedTlvHCI_Qos_Violation_Event(void * pCtx, tBtampTLVHCI_Qos_Violation_Event *pTlv, v_U32_t *pnNeeded)
3931{
3932 v_U32_t status = BTAMP_PARSE_SUCCESS;
3933 (void)pCtx; (void)pTlv; (void)pnNeeded;
3934 while ( pTlv->present )
3935 {
3936 *pnNeeded += 2;
3937 break;
3938 }
3939 return status;
3940} /* End btampGetPackedTLVHCI_Qos_Violation_Event. */
3941
3942typedef v_U32_t (*pfnPackSizeTlvHCI_Qos_Violation_Event_t)(void *, tBtampTLVHCI_Qos_Violation_Event*, v_U32_t*);
3943#define SigPackSizeTlvHCI_Qos_Violation_Event ( 0x005c )
3944
3945v_U32_t btampGetPackedTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
3946{
3947 v_U32_t status = BTAMP_PARSE_SUCCESS;
3948 (void)pCtx; (void)pTlv; (void)pnNeeded;
3949 while ( pTlv->present )
3950 {
3951 *pnNeeded += 2;
3952 break;
3953 }
3954 return status;
3955} /* End btampGetPackedTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd. */
3956
3957typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd*, v_U32_t*);
3958#define SigPackSizeTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd ( 0x005d )
3959
3960v_U32_t btampGetPackedTlvHCI_Read_Buffer_Size_Cmd(void * pCtx, tBtampTLVHCI_Read_Buffer_Size_Cmd *pTlv, v_U32_t *pnNeeded)
3961{
3962 v_U32_t status = BTAMP_PARSE_SUCCESS;
3963 (void)pCtx; (void)pTlv; (void)pnNeeded;
3964 while ( pTlv->present )
3965 {
3966 break;
3967 }
3968 return status;
3969} /* End btampGetPackedTLVHCI_Read_Buffer_Size_Cmd. */
3970
3971typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Buffer_Size_Cmd_t)(void *, tBtampTLVHCI_Read_Buffer_Size_Cmd*, v_U32_t*);
3972#define SigPackSizeTlvHCI_Read_Buffer_Size_Cmd ( 0x005e )
3973
3974v_U32_t btampGetPackedTlvHCI_Read_Connection_Accept_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
3975{
3976 v_U32_t status = BTAMP_PARSE_SUCCESS;
3977 (void)pCtx; (void)pTlv; (void)pnNeeded;
3978 while ( pTlv->present )
3979 {
3980 break;
3981 }
3982 return status;
3983} /* End btampGetPackedTLVHCI_Read_Connection_Accept_Timeout_Cmd. */
3984
3985typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd*, v_U32_t*);
3986#define SigPackSizeTlvHCI_Read_Connection_Accept_Timeout_Cmd ( 0x005f )
3987
3988v_U32_t btampGetPackedTlvHCI_Read_Data_Block_Size_Cmd(void * pCtx, tBtampTLVHCI_Read_Data_Block_Size_Cmd *pTlv, v_U32_t *pnNeeded)
3989{
3990 v_U32_t status = BTAMP_PARSE_SUCCESS;
3991 (void)pCtx; (void)pTlv; (void)pnNeeded;
3992 while ( pTlv->present )
3993 {
3994 break;
3995 }
3996 return status;
3997} /* End btampGetPackedTLVHCI_Read_Data_Block_Size_Cmd. */
3998
3999typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Data_Block_Size_Cmd_t)(void *, tBtampTLVHCI_Read_Data_Block_Size_Cmd*, v_U32_t*);
4000#define SigPackSizeTlvHCI_Read_Data_Block_Size_Cmd ( 0x0060 )
4001
4002v_U32_t btampGetPackedTlvHCI_Read_Failed_Contact_Counter_Cmd(void * pCtx, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd *pTlv, v_U32_t *pnNeeded)
4003{
4004 v_U32_t status = BTAMP_PARSE_SUCCESS;
4005 (void)pCtx; (void)pTlv; (void)pnNeeded;
4006 while ( pTlv->present )
4007 {
4008 *pnNeeded += 2;
4009 break;
4010 }
4011 return status;
4012} /* End btampGetPackedTLVHCI_Read_Failed_Contact_Counter_Cmd. */
4013
4014typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(void *, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd*, v_U32_t*);
4015#define SigPackSizeTlvHCI_Read_Failed_Contact_Counter_Cmd ( 0x0061 )
4016
4017v_U32_t btampGetPackedTlvHCI_Read_Flow_Control_Mode_Cmd(void * pCtx, tBtampTLVHCI_Read_Flow_Control_Mode_Cmd *pTlv, v_U32_t *pnNeeded)
4018{
4019 v_U32_t status = BTAMP_PARSE_SUCCESS;
4020 (void)pCtx; (void)pTlv; (void)pnNeeded;
4021 while ( pTlv->present )
4022 {
4023 break;
4024 }
4025 return status;
4026} /* End btampGetPackedTLVHCI_Read_Flow_Control_Mode_Cmd. */
4027
4028typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Flow_Control_Mode_Cmd_t)(void *, tBtampTLVHCI_Read_Flow_Control_Mode_Cmd*, v_U32_t*);
4029#define SigPackSizeTlvHCI_Read_Flow_Control_Mode_Cmd ( 0x0062 )
4030
4031v_U32_t btampGetPackedTlvHCI_Read_Link_Quality_Cmd(void * pCtx, tBtampTLVHCI_Read_Link_Quality_Cmd *pTlv, v_U32_t *pnNeeded)
4032{
4033 v_U32_t status = BTAMP_PARSE_SUCCESS;
4034 (void)pCtx; (void)pTlv; (void)pnNeeded;
4035 while ( pTlv->present )
4036 {
4037 *pnNeeded += 2;
4038 break;
4039 }
4040 return status;
4041} /* End btampGetPackedTLVHCI_Read_Link_Quality_Cmd. */
4042
4043typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Link_Quality_Cmd_t)(void *, tBtampTLVHCI_Read_Link_Quality_Cmd*, v_U32_t*);
4044#define SigPackSizeTlvHCI_Read_Link_Quality_Cmd ( 0x0063 )
4045
4046v_U32_t btampGetPackedTlvHCI_Read_Link_Supervision_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4047{
4048 v_U32_t status = BTAMP_PARSE_SUCCESS;
4049 (void)pCtx; (void)pTlv; (void)pnNeeded;
4050 while ( pTlv->present )
4051 {
4052 *pnNeeded += 2;
4053 break;
4054 }
4055 return status;
4056} /* End btampGetPackedTLVHCI_Read_Link_Supervision_Timeout_Cmd. */
4057
4058typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd*, v_U32_t*);
4059#define SigPackSizeTlvHCI_Read_Link_Supervision_Timeout_Cmd ( 0x0064 )
4060
4061v_U32_t btampGetPackedTlvHCI_Read_Local_AMP_Assoc_Cmd(void * pCtx, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd *pTlv, v_U32_t *pnNeeded)
4062{
4063 v_U32_t status = BTAMP_PARSE_SUCCESS;
4064 (void)pCtx; (void)pTlv; (void)pnNeeded;
4065 while ( pTlv->present )
4066 {
4067 *pnNeeded += 1;
4068 *pnNeeded += 2;
4069 *pnNeeded += 2;
4070 break;
4071 }
4072 return status;
4073} /* End btampGetPackedTLVHCI_Read_Local_AMP_Assoc_Cmd. */
4074
4075typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(void *, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd*, v_U32_t*);
4076#define SigPackSizeTlvHCI_Read_Local_AMP_Assoc_Cmd ( 0x0065 )
4077
4078v_U32_t btampGetPackedTlvHCI_Read_Local_AMP_Information_Cmd(void * pCtx, tBtampTLVHCI_Read_Local_AMP_Information_Cmd *pTlv, v_U32_t *pnNeeded)
4079{
4080 v_U32_t status = BTAMP_PARSE_SUCCESS;
4081 (void)pCtx; (void)pTlv; (void)pnNeeded;
4082 while ( pTlv->present )
4083 {
4084 break;
4085 }
4086 return status;
4087} /* End btampGetPackedTLVHCI_Read_Local_AMP_Information_Cmd. */
4088
4089typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Local_AMP_Information_Cmd_t)(void *, tBtampTLVHCI_Read_Local_AMP_Information_Cmd*, v_U32_t*);
4090#define SigPackSizeTlvHCI_Read_Local_AMP_Information_Cmd ( 0x0066 )
4091
4092v_U32_t btampGetPackedTlvHCI_Read_Local_Supported_Cmds_Cmd(void * pCtx, tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd *pTlv, v_U32_t *pnNeeded)
4093{
4094 v_U32_t status = BTAMP_PARSE_SUCCESS;
4095 (void)pCtx; (void)pTlv; (void)pnNeeded;
4096 while ( pTlv->present )
4097 {
4098 break;
4099 }
4100 return status;
4101} /* End btampGetPackedTLVHCI_Read_Local_Supported_Cmds_Cmd. */
4102
4103typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(void *, tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd*, v_U32_t*);
4104#define SigPackSizeTlvHCI_Read_Local_Supported_Cmds_Cmd ( 0x0067 )
4105
4106v_U32_t btampGetPackedTlvHCI_Read_Local_Version_Info_Cmd(void * pCtx, tBtampTLVHCI_Read_Local_Version_Info_Cmd *pTlv, v_U32_t *pnNeeded)
4107{
4108 v_U32_t status = BTAMP_PARSE_SUCCESS;
4109 (void)pCtx; (void)pTlv; (void)pnNeeded;
4110 while ( pTlv->present )
4111 {
4112 break;
4113 }
4114 return status;
4115} /* End btampGetPackedTLVHCI_Read_Local_Version_Info_Cmd. */
4116
4117typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Local_Version_Info_Cmd_t)(void *, tBtampTLVHCI_Read_Local_Version_Info_Cmd*, v_U32_t*);
4118#define SigPackSizeTlvHCI_Read_Local_Version_Info_Cmd ( 0x0068 )
4119
4120v_U32_t btampGetPackedTlvHCI_Read_Location_Data_Cmd(void * pCtx, tBtampTLVHCI_Read_Location_Data_Cmd *pTlv, v_U32_t *pnNeeded)
4121{
4122 v_U32_t status = BTAMP_PARSE_SUCCESS;
4123 (void)pCtx; (void)pTlv; (void)pnNeeded;
4124 while ( pTlv->present )
4125 {
4126 break;
4127 }
4128 return status;
4129} /* End btampGetPackedTLVHCI_Read_Location_Data_Cmd. */
4130
4131typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Location_Data_Cmd_t)(void *, tBtampTLVHCI_Read_Location_Data_Cmd*, v_U32_t*);
4132#define SigPackSizeTlvHCI_Read_Location_Data_Cmd ( 0x0069 )
4133
4134v_U32_t btampGetPackedTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4135{
4136 v_U32_t status = BTAMP_PARSE_SUCCESS;
4137 (void)pCtx; (void)pTlv; (void)pnNeeded;
4138 while ( pTlv->present )
4139 {
4140 break;
4141 }
4142 return status;
4143} /* End btampGetPackedTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd. */
4144
4145typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd*, v_U32_t*);
4146#define SigPackSizeTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd ( 0x006a )
4147
4148v_U32_t btampGetPackedTlvHCI_Read_Loopback_Mode_Cmd(void * pCtx, tBtampTLVHCI_Read_Loopback_Mode_Cmd *pTlv, v_U32_t *pnNeeded)
4149{
4150 v_U32_t status = BTAMP_PARSE_SUCCESS;
4151 (void)pCtx; (void)pTlv; (void)pnNeeded;
4152 while ( pTlv->present )
4153 {
4154 break;
4155 }
4156 return status;
4157} /* End btampGetPackedTLVHCI_Read_Loopback_Mode_Cmd. */
4158
4159typedef v_U32_t (*pfnPackSizeTlvHCI_Read_Loopback_Mode_Cmd_t)(void *, tBtampTLVHCI_Read_Loopback_Mode_Cmd*, v_U32_t*);
4160#define SigPackSizeTlvHCI_Read_Loopback_Mode_Cmd ( 0x006b )
4161
4162v_U32_t btampGetPackedTlvHCI_Read_RSSI_Cmd(void * pCtx, tBtampTLVHCI_Read_RSSI_Cmd *pTlv, v_U32_t *pnNeeded)
4163{
4164 v_U32_t status = BTAMP_PARSE_SUCCESS;
4165 (void)pCtx; (void)pTlv; (void)pnNeeded;
4166 while ( pTlv->present )
4167 {
4168 *pnNeeded += 2;
4169 break;
4170 }
4171 return status;
4172} /* End btampGetPackedTLVHCI_Read_RSSI_Cmd. */
4173
4174typedef v_U32_t (*pfnPackSizeTlvHCI_Read_RSSI_Cmd_t)(void *, tBtampTLVHCI_Read_RSSI_Cmd*, v_U32_t*);
4175#define SigPackSizeTlvHCI_Read_RSSI_Cmd ( 0x006c )
4176
4177v_U32_t btampGetPackedTlvHCI_Reset_Cmd(void * pCtx, tBtampTLVHCI_Reset_Cmd *pTlv, v_U32_t *pnNeeded)
4178{
4179 v_U32_t status = BTAMP_PARSE_SUCCESS;
4180 (void)pCtx; (void)pTlv; (void)pnNeeded;
4181 while ( pTlv->present )
4182 {
4183 break;
4184 }
4185 return status;
4186} /* End btampGetPackedTLVHCI_Reset_Cmd. */
4187
4188typedef v_U32_t (*pfnPackSizeTlvHCI_Reset_Cmd_t)(void *, tBtampTLVHCI_Reset_Cmd*, v_U32_t*);
4189#define SigPackSizeTlvHCI_Reset_Cmd ( 0x006d )
4190
4191v_U32_t btampGetPackedTlvHCI_Reset_Failed_Contact_Counter_Cmd(void * pCtx, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd *pTlv, v_U32_t *pnNeeded)
4192{
4193 v_U32_t status = BTAMP_PARSE_SUCCESS;
4194 (void)pCtx; (void)pTlv; (void)pnNeeded;
4195 while ( pTlv->present )
4196 {
4197 *pnNeeded += 2;
4198 break;
4199 }
4200 return status;
4201} /* End btampGetPackedTLVHCI_Reset_Failed_Contact_Counter_Cmd. */
4202
4203typedef v_U32_t (*pfnPackSizeTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(void *, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd*, v_U32_t*);
4204#define SigPackSizeTlvHCI_Reset_Failed_Contact_Counter_Cmd ( 0x006e )
4205
4206v_U32_t btampGetPackedTlvHCI_Set_Event_Mask_Cmd(void * pCtx, tBtampTLVHCI_Set_Event_Mask_Cmd *pTlv, v_U32_t *pnNeeded)
4207{
4208 v_U32_t status = BTAMP_PARSE_SUCCESS;
4209 (void)pCtx; (void)pTlv; (void)pnNeeded;
4210 while ( pTlv->present )
4211 {
4212 *pnNeeded += 8;
4213 break;
4214 }
4215 return status;
4216} /* End btampGetPackedTLVHCI_Set_Event_Mask_Cmd. */
4217
4218typedef v_U32_t (*pfnPackSizeTlvHCI_Set_Event_Mask_Cmd_t)(void *, tBtampTLVHCI_Set_Event_Mask_Cmd*, v_U32_t*);
4219#define SigPackSizeTlvHCI_Set_Event_Mask_Cmd ( 0x006f )
4220
4221v_U32_t btampGetPackedTlvHCI_Set_Event_Mask_Page_2_Cmd(void * pCtx, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *pTlv, v_U32_t *pnNeeded)
4222{
4223 v_U32_t status = BTAMP_PARSE_SUCCESS;
4224 (void)pCtx; (void)pTlv; (void)pnNeeded;
4225 while ( pTlv->present )
4226 {
4227 *pnNeeded += 8;
4228 break;
4229 }
4230 return status;
4231} /* End btampGetPackedTLVHCI_Set_Event_Mask_Page_2_Cmd. */
4232
4233typedef v_U32_t (*pfnPackSizeTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(void *, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd*, v_U32_t*);
4234#define SigPackSizeTlvHCI_Set_Event_Mask_Page_2_Cmd ( 0x0070 )
4235
4236v_U32_t btampGetPackedTlvHCI_Set_Short_Range_Mode_Cmd(void * pCtx, tBtampTLVHCI_Set_Short_Range_Mode_Cmd *pTlv, v_U32_t *pnNeeded)
4237{
4238 v_U32_t status = BTAMP_PARSE_SUCCESS;
4239 (void)pCtx; (void)pTlv; (void)pnNeeded;
4240 while ( pTlv->present )
4241 {
4242 *pnNeeded += 1;
4243 *pnNeeded += 1;
4244 break;
4245 }
4246 return status;
4247} /* End btampGetPackedTLVHCI_Set_Short_Range_Mode_Cmd. */
4248
4249typedef v_U32_t (*pfnPackSizeTlvHCI_Set_Short_Range_Mode_Cmd_t)(void *, tBtampTLVHCI_Set_Short_Range_Mode_Cmd*, v_U32_t*);
4250#define SigPackSizeTlvHCI_Set_Short_Range_Mode_Cmd ( 0x0071 )
4251
4252v_U32_t btampGetPackedTlvHCI_Short_Range_Mode_Change_Complete_Event(void * pCtx, tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event *pTlv, v_U32_t *pnNeeded)
4253{
4254 v_U32_t status = BTAMP_PARSE_SUCCESS;
4255 (void)pCtx; (void)pTlv; (void)pnNeeded;
4256 while ( pTlv->present )
4257 {
4258 *pnNeeded += 1;
4259 *pnNeeded += 1;
4260 *pnNeeded += 1;
4261 break;
4262 }
4263 return status;
4264} /* End btampGetPackedTLVHCI_Short_Range_Mode_Change_Complete_Event. */
4265
4266typedef v_U32_t (*pfnPackSizeTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(void *, tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event*, v_U32_t*);
4267#define SigPackSizeTlvHCI_Short_Range_Mode_Change_Complete_Event ( 0x0072 )
4268
4269v_U32_t btampGetPackedTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4270{
4271 v_U32_t status = BTAMP_PARSE_SUCCESS;
4272 (void)pCtx; (void)pTlv; (void)pnNeeded;
4273 while ( pTlv->present )
4274 {
4275 *pnNeeded += 2;
4276 *pnNeeded += 4;
4277 break;
4278 }
4279 return status;
4280} /* End btampGetPackedTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd. */
4281
4282typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd*, v_U32_t*);
4283#define SigPackSizeTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd ( 0x0073 )
4284
4285v_U32_t btampGetPackedTlvHCI_Write_Connection_Accept_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4286{
4287 v_U32_t status = BTAMP_PARSE_SUCCESS;
4288 (void)pCtx; (void)pTlv; (void)pnNeeded;
4289 while ( pTlv->present )
4290 {
4291 *pnNeeded += 2;
4292 break;
4293 }
4294 return status;
4295} /* End btampGetPackedTLVHCI_Write_Connection_Accept_Timeout_Cmd. */
4296
4297typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd*, v_U32_t*);
4298#define SigPackSizeTlvHCI_Write_Connection_Accept_Timeout_Cmd ( 0x0074 )
4299
4300v_U32_t btampGetPackedTlvHCI_Write_Flow_Control_Mode_Cmd(void * pCtx, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *pTlv, v_U32_t *pnNeeded)
4301{
4302 v_U32_t status = BTAMP_PARSE_SUCCESS;
4303 (void)pCtx; (void)pTlv; (void)pnNeeded;
4304 while ( pTlv->present )
4305 {
4306 *pnNeeded += 1;
4307 break;
4308 }
4309 return status;
4310} /* End btampGetPackedTLVHCI_Write_Flow_Control_Mode_Cmd. */
4311
4312typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Flow_Control_Mode_Cmd_t)(void *, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd*, v_U32_t*);
4313#define SigPackSizeTlvHCI_Write_Flow_Control_Mode_Cmd ( 0x0075 )
4314
4315v_U32_t btampGetPackedTlvHCI_Write_Link_Supervision_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4316{
4317 v_U32_t status = BTAMP_PARSE_SUCCESS;
4318 (void)pCtx; (void)pTlv; (void)pnNeeded;
4319 while ( pTlv->present )
4320 {
4321 *pnNeeded += 2;
4322 *pnNeeded += 2;
4323 break;
4324 }
4325 return status;
4326} /* End btampGetPackedTLVHCI_Write_Link_Supervision_Timeout_Cmd. */
4327
4328typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd*, v_U32_t*);
4329#define SigPackSizeTlvHCI_Write_Link_Supervision_Timeout_Cmd ( 0x0076 )
4330
4331v_U32_t btampGetPackedTlvHCI_Write_Location_Data_Cmd(void * pCtx, tBtampTLVHCI_Write_Location_Data_Cmd *pTlv, v_U32_t *pnNeeded)
4332{
4333 v_U32_t status = BTAMP_PARSE_SUCCESS;
4334 (void)pCtx; (void)pTlv; (void)pnNeeded;
4335 while ( pTlv->present )
4336 {
4337 *pnNeeded += 1;
4338 *pnNeeded += 3;
4339 *pnNeeded += 1;
4340 break;
4341 }
4342 return status;
4343} /* End btampGetPackedTLVHCI_Write_Location_Data_Cmd. */
4344
4345typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Location_Data_Cmd_t)(void *, tBtampTLVHCI_Write_Location_Data_Cmd*, v_U32_t*);
4346#define SigPackSizeTlvHCI_Write_Location_Data_Cmd ( 0x0077 )
4347
4348v_U32_t btampGetPackedTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd(void * pCtx, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *pTlv, v_U32_t *pnNeeded)
4349{
4350 v_U32_t status = BTAMP_PARSE_SUCCESS;
4351 (void)pCtx; (void)pTlv; (void)pnNeeded;
4352 while ( pTlv->present )
4353 {
4354 *pnNeeded += 2;
4355 break;
4356 }
4357 return status;
4358} /* End btampGetPackedTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd. */
4359
4360typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd*, v_U32_t*);
4361#define SigPackSizeTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd ( 0x0078 )
4362
4363v_U32_t btampGetPackedTlvHCI_Write_Loopback_Mode_Cmd(void * pCtx, tBtampTLVHCI_Write_Loopback_Mode_Cmd *pTlv, v_U32_t *pnNeeded)
4364{
4365 v_U32_t status = BTAMP_PARSE_SUCCESS;
4366 (void)pCtx; (void)pTlv; (void)pnNeeded;
4367 while ( pTlv->present )
4368 {
4369 *pnNeeded += 1;
4370 break;
4371 }
4372 return status;
4373} /* End btampGetPackedTLVHCI_Write_Loopback_Mode_Cmd. */
4374
4375typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Loopback_Mode_Cmd_t)(void *, tBtampTLVHCI_Write_Loopback_Mode_Cmd*, v_U32_t*);
4376#define SigPackSizeTlvHCI_Write_Loopback_Mode_Cmd ( 0x0079 )
4377
4378v_U32_t btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd(void * pCtx, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pTlv, v_U32_t *pnNeeded)
4379{
4380 v_U32_t status = BTAMP_PARSE_SUCCESS;
4381 (void)pCtx; (void)pTlv; (void)pnNeeded;
4382#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4383 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4384 "In btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd\n");
4385#endif
4386
4387 while ( pTlv->present )
4388 {
4389 *pnNeeded += 1;
4390 *pnNeeded += 2;
4391 *pnNeeded += 2;
4392 *pnNeeded += pTlv->amp_assoc_remaining_length;
4393 break;
4394 }
4395 return status;
4396} /* End btampGetPackedTLVHCI_Write_Remote_AMP_ASSOC_Cmd. */
4397
4398typedef v_U32_t (*pfnPackSizeTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(void *, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd*, v_U32_t*);
4399#define SigPackSizeTlvHCI_Write_Remote_AMP_ASSOC_Cmd ( 0x007a )
4400
4401v_U32_t btampGetPackedTlvHCI_Enhanced_Flush_Cmd(void * pCtx, tBtampTLVHCI_Enhanced_Flush_Cmd *pTlv, v_U32_t *pnNeeded)
4402{
4403 v_U32_t status = BTAMP_PARSE_SUCCESS;
4404 (void)pCtx; (void)pTlv; (void)pnNeeded;
4405 while ( pTlv->present )
4406 {
4407 *pnNeeded += 2;
4408 *pnNeeded += 1;
4409 break;
4410 }
4411 return status;
4412} /* End btampGetPackedTLVHCI_Enhanced_Flush_Cmd. */
4413
4414typedef v_U32_t (*pfnPackSizeTlvHCI_Enhanced_Flush_Cmd_t)(void *, tBtampTLVHCI_Enhanced_Flush_Cmd*, v_U32_t*);
4415#define SigPackSizeTlvHCI_Enhanced_Flush_Cmd ( 0x007b )
4416
4417v_U32_t btampGetPackedTlvHCI_Enhanced_Flush_Complete_Event(void * pCtx, tBtampTLVHCI_Enhanced_Flush_Complete_Event *pTlv, v_U32_t *pnNeeded)
4418{
4419 v_U32_t status = BTAMP_PARSE_SUCCESS;
4420 (void)pCtx; (void)pTlv; (void)pnNeeded;
4421 while ( pTlv->present )
4422 {
4423 *pnNeeded += 2;
4424 break;
4425 }
4426 return status;
4427} /* End btampGetPackedTLVHCI_Enhanced_Flush_Complete_Event. */
4428
4429typedef v_U32_t (*pfnPackSizeTlvHCI_Enhanced_Flush_Complete_Event_t)(void *, tBtampTLVHCI_Enhanced_Flush_Complete_Event*, v_U32_t*);
4430#define SigPackSizeTlvHCI_Enhanced_Flush_Complete_Event ( 0x007c )
4431
4432v_U32_t btampGetPackedAMP_ASSOCSize(void * pCtx, tBtampAMP_ASSOC *pFrm, v_U32_t *pnNeeded)
4433{
4434 static tTLVDefn TLVS[ ] = {
4435 {BTAMP_TLV_AMP_ASSOC_MAC_ADDR, 0, 9, 9, offsetof(tBtampAMP_ASSOC, AMP_Assoc_MAC_Addr), offsetof(tBtampTLVAMP_Assoc_MAC_Addr, present), SigPackSizeTlvAMP_Assoc_MAC_Addr, (pfnGeneric_t)btampGetPackedTlvAMP_Assoc_MAC_Addr, "AMP_Assoc_MAC_Addr", 1, },
4436 {BTAMP_TLV_AMP_ASSOC_PREFERRED_CHANNEL_LIST, 0, 9, 12, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Preferred_Channel_List), offsetof(tBtampTLVAMP_Assoc_Preferred_Channel_List, present), SigPackSizeTlvAMP_Assoc_Preferred_Channel_List, (pfnGeneric_t)btampGetPackedTlvAMP_Assoc_Preferred_Channel_List, "AMP_Assoc_Preferred_Channel_List", 1, },
4437 {BTAMP_TLV_AMP_ASSOC_CONNECTED_CHANNEL, 0, 9, 12, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Connected_Channel), offsetof(tBtampTLVAMP_Assoc_Connected_Channel, present), SigPackSizeTlvAMP_Assoc_Connected_Channel, (pfnGeneric_t)btampGetPackedTlvAMP_Assoc_Connected_Channel, "AMP_Assoc_Connected_Channel", 0, },
4438 {BTAMP_TLV_AMP_ASSOC_PAL_CAPABILITIES, 0, 7, 7, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Capabilities), offsetof(tBtampTLVAMP_Assoc_PAL_Capabilities, present), SigPackSizeTlvAMP_Assoc_PAL_Capabilities, (pfnGeneric_t)btampGetPackedTlvAMP_Assoc_PAL_Capabilities, "AMP_Assoc_PAL_Capabilities", 0, },
4439 {BTAMP_TLV_AMP_ASSOC_PAL_VERSION, 0, 8, 8, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Version), offsetof(tBtampTLVAMP_Assoc_PAL_Version, present), SigPackSizeTlvAMP_Assoc_PAL_Version, (pfnGeneric_t)btampGetPackedTlvAMP_Assoc_PAL_Version, "AMP_Assoc_PAL_Version", 1, },
4440 { 0xffff, 0 },
4441 };
4442
4443 v_U32_t status = 0;
4444 *pnNeeded = 0;
4445#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4446 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4447 "In btampGetPackedAMP_ASSOCSize\n");
4448#endif
4449
4450 status |= GetPackedSizeTlvCore(pCtx,(v_U8_t*)pFrm,pnNeeded,TLVS);
4451 return status;
4452} /* End btampGetPackedAMP_ASSOCSize. */
4453
4454static v_U32_t GetPackedSizeTlvCore(void * pCtx,
4455 v_U8_t *pFrm,
4456 v_U32_t *pnNeeded,
4457 tTLVDefn TLVs[])
4458{
4459 tTLVDefn *pTlv;
4460 v_U32_t status, status2;
4461 tFRAMES_BOOL *pfFound;
4462
4463 status = BTAMP_PARSE_SUCCESS;
4464 status2 = BTAMP_PARSE_SUCCESS;
4465#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4466 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4467 "In GetPackedSizeTlvCore\n");
4468#endif
4469
4470 pTlv = &( TLVs[0] );
4471 while ( 0xffff != pTlv->id )
4472 {
4473 pfFound = (tFRAMES_BOOL*)(pFrm + pTlv->offset +
4474 pTlv->presenceOffset);
4475 if ( *pfFound )
4476 {
4477 *pnNeeded += 4U;
4478 if ( pTlv->pec ) *pnNeeded += 3U;
4479#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4480 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4481 "In GetPackedSizeTlvCore, pTlv->sig - %d\n", pTlv->sig);
4482#endif
4483
4484 switch (pTlv->sig)
4485 {
4486 case SigPackSizeTlvAMP_Assoc_Connected_Channel:
4487 status2 = ( (pfnPackSizeTlvAMP_Assoc_Connected_Channel_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_Connected_Channel* )(pFrm + pTlv->offset), pnNeeded);
4488 if (status2) status |= status2;
4489 break;
4490 case SigPackSizeTlvAMP_Assoc_MAC_Addr:
4491 status2 = ( (pfnPackSizeTlvAMP_Assoc_MAC_Addr_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_MAC_Addr* )(pFrm + pTlv->offset), pnNeeded);
4492 if (status2) status |= status2;
4493 break;
4494 case SigPackSizeTlvAMP_Assoc_PAL_Capabilities:
4495 status2 = ( (pfnPackSizeTlvAMP_Assoc_PAL_Capabilities_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_PAL_Capabilities* )(pFrm + pTlv->offset), pnNeeded);
4496 if (status2) status |= status2;
4497 break;
4498 case SigPackSizeTlvAMP_Assoc_PAL_Version:
4499 status2 = ( (pfnPackSizeTlvAMP_Assoc_PAL_Version_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_PAL_Version* )(pFrm + pTlv->offset), pnNeeded);
4500 if (status2) status |= status2;
4501 break;
4502 case SigPackSizeTlvAMP_Assoc_Preferred_Channel_List:
4503 status2 = ( (pfnPackSizeTlvAMP_Assoc_Preferred_Channel_List_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_Preferred_Channel_List* )(pFrm + pTlv->offset), pnNeeded);
4504 if (status2) status |= status2;
4505 break;
4506 case SigPackSizeTlvFlow_Spec:
4507 status2 = ( (pfnPackSizeTlvFlow_Spec_t)(pTlv->pfn) )(pCtx, ( tBtampTLVFlow_Spec* )(pFrm + pTlv->offset), pnNeeded);
4508 if (status2) status |= status2;
4509 break;
4510 case SigPackSizeTlvHCI_Accept_Logical_Link_Cmd:
4511 status2 = ( (pfnPackSizeTlvHCI_Accept_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Accept_Logical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4512 if (status2) status |= status2;
4513 break;
4514 case SigPackSizeTlvHCI_Accept_Physical_Link_Cmd:
4515 status2 = ( (pfnPackSizeTlvHCI_Accept_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Accept_Physical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4516 if (status2) status |= status2;
4517 break;
4518 case SigPackSizeTlvHCI_Channel_Selected_Event:
4519 status2 = ( (pfnPackSizeTlvHCI_Channel_Selected_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Channel_Selected_Event* )(pFrm + pTlv->offset), pnNeeded);
4520 if (status2) status |= status2;
4521 break;
4522 case SigPackSizeTlvHCI_Command_Complete_Event:
4523 status2 = ( (pfnPackSizeTlvHCI_Command_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Command_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4524 if (status2) status |= status2;
4525 break;
4526 case SigPackSizeTlvHCI_Command_Status_Event:
4527 status2 = ( (pfnPackSizeTlvHCI_Command_Status_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Command_Status_Event* )(pFrm + pTlv->offset), pnNeeded);
4528 if (status2) status |= status2;
4529 break;
4530 case SigPackSizeTlvHCI_Create_Logical_Link_Cmd:
4531 status2 = ( (pfnPackSizeTlvHCI_Create_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Create_Logical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4532 if (status2) status |= status2;
4533 break;
4534 case SigPackSizeTlvHCI_Create_Physical_Link_Cmd:
4535 status2 = ( (pfnPackSizeTlvHCI_Create_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Create_Physical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4536 if (status2) status |= status2;
4537 break;
4538 case SigPackSizeTlvHCI_Data_Buffer_Overflow_Event:
4539 status2 = ( (pfnPackSizeTlvHCI_Data_Buffer_Overflow_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Data_Buffer_Overflow_Event* )(pFrm + pTlv->offset), pnNeeded);
4540 if (status2) status |= status2;
4541 break;
4542 case SigPackSizeTlvHCI_Disconnect_Logical_Link_Cmd:
4543 status2 = ( (pfnPackSizeTlvHCI_Disconnect_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Logical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4544 if (status2) status |= status2;
4545 break;
4546 case SigPackSizeTlvHCI_Disconnect_Logical_Link_Complete_Event:
4547 status2 = ( (pfnPackSizeTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4548 if (status2) status |= status2;
4549 break;
4550 case SigPackSizeTlvHCI_Disconnect_Physical_Link_Cmd:
4551 status2 = ( (pfnPackSizeTlvHCI_Disconnect_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Physical_Link_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4552 if (status2) status |= status2;
4553 break;
4554 case SigPackSizeTlvHCI_Disconnect_Physical_Link_Complete_Event:
4555 status2 = ( (pfnPackSizeTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4556 if (status2) status |= status2;
4557 break;
4558 case SigPackSizeTlvHCI_Flow_Spec_Modify_Cmd:
4559 status2 = ( (pfnPackSizeTlvHCI_Flow_Spec_Modify_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flow_Spec_Modify_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4560 if (status2) status |= status2;
4561 break;
4562 case SigPackSizeTlvHCI_Flow_Spec_Modify_Complete_Event:
4563 status2 = ( (pfnPackSizeTlvHCI_Flow_Spec_Modify_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flow_Spec_Modify_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4564 if (status2) status |= status2;
4565 break;
4566 case SigPackSizeTlvHCI_Flush_Cmd:
4567 status2 = ( (pfnPackSizeTlvHCI_Flush_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flush_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4568 if (status2) status |= status2;
4569 break;
4570 case SigPackSizeTlvHCI_Flush_Occurred_Event:
4571 status2 = ( (pfnPackSizeTlvHCI_Flush_Occurred_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flush_Occurred_Event* )(pFrm + pTlv->offset), pnNeeded);
4572 if (status2) status |= status2;
4573 break;
4574 case SigPackSizeTlvHCI_Generic_AMP_Link_Key_Notification_Event:
4575 status2 = ( (pfnPackSizeTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event* )(pFrm + pTlv->offset), pnNeeded);
4576 if (status2) status |= status2;
4577 break;
4578 case SigPackSizeTlvHCI_Hardware_Error_Event:
4579 status2 = ( (pfnPackSizeTlvHCI_Hardware_Error_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Hardware_Error_Event* )(pFrm + pTlv->offset), pnNeeded);
4580 if (status2) status |= status2;
4581 break;
4582 case SigPackSizeTlvHCI_Logical_Link_Cancel_Cmd:
4583 status2 = ( (pfnPackSizeTlvHCI_Logical_Link_Cancel_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Logical_Link_Cancel_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4584 if (status2) status |= status2;
4585 break;
4586 case SigPackSizeTlvHCI_Logical_Link_Complete_Event:
4587 status2 = ( (pfnPackSizeTlvHCI_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Logical_Link_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4588 if (status2) status |= status2;
4589 break;
4590 case SigPackSizeTlvHCI_Loopback_Command_Event:
4591 status2 = ( (pfnPackSizeTlvHCI_Loopback_Command_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Loopback_Command_Event* )(pFrm + pTlv->offset), pnNeeded);
4592 if (status2) status |= status2;
4593 break;
4594 case SigPackSizeTlvHCI_Physical_Link_Complete_Event:
4595 status2 = ( (pfnPackSizeTlvHCI_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4596 if (status2) status |= status2;
4597 break;
4598 case SigPackSizeTlvHCI_Physical_Link_Loss_Warning_Event:
4599 status2 = ( (pfnPackSizeTlvHCI_Physical_Link_Loss_Warning_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Loss_Warning_Event* )(pFrm + pTlv->offset), pnNeeded);
4600 if (status2) status |= status2;
4601 break;
4602 case SigPackSizeTlvHCI_Physical_Link_Recovery_Event:
4603 status2 = ( (pfnPackSizeTlvHCI_Physical_Link_Recovery_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Recovery_Event* )(pFrm + pTlv->offset), pnNeeded);
4604 if (status2) status |= status2;
4605 break;
4606 case SigPackSizeTlvHCI_Qos_Violation_Event:
4607 status2 = ( (pfnPackSizeTlvHCI_Qos_Violation_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Qos_Violation_Event* )(pFrm + pTlv->offset), pnNeeded);
4608 if (status2) status |= status2;
4609 break;
4610 case SigPackSizeTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd:
4611 status2 = ( (pfnPackSizeTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4612 if (status2) status |= status2;
4613 break;
4614 case SigPackSizeTlvHCI_Read_Buffer_Size_Cmd:
4615 status2 = ( (pfnPackSizeTlvHCI_Read_Buffer_Size_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Buffer_Size_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4616 if (status2) status |= status2;
4617 break;
4618 case SigPackSizeTlvHCI_Read_Connection_Accept_Timeout_Cmd:
4619 status2 = ( (pfnPackSizeTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4620 if (status2) status |= status2;
4621 break;
4622 case SigPackSizeTlvHCI_Read_Data_Block_Size_Cmd:
4623 status2 = ( (pfnPackSizeTlvHCI_Read_Data_Block_Size_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Data_Block_Size_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4624 if (status2) status |= status2;
4625 break;
4626 case SigPackSizeTlvHCI_Read_Failed_Contact_Counter_Cmd:
4627 status2 = ( (pfnPackSizeTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4628 if (status2) status |= status2;
4629 break;
4630 case SigPackSizeTlvHCI_Read_Flow_Control_Mode_Cmd:
4631 status2 = ( (pfnPackSizeTlvHCI_Read_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Flow_Control_Mode_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4632 if (status2) status |= status2;
4633 break;
4634 case SigPackSizeTlvHCI_Read_Link_Quality_Cmd:
4635 status2 = ( (pfnPackSizeTlvHCI_Read_Link_Quality_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Link_Quality_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4636 if (status2) status |= status2;
4637 break;
4638 case SigPackSizeTlvHCI_Read_Link_Supervision_Timeout_Cmd:
4639 status2 = ( (pfnPackSizeTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4640 if (status2) status |= status2;
4641 break;
4642 case SigPackSizeTlvHCI_Read_Local_AMP_Assoc_Cmd:
4643 status2 = ( (pfnPackSizeTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4644 if (status2) status |= status2;
4645 break;
4646 case SigPackSizeTlvHCI_Read_Local_AMP_Information_Cmd:
4647 status2 = ( (pfnPackSizeTlvHCI_Read_Local_AMP_Information_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_AMP_Information_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4648 if (status2) status |= status2;
4649 break;
4650 case SigPackSizeTlvHCI_Read_Local_Supported_Cmds_Cmd:
4651 status2 = ( (pfnPackSizeTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4652 if (status2) status |= status2;
4653 break;
4654 case SigPackSizeTlvHCI_Read_Local_Version_Info_Cmd:
4655 status2 = ( (pfnPackSizeTlvHCI_Read_Local_Version_Info_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_Version_Info_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4656 if (status2) status |= status2;
4657 break;
4658 case SigPackSizeTlvHCI_Read_Location_Data_Cmd:
4659 status2 = ( (pfnPackSizeTlvHCI_Read_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Location_Data_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4660 if (status2) status |= status2;
4661 break;
4662 case SigPackSizeTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd:
4663 status2 = ( (pfnPackSizeTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4664 if (status2) status |= status2;
4665 break;
4666 case SigPackSizeTlvHCI_Read_Loopback_Mode_Cmd:
4667 status2 = ( (pfnPackSizeTlvHCI_Read_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Loopback_Mode_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4668 if (status2) status |= status2;
4669 break;
4670 case SigPackSizeTlvHCI_Read_RSSI_Cmd:
4671 status2 = ( (pfnPackSizeTlvHCI_Read_RSSI_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_RSSI_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4672 if (status2) status |= status2;
4673 break;
4674 case SigPackSizeTlvHCI_Reset_Cmd:
4675 status2 = ( (pfnPackSizeTlvHCI_Reset_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Reset_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4676 if (status2) status |= status2;
4677 break;
4678 case SigPackSizeTlvHCI_Reset_Failed_Contact_Counter_Cmd:
4679 status2 = ( (pfnPackSizeTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4680 if (status2) status |= status2;
4681 break;
4682 case SigPackSizeTlvHCI_Set_Event_Mask_Cmd:
4683 status2 = ( (pfnPackSizeTlvHCI_Set_Event_Mask_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Event_Mask_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4684 if (status2) status |= status2;
4685 break;
4686 case SigPackSizeTlvHCI_Set_Event_Mask_Page_2_Cmd:
4687 status2 = ( (pfnPackSizeTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4688 if (status2) status |= status2;
4689 break;
4690 case SigPackSizeTlvHCI_Set_Short_Range_Mode_Cmd:
4691 status2 = ( (pfnPackSizeTlvHCI_Set_Short_Range_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Short_Range_Mode_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4692 if (status2) status |= status2;
4693 break;
4694 case SigPackSizeTlvHCI_Short_Range_Mode_Change_Complete_Event:
4695 status2 = ( (pfnPackSizeTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event* )(pFrm + pTlv->offset), pnNeeded);
4696 if (status2) status |= status2;
4697 break;
4698 case SigPackSizeTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd:
4699 status2 = ( (pfnPackSizeTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4700 if (status2) status |= status2;
4701 break;
4702 case SigPackSizeTlvHCI_Write_Connection_Accept_Timeout_Cmd:
4703 status2 = ( (pfnPackSizeTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4704 if (status2) status |= status2;
4705 break;
4706 case SigPackSizeTlvHCI_Write_Flow_Control_Mode_Cmd:
4707 status2 = ( (pfnPackSizeTlvHCI_Write_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Flow_Control_Mode_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4708 if (status2) status |= status2;
4709 break;
4710 case SigPackSizeTlvHCI_Write_Link_Supervision_Timeout_Cmd:
4711 status2 = ( (pfnPackSizeTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4712 if (status2) status |= status2;
4713 break;
4714 case SigPackSizeTlvHCI_Write_Location_Data_Cmd:
4715 status2 = ( (pfnPackSizeTlvHCI_Write_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Location_Data_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4716 if (status2) status |= status2;
4717 break;
4718 case SigPackSizeTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd:
4719 status2 = ( (pfnPackSizeTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4720 if (status2) status |= status2;
4721 break;
4722 case SigPackSizeTlvHCI_Write_Loopback_Mode_Cmd:
4723 status2 = ( (pfnPackSizeTlvHCI_Write_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Loopback_Mode_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4724 if (status2) status |= status2;
4725 break;
4726 case SigPackSizeTlvHCI_Write_Remote_AMP_ASSOC_Cmd:
4727 status2 = ( (pfnPackSizeTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd* )(pFrm + pTlv->offset), pnNeeded);
4728 if (status2) status |= status2;
4729 break;
4730 default:
4731 FRAMES_LOG1(pCtx, FRLOGE, FRFL("INTERNAL ERROR-- I don"
4732 "'t know about the TLV signature %d; this is most l"
4733 "ikely a bug in 'framesc'.\n"), pTlv->sig);
4734 return BTAMP_INTERNAL_ERROR;
4735 }
4736 }
4737 ++pTlv;
4738 }
4739 return status;
4740}
4741v_U32_t btampPackTlvAMP_Assoc_Connected_Channel(void * pCtx,
4742 tBtampTLVAMP_Assoc_Connected_Channel *pSrc,
4743 v_U8_t *pBuf,
4744 v_U32_t nBuf,
4745 v_U32_t *pnConsumed)
4746{
4747 v_U8_t* pTlvLen = 0;
4748 v_U32_t nConsumedOnEntry;
4749 v_U32_t status = BTAMP_PARSE_SUCCESS;
4750 v_U32_t nNeeded = 0U;
4751 v_U32_t sType = 0U;
4752 v_U32_t sLen = 0U;
4753 sType = 1;
4754 sLen = 2;
4755#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4756 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4757 "In btampPackTlvAMP_Assoc_Connected_Channel\n");
4758#endif
4759 // sanity checking
4760 if( pCtx == NULL || pSrc == NULL ||
4761 pBuf == NULL || pnConsumed == NULL)
4762 {
4763 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
4764 return BTAMP_BAD_INPUT_BUFFER;
4765 }
4766
4767 nConsumedOnEntry = *pnConsumed;
4768
4769 status = btampGetPackedTlvAMP_Assoc_Connected_Channel(pCtx, pSrc, &nNeeded);
4770 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
4771 nNeeded += sType + sLen;
4772 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
4773 pTlvLen = pBuf;
4774 while ( pSrc->present )
4775 {
4776 if( sType == 2) frameshtons( pCtx, pBuf, 3, 0);
4777 else *pBuf = 3;
4778 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
4779 pTlvLen = pBuf;
4780 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
4781 BTAMP_MEMCPY(pCtx, pBuf, pSrc->country, 3);
4782 *pnConsumed += 3;
4783 pBuf += 3;
4784 nBuf -= 3;
4785 if ( pSrc->num_triplets ) {
4786 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->triplets ), ( pSrc->num_triplets * 3 ));
4787 *pnConsumed += ( pSrc->num_triplets * 3 );
4788 pBuf += ( ( pSrc->num_triplets * 3 ) );
4789 nBuf -= ( ( pSrc->num_triplets * 3 ) );
4790 }
4791 else break;
4792 break;
4793 }
4794
4795 if (pTlvLen && sLen == 2)
4796 {
4797 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
4798 }
4799 else if(NULL != pTlvLen)
4800 {
4801 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
4802 }
4803 return status;
4804} /* End btampPackTlvAMP_Assoc_Connected_Channel. */
4805
4806typedef v_U32_t (*pfnPackTlvAMP_Assoc_Connected_Channel_t)(void *, tBtampTLVAMP_Assoc_Connected_Channel *, v_U8_t*, v_U32_t, v_U32_t*);
4807#define SigPackTlvAMP_Assoc_Connected_Channel ( 0x007b )
4808
4809v_U32_t btampPackTlvAMP_Assoc_MAC_Addr(void * pCtx,
4810 tBtampTLVAMP_Assoc_MAC_Addr *pSrc,
4811 v_U8_t *pBuf,
4812 v_U32_t nBuf,
4813 v_U32_t *pnConsumed)
4814{
4815 v_U8_t* pTlvLen = 0;
4816 v_U32_t nConsumedOnEntry;
4817 v_U32_t status = BTAMP_PARSE_SUCCESS;
4818 v_U32_t nNeeded = 0U;
4819 v_U32_t sType = 0U;
4820 v_U32_t sLen = 0U;
4821 sType = 1;
4822 sLen = 2;
4823#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4824 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4825 "In btampPackTlvAMP_Assoc_MAC_Addr\n");
4826#endif
4827 // sanity checking
4828 if( pCtx == NULL || pSrc == NULL ||
4829 pBuf == NULL || pnConsumed == NULL)
4830 {
4831 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
4832 return BTAMP_BAD_INPUT_BUFFER;
4833 }
4834
4835 nConsumedOnEntry = *pnConsumed;
4836
4837 status = btampGetPackedTlvAMP_Assoc_MAC_Addr(pCtx, pSrc, &nNeeded);
4838 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
4839 nNeeded += sType + sLen;
4840 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
4841 pTlvLen = pBuf;
4842 while ( pSrc->present )
4843 {
4844 if( sType == 2) frameshtons( pCtx, pBuf, 1, 0);
4845 else *pBuf = 1;
4846 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
4847 pTlvLen = pBuf;
4848 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
4849 BTAMP_MEMCPY(pCtx, pBuf, pSrc->mac_addr, 6);
4850 *pnConsumed += 6;
4851 pBuf += 6;
4852 nBuf -= 6;
4853 break;
4854 }
4855
4856 if (pTlvLen && sLen == 2)
4857 {
4858 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
4859 } else if(NULL != pTlvLen)
4860 {
4861 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
4862 }
4863 return status;
4864} /* End btampPackTlvAMP_Assoc_MAC_Addr. */
4865
4866typedef v_U32_t (*pfnPackTlvAMP_Assoc_MAC_Addr_t)(void *, tBtampTLVAMP_Assoc_MAC_Addr *, v_U8_t*, v_U32_t, v_U32_t*);
4867#define SigPackTlvAMP_Assoc_MAC_Addr ( 0x007c )
4868
4869v_U32_t btampPackTlvAMP_Assoc_PAL_Capabilities(void * pCtx,
4870 tBtampTLVAMP_Assoc_PAL_Capabilities *pSrc,
4871 v_U8_t *pBuf,
4872 v_U32_t nBuf,
4873 v_U32_t *pnConsumed)
4874{
4875 v_U8_t* pTlvLen = 0;
4876 v_U32_t nConsumedOnEntry;
4877 v_U32_t status = BTAMP_PARSE_SUCCESS;
4878 v_U32_t nNeeded = 0U;
4879 v_U32_t sType = 0U;
4880 v_U32_t sLen = 0U;
4881 sType = 1;
4882 sLen = 2;
4883#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4884 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4885 "In btampPackTlvAMP_Assoc_PAL_Capabilities\n");
4886#endif
4887 // sanity checking
4888 if( pCtx == NULL || pSrc == NULL ||
4889 pBuf == NULL || pnConsumed == NULL)
4890 {
4891 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
4892 return BTAMP_BAD_INPUT_BUFFER;
4893 }
4894
4895 nConsumedOnEntry = *pnConsumed;
4896
4897 status = btampGetPackedTlvAMP_Assoc_PAL_Capabilities(pCtx, pSrc, &nNeeded);
4898 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
4899 nNeeded += sType + sLen;
4900 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
4901 pTlvLen = pBuf;
4902 while ( pSrc->present )
4903 {
4904 if( sType == 2) frameshtons( pCtx, pBuf, 4, 0);
4905 else *pBuf = 4;
4906 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
4907 pTlvLen = pBuf;
4908 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
4909 frameshtonl(pCtx, pBuf, pSrc->pal_capabilities, 0);
4910 *pnConsumed += 4;
4911 pBuf += 4;
4912 nBuf -= 4;
4913 break;
4914 }
4915
4916 if (pTlvLen && sLen == 2)
4917 {
4918 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
4919 } else if(NULL != pTlvLen)
4920 {
4921 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
4922 }
4923 return status;
4924} /* End btampPackTlvAMP_Assoc_PAL_Capabilities. */
4925
4926typedef v_U32_t (*pfnPackTlvAMP_Assoc_PAL_Capabilities_t)(void *, tBtampTLVAMP_Assoc_PAL_Capabilities *, v_U8_t*, v_U32_t, v_U32_t*);
4927#define SigPackTlvAMP_Assoc_PAL_Capabilities ( 0x007d )
4928
4929v_U32_t btampPackTlvAMP_Assoc_PAL_Version(void * pCtx,
4930 tBtampTLVAMP_Assoc_PAL_Version *pSrc,
4931 v_U8_t *pBuf,
4932 v_U32_t nBuf,
4933 v_U32_t *pnConsumed)
4934{
4935 v_U8_t* pTlvLen = 0;
4936 v_U32_t nConsumedOnEntry;
4937 v_U32_t status = BTAMP_PARSE_SUCCESS;
4938 v_U32_t nNeeded = 0U;
4939 v_U32_t sType = 0U;
4940 v_U32_t sLen = 0U;
4941 sType = 1;
4942 sLen = 2;
4943#ifdef WLAN_BAPHCI_ENABLE_LOGGING
4944 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
4945 "In btampPackTlvAMP_Assoc_PAL_Version\n");
4946#endif
4947 // sanity checking
4948 if( pCtx == NULL || pSrc == NULL ||
4949 pBuf == NULL || pnConsumed == NULL)
4950 {
4951 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
4952 return BTAMP_BAD_INPUT_BUFFER;
4953 }
4954
4955 nConsumedOnEntry = *pnConsumed;
4956
4957 status = btampGetPackedTlvAMP_Assoc_PAL_Version(pCtx, pSrc, &nNeeded);
4958 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
4959 nNeeded += sType + sLen;
4960 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
4961 pTlvLen = pBuf;
4962 while ( pSrc->present )
4963 {
4964 if( sType == 2) frameshtons( pCtx, pBuf, 5, 0);
4965 else *pBuf = 5;
4966 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
4967 pTlvLen = pBuf;
4968 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
4969 *pBuf = pSrc->pal_version;
4970 *pnConsumed += 1;
4971 pBuf += 1;
4972 nBuf -= 1;
4973 frameshtons(pCtx, pBuf, pSrc->pal_CompanyID, 0);
4974 *pnConsumed += 2;
4975 pBuf += 2;
4976 nBuf -= 2;
4977 frameshtons(pCtx, pBuf, pSrc->pal_subversion, 0);
4978 *pnConsumed += 2;
4979 pBuf += 2;
4980 nBuf -= 2;
4981 break;
4982 }
4983
4984 if (pTlvLen && sLen == 2)
4985 {
4986 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
4987 } else if(NULL != pTlvLen)
4988 {
4989 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
4990 }
4991 return status;
4992} /* End btampPackTlvAMP_Assoc_PAL_Version. */
4993
4994typedef v_U32_t (*pfnPackTlvAMP_Assoc_PAL_Version_t)(void *, tBtampTLVAMP_Assoc_PAL_Version *, v_U8_t*, v_U32_t, v_U32_t*);
4995#define SigPackTlvAMP_Assoc_PAL_Version ( 0x007e )
4996
4997v_U32_t btampPackTlvAMP_Assoc_Preferred_Channel_List(void * pCtx,
4998 tBtampTLVAMP_Assoc_Preferred_Channel_List *pSrc,
4999 v_U8_t *pBuf,
5000 v_U32_t nBuf,
5001 v_U32_t *pnConsumed)
5002{
5003 v_U8_t* pTlvLen = 0;
5004 v_U32_t nConsumedOnEntry;
5005 v_U32_t status = BTAMP_PARSE_SUCCESS;
5006 v_U32_t nNeeded = 0U;
5007 v_U32_t sType = 0U;
5008 v_U32_t sLen = 0U;
5009 sType = 1;
5010 sLen = 2;
5011#ifdef WLAN_BAPHCI_ENABLE_LOGGING
5012 VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,
5013 "In btampPackTlvAMP_Assoc_Preferred_Channel_List\n");
5014#endif
5015 // sanity checking
5016 if( pCtx == NULL || pSrc == NULL ||
5017 pBuf == NULL || pnConsumed == NULL)
5018 {
5019 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5020 return BTAMP_BAD_INPUT_BUFFER;
5021 }
5022
5023 nConsumedOnEntry = *pnConsumed;
5024
5025 status = btampGetPackedTlvAMP_Assoc_Preferred_Channel_List(pCtx, pSrc, &nNeeded);
5026 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5027 nNeeded += sType + sLen;
5028 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5029 pTlvLen = pBuf;
5030 while ( pSrc->present )
5031 {
5032 if( sType == 2) frameshtons( pCtx, pBuf, 2, 0);
5033 else *pBuf = 2;
5034 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5035 pTlvLen = pBuf;
5036 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5037 BTAMP_MEMCPY(pCtx, pBuf, pSrc->country, 3);
5038 *pnConsumed += 3;
5039 pBuf += 3;
5040 nBuf -= 3;
5041 if ( pSrc->num_triplets ) {
5042 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->triplets ), ( pSrc->num_triplets * 3 ));
5043 *pnConsumed += ( pSrc->num_triplets * 3 );
5044 pBuf += ( ( pSrc->num_triplets * 3 ) );
5045 nBuf -= ( ( pSrc->num_triplets * 3 ) );
5046 }
5047 else break;
5048 break;
5049 }
5050
5051 if (pTlvLen && sLen == 2)
5052 {
5053 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5054 } else if(NULL != pTlvLen)
5055 {
5056 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5057 }
5058 return status;
5059} /* End btampPackTlvAMP_Assoc_Preferred_Channel_List. */
5060
5061typedef v_U32_t (*pfnPackTlvAMP_Assoc_Preferred_Channel_List_t)(void *, tBtampTLVAMP_Assoc_Preferred_Channel_List *, v_U8_t*, v_U32_t, v_U32_t*);
5062#define SigPackTlvAMP_Assoc_Preferred_Channel_List ( 0x007f )
5063
5064v_U32_t btampPackTlvFlow_Spec(void * pCtx,
5065 tBtampTLVFlow_Spec *pSrc,
5066 v_U8_t *pBuf,
5067 v_U32_t nBuf,
5068 v_U32_t *pnConsumed)
5069{
5070 v_U8_t* pTlvLen = 0;
5071 v_U32_t nConsumedOnEntry;
5072 v_U32_t status = BTAMP_PARSE_SUCCESS;
5073 v_U32_t nNeeded = 0U;
5074 v_U32_t sType = 0U;
5075 v_U32_t sLen = 0U;
5076 sType = 1;
5077 sLen = 1;
5078 // sanity checking
5079 if( pCtx == NULL || pSrc == NULL ||
5080 pBuf == NULL || pnConsumed == NULL)
5081 {
5082 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5083 return BTAMP_BAD_INPUT_BUFFER;
5084 }
5085
5086 nConsumedOnEntry = *pnConsumed;
5087
5088 status = btampGetPackedTlvFlow_Spec(pCtx, pSrc, &nNeeded);
5089 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5090 nNeeded += sType + sLen;
5091 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5092 pTlvLen = pBuf;
5093 while ( pSrc->present )
5094 {
5095 if( sType == 2) frameshtons( pCtx, pBuf, 6, 0);
5096 else *pBuf = 6;
5097 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5098 pTlvLen = pBuf;
5099 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5100 *pBuf = pSrc->flow_spec_id;
5101 *pnConsumed += 1;
5102 pBuf += 1;
5103 nBuf -= 1;
5104 *pBuf = pSrc->service_type;
5105 *pnConsumed += 1;
5106 pBuf += 1;
5107 nBuf -= 1;
5108 frameshtons(pCtx, pBuf, pSrc->max_sdu, 0);
5109 *pnConsumed += 2;
5110 pBuf += 2;
5111 nBuf -= 2;
5112 frameshtonl(pCtx, pBuf, pSrc->sdu_inter_arrival, 0);
5113 *pnConsumed += 4;
5114 pBuf += 4;
5115 nBuf -= 4;
5116 frameshtonl(pCtx, pBuf, pSrc->access_latency, 0);
5117 *pnConsumed += 4;
5118 pBuf += 4;
5119 nBuf -= 4;
5120 frameshtonl(pCtx, pBuf, pSrc->flush_timeout, 0);
5121 *pnConsumed += 4;
5122 pBuf += 4;
5123 nBuf -= 4;
5124 break;
5125 }
5126
5127 if (pTlvLen && sLen == 2)
5128 {
5129 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5130 } else if(NULL != pTlvLen)
5131 {
5132 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5133 }
5134 return status;
5135} /* End btampPackTlvFlow_Spec. */
5136
5137typedef v_U32_t (*pfnPackTlvFlow_Spec_t)(void *, tBtampTLVFlow_Spec *, v_U8_t*, v_U32_t, v_U32_t*);
5138#define SigPackTlvFlow_Spec ( 0x0080 )
5139
5140v_U32_t btampPackTlvHCI_Accept_Logical_Link_Cmd(void * pCtx,
5141 tBtampTLVHCI_Accept_Logical_Link_Cmd *pSrc,
5142 v_U8_t *pBuf,
5143 v_U32_t nBuf,
5144 v_U32_t *pnConsumed)
5145{
5146 v_U8_t* pTlvLen = 0;
5147 v_U32_t nConsumedOnEntry;
5148 v_U32_t status = BTAMP_PARSE_SUCCESS;
5149 v_U32_t nNeeded = 0U;
5150 v_U32_t sType = 0U;
5151 v_U32_t sLen = 0U;
5152 sType = 2;
5153 sLen = 1;
5154 // sanity checking
5155 if( pCtx == NULL || pSrc == NULL ||
5156 pBuf == NULL || pnConsumed == NULL)
5157 {
5158 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5159 return BTAMP_BAD_INPUT_BUFFER;
5160 }
5161
5162 nConsumedOnEntry = *pnConsumed;
5163
5164 status = btampGetPackedTlvHCI_Accept_Logical_Link_Cmd(pCtx, pSrc, &nNeeded);
5165 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5166 nNeeded += sType + sLen;
5167 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5168 pTlvLen = pBuf;
5169 while ( pSrc->present )
5170 {
5171 if( sType == 2) frameshtons( pCtx, pBuf, 1081, 0);
5172 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5173 pTlvLen = pBuf;
5174 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5175 *pBuf = pSrc->phy_link_handle;
5176 *pnConsumed += 1;
5177 pBuf += 1;
5178 nBuf -= 1;
5179 BTAMP_MEMCPY(pCtx, pBuf, pSrc->tx_flow_spec, 18);
5180 *pnConsumed += 18;
5181 pBuf += 18;
5182 nBuf -= 18;
5183 BTAMP_MEMCPY(pCtx, pBuf, pSrc->rx_flow_spec, 18);
5184 *pnConsumed += 18;
5185 pBuf += 18;
5186 nBuf -= 18;
5187 break;
5188 }
5189
5190 if (pTlvLen && sLen == 2)
5191 {
5192 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5193 } else if(NULL != pTlvLen)
5194 {
5195 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5196 }
5197 return status;
5198} /* End btampPackTlvHCI_Accept_Logical_Link_Cmd. */
5199
5200typedef v_U32_t (*pfnPackTlvHCI_Accept_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Accept_Logical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
5201#define SigPackTlvHCI_Accept_Logical_Link_Cmd ( 0x0081 )
5202
5203v_U32_t btampPackTlvHCI_Accept_Physical_Link_Cmd(void * pCtx,
5204 tBtampTLVHCI_Accept_Physical_Link_Cmd *pSrc,
5205 v_U8_t *pBuf,
5206 v_U32_t nBuf,
5207 v_U32_t *pnConsumed)
5208{
5209 v_U8_t* pTlvLen = 0;
5210 v_U32_t nConsumedOnEntry;
5211 v_U32_t status = BTAMP_PARSE_SUCCESS;
5212 v_U32_t nNeeded = 0U;
5213 v_U32_t sType = 0U;
5214 v_U32_t sLen = 0U;
5215 sType = 2;
5216 sLen = 1;
5217 // sanity checking
5218 if( pCtx == NULL || pSrc == NULL ||
5219 pBuf == NULL || pnConsumed == NULL)
5220 {
5221 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5222 return BTAMP_BAD_INPUT_BUFFER;
5223 }
5224
5225 nConsumedOnEntry = *pnConsumed;
5226
5227 status = btampGetPackedTlvHCI_Accept_Physical_Link_Cmd(pCtx, pSrc, &nNeeded);
5228 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5229 nNeeded += sType + sLen;
5230 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5231 pTlvLen = pBuf;
5232 while ( pSrc->present )
5233 {
5234 if( sType == 2) frameshtons( pCtx, pBuf, 1078, 0);
5235 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5236 pTlvLen = pBuf;
5237 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5238 *pBuf = pSrc->phy_link_handle;
5239 *pnConsumed += 1;
5240 pBuf += 1;
5241 nBuf -= 1;
5242 *pBuf = pSrc->key_length;
5243 *pnConsumed += 1;
5244 pBuf += 1;
5245 nBuf -= 1;
5246 *pBuf = pSrc->key_type;
5247 *pnConsumed += 1;
5248 pBuf += 1;
5249 nBuf -= 1;
5250 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->key_material ), pSrc->key_length);
5251 *pnConsumed += pSrc->key_length;
5252 pBuf += ( pSrc->key_length );
5253 nBuf -= ( pSrc->key_length );
5254 break;
5255 }
5256
5257 if (pTlvLen && sLen == 2)
5258 {
5259 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5260 } else if(NULL != pTlvLen)
5261 {
5262 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5263 }
5264 return status;
5265} /* End btampPackTlvHCI_Accept_Physical_Link_Cmd. */
5266
5267typedef v_U32_t (*pfnPackTlvHCI_Accept_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Accept_Physical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
5268#define SigPackTlvHCI_Accept_Physical_Link_Cmd ( 0x0082 )
5269
5270v_U32_t btampPackTlvHCI_Channel_Selected_Event(void * pCtx,
5271 tBtampTLVHCI_Channel_Selected_Event *pSrc,
5272 v_U8_t *pBuf,
5273 v_U32_t nBuf,
5274 v_U32_t *pnConsumed)
5275{
5276 v_U8_t* pTlvLen = 0;
5277 v_U32_t nConsumedOnEntry;
5278 v_U32_t status = BTAMP_PARSE_SUCCESS;
5279 v_U32_t nNeeded = 0U;
5280 v_U32_t sType = 0U;
5281 v_U32_t sLen = 0U;
5282 sType = 1;
5283 sLen = 1;
5284 // sanity checking
5285 if( pCtx == NULL || pSrc == NULL ||
5286 pBuf == NULL || pnConsumed == NULL)
5287 {
5288 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5289 return BTAMP_BAD_INPUT_BUFFER;
5290 }
5291 nConsumedOnEntry = *pnConsumed;
5292
5293 status = btampGetPackedTlvHCI_Channel_Selected_Event(pCtx, pSrc, &nNeeded);
5294 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5295 nNeeded += sType + sLen;
5296 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5297 pTlvLen = pBuf;
5298 while ( pSrc->present )
5299 {
5300 if( sType == 2) frameshtons( pCtx, pBuf, 65, 0);
5301 else *pBuf = 65;
5302 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5303 pTlvLen = pBuf;
5304 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5305 *pBuf = pSrc->phy_link_handle;
5306 *pnConsumed += 1;
5307 pBuf += 1;
5308 nBuf -= 1;
5309 break;
5310 }
5311
5312 if (pTlvLen && sLen == 2)
5313 {
5314 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5315 } else if(NULL != pTlvLen)
5316 {
5317 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5318 }
5319 return status;
5320} /* End btampPackTlvHCI_Channel_Selected_Event. */
5321
5322typedef v_U32_t (*pfnPackTlvHCI_Channel_Selected_Event_t)(void *, tBtampTLVHCI_Channel_Selected_Event *, v_U8_t*, v_U32_t, v_U32_t*);
5323#define SigPackTlvHCI_Channel_Selected_Event ( 0x0083 )
5324
5325v_U32_t btampPackTlvHCI_Command_Complete_Event(void * pCtx,
5326 tBtampTLVHCI_Command_Complete_Event *pSrc,
5327 v_U8_t *pBuf,
5328 v_U32_t nBuf,
5329 v_U32_t *pnConsumed)
5330{
5331 v_U8_t* pTlvLen = 0;
5332 v_U32_t nConsumedOnEntry;
5333 v_U32_t status = BTAMP_PARSE_SUCCESS;
5334 v_U32_t nNeeded = 0U;
5335 v_U32_t sType = 0U;
5336 v_U32_t sLen = 0U;
5337 sType = 1;
5338 sLen = 1;
5339 // sanity checking
5340 if( pCtx == NULL || pSrc == NULL ||
5341 pBuf == NULL || pnConsumed == NULL)
5342 {
5343 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5344 return BTAMP_BAD_INPUT_BUFFER;
5345 }
5346
5347 nConsumedOnEntry = *pnConsumed;
5348
5349 status = btampGetPackedTlvHCI_Command_Complete_Event(pCtx, pSrc, &nNeeded);
5350 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5351 nNeeded += sType + sLen;
5352 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5353 pTlvLen = pBuf;
5354 while ( pSrc->present )
5355 {
5356 if( sType == 2) frameshtons( pCtx, pBuf, 14, 0);
5357 else *pBuf = 14;
5358 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5359 pTlvLen = pBuf;
5360 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5361 *pBuf = pSrc->num_hci_command_packets;
5362 *pnConsumed += 1;
5363 pBuf += 1;
5364 nBuf -= 1;
5365 frameshtons(pCtx, pBuf, pSrc->command_opcode, 0);
5366 *pnConsumed += 2;
5367 pBuf += 2;
5368 nBuf -= 2;
5369 switch (pSrc->command_opcode)
5370 {
5371 case 3075:
5372 *pBuf = pSrc->cc_event.Reset.status;
5373 *pnConsumed += 1;
5374 pBuf += 1;
5375 nBuf -= 1;
5376 break;
5377 case 3080:
5378 *pBuf = pSrc->cc_event.Flush.status;
5379 *pnConsumed += 1;
5380 pBuf += 1;
5381 nBuf -= 1;
5382 frameshtons(pCtx, pBuf, pSrc->cc_event.Flush.log_link_handle, 0);
5383 *pnConsumed += 2;
5384 pBuf += 2;
5385 nBuf -= 2;
5386 break;
5387 case 1083:
5388 *pBuf = pSrc->cc_event.Logical_Link_Cancel.status;
5389 *pnConsumed += 1;
5390 pBuf += 1;
5391 nBuf -= 1;
5392 *pBuf = pSrc->cc_event.Logical_Link_Cancel.phy_link_handle;
5393 *pnConsumed += 1;
5394 pBuf += 1;
5395 nBuf -= 1;
5396 *pBuf = pSrc->cc_event.Logical_Link_Cancel.tx_flow_spec_id;
5397 *pnConsumed += 1;
5398 pBuf += 1;
5399 nBuf -= 1;
5400 break;
5401 case 3077:
5402 *pBuf = pSrc->cc_event.Set_Event_Mask.status;
5403 *pnConsumed += 1;
5404 pBuf += 1;
5405 nBuf -= 1;
5406 break;
5407 case 3093:
5408 *pBuf = pSrc->cc_event.Read_Connection_Accept_TO.status;
5409 *pnConsumed += 1;
5410 pBuf += 1;
5411 nBuf -= 1;
5412 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Connection_Accept_TO.connection_accept_timeout, 0);
5413 *pnConsumed += 2;
5414 pBuf += 2;
5415 nBuf -= 2;
5416 break;
5417 case 3094:
5418 *pBuf = pSrc->cc_event.Write_Connection_Accept_TO.status;
5419 *pnConsumed += 1;
5420 pBuf += 1;
5421 nBuf -= 1;
5422 break;
5423 case 3126:
5424 *pBuf = pSrc->cc_event.Read_Link_Supervision_TO.status;
5425 *pnConsumed += 1;
5426 pBuf += 1;
5427 nBuf -= 1;
5428 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Link_Supervision_TO.log_link_handle, 0);
5429 *pnConsumed += 2;
5430 pBuf += 2;
5431 nBuf -= 2;
5432 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Link_Supervision_TO.link_supervision_timeout, 0);
5433 *pnConsumed += 2;
5434 pBuf += 2;
5435 nBuf -= 2;
5436 break;
5437 case 3127:
5438 *pBuf = pSrc->cc_event.Write_Link_Supervision_TO.status;
5439 *pnConsumed += 1;
5440 pBuf += 1;
5441 nBuf -= 1;
5442 frameshtons(pCtx, pBuf, pSrc->cc_event.Write_Link_Supervision_TO.log_link_handle, 0);
5443 *pnConsumed += 2;
5444 pBuf += 2;
5445 nBuf -= 2;
5446 break;
5447 case 3169:
5448 *pBuf = pSrc->cc_event.Read_Logical_Link_Accept_TO.status;
5449 *pnConsumed += 1;
5450 pBuf += 1;
5451 nBuf -= 1;
5452 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Logical_Link_Accept_TO.logical_link_accept_timeout, 0);
5453 *pnConsumed += 2;
5454 pBuf += 2;
5455 nBuf -= 2;
5456 break;
5457 case 3170:
5458 *pBuf = pSrc->cc_event.Write_Logical_Link_Accept_TO.status;
5459 *pnConsumed += 1;
5460 pBuf += 1;
5461 nBuf -= 1;
5462 break;
5463 case 3171:
5464 *pBuf = pSrc->cc_event.Set_Event_Mask_Page_2.status;
5465 *pnConsumed += 1;
5466 pBuf += 1;
5467 nBuf -= 1;
5468 break;
5469 case 3172:
5470 *pBuf = pSrc->cc_event.Read_Location_Data.status;
5471 *pnConsumed += 1;
5472 pBuf += 1;
5473 nBuf -= 1;
5474 *pBuf = pSrc->cc_event.Read_Location_Data.loc_domain_aware;
5475 *pnConsumed += 1;
5476 pBuf += 1;
5477 nBuf -= 1;
5478 BTAMP_MEMCPY(pCtx, pBuf, pSrc->cc_event.Read_Location_Data.loc_domain, 3);
5479 *pnConsumed += 3;
5480 pBuf += 3;
5481 nBuf -= 3;
5482 *pBuf = pSrc->cc_event.Read_Location_Data.loc_options;
5483 *pnConsumed += 1;
5484 pBuf += 1;
5485 nBuf -= 1;
5486 break;
5487 case 3173:
5488 *pBuf = pSrc->cc_event.Write_Location_Data.status;
5489 *pnConsumed += 1;
5490 pBuf += 1;
5491 nBuf -= 1;
5492 break;
5493 case 3174:
5494 *pBuf = pSrc->cc_event.Read_Flow_Control_Mode.status;
5495 *pnConsumed += 1;
5496 pBuf += 1;
5497 nBuf -= 1;
5498 *pBuf = pSrc->cc_event.Read_Flow_Control_Mode.flow_control_mode;
5499 *pnConsumed += 1;
5500 pBuf += 1;
5501 nBuf -= 1;
5502 break;
5503 case 3175:
5504 *pBuf = pSrc->cc_event.Write_Flow_Control_Mode.status;
5505 *pnConsumed += 1;
5506 pBuf += 1;
5507 nBuf -= 1;
5508 break;
5509 case 3177:
5510 *pBuf = pSrc->cc_event.Read_BE_Flush_TO.status;
5511 *pnConsumed += 1;
5512 pBuf += 1;
5513 nBuf -= 1;
5514 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_BE_Flush_TO.best_effort_flush_timeout, 0);
5515 *pnConsumed += 4;
5516 pBuf += 4;
5517 nBuf -= 4;
5518 break;
5519 case 3178:
5520 *pBuf = pSrc->cc_event.Write_BE_Flush_TO.status;
5521 *pnConsumed += 1;
5522 pBuf += 1;
5523 nBuf -= 1;
5524 break;
5525 case 3179:
5526 *pBuf = pSrc->cc_event.Set_Short_Range_Mode.status;
5527 *pnConsumed += 1;
5528 pBuf += 1;
5529 nBuf -= 1;
5530 break;
5531 case 4097:
5532 *pBuf = pSrc->cc_event.Read_Local_Version_Info.status;
5533 *pnConsumed += 1;
5534 pBuf += 1;
5535 nBuf -= 1;
5536 *pBuf = pSrc->cc_event.Read_Local_Version_Info.HC_HCI_Version;
5537 *pnConsumed += 1;
5538 pBuf += 1;
5539 nBuf -= 1;
5540 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Local_Version_Info.HC_HCI_Revision, 0);
5541 *pnConsumed += 2;
5542 pBuf += 2;
5543 nBuf -= 2;
5544 *pBuf = pSrc->cc_event.Read_Local_Version_Info.HC_PAL_Version;
5545 *pnConsumed += 1;
5546 pBuf += 1;
5547 nBuf -= 1;
5548 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Local_Version_Info.HC_Manufac_Name, 0);
5549 *pnConsumed += 2;
5550 pBuf += 2;
5551 nBuf -= 2;
5552 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Local_Version_Info.HC_PAL_Sub_Version, 0);
5553 *pnConsumed += 2;
5554 pBuf += 2;
5555 nBuf -= 2;
5556 break;
5557 case 4098:
5558 *pBuf = pSrc->cc_event.Read_Local_Supported_Cmds.status;
5559 *pnConsumed += 1;
5560 pBuf += 1;
5561 nBuf -= 1;
5562 BTAMP_MEMCPY(pCtx, pBuf, pSrc->cc_event.Read_Local_Supported_Cmds.HC_Support_Cmds, 64);
5563 *pnConsumed += 64;
5564 pBuf += 64;
5565 nBuf -= 64;
5566 break;
5567 case 4101:
5568 *pBuf = pSrc->cc_event.Read_Buffer_Size.status;
5569 *pnConsumed += 1;
5570 pBuf += 1;
5571 nBuf -= 1;
5572 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Buffer_Size.HC_ACL_Data_Packet_Length, 0);
5573 *pnConsumed += 2;
5574 pBuf += 2;
5575 nBuf -= 2;
5576 *pBuf = pSrc->cc_event.Read_Buffer_Size.HC_SCO_Packet_Length;
5577 *pnConsumed += 1;
5578 pBuf += 1;
5579 nBuf -= 1;
5580 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Buffer_Size.HC_Total_Num_ACL_Packets, 0);
5581 *pnConsumed += 2;
5582 pBuf += 2;
5583 nBuf -= 2;
5584 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Buffer_Size.HC_Total_Num_SCO_Packets, 0);
5585 *pnConsumed += 2;
5586 pBuf += 2;
5587 nBuf -= 2;
5588 break;
5589 case 4106:
5590 *pBuf = pSrc->cc_event.Read_Data_Block_Size.status;
5591 *pnConsumed += 1;
5592 pBuf += 1;
5593 nBuf -= 1;
5594 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Data_Block_Size.HC_Max_ACL_Data_Packet_Length, 0);
5595 *pnConsumed += 2;
5596 pBuf += 2;
5597 nBuf -= 2;
5598 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Data_Block_Size.HC_Data_Block_Length, 0);
5599 *pnConsumed += 2;
5600 pBuf += 2;
5601 nBuf -= 2;
5602 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Data_Block_Size.HC_Total_Num_Data_Blocks, 0);
5603 *pnConsumed += 2;
5604 pBuf += 2;
5605 nBuf -= 2;
5606 break;
5607 case 5121:
5608 *pBuf = pSrc->cc_event.Read_Failed_Contact_Counter.status;
5609 *pnConsumed += 1;
5610 pBuf += 1;
5611 nBuf -= 1;
5612 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Failed_Contact_Counter.log_link_handle, 0);
5613 *pnConsumed += 2;
5614 pBuf += 2;
5615 nBuf -= 2;
5616 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Failed_Contact_Counter.failed_contact_counter, 0);
5617 *pnConsumed += 2;
5618 pBuf += 2;
5619 nBuf -= 2;
5620 break;
5621 case 5122:
5622 *pBuf = pSrc->cc_event.Reset_Failed_Contact_Counter.status;
5623 *pnConsumed += 1;
5624 pBuf += 1;
5625 nBuf -= 1;
5626 frameshtons(pCtx, pBuf, pSrc->cc_event.Reset_Failed_Contact_Counter.log_link_handle, 0);
5627 *pnConsumed += 2;
5628 pBuf += 2;
5629 nBuf -= 2;
5630 break;
5631 case 5123:
5632 *pBuf = pSrc->cc_event.Read_Link_Quality.status;
5633 *pnConsumed += 1;
5634 pBuf += 1;
5635 nBuf -= 1;
5636 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Link_Quality.log_link_handle, 0);
5637 *pnConsumed += 2;
5638 pBuf += 2;
5639 nBuf -= 2;
5640 *pBuf = pSrc->cc_event.Read_Link_Quality.link_quality;
5641 *pnConsumed += 1;
5642 pBuf += 1;
5643 nBuf -= 1;
5644 break;
5645 case 5125:
5646 *pBuf = pSrc->cc_event.Read_RSSI.status;
5647 *pnConsumed += 1;
5648 pBuf += 1;
5649 nBuf -= 1;
5650 *pBuf = pSrc->cc_event.Read_RSSI.phy_link_handle;
5651 *pnConsumed += 1;
5652 pBuf += 1;
5653 nBuf -= 1;
5654 *pBuf = pSrc->cc_event.Read_RSSI.rssi;
5655 *pnConsumed += 1;
5656 pBuf += 1;
5657 nBuf -= 1;
5658 break;
5659 case 5129:
5660 *pBuf = pSrc->cc_event.Read_Local_AMP_Info.status;
5661 *pnConsumed += 1;
5662 pBuf += 1;
5663 nBuf -= 1;
5664 *pBuf = pSrc->cc_event.Read_Local_AMP_Info.HC_AMP_Status;
5665 *pnConsumed += 1;
5666 pBuf += 1;
5667 nBuf -= 1;
5668 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_Total_BW, 0);
5669 *pnConsumed += 4;
5670 pBuf += 4;
5671 nBuf -= 4;
5672 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_Max_Guaranteed_BW, 0);
5673 *pnConsumed += 4;
5674 pBuf += 4;
5675 nBuf -= 4;
5676 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_Min_Latency, 0);
5677 *pnConsumed += 4;
5678 pBuf += 4;
5679 nBuf -= 4;
5680 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_Max_PDU_Size, 0);
5681 *pnConsumed += 4;
5682 pBuf += 4;
5683 nBuf -= 4;
5684 *pBuf = pSrc->cc_event.Read_Local_AMP_Info.HC_Controller_Type;
5685 *pnConsumed += 1;
5686 pBuf += 1;
5687 nBuf -= 1;
5688 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_PAL_Capabilities, 0);
5689 *pnConsumed += 2;
5690 pBuf += 2;
5691 nBuf -= 2;
5692 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_AMP_Assoc_Length, 0);
5693 *pnConsumed += 2;
5694 pBuf += 2;
5695 nBuf -= 2;
5696 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_Max_Flush_Timeout, 0);
5697 *pnConsumed += 4;
5698 pBuf += 4;
5699 nBuf -= 4;
5700 frameshtonl(pCtx, pBuf, pSrc->cc_event.Read_Local_AMP_Info.HC_BE_Flush_Timeout, 0);
5701 *pnConsumed += 4;
5702 pBuf += 4;
5703 nBuf -= 4;
5704 break;
5705 case 5130:
5706 *pBuf = pSrc->cc_event.Read_Read_Local_AMP_Assoc.status;
5707 *pnConsumed += 1;
5708 pBuf += 1;
5709 nBuf -= 1;
5710 *pBuf = pSrc->cc_event.Read_Read_Local_AMP_Assoc.phy_link_handle;
5711 *pnConsumed += 1;
5712 pBuf += 1;
5713 nBuf -= 1;
5714 frameshtons(pCtx, pBuf, pSrc->cc_event.Read_Read_Local_AMP_Assoc.remaining_length, 0);
5715 *pnConsumed += 2;
5716 pBuf += 2;
5717 nBuf -= 2;
5718 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->cc_event.Read_Read_Local_AMP_Assoc.AMP_assoc_fragment ), pSrc->cc_event.Read_Read_Local_AMP_Assoc.remaining_length);
5719 *pnConsumed += pSrc->cc_event.Read_Read_Local_AMP_Assoc.remaining_length;
5720 pBuf += ( pSrc->cc_event.Read_Read_Local_AMP_Assoc.remaining_length );
5721 nBuf -= ( pSrc->cc_event.Read_Read_Local_AMP_Assoc.remaining_length );
5722 break;
5723 case 5131:
5724 *pBuf = pSrc->cc_event.Write_Remote_AMP_Assoc.status;
5725 *pnConsumed += 1;
5726 pBuf += 1;
5727 nBuf -= 1;
5728 *pBuf = pSrc->cc_event.Write_Remote_AMP_Assoc.phy_link_handle;
5729 *pnConsumed += 1;
5730 pBuf += 1;
5731 nBuf -= 1;
5732 break;
5733 case 6145:
5734 *pBuf = pSrc->cc_event.Read_Loopback_Mode.status;
5735 *pnConsumed += 1;
5736 pBuf += 1;
5737 nBuf -= 1;
5738 *pBuf = pSrc->cc_event.Read_Loopback_Mode.loopback_mode;
5739 *pnConsumed += 1;
5740 pBuf += 1;
5741 nBuf -= 1;
5742 break;
5743 case 6146:
5744 *pBuf = pSrc->cc_event.Write_Loopback_Mode.status;
5745 *pnConsumed += 1;
5746 pBuf += 1;
5747 nBuf -= 1;
5748 break;
5749 }
5750 break;
5751 }
5752
5753 if (pTlvLen && sLen == 2)
5754 {
5755 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5756 } else if(NULL != pTlvLen)
5757 {
5758 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5759 }
5760 return status;
5761} /* End btampPackTlvHCI_Command_Complete_Event. */
5762
5763typedef v_U32_t (*pfnPackTlvHCI_Command_Complete_Event_t)(void *, tBtampTLVHCI_Command_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
5764#define SigPackTlvHCI_Command_Complete_Event ( 0x0084 )
5765
5766v_U32_t btampPackTlvHCI_Command_Status_Event(void * pCtx,
5767 tBtampTLVHCI_Command_Status_Event *pSrc,
5768 v_U8_t *pBuf,
5769 v_U32_t nBuf,
5770 v_U32_t *pnConsumed)
5771{
5772 v_U8_t* pTlvLen = 0;
5773 v_U32_t nConsumedOnEntry;
5774 v_U32_t status = BTAMP_PARSE_SUCCESS;
5775 v_U32_t nNeeded = 0U;
5776 v_U32_t sType = 0U;
5777 v_U32_t sLen = 0U;
5778 sType = 1;
5779 sLen = 1;
5780 // sanity checking
5781 if( pCtx == NULL || pSrc == NULL ||
5782 pBuf == NULL || pnConsumed == NULL)
5783 {
5784 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5785 return BTAMP_BAD_INPUT_BUFFER;
5786 }
5787 nConsumedOnEntry = *pnConsumed;
5788
5789 status = btampGetPackedTlvHCI_Command_Status_Event(pCtx, pSrc, &nNeeded);
5790 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5791 nNeeded += sType + sLen;
5792 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5793 pTlvLen = pBuf;
5794 while ( pSrc->present )
5795 {
5796 if( sType == 2) frameshtons( pCtx, pBuf, 15, 0);
5797 else *pBuf = 15;
5798 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5799 pTlvLen = pBuf;
5800 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5801 *pBuf = pSrc->status;
5802 *pnConsumed += 1;
5803 pBuf += 1;
5804 nBuf -= 1;
5805 *pBuf = pSrc->num_hci_command_packets;
5806 *pnConsumed += 1;
5807 pBuf += 1;
5808 nBuf -= 1;
5809 frameshtons(pCtx, pBuf, pSrc->command_opcode, 0);
5810 *pnConsumed += 2;
5811 pBuf += 2;
5812 nBuf -= 2;
5813 break;
5814 }
5815
5816 if (pTlvLen && sLen == 2)
5817 {
5818 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5819 } else if(NULL != pTlvLen)
5820 {
5821 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5822 }
5823 return status;
5824} /* End btampPackTlvHCI_Command_Status_Event. */
5825
5826typedef v_U32_t (*pfnPackTlvHCI_Command_Status_Event_t)(void *, tBtampTLVHCI_Command_Status_Event *, v_U8_t*, v_U32_t, v_U32_t*);
5827#define SigPackTlvHCI_Command_Status_Event ( 0x0085 )
5828
5829v_U32_t btampPackTlvHCI_Create_Logical_Link_Cmd(void * pCtx,
5830 tBtampTLVHCI_Create_Logical_Link_Cmd *pSrc,
5831 v_U8_t *pBuf,
5832 v_U32_t nBuf,
5833 v_U32_t *pnConsumed)
5834{
5835 v_U8_t* pTlvLen = 0;
5836 v_U32_t nConsumedOnEntry;
5837 v_U32_t status = BTAMP_PARSE_SUCCESS;
5838 v_U32_t nNeeded = 0U;
5839 v_U32_t sType = 0U;
5840 v_U32_t sLen = 0U;
5841 sType = 2;
5842 sLen = 1;
5843 // sanity checking
5844 if( pCtx == NULL || pSrc == NULL ||
5845 pBuf == NULL || pnConsumed == NULL)
5846 {
5847 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5848 return BTAMP_BAD_INPUT_BUFFER;
5849 }
5850
5851 nConsumedOnEntry = *pnConsumed;
5852 status = btampGetPackedTlvHCI_Create_Logical_Link_Cmd(pCtx, pSrc, &nNeeded);
5853 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5854 nNeeded += sType + sLen;
5855 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5856 pTlvLen = pBuf;
5857 while ( pSrc->present )
5858 {
5859 if( sType == 2) frameshtons( pCtx, pBuf, 1080, 0);
5860 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5861 pTlvLen = pBuf;
5862 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5863 *pBuf = pSrc->phy_link_handle;
5864 *pnConsumed += 1;
5865 pBuf += 1;
5866 nBuf -= 1;
5867 BTAMP_MEMCPY(pCtx, pBuf, pSrc->tx_flow_spec, 18);
5868 *pnConsumed += 18;
5869 pBuf += 18;
5870 nBuf -= 18;
5871 BTAMP_MEMCPY(pCtx, pBuf, pSrc->rx_flow_spec, 18);
5872 *pnConsumed += 18;
5873 pBuf += 18;
5874 nBuf -= 18;
5875 break;
5876 }
5877
5878 if (pTlvLen && sLen == 2)
5879 {
5880 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5881 } else if(NULL != pTlvLen)
5882 {
5883 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5884 }
5885 return status;
5886} /* End btampPackTlvHCI_Create_Logical_Link_Cmd. */
5887
5888typedef v_U32_t (*pfnPackTlvHCI_Create_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Create_Logical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
5889#define SigPackTlvHCI_Create_Logical_Link_Cmd ( 0x0086 )
5890
5891v_U32_t btampPackTlvHCI_Create_Physical_Link_Cmd(void * pCtx,
5892 tBtampTLVHCI_Create_Physical_Link_Cmd *pSrc,
5893 v_U8_t *pBuf,
5894 v_U32_t nBuf,
5895 v_U32_t *pnConsumed)
5896{
5897 v_U8_t* pTlvLen = 0;
5898 v_U32_t nConsumedOnEntry;
5899 v_U32_t status = BTAMP_PARSE_SUCCESS;
5900 v_U32_t nNeeded = 0U;
5901 v_U32_t sType = 0U;
5902 v_U32_t sLen = 0U;
5903 sType = 2;
5904 sLen = 1;
5905 // sanity checking
5906 if( pCtx == NULL || pSrc == NULL ||
5907 pBuf == NULL || pnConsumed == NULL)
5908 {
5909 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5910 return BTAMP_BAD_INPUT_BUFFER;
5911 }
5912 nConsumedOnEntry = *pnConsumed;
5913
5914 status = btampGetPackedTlvHCI_Create_Physical_Link_Cmd(pCtx, pSrc, &nNeeded);
5915 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5916 nNeeded += sType + sLen;
5917 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5918 pTlvLen = pBuf;
5919 while ( pSrc->present )
5920 {
5921 if( sType == 2) frameshtons( pCtx, pBuf, 1077, 0);
5922 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5923 pTlvLen = pBuf;
5924 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5925 *pBuf = pSrc->phy_link_handle;
5926 *pnConsumed += 1;
5927 pBuf += 1;
5928 nBuf -= 1;
5929 *pBuf = pSrc->key_length;
5930 *pnConsumed += 1;
5931 pBuf += 1;
5932 nBuf -= 1;
5933 *pBuf = pSrc->key_type;
5934 *pnConsumed += 1;
5935 pBuf += 1;
5936 nBuf -= 1;
5937 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->key_material ), pSrc->key_length);
5938 *pnConsumed += pSrc->key_length;
5939 pBuf += ( pSrc->key_length );
5940 nBuf -= ( pSrc->key_length );
5941 break;
5942 }
5943
5944 if (pTlvLen && sLen == 2)
5945 {
5946 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
5947 } else if(NULL != pTlvLen)
5948 {
5949 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
5950 }
5951 return status;
5952} /* End btampPackTlvHCI_Create_Physical_Link_Cmd. */
5953
5954typedef v_U32_t (*pfnPackTlvHCI_Create_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Create_Physical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
5955#define SigPackTlvHCI_Create_Physical_Link_Cmd ( 0x0087 )
5956
5957v_U32_t btampPackTlvHCI_Data_Buffer_Overflow_Event(void * pCtx,
5958 tBtampTLVHCI_Data_Buffer_Overflow_Event *pSrc,
5959 v_U8_t *pBuf,
5960 v_U32_t nBuf,
5961 v_U32_t *pnConsumed)
5962{
5963 v_U8_t* pTlvLen = 0;
5964 v_U32_t nConsumedOnEntry;
5965 v_U32_t status = BTAMP_PARSE_SUCCESS;
5966 v_U32_t nNeeded = 0U;
5967 v_U32_t sType = 0U;
5968 v_U32_t sLen = 0U;
5969 sType = 1;
5970 sLen = 1;
5971 // sanity checking
5972 if( pCtx == NULL || pSrc == NULL ||
5973 pBuf == NULL || pnConsumed == NULL)
5974 {
5975 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
5976 return BTAMP_BAD_INPUT_BUFFER;
5977 }
5978 nConsumedOnEntry = *pnConsumed;
5979
5980 status = btampGetPackedTlvHCI_Data_Buffer_Overflow_Event(pCtx, pSrc, &nNeeded);
5981 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
5982 nNeeded += sType + sLen;
5983 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
5984 pTlvLen = pBuf;
5985 while ( pSrc->present )
5986 {
5987 if( sType == 2) frameshtons( pCtx, pBuf, 26, 0);
5988 else *pBuf = 26;
5989 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
5990 pTlvLen = pBuf;
5991 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
5992 *pBuf = pSrc->link_type;
5993 *pnConsumed += 1;
5994 pBuf += 1;
5995 nBuf -= 1;
5996 break;
5997 }
5998
5999 if (pTlvLen && sLen == 2)
6000 {
6001 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6002 } else if(NULL != pTlvLen)
6003 {
6004 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6005 }
6006 return status;
6007} /* End btampPackTlvHCI_Data_Buffer_Overflow_Event. */
6008
6009typedef v_U32_t (*pfnPackTlvHCI_Data_Buffer_Overflow_Event_t)(void *, tBtampTLVHCI_Data_Buffer_Overflow_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6010#define SigPackTlvHCI_Data_Buffer_Overflow_Event ( 0x0088 )
6011
6012v_U32_t btampPackTlvHCI_Disconnect_Logical_Link_Cmd(void * pCtx,
6013 tBtampTLVHCI_Disconnect_Logical_Link_Cmd *pSrc,
6014 v_U8_t *pBuf,
6015 v_U32_t nBuf,
6016 v_U32_t *pnConsumed)
6017{
6018 v_U8_t* pTlvLen = 0;
6019 v_U32_t nConsumedOnEntry;
6020 v_U32_t status = BTAMP_PARSE_SUCCESS;
6021 v_U32_t nNeeded = 0U;
6022 v_U32_t sType = 0U;
6023 v_U32_t sLen = 0U;
6024 sType = 2;
6025 sLen = 1;
6026 // sanity checking
6027 if( pCtx == NULL || pSrc == NULL ||
6028 pBuf == NULL || pnConsumed == NULL)
6029 {
6030 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6031 return BTAMP_BAD_INPUT_BUFFER;
6032 }
6033 nConsumedOnEntry = *pnConsumed;
6034
6035 status = btampGetPackedTlvHCI_Disconnect_Logical_Link_Cmd(pCtx, pSrc, &nNeeded);
6036 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6037 nNeeded += sType + sLen;
6038 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6039 pTlvLen = pBuf;
6040 while ( pSrc->present )
6041 {
6042 if( sType == 2) frameshtons( pCtx, pBuf, 1082, 0);
6043 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6044 pTlvLen = pBuf;
6045 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6046 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6047 *pnConsumed += 2;
6048 pBuf += 2;
6049 nBuf -= 2;
6050 break;
6051 }
6052
6053 if (pTlvLen && sLen == 2)
6054 {
6055 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6056 } else if(NULL != pTlvLen)
6057 {
6058 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6059 }
6060 return status;
6061} /* End btampPackTlvHCI_Disconnect_Logical_Link_Cmd. */
6062
6063typedef v_U32_t (*pfnPackTlvHCI_Disconnect_Logical_Link_Cmd_t)(void *, tBtampTLVHCI_Disconnect_Logical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
6064#define SigPackTlvHCI_Disconnect_Logical_Link_Cmd ( 0x0089 )
6065
6066v_U32_t btampPackTlvHCI_Disconnect_Logical_Link_Complete_Event(void * pCtx,
6067 tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event *pSrc,
6068 v_U8_t *pBuf,
6069 v_U32_t nBuf,
6070 v_U32_t *pnConsumed)
6071{
6072 v_U8_t* pTlvLen = 0;
6073 v_U32_t nConsumedOnEntry;
6074 v_U32_t status = BTAMP_PARSE_SUCCESS;
6075 v_U32_t nNeeded = 0U;
6076 v_U32_t sType = 0U;
6077 v_U32_t sLen = 0U;
6078 sType = 1;
6079 sLen = 1;
6080 // sanity checking
6081 if( pCtx == NULL || pSrc == NULL ||
6082 pBuf == NULL || pnConsumed == NULL)
6083 {
6084 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6085 return BTAMP_BAD_INPUT_BUFFER;
6086 }
6087 nConsumedOnEntry = *pnConsumed;
6088
6089 status = btampGetPackedTlvHCI_Disconnect_Logical_Link_Complete_Event(pCtx, pSrc, &nNeeded);
6090 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6091 nNeeded += sType + sLen;
6092 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6093 pTlvLen = pBuf;
6094 while ( pSrc->present )
6095 {
6096 if( sType == 2) frameshtons( pCtx, pBuf, 70, 0);
6097 else *pBuf = 70;
6098 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6099 pTlvLen = pBuf;
6100 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6101 *pBuf = pSrc->status;
6102 *pnConsumed += 1;
6103 pBuf += 1;
6104 nBuf -= 1;
6105 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6106 *pnConsumed += 2;
6107 pBuf += 2;
6108 nBuf -= 2;
6109 *pBuf = pSrc->reason;
6110 *pnConsumed += 1;
6111 pBuf += 1;
6112 nBuf -= 1;
6113 break;
6114 }
6115
6116 if (pTlvLen && sLen == 2)
6117 {
6118 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6119 } else if(NULL != pTlvLen)
6120 {
6121 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6122 }
6123 return status;
6124} /* End btampPackTlvHCI_Disconnect_Logical_Link_Complete_Event. */
6125
6126typedef v_U32_t (*pfnPackTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6127#define SigPackTlvHCI_Disconnect_Logical_Link_Complete_Event ( 0x008a )
6128
6129v_U32_t btampPackTlvHCI_Disconnect_Physical_Link_Cmd(void * pCtx,
6130 tBtampTLVHCI_Disconnect_Physical_Link_Cmd *pSrc,
6131 v_U8_t *pBuf,
6132 v_U32_t nBuf,
6133 v_U32_t *pnConsumed)
6134{
6135 v_U8_t* pTlvLen = 0;
6136 v_U32_t nConsumedOnEntry;
6137 v_U32_t status = BTAMP_PARSE_SUCCESS;
6138 v_U32_t nNeeded = 0U;
6139 v_U32_t sType = 0U;
6140 v_U32_t sLen = 0U;
6141 sType = 2;
6142 sLen = 1;
6143 // sanity checking
6144 if( pCtx == NULL || pSrc == NULL ||
6145 pBuf == NULL || pnConsumed == NULL)
6146 {
6147 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6148 return BTAMP_BAD_INPUT_BUFFER;
6149 }
6150 nConsumedOnEntry = *pnConsumed;
6151
6152 status = btampGetPackedTlvHCI_Disconnect_Physical_Link_Cmd(pCtx, pSrc, &nNeeded);
6153 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6154 nNeeded += sType + sLen;
6155 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6156 pTlvLen = pBuf;
6157 while ( pSrc->present )
6158 {
6159 if( sType == 2) frameshtons( pCtx, pBuf, 1079, 0);
6160 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6161 pTlvLen = pBuf;
6162 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6163 *pBuf = pSrc->phy_link_handle;
6164 *pnConsumed += 1;
6165 pBuf += 1;
6166 nBuf -= 1;
6167 *pBuf = pSrc->reason;
6168 *pnConsumed += 1;
6169 pBuf += 1;
6170 nBuf -= 1;
6171 break;
6172 }
6173
6174 if (pTlvLen && sLen == 2)
6175 {
6176 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6177 } else if(NULL != pTlvLen)
6178 {
6179 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6180 }
6181 return status;
6182} /* End btampPackTlvHCI_Disconnect_Physical_Link_Cmd. */
6183
6184typedef v_U32_t (*pfnPackTlvHCI_Disconnect_Physical_Link_Cmd_t)(void *, tBtampTLVHCI_Disconnect_Physical_Link_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
6185#define SigPackTlvHCI_Disconnect_Physical_Link_Cmd ( 0x008b )
6186
6187v_U32_t btampPackTlvHCI_Disconnect_Physical_Link_Complete_Event(void * pCtx,
6188 tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event *pSrc,
6189 v_U8_t *pBuf,
6190 v_U32_t nBuf,
6191 v_U32_t *pnConsumed)
6192{
6193 v_U8_t* pTlvLen = 0;
6194 v_U32_t nConsumedOnEntry;
6195 v_U32_t status = BTAMP_PARSE_SUCCESS;
6196 v_U32_t nNeeded = 0U;
6197 v_U32_t sType = 0U;
6198 v_U32_t sLen = 0U;
6199 sType = 1;
6200 sLen = 1;
6201 // sanity checking
6202 if( pCtx == NULL || pSrc == NULL ||
6203 pBuf == NULL || pnConsumed == NULL)
6204 {
6205 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6206 return BTAMP_BAD_INPUT_BUFFER;
6207 }
6208 nConsumedOnEntry = *pnConsumed;
6209
6210 status = btampGetPackedTlvHCI_Disconnect_Physical_Link_Complete_Event(pCtx, pSrc, &nNeeded);
6211 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6212 nNeeded += sType + sLen;
6213 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6214 pTlvLen = pBuf;
6215 while ( pSrc->present )
6216 {
6217 if( sType == 2) frameshtons( pCtx, pBuf, 66, 0);
6218 else *pBuf = 66;
6219 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6220 pTlvLen = pBuf;
6221 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6222 *pBuf = pSrc->status;
6223 *pnConsumed += 1;
6224 pBuf += 1;
6225 nBuf -= 1;
6226 *pBuf = pSrc->phy_link_handle;
6227 *pnConsumed += 1;
6228 pBuf += 1;
6229 nBuf -= 1;
6230 *pBuf = pSrc->reason;
6231 *pnConsumed += 1;
6232 pBuf += 1;
6233 nBuf -= 1;
6234 break;
6235 }
6236
6237 if (pTlvLen && sLen == 2)
6238 {
6239 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6240 } else if(NULL != pTlvLen)
6241 {
6242 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6243 }
6244 return status;
6245} /* End btampPackTlvHCI_Disconnect_Physical_Link_Complete_Event. */
6246
6247typedef v_U32_t (*pfnPackTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6248#define SigPackTlvHCI_Disconnect_Physical_Link_Complete_Event ( 0x008c )
6249
6250v_U32_t btampPackTlvHCI_Flow_Spec_Modify_Cmd(void * pCtx,
6251 tBtampTLVHCI_Flow_Spec_Modify_Cmd *pSrc,
6252 v_U8_t *pBuf,
6253 v_U32_t nBuf,
6254 v_U32_t *pnConsumed)
6255{
6256 v_U8_t* pTlvLen = 0;
6257 v_U32_t nConsumedOnEntry;
6258 v_U32_t status = BTAMP_PARSE_SUCCESS;
6259 v_U32_t nNeeded = 0U;
6260 v_U32_t sType = 0U;
6261 v_U32_t sLen = 0U;
6262 sType = 2;
6263 sLen = 1;
6264 // sanity checking
6265 if( pCtx == NULL || pSrc == NULL ||
6266 pBuf == NULL || pnConsumed == NULL)
6267 {
6268 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6269 return BTAMP_BAD_INPUT_BUFFER;
6270 }
6271 nConsumedOnEntry = *pnConsumed;
6272
6273 status = btampGetPackedTlvHCI_Flow_Spec_Modify_Cmd(pCtx, pSrc, &nNeeded);
6274 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6275 nNeeded += sType + sLen;
6276 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6277 pTlvLen = pBuf;
6278 while ( pSrc->present )
6279 {
6280 if( sType == 2) frameshtons( pCtx, pBuf, 1084, 0);
6281 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6282 pTlvLen = pBuf;
6283 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6284 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6285 *pnConsumed += 2;
6286 pBuf += 2;
6287 nBuf -= 2;
6288 *pBuf = pSrc->be_aggr_counter;
6289 *pnConsumed += 1;
6290 pBuf += 1;
6291 nBuf -= 1;
6292 BTAMP_MEMCPY(pCtx, pBuf, pSrc->tx_flow_spec, 18);
6293 *pnConsumed += 18;
6294 pBuf += 18;
6295 nBuf -= 18;
6296 BTAMP_MEMCPY(pCtx, pBuf, pSrc->rx_flow_spec, 18);
6297 *pnConsumed += 18;
6298 pBuf += 18;
6299 nBuf -= 18;
6300 break;
6301 }
6302
6303 if (pTlvLen && sLen == 2)
6304 {
6305 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6306 } else if(NULL != pTlvLen)
6307 {
6308 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6309 }
6310 return status;
6311} /* End btampPackTlvHCI_Flow_Spec_Modify_Cmd. */
6312
6313typedef v_U32_t (*pfnPackTlvHCI_Flow_Spec_Modify_Cmd_t)(void *, tBtampTLVHCI_Flow_Spec_Modify_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
6314#define SigPackTlvHCI_Flow_Spec_Modify_Cmd ( 0x008d )
6315
6316v_U32_t btampPackTlvHCI_Flow_Spec_Modify_Complete_Event(void * pCtx,
6317 tBtampTLVHCI_Flow_Spec_Modify_Complete_Event *pSrc,
6318 v_U8_t *pBuf,
6319 v_U32_t nBuf,
6320 v_U32_t *pnConsumed)
6321{
6322 v_U8_t* pTlvLen = 0;
6323 v_U32_t nConsumedOnEntry;
6324 v_U32_t status = BTAMP_PARSE_SUCCESS;
6325 v_U32_t nNeeded = 0U;
6326 v_U32_t sType = 0U;
6327 v_U32_t sLen = 0U;
6328 sType = 1;
6329 sLen = 1;
6330 // sanity checking
6331 if( pCtx == NULL || pSrc == NULL ||
6332 pBuf == NULL || pnConsumed == NULL)
6333 {
6334 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6335 return BTAMP_BAD_INPUT_BUFFER;
6336 }
6337 nConsumedOnEntry = *pnConsumed;
6338
6339 status = btampGetPackedTlvHCI_Flow_Spec_Modify_Complete_Event(pCtx, pSrc, &nNeeded);
6340 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6341 nNeeded += sType + sLen;
6342 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6343 pTlvLen = pBuf;
6344 while ( pSrc->present )
6345 {
6346 if( sType == 2) frameshtons( pCtx, pBuf, 71, 0);
6347 else *pBuf = 71;
6348 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6349 pTlvLen = pBuf;
6350 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6351 *pBuf = pSrc->status;
6352 *pnConsumed += 1;
6353 pBuf += 1;
6354 nBuf -= 1;
6355 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6356 *pnConsumed += 2;
6357 pBuf += 2;
6358 nBuf -= 2;
6359 break;
6360 }
6361
6362 if (pTlvLen && sLen == 2)
6363 {
6364 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6365 } else if(NULL != pTlvLen)
6366 {
6367 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6368 }
6369 return status;
6370} /* End btampPackTlvHCI_Flow_Spec_Modify_Complete_Event. */
6371
6372typedef v_U32_t (*pfnPackTlvHCI_Flow_Spec_Modify_Complete_Event_t)(void *, tBtampTLVHCI_Flow_Spec_Modify_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6373#define SigPackTlvHCI_Flow_Spec_Modify_Complete_Event ( 0x008e )
6374
6375v_U32_t btampPackTlvHCI_Flush_Cmd(void * pCtx,
6376 tBtampTLVHCI_Flush_Cmd *pSrc,
6377 v_U8_t *pBuf,
6378 v_U32_t nBuf,
6379 v_U32_t *pnConsumed)
6380{
6381 v_U8_t* pTlvLen = 0;
6382 v_U32_t nConsumedOnEntry;
6383 v_U32_t status = BTAMP_PARSE_SUCCESS;
6384 v_U32_t nNeeded = 0U;
6385 v_U32_t sType = 0U;
6386 v_U32_t sLen = 0U;
6387 sType = 2;
6388 sLen = 1;
6389 // sanity checking
6390 if( pCtx == NULL || pSrc == NULL ||
6391 pBuf == NULL || pnConsumed == NULL)
6392 {
6393 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6394 return BTAMP_BAD_INPUT_BUFFER;
6395 }
6396 nConsumedOnEntry = *pnConsumed;
6397
6398 status = btampGetPackedTlvHCI_Flush_Cmd(pCtx, pSrc, &nNeeded);
6399 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6400 nNeeded += sType + sLen;
6401 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6402 pTlvLen = pBuf;
6403 while ( pSrc->present )
6404 {
6405 if( sType == 2) frameshtons( pCtx, pBuf, 3080, 0);
6406 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6407 pTlvLen = pBuf;
6408 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6409 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6410 *pnConsumed += 2;
6411 pBuf += 2;
6412 nBuf -= 2;
6413 break;
6414 }
6415
6416 if (pTlvLen && sLen == 2)
6417 {
6418 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6419 } else if(NULL != pTlvLen)
6420 {
6421 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6422 }
6423 return status;
6424} /* End btampPackTlvHCI_Flush_Cmd. */
6425
6426typedef v_U32_t (*pfnPackTlvHCI_Flush_Cmd_t)(void *, tBtampTLVHCI_Flush_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
6427#define SigPackTlvHCI_Flush_Cmd ( 0x008f )
6428
6429v_U32_t btampPackTlvHCI_Flush_Occurred_Event(void * pCtx,
6430 tBtampTLVHCI_Flush_Occurred_Event *pSrc,
6431 v_U8_t *pBuf,
6432 v_U32_t nBuf,
6433 v_U32_t *pnConsumed)
6434{
6435 v_U8_t* pTlvLen = 0;
6436 v_U32_t nConsumedOnEntry;
6437 v_U32_t status = BTAMP_PARSE_SUCCESS;
6438 v_U32_t nNeeded = 0U;
6439 v_U32_t sType = 0U;
6440 v_U32_t sLen = 0U;
6441 sType = 1;
6442 sLen = 1;
6443 // sanity checking
6444 if( pCtx == NULL || pSrc == NULL ||
6445 pBuf == NULL || pnConsumed == NULL)
6446 {
6447 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6448 return BTAMP_BAD_INPUT_BUFFER;
6449 }
6450 nConsumedOnEntry = *pnConsumed;
6451
6452 status = btampGetPackedTlvHCI_Flush_Occurred_Event(pCtx, pSrc, &nNeeded);
6453 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6454 nNeeded += sType + sLen;
6455 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6456 pTlvLen = pBuf;
6457 while ( pSrc->present )
6458 {
6459 if( sType == 2) frameshtons( pCtx, pBuf, 17, 0);
6460 else *pBuf = 17;
6461 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6462 pTlvLen = pBuf;
6463 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6464 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6465 *pnConsumed += 2;
6466 pBuf += 2;
6467 nBuf -= 2;
6468 break;
6469 }
6470
6471 if (pTlvLen && sLen == 2)
6472 {
6473 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6474 } else if(NULL != pTlvLen)
6475 {
6476 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6477 }
6478 return status;
6479} /* End btampPackTlvHCI_Flush_Occurred_Event. */
6480
6481typedef v_U32_t (*pfnPackTlvHCI_Flush_Occurred_Event_t)(void *, tBtampTLVHCI_Flush_Occurred_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6482#define SigPackTlvHCI_Flush_Occurred_Event ( 0x0090 )
6483
6484v_U32_t btampPackTlvHCI_Num_Completed_Pkts_Event(void * pCtx,
6485 tBtampTLVHCI_Num_Completed_Pkts_Event *pSrc,
6486 v_U8_t *pBuf,
6487 v_U32_t nBuf,
6488 v_U32_t *pnConsumed)
6489{
6490 v_U8_t* pTlvLen = 0;
6491 v_U32_t nConsumedOnEntry;
6492 v_U32_t status = BTAMP_PARSE_SUCCESS;
6493 v_U32_t nNeeded = 0U;
6494 v_U32_t sType = 0U;
6495 v_U32_t sLen = 0U;
6496 sType = 1;
6497 sLen = 1;
6498 // sanity checking
6499 if( pCtx == NULL || pSrc == NULL ||
6500 pBuf == NULL || pnConsumed == NULL)
6501 {
6502 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6503 return BTAMP_BAD_INPUT_BUFFER;
6504 }
6505 nConsumedOnEntry = *pnConsumed;
6506
6507 status = btampGetPackedTlvHCI_Num_Completed_Pkts_Event(pCtx, pSrc, &nNeeded);
6508 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6509 nNeeded += sType + sLen;
6510 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6511// while ( pSrc->present )
6512 {
6513 if( sType == 2) frameshtons( pCtx, pBuf, 19, 0);
6514 else *pBuf = 19;
6515 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6516 pTlvLen = pBuf;
6517 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6518 *pBuf = pSrc->num_handles;
6519 *pnConsumed += 1;
6520 pBuf += 1;
6521 nBuf -= 1;
6522 frameshtons(pCtx, pBuf, pSrc->conn_handles[0], 0);
6523 *pnConsumed += 2;
6524 pBuf += 2;
6525 nBuf -= 2;
6526 frameshtons(pCtx, pBuf, pSrc->num_completed_pkts[0], 0);
6527 *pnConsumed += 2;
6528 pBuf += 2;
6529 nBuf -= 2;
6530#if 0
6531 // New
6532 frameshtons(pCtx, pBuf, 0, 0);
6533 *pnConsumed += 2;
6534 pBuf += 2;
6535 nBuf -= 2;
6536 frameshtons(pCtx, pBuf, 0, 0);
6537 *pnConsumed += 2;
6538 pBuf += 2;
6539 nBuf -= 2;
6540 frameshtons(pCtx, pBuf, 0, 0);
6541 *pnConsumed += 2;
6542 pBuf += 2;
6543 nBuf -= 2;
6544 frameshtons(pCtx, pBuf, 0, 0);
6545 *pnConsumed += 2;
6546 pBuf += 2;
6547 nBuf -= 2;
6548 frameshtons(pCtx, pBuf, 0, 0);
6549 *pnConsumed += 2;
6550 pBuf += 2;
6551 nBuf -= 2;
6552 frameshtons(pCtx, pBuf, 0, 0);
6553 *pnConsumed += 2;
6554 pBuf += 2;
6555 nBuf -= 2;
6556// End of new
6557#endif
6558// break;
6559 }
6560
6561 if (pTlvLen && sLen == 2)
6562 {
6563 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6564 } else if(NULL != pTlvLen)
6565 {
6566 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6567 }
6568 return status;
6569} /* End btampPackTlvHCI_Num_Completed_Pkts_Event. */
6570
6571v_U32_t btampPackTlvHCI_Num_Completed_Data_Blocks_Event(void * pCtx,
6572 tBtampTLVHCI_Num_Completed_Data_Blocks_Event *pSrc,
6573 v_U8_t *pBuf,
6574 v_U32_t nBuf,
6575 v_U32_t *pnConsumed)
6576{
6577 v_U8_t* pTlvLen = 0;
6578 v_U32_t nConsumedOnEntry;
6579 v_U32_t status = BTAMP_PARSE_SUCCESS;
6580 v_U32_t nNeeded = 0U;
6581 v_U32_t sType = 0U;
6582 v_U32_t sLen = 0U;
6583 sType = 1;
6584 sLen = 1;
6585 // sanity checking
6586 if( pCtx == NULL || pSrc == NULL ||
6587 pBuf == NULL || pnConsumed == NULL)
6588 {
6589 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6590 return BTAMP_BAD_INPUT_BUFFER;
6591 }
6592 nConsumedOnEntry = *pnConsumed;
6593
6594 status = btampGetPackedTlvHCI_Num_Completed_Data_Blocks_Event(pCtx, pSrc, &nNeeded);
6595 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6596 nNeeded += sType + sLen;
6597 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6598// while ( pSrc->present )
6599 {
6600 if( sType == 2) frameshtons( pCtx, pBuf, 72, 0);
6601 else *pBuf = 72;
6602 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6603 pTlvLen = pBuf;
6604 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6605 frameshtons(pCtx, pBuf, pSrc->total_num_data_blocks, 0);
6606 *pnConsumed += 2;
6607 pBuf += 2;
6608 nBuf -= 2;
6609 *pBuf = pSrc->num_handles;
6610 *pnConsumed += 1;
6611 pBuf += 1;
6612 nBuf -= 1;
6613 frameshtons(pCtx, pBuf, pSrc->conn_handles[0], 0);
6614 *pnConsumed += 2;
6615 pBuf += 2;
6616 nBuf -= 2;
6617 frameshtons(pCtx, pBuf, pSrc->num_completed_pkts[0], 0);
6618 *pnConsumed += 2;
6619 pBuf += 2;
6620 nBuf -= 2;
6621 frameshtons(pCtx, pBuf, pSrc->num_completed_blocks[0], 0);
6622 *pnConsumed += 2;
6623 pBuf += 2;
6624 nBuf -= 2;
6625#if 0
6626 // New
6627 frameshtons(pCtx, pBuf, 0, 0);
6628 *pnConsumed += 2;
6629 pBuf += 2;
6630 nBuf -= 2;
6631 frameshtons(pCtx, pBuf, 0, 0);
6632 *pnConsumed += 2;
6633 pBuf += 2;
6634 nBuf -= 2;
6635 frameshtons(pCtx, pBuf, 0, 0);
6636 *pnConsumed += 2;
6637 pBuf += 2;
6638 nBuf -= 2;
6639 frameshtons(pCtx, pBuf, 0, 0);
6640 *pnConsumed += 2;
6641 pBuf += 2;
6642 nBuf -= 2;
6643 frameshtons(pCtx, pBuf, 0, 0);
6644 *pnConsumed += 2;
6645 pBuf += 2;
6646 nBuf -= 2;
6647 frameshtons(pCtx, pBuf, 0, 0);
6648 *pnConsumed += 2;
6649 pBuf += 2;
6650 nBuf -= 2;
6651// End of new
6652#endif
6653// break;
6654 }
6655
6656 if (pTlvLen && sLen == 2)
6657 {
6658 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6659 } else if(NULL != pTlvLen)
6660 {
6661 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6662 }
6663 return status;
6664} /* End btampPackTlvHCI_Num_Completed_Data_Blocks_Event. */
6665
6666//typedef v_U32_t (*pfnPackTlvHCI_Num_Completed_Pkts_Event_t)(void *, tBtampTLVHCI_Num_Completed_Pkts_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6667//#define SigPackTlvHCI_Num_Completed_Pkts_Event ( 0x0085 )
6668
6669v_U32_t btampPackTlvHCI_Generic_AMP_Link_Key_Notification_Event(void * pCtx,
6670 tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event *pSrc,
6671 v_U8_t *pBuf,
6672 v_U32_t nBuf,
6673 v_U32_t *pnConsumed)
6674{
6675 v_U8_t* pTlvLen = 0;
6676 v_U32_t nConsumedOnEntry;
6677 v_U32_t status = BTAMP_PARSE_SUCCESS;
6678 v_U32_t nNeeded = 0U;
6679 v_U32_t sType = 0U;
6680 v_U32_t sLen = 0U;
6681 sType = 1;
6682 sLen = 1;
6683 // sanity checking
6684 if( pCtx == NULL || pSrc == NULL ||
6685 pBuf == NULL || pnConsumed == NULL)
6686 {
6687 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6688 return BTAMP_BAD_INPUT_BUFFER;
6689 }
6690 nConsumedOnEntry = *pnConsumed;
6691
6692 status = btampGetPackedTlvHCI_Generic_AMP_Link_Key_Notification_Event(pCtx, pSrc, &nNeeded);
6693 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6694 nNeeded += sType + sLen;
6695 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6696 pTlvLen = pBuf;
6697 while ( pSrc->present )
6698 {
6699 if( sType == 2) frameshtons( pCtx, pBuf, 62, 0);
6700 else *pBuf = 62;
6701 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6702 pTlvLen = pBuf;
6703 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6704 BTAMP_MEMCPY(pCtx, pBuf, pSrc->bd_addr, 6);
6705 *pnConsumed += 6;
6706 pBuf += 6;
6707 nBuf -= 6;
6708 BTAMP_MEMCPY(pCtx, pBuf, pSrc->generic_amp_link_key, 32);
6709 *pnConsumed += 32;
6710 pBuf += 32;
6711 nBuf -= 32;
6712 *pBuf = pSrc->key_type;
6713 *pnConsumed += 1;
6714 pBuf += 1;
6715 nBuf -= 1;
6716 break;
6717 }
6718
6719 if (pTlvLen && sLen == 2)
6720 {
6721 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6722 } else if(NULL != pTlvLen)
6723 {
6724 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6725 }
6726 return status;
6727} /* End btampPackTlvHCI_Generic_AMP_Link_Key_Notification_Event. */
6728
6729typedef v_U32_t (*pfnPackTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(void *, tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6730#define SigPackTlvHCI_Generic_AMP_Link_Key_Notification_Event ( 0x0091 )
6731
6732v_U32_t btampPackTlvHCI_Hardware_Error_Event(void * pCtx,
6733 tBtampTLVHCI_Hardware_Error_Event *pSrc,
6734 v_U8_t *pBuf,
6735 v_U32_t nBuf,
6736 v_U32_t *pnConsumed)
6737{
6738 v_U8_t* pTlvLen = 0;
6739 v_U32_t nConsumedOnEntry;
6740 v_U32_t status = BTAMP_PARSE_SUCCESS;
6741 v_U32_t nNeeded = 0U;
6742 v_U32_t sType = 0U;
6743 v_U32_t sLen = 0U;
6744 sType = 1;
6745 sLen = 1;
6746 // sanity checking
6747 if( pCtx == NULL || pSrc == NULL ||
6748 pBuf == NULL || pnConsumed == NULL)
6749 {
6750 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6751 return BTAMP_BAD_INPUT_BUFFER;
6752 }
6753 nConsumedOnEntry = *pnConsumed;
6754
6755 status = btampGetPackedTlvHCI_Hardware_Error_Event(pCtx, pSrc, &nNeeded);
6756 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6757 nNeeded += sType + sLen;
6758 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6759 pTlvLen = pBuf;
6760 while ( pSrc->present )
6761 {
6762 if( sType == 2) frameshtons( pCtx, pBuf, 16, 0);
6763 else *pBuf = 16;
6764 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6765 pTlvLen = pBuf;
6766 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6767 *pBuf = pSrc->hardware_code;
6768 *pnConsumed += 1;
6769 pBuf += 1;
6770 nBuf -= 1;
6771 break;
6772 }
6773
6774 if (pTlvLen && sLen == 2)
6775 {
6776 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6777 } else if(NULL != pTlvLen)
6778 {
6779 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6780 }
6781 return status;
6782} /* End btampPackTlvHCI_Hardware_Error_Event. */
6783
6784typedef v_U32_t (*pfnPackTlvHCI_Hardware_Error_Event_t)(void *, tBtampTLVHCI_Hardware_Error_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6785#define SigPackTlvHCI_Hardware_Error_Event ( 0x0092 )
6786
6787v_U32_t btampPackTlvHCI_Logical_Link_Cancel_Cmd(void * pCtx,
6788 tBtampTLVHCI_Logical_Link_Cancel_Cmd *pSrc,
6789 v_U8_t *pBuf,
6790 v_U32_t nBuf,
6791 v_U32_t *pnConsumed)
6792{
6793 v_U8_t* pTlvLen = 0;
6794 v_U32_t nConsumedOnEntry;
6795 v_U32_t status = BTAMP_PARSE_SUCCESS;
6796 v_U32_t nNeeded = 0U;
6797 v_U32_t sType = 0U;
6798 v_U32_t sLen = 0U;
6799 sType = 2;
6800 sLen = 1;
6801 // sanity checking
6802 if( pCtx == NULL || pSrc == NULL ||
6803 pBuf == NULL || pnConsumed == NULL)
6804 {
6805 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6806 return BTAMP_BAD_INPUT_BUFFER;
6807 }
6808 nConsumedOnEntry = *pnConsumed;
6809
6810 status = btampGetPackedTlvHCI_Logical_Link_Cancel_Cmd(pCtx, pSrc, &nNeeded);
6811 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6812 nNeeded += sType + sLen;
6813 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6814 pTlvLen = pBuf;
6815 while ( pSrc->present )
6816 {
6817 if( sType == 2) frameshtons( pCtx, pBuf, 1083, 0);
6818 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6819 pTlvLen = pBuf;
6820 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6821 *pBuf = pSrc->phy_link_handle;
6822 *pnConsumed += 1;
6823 pBuf += 1;
6824 nBuf -= 1;
6825 *pBuf = pSrc->tx_flow_spec_id;
6826 *pnConsumed += 1;
6827 pBuf += 1;
6828 nBuf -= 1;
6829 break;
6830 }
6831
6832 if (pTlvLen && sLen == 2)
6833 {
6834 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6835 } else if(NULL != pTlvLen)
6836 {
6837 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6838 }
6839 return status;
6840} /* End btampPackTlvHCI_Logical_Link_Cancel_Cmd. */
6841
6842typedef v_U32_t (*pfnPackTlvHCI_Logical_Link_Cancel_Cmd_t)(void *, tBtampTLVHCI_Logical_Link_Cancel_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
6843#define SigPackTlvHCI_Logical_Link_Cancel_Cmd ( 0x0093 )
6844
6845v_U32_t btampPackTlvHCI_Logical_Link_Complete_Event(void * pCtx,
6846 tBtampTLVHCI_Logical_Link_Complete_Event *pSrc,
6847 v_U8_t *pBuf,
6848 v_U32_t nBuf,
6849 v_U32_t *pnConsumed)
6850{
6851 v_U8_t* pTlvLen = 0;
6852 v_U32_t nConsumedOnEntry;
6853 v_U32_t status = BTAMP_PARSE_SUCCESS;
6854 v_U32_t nNeeded = 0U;
6855 v_U32_t sType = 0U;
6856 v_U32_t sLen = 0U;
6857 sType = 1;
6858 sLen = 1;
6859 // sanity checking
6860 if( pCtx == NULL || pSrc == NULL ||
6861 pBuf == NULL || pnConsumed == NULL)
6862 {
6863 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6864 return BTAMP_BAD_INPUT_BUFFER;
6865 }
6866 nConsumedOnEntry = *pnConsumed;
6867
6868 status = btampGetPackedTlvHCI_Logical_Link_Complete_Event(pCtx, pSrc, &nNeeded);
6869 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6870 nNeeded += sType + sLen;
6871 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6872 pTlvLen = pBuf;
6873 while ( pSrc->present )
6874 {
6875 if( sType == 2) frameshtons( pCtx, pBuf, 69, 0);
6876 else *pBuf = 69;
6877 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6878 pTlvLen = pBuf;
6879 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6880 *pBuf = pSrc->status;
6881 *pnConsumed += 1;
6882 pBuf += 1;
6883 nBuf -= 1;
6884 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
6885 *pnConsumed += 2;
6886 pBuf += 2;
6887 nBuf -= 2;
6888 *pBuf = pSrc->phy_link_handle;
6889 *pnConsumed += 1;
6890 pBuf += 1;
6891 nBuf -= 1;
6892 *pBuf = pSrc->flow_spec_id;
6893 *pnConsumed += 1;
6894 pBuf += 1;
6895 nBuf -= 1;
6896 break;
6897 }
6898
6899 if (pTlvLen && sLen == 2)
6900 {
6901 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6902 } else if(NULL != pTlvLen)
6903 {
6904 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6905 }
6906 return status;
6907} /* End btampPackTlvHCI_Logical_Link_Complete_Event. */
6908
6909typedef v_U32_t (*pfnPackTlvHCI_Logical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Logical_Link_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6910#define SigPackTlvHCI_Logical_Link_Complete_Event ( 0x0094 )
6911
6912v_U32_t btampPackTlvHCI_Loopback_Command_Event(void * pCtx,
6913 tBtampTLVHCI_Loopback_Command_Event *pSrc,
6914 v_U8_t *pBuf,
6915 v_U32_t nBuf,
6916 v_U32_t *pnConsumed)
6917{
6918 v_U8_t* pTlvLen = 0;
6919 v_U32_t nConsumedOnEntry;
6920 v_U32_t status = BTAMP_PARSE_SUCCESS;
6921 v_U32_t nNeeded = 0U;
6922 v_U32_t sType = 0U;
6923 v_U32_t sLen = 0U;
6924 sType = 1;
6925 sLen = 1;
6926 // sanity checking
6927 if( pCtx == NULL || pSrc == NULL ||
6928 pBuf == NULL || pnConsumed == NULL)
6929 {
6930 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6931 return BTAMP_BAD_INPUT_BUFFER;
6932 }
6933 nConsumedOnEntry = *pnConsumed;
6934
6935 status = btampGetPackedTlvHCI_Loopback_Command_Event(pCtx, pSrc, &nNeeded);
6936 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6937 nNeeded += sType + sLen;
6938 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6939 pTlvLen = pBuf;
6940 while ( pSrc->present )
6941 {
6942 if( sType == 2) frameshtons( pCtx, pBuf, 25, 0);
6943 else *pBuf = 25;
6944 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
6945 pTlvLen = pBuf;
6946 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
6947 BTAMP_MEMCPY(pCtx, pBuf, pSrc->hci_command_packet, 64);
6948 *pnConsumed += 64;
6949 pBuf += 64;
6950 nBuf -= 64;
6951 break;
6952 }
6953
6954 if (pTlvLen && sLen == 2)
6955 {
6956 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
6957 } else if(NULL != pTlvLen)
6958 {
6959 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
6960 }
6961 return status;
6962} /* End btampPackTlvHCI_Loopback_Command_Event. */
6963
6964typedef v_U32_t (*pfnPackTlvHCI_Loopback_Command_Event_t)(void *, tBtampTLVHCI_Loopback_Command_Event *, v_U8_t*, v_U32_t, v_U32_t*);
6965#define SigPackTlvHCI_Loopback_Command_Event ( 0x0095 )
6966
6967v_U32_t btampPackTlvHCI_Physical_Link_Complete_Event(void * pCtx,
6968 tBtampTLVHCI_Physical_Link_Complete_Event *pSrc,
6969 v_U8_t *pBuf,
6970 v_U32_t nBuf,
6971 v_U32_t *pnConsumed)
6972{
6973 v_U8_t* pTlvLen = 0;
6974 v_U32_t nConsumedOnEntry;
6975 v_U32_t status = BTAMP_PARSE_SUCCESS;
6976 v_U32_t nNeeded = 0U;
6977 v_U32_t sType = 0U;
6978 v_U32_t sLen = 0U;
6979 sType = 1;
6980 sLen = 1;
6981 // sanity checking
6982 if( pCtx == NULL || pSrc == NULL ||
6983 pBuf == NULL || pnConsumed == NULL)
6984 {
6985 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
6986 return BTAMP_BAD_INPUT_BUFFER;
6987 }
6988 nConsumedOnEntry = *pnConsumed;
6989
6990 status = btampGetPackedTlvHCI_Physical_Link_Complete_Event(pCtx, pSrc, &nNeeded);
6991 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
6992 nNeeded += sType + sLen;
6993 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
6994 pTlvLen = pBuf;
6995 while ( pSrc->present )
6996 {
6997 if( sType == 2) frameshtons( pCtx, pBuf, 64, 0);
6998 else *pBuf = 64;
6999 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7000 pTlvLen = pBuf;
7001 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7002 *pBuf = pSrc->status;
7003 *pnConsumed += 1;
7004 pBuf += 1;
7005 nBuf -= 1;
7006 *pBuf = pSrc->phy_link_handle;
7007 *pnConsumed += 1;
7008 pBuf += 1;
7009 nBuf -= 1;
7010 break;
7011 }
7012
7013 if (pTlvLen && sLen == 2)
7014 {
7015 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7016 } else if(NULL != pTlvLen)
7017 {
7018 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7019 }
7020 return status;
7021} /* End btampPackTlvHCI_Physical_Link_Complete_Event. */
7022
7023typedef v_U32_t (*pfnPackTlvHCI_Physical_Link_Complete_Event_t)(void *, tBtampTLVHCI_Physical_Link_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
7024#define SigPackTlvHCI_Physical_Link_Complete_Event ( 0x0096 )
7025
7026v_U32_t btampPackTlvHCI_Physical_Link_Loss_Warning_Event(void * pCtx,
7027 tBtampTLVHCI_Physical_Link_Loss_Warning_Event *pSrc,
7028 v_U8_t *pBuf,
7029 v_U32_t nBuf,
7030 v_U32_t *pnConsumed)
7031{
7032 v_U8_t* pTlvLen = 0;
7033 v_U32_t nConsumedOnEntry;
7034 v_U32_t status = BTAMP_PARSE_SUCCESS;
7035 v_U32_t nNeeded = 0U;
7036 v_U32_t sType = 0U;
7037 v_U32_t sLen = 0U;
7038 sType = 1;
7039 sLen = 1;
7040 // sanity checking
7041 if( pCtx == NULL || pSrc == NULL ||
7042 pBuf == NULL || pnConsumed == NULL)
7043 {
7044 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7045 return BTAMP_BAD_INPUT_BUFFER;
7046 }
7047 nConsumedOnEntry = *pnConsumed;
7048
7049 status = btampGetPackedTlvHCI_Physical_Link_Loss_Warning_Event(pCtx, pSrc, &nNeeded);
7050 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7051 nNeeded += sType + sLen;
7052 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7053 pTlvLen = pBuf;
7054 while ( pSrc->present )
7055 {
7056 if( sType == 2) frameshtons( pCtx, pBuf, 67, 0);
7057 else *pBuf = 67;
7058 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7059 pTlvLen = pBuf;
7060 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7061 *pBuf = pSrc->phy_link_handle;
7062 *pnConsumed += 1;
7063 pBuf += 1;
7064 nBuf -= 1;
7065 *pBuf = pSrc->reason;
7066 *pnConsumed += 1;
7067 pBuf += 1;
7068 nBuf -= 1;
7069 break;
7070 }
7071
7072 if (pTlvLen && sLen == 2)
7073 {
7074 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7075 } else if(NULL != pTlvLen)
7076 {
7077 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7078 }
7079 return status;
7080} /* End btampPackTlvHCI_Physical_Link_Loss_Warning_Event. */
7081
7082typedef v_U32_t (*pfnPackTlvHCI_Physical_Link_Loss_Warning_Event_t)(void *, tBtampTLVHCI_Physical_Link_Loss_Warning_Event *, v_U8_t*, v_U32_t, v_U32_t*);
7083#define SigPackTlvHCI_Physical_Link_Loss_Warning_Event ( 0x0097 )
7084
7085v_U32_t btampPackTlvHCI_Physical_Link_Recovery_Event(void * pCtx,
7086 tBtampTLVHCI_Physical_Link_Recovery_Event *pSrc,
7087 v_U8_t *pBuf,
7088 v_U32_t nBuf,
7089 v_U32_t *pnConsumed)
7090{
7091 v_U8_t* pTlvLen = 0;
7092 v_U32_t nConsumedOnEntry;
7093 v_U32_t status = BTAMP_PARSE_SUCCESS;
7094 v_U32_t nNeeded = 0U;
7095 v_U32_t sType = 0U;
7096 v_U32_t sLen = 0U;
7097 sType = 1;
7098 sLen = 1;
7099 // sanity checking
7100 if( pCtx == NULL || pSrc == NULL ||
7101 pBuf == NULL || pnConsumed == NULL)
7102 {
7103 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7104 return BTAMP_BAD_INPUT_BUFFER;
7105 }
7106 nConsumedOnEntry = *pnConsumed;
7107
7108 status = btampGetPackedTlvHCI_Physical_Link_Recovery_Event(pCtx, pSrc, &nNeeded);
7109 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7110 nNeeded += sType + sLen;
7111 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7112 pTlvLen = pBuf;
7113 while ( pSrc->present )
7114 {
7115 if( sType == 2) frameshtons( pCtx, pBuf, 68, 0);
7116 else *pBuf = 68;
7117 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7118 pTlvLen = pBuf;
7119 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7120 *pBuf = pSrc->phy_link_handle;
7121 *pnConsumed += 1;
7122 pBuf += 1;
7123 nBuf -= 1;
7124 break;
7125 }
7126
7127 if (pTlvLen && sLen == 2)
7128 {
7129 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7130 } else if(NULL != pTlvLen)
7131 {
7132 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7133 }
7134 return status;
7135} /* End btampPackTlvHCI_Physical_Link_Recovery_Event. */
7136
7137typedef v_U32_t (*pfnPackTlvHCI_Physical_Link_Recovery_Event_t)(void *, tBtampTLVHCI_Physical_Link_Recovery_Event *, v_U8_t*, v_U32_t, v_U32_t*);
7138#define SigPackTlvHCI_Physical_Link_Recovery_Event ( 0x0098 )
7139
7140v_U32_t btampPackTlvHCI_Qos_Violation_Event(void * pCtx,
7141 tBtampTLVHCI_Qos_Violation_Event *pSrc,
7142 v_U8_t *pBuf,
7143 v_U32_t nBuf,
7144 v_U32_t *pnConsumed)
7145{
7146 v_U8_t* pTlvLen = 0;
7147 v_U32_t nConsumedOnEntry;
7148 v_U32_t status = BTAMP_PARSE_SUCCESS;
7149 v_U32_t nNeeded = 0U;
7150 v_U32_t sType = 0U;
7151 v_U32_t sLen = 0U;
7152 sType = 1;
7153 sLen = 1;
7154 // sanity checking
7155 if( pCtx == NULL || pSrc == NULL ||
7156 pBuf == NULL || pnConsumed == NULL)
7157 {
7158 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7159 return BTAMP_BAD_INPUT_BUFFER;
7160 }
7161 nConsumedOnEntry = *pnConsumed;
7162
7163 status = btampGetPackedTlvHCI_Qos_Violation_Event(pCtx, pSrc, &nNeeded);
7164 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7165 nNeeded += sType + sLen;
7166 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7167 pTlvLen = pBuf;
7168 while ( pSrc->present )
7169 {
7170 if( sType == 2) frameshtons( pCtx, pBuf, 30, 0);
7171 else *pBuf = 30;
7172 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7173 pTlvLen = pBuf;
7174 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7175 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
7176 *pnConsumed += 2;
7177 pBuf += 2;
7178 nBuf -= 2;
7179 break;
7180 }
7181
7182 if (pTlvLen && sLen == 2)
7183 {
7184 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7185 } else if(NULL != pTlvLen)
7186 {
7187 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7188 }
7189 return status;
7190} /* End btampPackTlvHCI_Qos_Violation_Event. */
7191
7192typedef v_U32_t (*pfnPackTlvHCI_Qos_Violation_Event_t)(void *, tBtampTLVHCI_Qos_Violation_Event *, v_U8_t*, v_U32_t, v_U32_t*);
7193#define SigPackTlvHCI_Qos_Violation_Event ( 0x0099 )
7194
7195v_U32_t btampPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd(void * pCtx,
7196 tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *pSrc,
7197 v_U8_t *pBuf,
7198 v_U32_t nBuf,
7199 v_U32_t *pnConsumed)
7200{
7201 v_U8_t* pTlvLen = 0;
7202 v_U32_t nConsumedOnEntry;
7203 v_U32_t status = BTAMP_PARSE_SUCCESS;
7204 v_U32_t nNeeded = 0U;
7205 v_U32_t sType = 0U;
7206 v_U32_t sLen = 0U;
7207 sType = 2;
7208 sLen = 1;
7209 // sanity checking
7210 if( pCtx == NULL || pSrc == NULL ||
7211 pBuf == NULL || pnConsumed == NULL)
7212 {
7213 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7214 return BTAMP_BAD_INPUT_BUFFER;
7215 }
7216 nConsumedOnEntry = *pnConsumed;
7217
7218 status = btampGetPackedTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd(pCtx, pSrc, &nNeeded);
7219 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7220 nNeeded += sType + sLen;
7221 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7222 pTlvLen = pBuf;
7223 while ( pSrc->present )
7224 {
7225 if( sType == 2) frameshtons( pCtx, pBuf, 3177, 0);
7226 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7227 pTlvLen = pBuf;
7228 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7229 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
7230 *pnConsumed += 2;
7231 pBuf += 2;
7232 nBuf -= 2;
7233 break;
7234 }
7235
7236 if (pTlvLen && sLen == 2)
7237 {
7238 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7239 } else if(NULL != pTlvLen)
7240 {
7241 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7242 }
7243 return status;
7244} /* End btampPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd. */
7245
7246typedef v_U32_t (*pfnPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7247#define SigPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd ( 0x009a )
7248
7249v_U32_t btampPackTlvHCI_Read_Buffer_Size_Cmd(void * pCtx,
7250 tBtampTLVHCI_Read_Buffer_Size_Cmd *pSrc,
7251 v_U8_t *pBuf,
7252 v_U32_t nBuf,
7253 v_U32_t *pnConsumed)
7254{
7255 v_U8_t* pTlvLen = 0;
7256 v_U32_t nConsumedOnEntry;
7257 v_U32_t status = BTAMP_PARSE_SUCCESS;
7258 v_U32_t nNeeded = 0U;
7259 v_U32_t sType = 0U;
7260 v_U32_t sLen = 0U;
7261 sType = 2;
7262 sLen = 1;
7263 // sanity checking
7264 if( pCtx == NULL || pSrc == NULL ||
7265 pBuf == NULL || pnConsumed == NULL)
7266 {
7267 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7268 return BTAMP_BAD_INPUT_BUFFER;
7269 }
7270 nConsumedOnEntry = *pnConsumed;
7271
7272 status = btampGetPackedTlvHCI_Read_Buffer_Size_Cmd(pCtx, pSrc, &nNeeded);
7273 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7274 nNeeded += sType + sLen;
7275 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7276 pTlvLen = pBuf;
7277 while ( pSrc->present )
7278 {
7279 if( sType == 2) frameshtons( pCtx, pBuf, 4101, 0);
7280 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7281 pTlvLen = pBuf;
7282 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7283 break;
7284 }
7285
7286 if (pTlvLen && sLen == 2)
7287 {
7288 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7289 } else if(NULL != pTlvLen)
7290 {
7291 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7292 }
7293 return status;
7294} /* End btampPackTlvHCI_Read_Buffer_Size_Cmd. */
7295
7296typedef v_U32_t (*pfnPackTlvHCI_Read_Buffer_Size_Cmd_t)(void *, tBtampTLVHCI_Read_Buffer_Size_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7297#define SigPackTlvHCI_Read_Buffer_Size_Cmd ( 0x009b )
7298
7299v_U32_t btampPackTlvHCI_Read_Connection_Accept_Timeout_Cmd(void * pCtx,
7300 tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd *pSrc,
7301 v_U8_t *pBuf,
7302 v_U32_t nBuf,
7303 v_U32_t *pnConsumed)
7304{
7305 v_U8_t* pTlvLen = 0;
7306 v_U32_t nConsumedOnEntry;
7307 v_U32_t status = BTAMP_PARSE_SUCCESS;
7308 v_U32_t nNeeded = 0U;
7309 v_U32_t sType = 0U;
7310 v_U32_t sLen = 0U;
7311 sType = 2;
7312 sLen = 1;
7313 // sanity checking
7314 if( pCtx == NULL || pSrc == NULL ||
7315 pBuf == NULL || pnConsumed == NULL)
7316 {
7317 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7318 return BTAMP_BAD_INPUT_BUFFER;
7319 }
7320 nConsumedOnEntry = *pnConsumed;
7321
7322 status = btampGetPackedTlvHCI_Read_Connection_Accept_Timeout_Cmd(pCtx, pSrc, &nNeeded);
7323 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7324 nNeeded += sType + sLen;
7325 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7326 pTlvLen = pBuf;
7327 while ( pSrc->present )
7328 {
7329 if( sType == 2) frameshtons( pCtx, pBuf, 3093, 0);
7330 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7331 pTlvLen = pBuf;
7332 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7333 break;
7334 }
7335
7336 if (pTlvLen && sLen == 2)
7337 {
7338 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7339 } else if(NULL != pTlvLen)
7340 {
7341 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7342 }
7343 return status;
7344} /* End btampPackTlvHCI_Read_Connection_Accept_Timeout_Cmd. */
7345
7346typedef v_U32_t (*pfnPackTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7347#define SigPackTlvHCI_Read_Connection_Accept_Timeout_Cmd ( 0x009c )
7348
7349v_U32_t btampPackTlvHCI_Read_Data_Block_Size_Cmd(void * pCtx,
7350 tBtampTLVHCI_Read_Data_Block_Size_Cmd *pSrc,
7351 v_U8_t *pBuf,
7352 v_U32_t nBuf,
7353 v_U32_t *pnConsumed)
7354{
7355 v_U8_t* pTlvLen = 0;
7356 v_U32_t nConsumedOnEntry;
7357 v_U32_t status = BTAMP_PARSE_SUCCESS;
7358 v_U32_t nNeeded = 0U;
7359 v_U32_t sType = 0U;
7360 v_U32_t sLen = 0U;
7361 sType = 2;
7362 sLen = 1;
7363 // sanity checking
7364 if( pCtx == NULL || pSrc == NULL ||
7365 pBuf == NULL || pnConsumed == NULL)
7366 {
7367 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7368 return BTAMP_BAD_INPUT_BUFFER;
7369 }
7370 nConsumedOnEntry = *pnConsumed;
7371
7372 status = btampGetPackedTlvHCI_Read_Data_Block_Size_Cmd(pCtx, pSrc, &nNeeded);
7373 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7374 nNeeded += sType + sLen;
7375 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7376 pTlvLen = pBuf;
7377 while ( pSrc->present )
7378 {
7379 if( sType == 2) frameshtons( pCtx, pBuf, 4106, 0);
7380 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7381 pTlvLen = pBuf;
7382 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7383 break;
7384 }
7385
7386 if (pTlvLen && sLen == 2)
7387 {
7388 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7389 } else if(NULL != pTlvLen)
7390 {
7391 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7392 }
7393 return status;
7394} /* End btampPackTlvHCI_Read_Data_Block_Size_Cmd. */
7395
7396typedef v_U32_t (*pfnPackTlvHCI_Read_Data_Block_Size_Cmd_t)(void *, tBtampTLVHCI_Read_Data_Block_Size_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7397#define SigPackTlvHCI_Read_Data_Block_Size_Cmd ( 0x009d )
7398
7399v_U32_t btampPackTlvHCI_Read_Failed_Contact_Counter_Cmd(void * pCtx,
7400 tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd *pSrc,
7401 v_U8_t *pBuf,
7402 v_U32_t nBuf,
7403 v_U32_t *pnConsumed)
7404{
7405 v_U8_t* pTlvLen = 0;
7406 v_U32_t nConsumedOnEntry;
7407 v_U32_t status = BTAMP_PARSE_SUCCESS;
7408 v_U32_t nNeeded = 0U;
7409 v_U32_t sType = 0U;
7410 v_U32_t sLen = 0U;
7411 sType = 2;
7412 sLen = 1;
7413 // sanity checking
7414 if( pCtx == NULL || pSrc == NULL ||
7415 pBuf == NULL || pnConsumed == NULL)
7416 {
7417 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7418 return BTAMP_BAD_INPUT_BUFFER;
7419 }
7420 nConsumedOnEntry = *pnConsumed;
7421
7422 status = btampGetPackedTlvHCI_Read_Failed_Contact_Counter_Cmd(pCtx, pSrc, &nNeeded);
7423 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7424 nNeeded += sType + sLen;
7425 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7426 pTlvLen = pBuf;
7427 while ( pSrc->present )
7428 {
7429 if( sType == 2) frameshtons( pCtx, pBuf, 5121, 0);
7430 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7431 pTlvLen = pBuf;
7432 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7433 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
7434 *pnConsumed += 2;
7435 pBuf += 2;
7436 nBuf -= 2;
7437 break;
7438 }
7439
7440 if (pTlvLen && sLen == 2)
7441 {
7442 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7443 } else if(NULL != pTlvLen)
7444 {
7445 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7446 }
7447 return status;
7448} /* End btampPackTlvHCI_Read_Failed_Contact_Counter_Cmd. */
7449
7450typedef v_U32_t (*pfnPackTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(void *, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7451#define SigPackTlvHCI_Read_Failed_Contact_Counter_Cmd ( 0x009e )
7452
7453v_U32_t btampPackTlvHCI_Read_Flow_Control_Mode_Cmd(void * pCtx,
7454 tBtampTLVHCI_Read_Flow_Control_Mode_Cmd *pSrc,
7455 v_U8_t *pBuf,
7456 v_U32_t nBuf,
7457 v_U32_t *pnConsumed)
7458{
7459 v_U8_t* pTlvLen = 0;
7460 v_U32_t nConsumedOnEntry;
7461 v_U32_t status = BTAMP_PARSE_SUCCESS;
7462 v_U32_t nNeeded = 0U;
7463 v_U32_t sType = 0U;
7464 v_U32_t sLen = 0U;
7465 sType = 2;
7466 sLen = 1;
7467 // sanity checking
7468 if( pCtx == NULL || pSrc == NULL ||
7469 pBuf == NULL || pnConsumed == NULL)
7470 {
7471 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7472 return BTAMP_BAD_INPUT_BUFFER;
7473 }
7474 nConsumedOnEntry = *pnConsumed;
7475
7476 status = btampGetPackedTlvHCI_Read_Flow_Control_Mode_Cmd(pCtx, pSrc, &nNeeded);
7477 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7478 nNeeded += sType + sLen;
7479 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7480 pTlvLen = pBuf;
7481 while ( pSrc->present )
7482 {
7483 if( sType == 2) frameshtons( pCtx, pBuf, 3174, 0);
7484 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7485 pTlvLen = pBuf;
7486 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7487 break;
7488 }
7489
7490 if (pTlvLen && sLen == 2)
7491 {
7492 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7493 } else if(NULL != pTlvLen)
7494 {
7495 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7496 }
7497 return status;
7498} /* End btampPackTlvHCI_Read_Flow_Control_Mode_Cmd. */
7499
7500typedef v_U32_t (*pfnPackTlvHCI_Read_Flow_Control_Mode_Cmd_t)(void *, tBtampTLVHCI_Read_Flow_Control_Mode_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7501#define SigPackTlvHCI_Read_Flow_Control_Mode_Cmd ( 0x009f )
7502
7503v_U32_t btampPackTlvHCI_Read_Link_Quality_Cmd(void * pCtx,
7504 tBtampTLVHCI_Read_Link_Quality_Cmd *pSrc,
7505 v_U8_t *pBuf,
7506 v_U32_t nBuf,
7507 v_U32_t *pnConsumed)
7508{
7509 v_U8_t* pTlvLen = 0;
7510 v_U32_t nConsumedOnEntry;
7511 v_U32_t status = BTAMP_PARSE_SUCCESS;
7512 v_U32_t nNeeded = 0U;
7513 v_U32_t sType = 0U;
7514 v_U32_t sLen = 0U;
7515 sType = 2;
7516 sLen = 1;
7517 // sanity checking
7518 if( pCtx == NULL || pSrc == NULL ||
7519 pBuf == NULL || pnConsumed == NULL)
7520 {
7521 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7522 return BTAMP_BAD_INPUT_BUFFER;
7523 }
7524 nConsumedOnEntry = *pnConsumed;
7525
7526 status = btampGetPackedTlvHCI_Read_Link_Quality_Cmd(pCtx, pSrc, &nNeeded);
7527 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7528 nNeeded += sType + sLen;
7529 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7530 pTlvLen = pBuf;
7531 while ( pSrc->present )
7532 {
7533 if( sType == 2) frameshtons( pCtx, pBuf, 5123, 0);
7534 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7535 pTlvLen = pBuf;
7536 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7537 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
7538 *pnConsumed += 2;
7539 pBuf += 2;
7540 nBuf -= 2;
7541 break;
7542 }
7543
7544 if (pTlvLen && sLen == 2)
7545 {
7546 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7547 } else if(NULL != pTlvLen)
7548 {
7549 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7550 }
7551 return status;
7552} /* End btampPackTlvHCI_Read_Link_Quality_Cmd. */
7553
7554typedef v_U32_t (*pfnPackTlvHCI_Read_Link_Quality_Cmd_t)(void *, tBtampTLVHCI_Read_Link_Quality_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7555#define SigPackTlvHCI_Read_Link_Quality_Cmd ( 0x00a0 )
7556
7557v_U32_t btampPackTlvHCI_Read_Link_Supervision_Timeout_Cmd(void * pCtx,
7558 tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *pSrc,
7559 v_U8_t *pBuf,
7560 v_U32_t nBuf,
7561 v_U32_t *pnConsumed)
7562{
7563 v_U8_t* pTlvLen = 0;
7564 v_U32_t nConsumedOnEntry;
7565 v_U32_t status = BTAMP_PARSE_SUCCESS;
7566 v_U32_t nNeeded = 0U;
7567 v_U32_t sType = 0U;
7568 v_U32_t sLen = 0U;
7569 sType = 2;
7570 sLen = 1;
7571 // sanity checking
7572 if( pCtx == NULL || pSrc == NULL ||
7573 pBuf == NULL || pnConsumed == NULL)
7574 {
7575 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7576 return BTAMP_BAD_INPUT_BUFFER;
7577 }
7578 nConsumedOnEntry = *pnConsumed;
7579
7580 status = btampGetPackedTlvHCI_Read_Link_Supervision_Timeout_Cmd(pCtx, pSrc, &nNeeded);
7581 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7582 nNeeded += sType + sLen;
7583 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7584 pTlvLen = pBuf;
7585 while ( pSrc->present )
7586 {
7587 if( sType == 2) frameshtons( pCtx, pBuf, 3126, 0);
7588 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7589 pTlvLen = pBuf;
7590 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7591 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
7592 *pnConsumed += 2;
7593 pBuf += 2;
7594 nBuf -= 2;
7595 break;
7596 }
7597
7598 if (pTlvLen && sLen == 2)
7599 {
7600 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7601 } else if(NULL != pTlvLen)
7602 {
7603 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7604 }
7605 return status;
7606} /* End btampPackTlvHCI_Read_Link_Supervision_Timeout_Cmd. */
7607
7608typedef v_U32_t (*pfnPackTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7609#define SigPackTlvHCI_Read_Link_Supervision_Timeout_Cmd ( 0x00a1 )
7610
7611v_U32_t btampPackTlvHCI_Read_Local_AMP_Assoc_Cmd(void * pCtx,
7612 tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd *pSrc,
7613 v_U8_t *pBuf,
7614 v_U32_t nBuf,
7615 v_U32_t *pnConsumed)
7616{
7617 v_U8_t* pTlvLen = 0;
7618 v_U32_t nConsumedOnEntry;
7619 v_U32_t status = BTAMP_PARSE_SUCCESS;
7620 v_U32_t nNeeded = 0U;
7621 v_U32_t sType = 0U;
7622 v_U32_t sLen = 0U;
7623 sType = 2;
7624 sLen = 1;
7625 // sanity checking
7626 if( pCtx == NULL || pSrc == NULL ||
7627 pBuf == NULL || pnConsumed == NULL)
7628 {
7629 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7630 return BTAMP_BAD_INPUT_BUFFER;
7631 }
7632 nConsumedOnEntry = *pnConsumed;
7633
7634 status = btampGetPackedTlvHCI_Read_Local_AMP_Assoc_Cmd(pCtx, pSrc, &nNeeded);
7635 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7636 nNeeded += sType + sLen;
7637 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7638 pTlvLen = pBuf;
7639 while ( pSrc->present )
7640 {
7641 if( sType == 2) frameshtons( pCtx, pBuf, 5130, 0);
7642 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7643 pTlvLen = pBuf;
7644 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7645 *pBuf = pSrc->phy_link_handle;
7646 *pnConsumed += 1;
7647 pBuf += 1;
7648 nBuf -= 1;
7649 frameshtons(pCtx, pBuf, pSrc->length_so_far, 0);
7650 *pnConsumed += 2;
7651 pBuf += 2;
7652 nBuf -= 2;
7653 frameshtons(pCtx, pBuf, pSrc->max_remote_amp_assoc_length, 0);
7654 *pnConsumed += 2;
7655 pBuf += 2;
7656 nBuf -= 2;
7657 break;
7658 }
7659
7660 if (pTlvLen && sLen == 2)
7661 {
7662 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7663 } else if(NULL != pTlvLen)
7664 {
7665 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7666 }
7667 return status;
7668} /* End btampPackTlvHCI_Read_Local_AMP_Assoc_Cmd. */
7669
7670typedef v_U32_t (*pfnPackTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(void *, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7671#define SigPackTlvHCI_Read_Local_AMP_Assoc_Cmd ( 0x00a2 )
7672
7673v_U32_t btampPackTlvHCI_Read_Local_AMP_Information_Cmd(void * pCtx,
7674 tBtampTLVHCI_Read_Local_AMP_Information_Cmd *pSrc,
7675 v_U8_t *pBuf,
7676 v_U32_t nBuf,
7677 v_U32_t *pnConsumed)
7678{
7679 v_U8_t* pTlvLen = 0;
7680 v_U32_t nConsumedOnEntry;
7681 v_U32_t status = BTAMP_PARSE_SUCCESS;
7682 v_U32_t nNeeded = 0U;
7683 v_U32_t sType = 0U;
7684 v_U32_t sLen = 0U;
7685 sType = 2;
7686 sLen = 1;
7687 // sanity checking
7688 if( pCtx == NULL || pSrc == NULL ||
7689 pBuf == NULL || pnConsumed == NULL)
7690 {
7691 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7692 return BTAMP_BAD_INPUT_BUFFER;
7693 }
7694 nConsumedOnEntry = *pnConsumed;
7695
7696 status = btampGetPackedTlvHCI_Read_Local_AMP_Information_Cmd(pCtx, pSrc, &nNeeded);
7697 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7698 nNeeded += sType + sLen;
7699 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7700 pTlvLen = pBuf;
7701 while ( pSrc->present )
7702 {
7703 if( sType == 2) frameshtons( pCtx, pBuf, 5129, 0);
7704 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7705 pTlvLen = pBuf;
7706 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7707 break;
7708 }
7709
7710 if (pTlvLen && sLen == 2)
7711 {
7712 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7713 } else if(NULL != pTlvLen)
7714 {
7715 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7716 }
7717 return status;
7718} /* End btampPackTlvHCI_Read_Local_AMP_Information_Cmd. */
7719
7720typedef v_U32_t (*pfnPackTlvHCI_Read_Local_AMP_Information_Cmd_t)(void *, tBtampTLVHCI_Read_Local_AMP_Information_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7721#define SigPackTlvHCI_Read_Local_AMP_Information_Cmd ( 0x00a3 )
7722
7723v_U32_t btampPackTlvHCI_Read_Local_Supported_Cmds_Cmd(void * pCtx,
7724 tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd *pSrc,
7725 v_U8_t *pBuf,
7726 v_U32_t nBuf,
7727 v_U32_t *pnConsumed)
7728{
7729 v_U8_t* pTlvLen = 0;
7730 v_U32_t nConsumedOnEntry;
7731 v_U32_t status = BTAMP_PARSE_SUCCESS;
7732 v_U32_t nNeeded = 0U;
7733 v_U32_t sType = 0U;
7734 v_U32_t sLen = 0U;
7735 sType = 2;
7736 sLen = 1;
7737 // sanity checking
7738 if( pCtx == NULL || pSrc == NULL ||
7739 pBuf == NULL || pnConsumed == NULL)
7740 {
7741 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7742 return BTAMP_BAD_INPUT_BUFFER;
7743 }
7744 nConsumedOnEntry = *pnConsumed;
7745
7746 status = btampGetPackedTlvHCI_Read_Local_Supported_Cmds_Cmd(pCtx, pSrc, &nNeeded);
7747 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7748 nNeeded += sType + sLen;
7749 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7750 pTlvLen = pBuf;
7751 while ( pSrc->present )
7752 {
7753 if( sType == 2) frameshtons( pCtx, pBuf, 4098, 0);
7754 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7755 pTlvLen = pBuf;
7756 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7757 break;
7758 }
7759
7760 if (pTlvLen && sLen == 2)
7761 {
7762 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7763 } else if(NULL != pTlvLen)
7764 {
7765 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7766 }
7767 return status;
7768} /* End btampPackTlvHCI_Read_Local_Supported_Cmds_Cmd. */
7769
7770typedef v_U32_t (*pfnPackTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(void *, tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7771#define SigPackTlvHCI_Read_Local_Supported_Cmds_Cmd ( 0x00a4 )
7772
7773v_U32_t btampPackTlvHCI_Read_Local_Version_Info_Cmd(void * pCtx,
7774 tBtampTLVHCI_Read_Local_Version_Info_Cmd *pSrc,
7775 v_U8_t *pBuf,
7776 v_U32_t nBuf,
7777 v_U32_t *pnConsumed)
7778{
7779 v_U8_t* pTlvLen = 0;
7780 v_U32_t nConsumedOnEntry;
7781 v_U32_t status = BTAMP_PARSE_SUCCESS;
7782 v_U32_t nNeeded = 0U;
7783 v_U32_t sType = 0U;
7784 v_U32_t sLen = 0U;
7785 sType = 2;
7786 sLen = 1;
7787 // sanity checking
7788 if( pCtx == NULL || pSrc == NULL ||
7789 pBuf == NULL || pnConsumed == NULL)
7790 {
7791 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7792 return BTAMP_BAD_INPUT_BUFFER;
7793 }
7794 nConsumedOnEntry = *pnConsumed;
7795
7796 status = btampGetPackedTlvHCI_Read_Local_Version_Info_Cmd(pCtx, pSrc, &nNeeded);
7797 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7798 nNeeded += sType + sLen;
7799 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7800 pTlvLen = pBuf;
7801 while ( pSrc->present )
7802 {
7803 if( sType == 2) frameshtons( pCtx, pBuf, 4097, 0);
7804 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7805 pTlvLen = pBuf;
7806 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7807 break;
7808 }
7809
7810 if (pTlvLen && sLen == 2)
7811 {
7812 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7813 } else if(NULL != pTlvLen)
7814 {
7815 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7816 }
7817 return status;
7818} /* End btampPackTlvHCI_Read_Local_Version_Info_Cmd. */
7819
7820typedef v_U32_t (*pfnPackTlvHCI_Read_Local_Version_Info_Cmd_t)(void *, tBtampTLVHCI_Read_Local_Version_Info_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7821#define SigPackTlvHCI_Read_Local_Version_Info_Cmd ( 0x00a5 )
7822
7823v_U32_t btampPackTlvHCI_Read_Location_Data_Cmd(void * pCtx,
7824 tBtampTLVHCI_Read_Location_Data_Cmd *pSrc,
7825 v_U8_t *pBuf,
7826 v_U32_t nBuf,
7827 v_U32_t *pnConsumed)
7828{
7829 v_U8_t* pTlvLen = 0;
7830 v_U32_t nConsumedOnEntry;
7831 v_U32_t status = BTAMP_PARSE_SUCCESS;
7832 v_U32_t nNeeded = 0U;
7833 v_U32_t sType = 0U;
7834 v_U32_t sLen = 0U;
7835 sType = 2;
7836 sLen = 1;
7837 // sanity checking
7838 if( pCtx == NULL || pSrc == NULL ||
7839 pBuf == NULL || pnConsumed == NULL)
7840 {
7841 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7842 return BTAMP_BAD_INPUT_BUFFER;
7843 }
7844 nConsumedOnEntry = *pnConsumed;
7845
7846 status = btampGetPackedTlvHCI_Read_Location_Data_Cmd(pCtx, pSrc, &nNeeded);
7847 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7848 nNeeded += sType + sLen;
7849 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7850 pTlvLen = pBuf;
7851 while ( pSrc->present )
7852 {
7853 if( sType == 2) frameshtons( pCtx, pBuf, 3172, 0);
7854 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7855 pTlvLen = pBuf;
7856 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7857 break;
7858 }
7859
7860 if (pTlvLen && sLen == 2)
7861 {
7862 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7863 } else if(NULL != pTlvLen)
7864 {
7865 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7866 }
7867 return status;
7868} /* End btampPackTlvHCI_Read_Location_Data_Cmd. */
7869
7870typedef v_U32_t (*pfnPackTlvHCI_Read_Location_Data_Cmd_t)(void *, tBtampTLVHCI_Read_Location_Data_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7871#define SigPackTlvHCI_Read_Location_Data_Cmd ( 0x00a6 )
7872
7873v_U32_t btampPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd(void * pCtx,
7874 tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd *pSrc,
7875 v_U8_t *pBuf,
7876 v_U32_t nBuf,
7877 v_U32_t *pnConsumed)
7878{
7879 v_U8_t* pTlvLen = 0;
7880 v_U32_t nConsumedOnEntry;
7881 v_U32_t status = BTAMP_PARSE_SUCCESS;
7882 v_U32_t nNeeded = 0U;
7883 v_U32_t sType = 0U;
7884 v_U32_t sLen = 0U;
7885 sType = 2;
7886 sLen = 1;
7887 // sanity checking
7888 if( pCtx == NULL || pSrc == NULL ||
7889 pBuf == NULL || pnConsumed == NULL)
7890 {
7891 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7892 return BTAMP_BAD_INPUT_BUFFER;
7893 }
7894 nConsumedOnEntry = *pnConsumed;
7895
7896 status = btampGetPackedTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd(pCtx, pSrc, &nNeeded);
7897 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7898 nNeeded += sType + sLen;
7899 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7900 pTlvLen = pBuf;
7901 while ( pSrc->present )
7902 {
7903 if( sType == 2) frameshtons( pCtx, pBuf, 3169, 0);
7904 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7905 pTlvLen = pBuf;
7906 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7907 break;
7908 }
7909
7910 if (pTlvLen && sLen == 2)
7911 {
7912 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7913 } else if(NULL != pTlvLen)
7914 {
7915 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7916 }
7917 return status;
7918} /* End btampPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd. */
7919
7920typedef v_U32_t (*pfnPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7921#define SigPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd ( 0x00a7 )
7922
7923v_U32_t btampPackTlvHCI_Read_Loopback_Mode_Cmd(void * pCtx,
7924 tBtampTLVHCI_Read_Loopback_Mode_Cmd *pSrc,
7925 v_U8_t *pBuf,
7926 v_U32_t nBuf,
7927 v_U32_t *pnConsumed)
7928{
7929 v_U8_t* pTlvLen = 0;
7930 v_U32_t nConsumedOnEntry;
7931 v_U32_t status = BTAMP_PARSE_SUCCESS;
7932 v_U32_t nNeeded = 0U;
7933 v_U32_t sType = 0U;
7934 v_U32_t sLen = 0U;
7935 sType = 2;
7936 sLen = 1;
7937 // sanity checking
7938 if( pCtx == NULL || pSrc == NULL ||
7939 pBuf == NULL || pnConsumed == NULL)
7940 {
7941 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7942 return BTAMP_BAD_INPUT_BUFFER;
7943 }
7944 nConsumedOnEntry = *pnConsumed;
7945
7946 status = btampGetPackedTlvHCI_Read_Loopback_Mode_Cmd(pCtx, pSrc, &nNeeded);
7947 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7948 nNeeded += sType + sLen;
7949 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
7950 pTlvLen = pBuf;
7951 while ( pSrc->present )
7952 {
7953 if( sType == 2) frameshtons( pCtx, pBuf, 6145, 0);
7954 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
7955 pTlvLen = pBuf;
7956 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
7957 break;
7958 }
7959
7960 if (pTlvLen && sLen == 2)
7961 {
7962 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
7963 } else if(NULL != pTlvLen)
7964 {
7965 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
7966 }
7967 return status;
7968} /* End btampPackTlvHCI_Read_Loopback_Mode_Cmd. */
7969
7970typedef v_U32_t (*pfnPackTlvHCI_Read_Loopback_Mode_Cmd_t)(void *, tBtampTLVHCI_Read_Loopback_Mode_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
7971#define SigPackTlvHCI_Read_Loopback_Mode_Cmd ( 0x00a8 )
7972
7973v_U32_t btampPackTlvHCI_Read_RSSI_Cmd(void * pCtx,
7974 tBtampTLVHCI_Read_RSSI_Cmd *pSrc,
7975 v_U8_t *pBuf,
7976 v_U32_t nBuf,
7977 v_U32_t *pnConsumed)
7978{
7979 v_U8_t* pTlvLen = 0;
7980 v_U32_t nConsumedOnEntry;
7981 v_U32_t status = BTAMP_PARSE_SUCCESS;
7982 v_U32_t nNeeded = 0U;
7983 v_U32_t sType = 0U;
7984 v_U32_t sLen = 0U;
7985 sType = 2;
7986 sLen = 1;
7987 // sanity checking
7988 if( pCtx == NULL || pSrc == NULL ||
7989 pBuf == NULL || pnConsumed == NULL)
7990 {
7991 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
7992 return BTAMP_BAD_INPUT_BUFFER;
7993 }
7994 nConsumedOnEntry = *pnConsumed;
7995
7996 status = btampGetPackedTlvHCI_Read_RSSI_Cmd(pCtx, pSrc, &nNeeded);
7997 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
7998 nNeeded += sType + sLen;
7999 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8000 pTlvLen = pBuf;
8001 while ( pSrc->present )
8002 {
8003 if( sType == 2) frameshtons( pCtx, pBuf, 5125, 0);
8004 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8005 pTlvLen = pBuf;
8006 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8007 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8008 *pnConsumed += 2;
8009 pBuf += 2;
8010 nBuf -= 2;
8011 break;
8012 }
8013
8014 if (pTlvLen && sLen == 2)
8015 {
8016 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8017 } else if(NULL != pTlvLen)
8018 {
8019 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8020 }
8021 return status;
8022} /* End btampPackTlvHCI_Read_RSSI_Cmd. */
8023
8024typedef v_U32_t (*pfnPackTlvHCI_Read_RSSI_Cmd_t)(void *, tBtampTLVHCI_Read_RSSI_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8025#define SigPackTlvHCI_Read_RSSI_Cmd ( 0x00a9 )
8026
8027v_U32_t btampPackTlvHCI_Reset_Cmd(void * pCtx,
8028 tBtampTLVHCI_Reset_Cmd *pSrc,
8029 v_U8_t *pBuf,
8030 v_U32_t nBuf,
8031 v_U32_t *pnConsumed)
8032{
8033 v_U8_t* pTlvLen = 0;
8034 v_U32_t nConsumedOnEntry;
8035 v_U32_t status = BTAMP_PARSE_SUCCESS;
8036 v_U32_t nNeeded = 0U;
8037 v_U32_t sType = 0U;
8038 v_U32_t sLen = 0U;
8039 sType = 2;
8040 sLen = 1;
8041 // sanity checking
8042 if( pCtx == NULL || pSrc == NULL ||
8043 pBuf == NULL || pnConsumed == NULL)
8044 {
8045 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8046 return BTAMP_BAD_INPUT_BUFFER;
8047 }
8048 nConsumedOnEntry = *pnConsumed;
8049
8050 status = btampGetPackedTlvHCI_Reset_Cmd(pCtx, pSrc, &nNeeded);
8051 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8052 nNeeded += sType + sLen;
8053 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8054 pTlvLen = pBuf;
8055 while ( pSrc->present )
8056 {
8057 if( sType == 2) frameshtons( pCtx, pBuf, 3075, 0);
8058 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8059 pTlvLen = pBuf;
8060 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8061 break;
8062 }
8063
8064 if (pTlvLen && sLen == 2)
8065 {
8066 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8067 } else if(NULL != pTlvLen)
8068 {
8069 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8070 }
8071 return status;
8072} /* End btampPackTlvHCI_Reset_Cmd. */
8073
8074typedef v_U32_t (*pfnPackTlvHCI_Reset_Cmd_t)(void *, tBtampTLVHCI_Reset_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8075#define SigPackTlvHCI_Reset_Cmd ( 0x00aa )
8076
8077v_U32_t btampPackTlvHCI_Reset_Failed_Contact_Counter_Cmd(void * pCtx,
8078 tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd *pSrc,
8079 v_U8_t *pBuf,
8080 v_U32_t nBuf,
8081 v_U32_t *pnConsumed)
8082{
8083 v_U8_t* pTlvLen = 0;
8084 v_U32_t nConsumedOnEntry;
8085 v_U32_t status = BTAMP_PARSE_SUCCESS;
8086 v_U32_t nNeeded = 0U;
8087 v_U32_t sType = 0U;
8088 v_U32_t sLen = 0U;
8089 sType = 2;
8090 sLen = 1;
8091 // sanity checking
8092 if( pCtx == NULL || pSrc == NULL ||
8093 pBuf == NULL || pnConsumed == NULL)
8094 {
8095 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8096 return BTAMP_BAD_INPUT_BUFFER;
8097 }
8098 nConsumedOnEntry = *pnConsumed;
8099
8100 status = btampGetPackedTlvHCI_Reset_Failed_Contact_Counter_Cmd(pCtx, pSrc, &nNeeded);
8101 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8102 nNeeded += sType + sLen;
8103 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8104 pTlvLen = pBuf;
8105 while ( pSrc->present )
8106 {
8107 if( sType == 2) frameshtons( pCtx, pBuf, 5122, 0);
8108 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8109 pTlvLen = pBuf;
8110 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8111 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8112 *pnConsumed += 2;
8113 pBuf += 2;
8114 nBuf -= 2;
8115 break;
8116 }
8117
8118 if (pTlvLen && sLen == 2)
8119 {
8120 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8121 } else if(NULL != pTlvLen)
8122 {
8123 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8124 }
8125 return status;
8126} /* End btampPackTlvHCI_Reset_Failed_Contact_Counter_Cmd. */
8127
8128typedef v_U32_t (*pfnPackTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(void *, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8129#define SigPackTlvHCI_Reset_Failed_Contact_Counter_Cmd ( 0x00ab )
8130
8131v_U32_t btampPackTlvHCI_Set_Event_Mask_Cmd(void * pCtx,
8132 tBtampTLVHCI_Set_Event_Mask_Cmd *pSrc,
8133 v_U8_t *pBuf,
8134 v_U32_t nBuf,
8135 v_U32_t *pnConsumed)
8136{
8137 v_U8_t* pTlvLen = 0;
8138 v_U32_t nConsumedOnEntry;
8139 v_U32_t status = BTAMP_PARSE_SUCCESS;
8140 v_U32_t nNeeded = 0U;
8141 v_U32_t sType = 0U;
8142 v_U32_t sLen = 0U;
8143 sType = 2;
8144 sLen = 1;
8145 // sanity checking
8146 if( pCtx == NULL || pSrc == NULL ||
8147 pBuf == NULL || pnConsumed == NULL)
8148 {
8149 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8150 return BTAMP_BAD_INPUT_BUFFER;
8151 }
8152 nConsumedOnEntry = *pnConsumed;
8153
8154 status = btampGetPackedTlvHCI_Set_Event_Mask_Cmd(pCtx, pSrc, &nNeeded);
8155 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8156 nNeeded += sType + sLen;
8157 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8158 pTlvLen = pBuf;
8159 while ( pSrc->present )
8160 {
8161 if( sType == 2) frameshtons( pCtx, pBuf, 3077, 0);
8162 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8163 pTlvLen = pBuf;
8164 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8165 BTAMP_MEMCPY(pCtx, pBuf, pSrc->event_mask, 8);
8166 *pnConsumed += 8;
8167 pBuf += 8;
8168 nBuf -= 8;
8169 break;
8170 }
8171
8172 if (pTlvLen && sLen == 2)
8173 {
8174 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8175 } else if(NULL != pTlvLen)
8176 {
8177 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8178 }
8179 return status;
8180} /* End btampPackTlvHCI_Set_Event_Mask_Cmd. */
8181
8182typedef v_U32_t (*pfnPackTlvHCI_Set_Event_Mask_Cmd_t)(void *, tBtampTLVHCI_Set_Event_Mask_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8183#define SigPackTlvHCI_Set_Event_Mask_Cmd ( 0x00ac )
8184
8185v_U32_t btampPackTlvHCI_Set_Event_Mask_Page_2_Cmd(void * pCtx,
8186 tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *pSrc,
8187 v_U8_t *pBuf,
8188 v_U32_t nBuf,
8189 v_U32_t *pnConsumed)
8190{
8191 v_U8_t* pTlvLen = 0;
8192 v_U32_t nConsumedOnEntry;
8193 v_U32_t status = BTAMP_PARSE_SUCCESS;
8194 v_U32_t nNeeded = 0U;
8195 v_U32_t sType = 0U;
8196 v_U32_t sLen = 0U;
8197 sType = 2;
8198 sLen = 1;
8199 // sanity checking
8200 if( pCtx == NULL || pSrc == NULL ||
8201 pBuf == NULL || pnConsumed == NULL)
8202 {
8203 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8204 return BTAMP_BAD_INPUT_BUFFER;
8205 }
8206 nConsumedOnEntry = *pnConsumed;
8207
8208 status = btampGetPackedTlvHCI_Set_Event_Mask_Page_2_Cmd(pCtx, pSrc, &nNeeded);
8209 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8210 nNeeded += sType + sLen;
8211 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8212 pTlvLen = pBuf;
8213 while ( pSrc->present )
8214 {
8215 if( sType == 2) frameshtons( pCtx, pBuf, 3171, 0);
8216 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8217 pTlvLen = pBuf;
8218 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8219 BTAMP_MEMCPY(pCtx, pBuf, pSrc->event_mask_page_2, 8);
8220 *pnConsumed += 8;
8221 pBuf += 8;
8222 nBuf -= 8;
8223 break;
8224 }
8225
8226 if (pTlvLen && sLen == 2)
8227 {
8228 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8229 } else if(NULL != pTlvLen)
8230 {
8231 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8232 }
8233 return status;
8234} /* End btampPackTlvHCI_Set_Event_Mask_Page_2_Cmd. */
8235
8236typedef v_U32_t (*pfnPackTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(void *, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8237#define SigPackTlvHCI_Set_Event_Mask_Page_2_Cmd ( 0x00ad )
8238
8239v_U32_t btampPackTlvHCI_Set_Short_Range_Mode_Cmd(void * pCtx,
8240 tBtampTLVHCI_Set_Short_Range_Mode_Cmd *pSrc,
8241 v_U8_t *pBuf,
8242 v_U32_t nBuf,
8243 v_U32_t *pnConsumed)
8244{
8245 v_U8_t* pTlvLen = 0;
8246 v_U32_t nConsumedOnEntry;
8247 v_U32_t status = BTAMP_PARSE_SUCCESS;
8248 v_U32_t nNeeded = 0U;
8249 v_U32_t sType = 0U;
8250 v_U32_t sLen = 0U;
8251 sType = 2;
8252 sLen = 1;
8253 // sanity checking
8254 if( pCtx == NULL || pSrc == NULL ||
8255 pBuf == NULL || pnConsumed == NULL)
8256 {
8257 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8258 return BTAMP_BAD_INPUT_BUFFER;
8259 }
8260 nConsumedOnEntry = *pnConsumed;
8261
8262 status = btampGetPackedTlvHCI_Set_Short_Range_Mode_Cmd(pCtx, pSrc, &nNeeded);
8263 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8264 nNeeded += sType + sLen;
8265 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8266 pTlvLen = pBuf;
8267 while ( pSrc->present )
8268 {
8269 if( sType == 2) frameshtons( pCtx, pBuf, 3179, 0);
8270 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8271 pTlvLen = pBuf;
8272 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8273 *pBuf = pSrc->phy_link_handle;
8274 *pnConsumed += 1;
8275 pBuf += 1;
8276 nBuf -= 1;
8277 *pBuf = pSrc->short_range_mode;
8278 *pnConsumed += 1;
8279 pBuf += 1;
8280 nBuf -= 1;
8281 break;
8282 }
8283
8284 if (pTlvLen && sLen == 2)
8285 {
8286 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8287 } else if(NULL != pTlvLen)
8288 {
8289 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8290 }
8291 return status;
8292} /* End btampPackTlvHCI_Set_Short_Range_Mode_Cmd. */
8293
8294typedef v_U32_t (*pfnPackTlvHCI_Set_Short_Range_Mode_Cmd_t)(void *, tBtampTLVHCI_Set_Short_Range_Mode_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8295#define SigPackTlvHCI_Set_Short_Range_Mode_Cmd ( 0x00ae )
8296
8297v_U32_t btampPackTlvHCI_Short_Range_Mode_Change_Complete_Event(void * pCtx,
8298 tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event *pSrc,
8299 v_U8_t *pBuf,
8300 v_U32_t nBuf,
8301 v_U32_t *pnConsumed)
8302{
8303 v_U8_t* pTlvLen = 0;
8304 v_U32_t nConsumedOnEntry;
8305 v_U32_t status = BTAMP_PARSE_SUCCESS;
8306 v_U32_t nNeeded = 0U;
8307 v_U32_t sType = 0U;
8308 v_U32_t sLen = 0U;
8309 sType = 1;
8310 sLen = 1;
8311 // sanity checking
8312 if( pCtx == NULL || pSrc == NULL ||
8313 pBuf == NULL || pnConsumed == NULL)
8314 {
8315 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8316 return BTAMP_BAD_INPUT_BUFFER;
8317 }
8318 nConsumedOnEntry = *pnConsumed;
8319
8320 status = btampGetPackedTlvHCI_Short_Range_Mode_Change_Complete_Event(pCtx, pSrc, &nNeeded);
8321 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8322 nNeeded += sType + sLen;
8323 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8324 pTlvLen = pBuf;
8325 while ( pSrc->present )
8326 {
8327 if( sType == 2) frameshtons( pCtx, pBuf, 76, 0);
8328 else *pBuf = 76;
8329 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8330 pTlvLen = pBuf;
8331 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8332 *pBuf = pSrc->status;
8333 *pnConsumed += 1;
8334 pBuf += 1;
8335 nBuf -= 1;
8336 *pBuf = pSrc->phy_link_handle;
8337 *pnConsumed += 1;
8338 pBuf += 1;
8339 nBuf -= 1;
8340 *pBuf = pSrc->short_range_mode;
8341 *pnConsumed += 1;
8342 pBuf += 1;
8343 nBuf -= 1;
8344 break;
8345 }
8346
8347 if (pTlvLen && sLen == 2)
8348 {
8349 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8350 } else if(NULL != pTlvLen)
8351 {
8352 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8353 }
8354 return status;
8355} /* End btampPackTlvHCI_Short_Range_Mode_Change_Complete_Event. */
8356
8357typedef v_U32_t (*pfnPackTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(void *, tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
8358#define SigPackTlvHCI_Short_Range_Mode_Change_Complete_Event ( 0x00af )
8359
8360v_U32_t btampPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd(void * pCtx,
8361 tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *pSrc,
8362 v_U8_t *pBuf,
8363 v_U32_t nBuf,
8364 v_U32_t *pnConsumed)
8365{
8366 v_U8_t* pTlvLen = 0;
8367 v_U32_t nConsumedOnEntry;
8368 v_U32_t status = BTAMP_PARSE_SUCCESS;
8369 v_U32_t nNeeded = 0U;
8370 v_U32_t sType = 0U;
8371 v_U32_t sLen = 0U;
8372 sType = 2;
8373 sLen = 1;
8374 // sanity checking
8375 if( pCtx == NULL || pSrc == NULL ||
8376 pBuf == NULL || pnConsumed == NULL)
8377 {
8378 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8379 return BTAMP_BAD_INPUT_BUFFER;
8380 }
8381 nConsumedOnEntry = *pnConsumed;
8382
8383 status = btampGetPackedTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd(pCtx, pSrc, &nNeeded);
8384 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8385 nNeeded += sType + sLen;
8386 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8387 pTlvLen = pBuf;
8388 while ( pSrc->present )
8389 {
8390 if( sType == 2) frameshtons( pCtx, pBuf, 3178, 0);
8391 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8392 pTlvLen = pBuf;
8393 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8394 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8395 *pnConsumed += 2;
8396 pBuf += 2;
8397 nBuf -= 2;
8398 frameshtonl(pCtx, pBuf, pSrc->best_effort_flush_timeout, 0);
8399 *pnConsumed += 4;
8400 pBuf += 4;
8401 nBuf -= 4;
8402 break;
8403 }
8404
8405 if (pTlvLen && sLen == 2)
8406 {
8407 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8408 } else if(NULL != pTlvLen)
8409 {
8410 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8411 }
8412 return status;
8413} /* End btampPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd. */
8414
8415typedef v_U32_t (*pfnPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8416#define SigPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd ( 0x00b0 )
8417
8418v_U32_t btampPackTlvHCI_Write_Connection_Accept_Timeout_Cmd(void * pCtx,
8419 tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *pSrc,
8420 v_U8_t *pBuf,
8421 v_U32_t nBuf,
8422 v_U32_t *pnConsumed)
8423{
8424 v_U8_t* pTlvLen = 0;
8425 v_U32_t nConsumedOnEntry;
8426 v_U32_t status = BTAMP_PARSE_SUCCESS;
8427 v_U32_t nNeeded = 0U;
8428 v_U32_t sType = 0U;
8429 v_U32_t sLen = 0U;
8430 sType = 2;
8431 sLen = 1;
8432 // sanity checking
8433 if( pCtx == NULL || pSrc == NULL ||
8434 pBuf == NULL || pnConsumed == NULL)
8435 {
8436 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8437 return BTAMP_BAD_INPUT_BUFFER;
8438 }
8439 nConsumedOnEntry = *pnConsumed;
8440
8441 status = btampGetPackedTlvHCI_Write_Connection_Accept_Timeout_Cmd(pCtx, pSrc, &nNeeded);
8442 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8443 nNeeded += sType + sLen;
8444 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8445 pTlvLen = pBuf;
8446 while ( pSrc->present )
8447 {
8448 if( sType == 2) frameshtons( pCtx, pBuf, 3094, 0);
8449 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8450 pTlvLen = pBuf;
8451 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8452 frameshtons(pCtx, pBuf, pSrc->connection_accept_timeout, 0);
8453 *pnConsumed += 2;
8454 pBuf += 2;
8455 nBuf -= 2;
8456 break;
8457 }
8458
8459 if (pTlvLen && sLen == 2)
8460 {
8461 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8462 } else if(NULL != pTlvLen)
8463 {
8464 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8465 }
8466 return status;
8467} /* End btampPackTlvHCI_Write_Connection_Accept_Timeout_Cmd. */
8468
8469typedef v_U32_t (*pfnPackTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8470#define SigPackTlvHCI_Write_Connection_Accept_Timeout_Cmd ( 0x00b1 )
8471
8472v_U32_t btampPackTlvHCI_Write_Flow_Control_Mode_Cmd(void * pCtx,
8473 tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *pSrc,
8474 v_U8_t *pBuf,
8475 v_U32_t nBuf,
8476 v_U32_t *pnConsumed)
8477{
8478 v_U8_t* pTlvLen = 0;
8479 v_U32_t nConsumedOnEntry;
8480 v_U32_t status = BTAMP_PARSE_SUCCESS;
8481 v_U32_t nNeeded = 0U;
8482 v_U32_t sType = 0U;
8483 v_U32_t sLen = 0U;
8484 sType = 2;
8485 sLen = 1;
8486 // sanity checking
8487 if( pCtx == NULL || pSrc == NULL ||
8488 pBuf == NULL || pnConsumed == NULL)
8489 {
8490 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8491 return BTAMP_BAD_INPUT_BUFFER;
8492 }
8493 nConsumedOnEntry = *pnConsumed;
8494
8495 status = btampGetPackedTlvHCI_Write_Flow_Control_Mode_Cmd(pCtx, pSrc, &nNeeded);
8496 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8497 nNeeded += sType + sLen;
8498 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8499 pTlvLen = pBuf;
8500 while ( pSrc->present )
8501 {
8502 if( sType == 2) frameshtons( pCtx, pBuf, 3175, 0);
8503 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8504 pTlvLen = pBuf;
8505 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8506 *pBuf = pSrc->flow_control_mode;
8507 *pnConsumed += 1;
8508 pBuf += 1;
8509 nBuf -= 1;
8510 break;
8511 }
8512
8513 if (pTlvLen && sLen == 2)
8514 {
8515 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8516 } else if(NULL != pTlvLen)
8517 {
8518 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8519 }
8520 return status;
8521} /* End btampPackTlvHCI_Write_Flow_Control_Mode_Cmd. */
8522
8523typedef v_U32_t (*pfnPackTlvHCI_Write_Flow_Control_Mode_Cmd_t)(void *, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8524#define SigPackTlvHCI_Write_Flow_Control_Mode_Cmd ( 0x00b2 )
8525
8526v_U32_t btampPackTlvHCI_Write_Link_Supervision_Timeout_Cmd(void * pCtx,
8527 tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *pSrc,
8528 v_U8_t *pBuf,
8529 v_U32_t nBuf,
8530 v_U32_t *pnConsumed)
8531{
8532 v_U8_t* pTlvLen = 0;
8533 v_U32_t nConsumedOnEntry;
8534 v_U32_t status = BTAMP_PARSE_SUCCESS;
8535 v_U32_t nNeeded = 0U;
8536 v_U32_t sType = 0U;
8537 v_U32_t sLen = 0U;
8538 sType = 2;
8539 sLen = 1;
8540 // sanity checking
8541 if( pCtx == NULL || pSrc == NULL ||
8542 pBuf == NULL || pnConsumed == NULL)
8543 {
8544 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8545 return BTAMP_BAD_INPUT_BUFFER;
8546 }
8547 nConsumedOnEntry = *pnConsumed;
8548
8549 status = btampGetPackedTlvHCI_Write_Link_Supervision_Timeout_Cmd(pCtx, pSrc, &nNeeded);
8550 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8551 nNeeded += sType + sLen;
8552 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8553 pTlvLen = pBuf;
8554 while ( pSrc->present )
8555 {
8556 if( sType == 2) frameshtons( pCtx, pBuf, 3127, 0);
8557 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8558 pTlvLen = pBuf;
8559 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8560 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8561 *pnConsumed += 2;
8562 pBuf += 2;
8563 nBuf -= 2;
8564 frameshtons(pCtx, pBuf, pSrc->link_supervision_timeout, 0);
8565 *pnConsumed += 2;
8566 pBuf += 2;
8567 nBuf -= 2;
8568 break;
8569 }
8570
8571 if (pTlvLen && sLen == 2)
8572 {
8573 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8574 } else if(NULL != pTlvLen)
8575 {
8576 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8577 }
8578 return status;
8579} /* End btampPackTlvHCI_Write_Link_Supervision_Timeout_Cmd. */
8580
8581typedef v_U32_t (*pfnPackTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8582#define SigPackTlvHCI_Write_Link_Supervision_Timeout_Cmd ( 0x00b3 )
8583
8584v_U32_t btampPackTlvHCI_Write_Location_Data_Cmd(void * pCtx,
8585 tBtampTLVHCI_Write_Location_Data_Cmd *pSrc,
8586 v_U8_t *pBuf,
8587 v_U32_t nBuf,
8588 v_U32_t *pnConsumed)
8589{
8590 v_U8_t* pTlvLen = 0;
8591 v_U32_t nConsumedOnEntry;
8592 v_U32_t status = BTAMP_PARSE_SUCCESS;
8593 v_U32_t nNeeded = 0U;
8594 v_U32_t sType = 0U;
8595 v_U32_t sLen = 0U;
8596 sType = 2;
8597 sLen = 1;
8598 // sanity checking
8599 if( pCtx == NULL || pSrc == NULL ||
8600 pBuf == NULL || pnConsumed == NULL)
8601 {
8602 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8603 return BTAMP_BAD_INPUT_BUFFER;
8604 }
8605 nConsumedOnEntry = *pnConsumed;
8606
8607 status = btampGetPackedTlvHCI_Write_Location_Data_Cmd(pCtx, pSrc, &nNeeded);
8608 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8609 nNeeded += sType + sLen;
8610 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8611 pTlvLen = pBuf;
8612 while ( pSrc->present )
8613 {
8614 if( sType == 2) frameshtons( pCtx, pBuf, 3173, 0);
8615 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8616 pTlvLen = pBuf;
8617 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8618 *pBuf = pSrc->loc_domain_aware;
8619 *pnConsumed += 1;
8620 pBuf += 1;
8621 nBuf -= 1;
8622 BTAMP_MEMCPY(pCtx, pBuf, pSrc->loc_domain, 3);
8623 *pnConsumed += 3;
8624 pBuf += 3;
8625 nBuf -= 3;
8626 *pBuf = pSrc->loc_options;
8627 *pnConsumed += 1;
8628 pBuf += 1;
8629 nBuf -= 1;
8630 break;
8631 }
8632
8633 if (pTlvLen && sLen == 2)
8634 {
8635 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8636 } else if(NULL != pTlvLen)
8637 {
8638 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8639 }
8640 return status;
8641} /* End btampPackTlvHCI_Write_Location_Data_Cmd. */
8642
8643typedef v_U32_t (*pfnPackTlvHCI_Write_Location_Data_Cmd_t)(void *, tBtampTLVHCI_Write_Location_Data_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8644#define SigPackTlvHCI_Write_Location_Data_Cmd ( 0x00b4 )
8645
8646v_U32_t btampPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd(void * pCtx,
8647 tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *pSrc,
8648 v_U8_t *pBuf,
8649 v_U32_t nBuf,
8650 v_U32_t *pnConsumed)
8651{
8652 v_U8_t* pTlvLen = 0;
8653 v_U32_t nConsumedOnEntry;
8654 v_U32_t status = BTAMP_PARSE_SUCCESS;
8655 v_U32_t nNeeded = 0U;
8656 v_U32_t sType = 0U;
8657 v_U32_t sLen = 0U;
8658 sType = 2;
8659 sLen = 1;
8660 // sanity checking
8661 if( pCtx == NULL || pSrc == NULL ||
8662 pBuf == NULL || pnConsumed == NULL)
8663 {
8664 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8665 return BTAMP_BAD_INPUT_BUFFER;
8666 }
8667 nConsumedOnEntry = *pnConsumed;
8668
8669 status = btampGetPackedTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd(pCtx, pSrc, &nNeeded);
8670 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8671 nNeeded += sType + sLen;
8672 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8673 pTlvLen = pBuf;
8674 while ( pSrc->present )
8675 {
8676 if( sType == 2) frameshtons( pCtx, pBuf, 3170, 0);
8677 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8678 pTlvLen = pBuf;
8679 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8680 frameshtons(pCtx, pBuf, pSrc->logical_link_accept_timeout, 0);
8681 *pnConsumed += 2;
8682 pBuf += 2;
8683 nBuf -= 2;
8684 break;
8685 }
8686
8687 if (pTlvLen && sLen == 2)
8688 {
8689 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8690 } else if(NULL != pTlvLen)
8691 {
8692 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8693 }
8694 return status;
8695} /* End btampPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd. */
8696
8697typedef v_U32_t (*pfnPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(void *, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8698#define SigPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd ( 0x00b5 )
8699
8700v_U32_t btampPackTlvHCI_Write_Loopback_Mode_Cmd(void * pCtx,
8701 tBtampTLVHCI_Write_Loopback_Mode_Cmd *pSrc,
8702 v_U8_t *pBuf,
8703 v_U32_t nBuf,
8704 v_U32_t *pnConsumed)
8705{
8706 v_U8_t* pTlvLen = 0;
8707 v_U32_t nConsumedOnEntry;
8708 v_U32_t status = BTAMP_PARSE_SUCCESS;
8709 v_U32_t nNeeded = 0U;
8710 v_U32_t sType = 0U;
8711 v_U32_t sLen = 0U;
8712 sType = 2;
8713 sLen = 1;
8714 // sanity checking
8715 if( pCtx == NULL || pSrc == NULL ||
8716 pBuf == NULL || pnConsumed == NULL)
8717 {
8718 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8719 return BTAMP_BAD_INPUT_BUFFER;
8720 }
8721 nConsumedOnEntry = *pnConsumed;
8722
8723 status = btampGetPackedTlvHCI_Write_Loopback_Mode_Cmd(pCtx, pSrc, &nNeeded);
8724 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8725 nNeeded += sType + sLen;
8726 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8727 pTlvLen = pBuf;
8728 while ( pSrc->present )
8729 {
8730 if( sType == 2) frameshtons( pCtx, pBuf, 6146, 0);
8731 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8732 pTlvLen = pBuf;
8733 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8734 *pBuf = pSrc->loopback_mode;
8735 *pnConsumed += 1;
8736 pBuf += 1;
8737 nBuf -= 1;
8738 break;
8739 }
8740
8741 if (pTlvLen && sLen == 2)
8742 {
8743 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8744 } else if(NULL != pTlvLen)
8745 {
8746 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8747 }
8748 return status;
8749} /* End btampPackTlvHCI_Write_Loopback_Mode_Cmd. */
8750
8751typedef v_U32_t (*pfnPackTlvHCI_Write_Loopback_Mode_Cmd_t)(void *, tBtampTLVHCI_Write_Loopback_Mode_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8752#define SigPackTlvHCI_Write_Loopback_Mode_Cmd ( 0x00b6 )
8753
8754v_U32_t btampPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd(void * pCtx,
8755 tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pSrc,
8756 v_U8_t *pBuf,
8757 v_U32_t nBuf,
8758 v_U32_t *pnConsumed)
8759{
8760 v_U8_t* pTlvLen = 0;
8761 v_U32_t nConsumedOnEntry;
8762 v_U32_t status = BTAMP_PARSE_SUCCESS;
8763 v_U32_t nNeeded = 0U;
8764 v_U32_t sType = 0U;
8765 v_U32_t sLen = 0U;
8766 sType = 2;
8767 sLen = 1;
8768 // sanity checking
8769 if( pCtx == NULL || pSrc == NULL ||
8770 pBuf == NULL || pnConsumed == NULL)
8771 {
8772 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8773 return BTAMP_BAD_INPUT_BUFFER;
8774 }
8775 nConsumedOnEntry = *pnConsumed;
8776
8777 status = btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd(pCtx, pSrc, &nNeeded);
8778 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8779 nNeeded += sType + sLen;
8780 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8781 pTlvLen = pBuf;
8782 while ( pSrc->present )
8783 {
8784 if( sType == 2) frameshtons( pCtx, pBuf, 5131, 0);
8785 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8786 pTlvLen = pBuf;
8787 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8788 *pBuf = pSrc->phy_link_handle;
8789 *pnConsumed += 1;
8790 pBuf += 1;
8791 nBuf -= 1;
8792 frameshtons(pCtx, pBuf, pSrc->length_so_far, 0);
8793 *pnConsumed += 2;
8794 pBuf += 2;
8795 nBuf -= 2;
8796 frameshtons(pCtx, pBuf, pSrc->amp_assoc_remaining_length, 0);
8797 *pnConsumed += 2;
8798 pBuf += 2;
8799 nBuf -= 2;
8800 BTAMP_MEMCPY(pCtx, pBuf, &( pSrc->amp_assoc_fragment ), pSrc->amp_assoc_remaining_length);
8801 *pnConsumed += pSrc->amp_assoc_remaining_length;
8802 pBuf += ( pSrc->amp_assoc_remaining_length );
8803 nBuf -= ( pSrc->amp_assoc_remaining_length );
8804 break;
8805 }
8806
8807 if (pTlvLen && sLen == 2)
8808 {
8809 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8810 } else if(NULL != pTlvLen)
8811 {
8812 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8813 }
8814 return status;
8815} /* End btampPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd. */
8816
8817typedef v_U32_t (*pfnPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(void *, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8818#define SigPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd ( 0x00b7 )
8819
8820v_U32_t btampPackTlvHCI_Enhanced_Flush_Cmd(void * pCtx,
8821 tBtampTLVHCI_Enhanced_Flush_Cmd *pSrc,
8822 v_U8_t *pBuf,
8823 v_U32_t nBuf,
8824 v_U32_t *pnConsumed)
8825{
8826 v_U8_t* pTlvLen = 0;
8827 v_U32_t nConsumedOnEntry;
8828 v_U32_t status = BTAMP_PARSE_SUCCESS;
8829 v_U32_t nNeeded = 0U;
8830 v_U32_t sType = 0U;
8831 v_U32_t sLen = 0U;
8832 sType = 2;
8833 sLen = 1;
8834 // sanity checking
8835 if( pCtx == NULL || pSrc == NULL ||
8836 pBuf == NULL || pnConsumed == NULL)
8837 {
8838 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8839 return BTAMP_BAD_INPUT_BUFFER;
8840 }
8841 nConsumedOnEntry = *pnConsumed;
8842
8843 status = btampGetPackedTlvHCI_Enhanced_Flush_Cmd(pCtx, pSrc, &nNeeded);
8844 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8845 nNeeded += sType + sLen;
8846 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8847 pTlvLen = pBuf;
8848 while ( pSrc->present )
8849 {
8850 if( sType == 2) frameshtons( pCtx, pBuf, 3167, 0);
8851 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8852 pTlvLen = pBuf;
8853 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8854 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8855 *pnConsumed += 2;
8856 pBuf += 2;
8857 nBuf -= 2;
8858 *pBuf = pSrc->packet_type;
8859 *pnConsumed += 1;
8860 pBuf += 1;
8861 nBuf -= 1;
8862 break;
8863 }
8864
8865 if (pTlvLen && sLen == 2)
8866 {
8867 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8868 } else if(NULL != pTlvLen)
8869 {
8870 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8871 }
8872 return status;
8873} /* End btampPackTlvHCI_Enhanced_Flush_Cmd. */
8874
8875typedef v_U32_t (*pfnPackTlvHCI_Enhanced_Flush_Cmd_t)(void *, tBtampTLVHCI_Enhanced_Flush_Cmd *, v_U8_t*, v_U32_t, v_U32_t*);
8876#define SigPackTlvHCI_Enhanced_Flush_Cmd ( 0x00b8 )
8877
8878v_U32_t btampPackTlvHCI_Enhanced_Flush_Complete_Event(void * pCtx,
8879 tBtampTLVHCI_Enhanced_Flush_Complete_Event *pSrc,
8880 v_U8_t *pBuf,
8881 v_U32_t nBuf,
8882 v_U32_t *pnConsumed)
8883{
8884 v_U8_t* pTlvLen = 0;
8885 v_U32_t nConsumedOnEntry;
8886 v_U32_t status = BTAMP_PARSE_SUCCESS;
8887 v_U32_t nNeeded = 0U;
8888 v_U32_t sType = 0U;
8889 v_U32_t sLen = 0U;
8890 sType = 1;
8891 sLen = 1;
8892 // sanity checking
8893 if( pCtx == NULL || pSrc == NULL ||
8894 pBuf == NULL || pnConsumed == NULL)
8895 {
8896 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "bad input" );
8897 return BTAMP_BAD_INPUT_BUFFER;
8898 }
8899 nConsumedOnEntry = *pnConsumed;
8900
8901 status = btampGetPackedTlvHCI_Enhanced_Flush_Complete_Event(pCtx, pSrc, &nNeeded);
8902 if ( ! BTAMP_SUCCEEDED( status ) ) return status;
8903 nNeeded += sType + sLen;
8904 if ( nNeeded > nBuf ) return BTAMP_BUFFER_OVERFLOW;
8905 pTlvLen = pBuf;
8906 while ( pSrc->present )
8907 {
8908 if( sType == 2) frameshtons( pCtx, pBuf, 57, 0);
8909 else *pBuf = 57;
8910 pBuf += sType; nBuf -= sType; *pnConsumed += sType;
8911 pTlvLen = pBuf;
8912 pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen;
8913 frameshtons(pCtx, pBuf, pSrc->log_link_handle, 0);
8914 *pnConsumed += 2;
8915 pBuf += 2;
8916 nBuf -= 2;
8917 break;
8918 }
8919
8920 if (pTlvLen && sLen == 2)
8921 {
8922 frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0);
8923 } else if(NULL != pTlvLen)
8924 {
8925 *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen);
8926 }
8927 return status;
8928} /* End btampPackTlvHCI_Enhanced_Flush_Complete_Event. */
8929
8930typedef v_U32_t (*pfnPackTlvHCI_Enhanced_Flush_Complete_Event_t)(void *, tBtampTLVHCI_Enhanced_Flush_Complete_Event *, v_U8_t*, v_U32_t, v_U32_t*);
8931#define SigPackTlvHCI_Enhanced_Flush_Complete_Event ( 0x00b9 )
8932
8933v_U32_t btampPackAMP_ASSOC(void * pCtx, tBtampAMP_ASSOC *pFrm, v_U8_t *pBuf, v_U32_t nBuf, v_U32_t *pnConsumed)
8934{
8935 v_U32_t i;
8936 static tTLVDefn TLVS[ ] = {
8937 {BTAMP_TLV_AMP_ASSOC_MAC_ADDR, 0, 9, 9, offsetof(tBtampAMP_ASSOC, AMP_Assoc_MAC_Addr), offsetof(tBtampTLVAMP_Assoc_MAC_Addr, present), SigPackTlvAMP_Assoc_MAC_Addr, (pfnGeneric_t)btampPackTlvAMP_Assoc_MAC_Addr, "AMP_Assoc_MAC_Addr", 1, },
8938 {BTAMP_TLV_AMP_ASSOC_PREFERRED_CHANNEL_LIST, 0, 9, 12, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Preferred_Channel_List), offsetof(tBtampTLVAMP_Assoc_Preferred_Channel_List, present), SigPackTlvAMP_Assoc_Preferred_Channel_List, (pfnGeneric_t)btampPackTlvAMP_Assoc_Preferred_Channel_List, "AMP_Assoc_Preferred_Channel_List", 1, },
8939 {BTAMP_TLV_AMP_ASSOC_CONNECTED_CHANNEL, 0, 9, 12, offsetof(tBtampAMP_ASSOC, AMP_Assoc_Connected_Channel), offsetof(tBtampTLVAMP_Assoc_Connected_Channel, present), SigPackTlvAMP_Assoc_Connected_Channel, (pfnGeneric_t)btampPackTlvAMP_Assoc_Connected_Channel, "AMP_Assoc_Connected_Channel", 0, },
8940 {BTAMP_TLV_AMP_ASSOC_PAL_CAPABILITIES, 0, 7, 7, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Capabilities), offsetof(tBtampTLVAMP_Assoc_PAL_Capabilities, present), SigPackTlvAMP_Assoc_PAL_Capabilities, (pfnGeneric_t)btampPackTlvAMP_Assoc_PAL_Capabilities, "AMP_Assoc_PAL_Capabilities", 0, },
8941 {BTAMP_TLV_AMP_ASSOC_PAL_VERSION, 0, 8, 8, offsetof(tBtampAMP_ASSOC, AMP_Assoc_PAL_Version), offsetof(tBtampTLVAMP_Assoc_PAL_Version, present), SigPackTlvAMP_Assoc_PAL_Version, (pfnGeneric_t)btampPackTlvAMP_Assoc_PAL_Version, "AMP_Assoc_PAL_Version", 1, },
8942 { 0xffff, 0 },
8943 };
8944
8945 v_U32_t idx = 0;
8946 v_U32_t status = 0;
8947 (void)i;
8948 *pnConsumed = 0U;
8949 status |= PackTlvCore(pCtx,(v_U8_t*)pFrm,pBuf,nBuf,pnConsumed,TLVS,&idx);
8950
8951# ifdef BTAMP_DUMP_FRAMES
8952 if (!BTAMP_FAILED(status))
8953 {
8954 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Packed the AMP_ASSOC:\n"));
8955 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_MAC_Addr:\n"));
8956 if (!pFrm->AMP_Assoc_MAC_Addr.present)
8957 {
8958 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
8959 }
8960 else
8961 {
8962 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_MAC_Addr.mac_addr, 6);
8963 }
8964 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_Preferred_Channel_List:\n"));
8965 if (!pFrm->AMP_Assoc_Preferred_Channel_List.present)
8966 {
8967 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
8968 }
8969 else
8970 {
8971 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_Preferred_Channel_List.country, 3);
8972 FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("num_triplets: %d.\n"), pFrm->AMP_Assoc_Preferred_Channel_List.num_triplets);
8973 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* ) pFrm->AMP_Assoc_Preferred_Channel_List.triplets, 3 * pFrm->AMP_Assoc_Preferred_Channel_List.num_triplets);
8974 }
8975 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_Connected_Channel:\n"));
8976 if (!pFrm->AMP_Assoc_Connected_Channel.present)
8977 {
8978 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
8979 }
8980 else
8981 {
8982 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_Connected_Channel.country, 3);
8983 FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("num_triplets: %d.\n"), pFrm->AMP_Assoc_Connected_Channel.num_triplets);
8984 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* ) pFrm->AMP_Assoc_Connected_Channel.triplets, 3 * pFrm->AMP_Assoc_Connected_Channel.num_triplets);
8985 }
8986 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_PAL_Capabilities:\n"));
8987 if (!pFrm->AMP_Assoc_PAL_Capabilities.present)
8988 {
8989 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
8990 }
8991 else
8992 {
8993 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Capabilities.pal_capabilities, 4);
8994 }
8995 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("AMP_Assoc_PAL_Version:\n"));
8996 if (!pFrm->AMP_Assoc_PAL_Version.present)
8997 {
8998 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("Not present.\n"));
8999 }
9000 else
9001 {
9002 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_version, 1);
9003 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_CompanyID, 2);
9004 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), ( v_U8_t* )&pFrm->AMP_Assoc_PAL_Version.pal_subversion, 2);
9005 }
9006 FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), FRFL("to:\n"));
9007 FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, BTAMP_AMP_ASSOC), pBuf, nBuf);
9008 }
9009# endif // BTAMP_DUMP_FRAMES
9010 return status;
9011
9012} /* End btampUnpackAMP_ASSOC. */
9013
9014
9015static v_U32_t PackTlvCore(void * pCtx,
9016 v_U8_t *pSrc,
9017 v_U8_t *pBuf,
9018 v_U32_t nBuf,
9019 v_U32_t *pnConsumed,
9020 tTLVDefn TLVs[],
9021 v_U32_t *pidx)
9022{
9023 tTLVDefn *pTlv;
9024 tFRAMES_BOOL *pfFound;
9025 v_U8_t *pBufRemaining;
9026 v_U32_t nBufRemaining, status, status2, len;
9027
9028 BTAMP_PARAMETER_CHECK2(pSrc, pBuf, nBuf, pnConsumed);
9029
9030 (void)pCtx;
9031 status = BTAMP_PARSE_SUCCESS;
9032 status2 = BTAMP_PARSE_SUCCESS;
9033 pBufRemaining = pBuf;
9034 nBufRemaining = nBuf;
9035
9036 pTlv = &( TLVs[0] );
9037 while ( 0xffff != pTlv->id )
9038 {
9039 pfFound = (tFRAMES_BOOL*)(pSrc + pTlv->offset +
9040 pTlv->presenceOffset);
9041 if ( *pfFound && pTlv->minSize > nBufRemaining )
9042 {
9043 FRAMES_LOG3(pCtx, FRLOGE, FRFL("The TLV %s takes at least"
9044 " %d bytes, but there are only %d left in the buffer."
9045 "\n"), pTlv->name, pTlv->minSize, nBufRemaining);
9046 return BTAMP_BUFFER_OVERFLOW;
9047 }
9048
9049 len = 0U;
9050
9051 if ( *pfFound ) {
9052 switch ( pTlv->sig )
9053 {
9054 case SigPackTlvAMP_Assoc_Connected_Channel:
9055 status2 = ( (pfnPackTlvAMP_Assoc_Connected_Channel_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_Connected_Channel* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9056 if (status2) status |= status2;
9057 break;
9058 case SigPackTlvAMP_Assoc_MAC_Addr:
9059 status2 = ( (pfnPackTlvAMP_Assoc_MAC_Addr_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_MAC_Addr* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9060 if (status2) status |= status2;
9061 break;
9062 case SigPackTlvAMP_Assoc_PAL_Capabilities:
9063 status2 = ( (pfnPackTlvAMP_Assoc_PAL_Capabilities_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_PAL_Capabilities* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9064 if (status2) status |= status2;
9065 break;
9066 case SigPackTlvAMP_Assoc_PAL_Version:
9067 status2 = ( (pfnPackTlvAMP_Assoc_PAL_Version_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_PAL_Version* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9068 if (status2) status |= status2;
9069 break;
9070 case SigPackTlvAMP_Assoc_Preferred_Channel_List:
9071 status2 = ( (pfnPackTlvAMP_Assoc_Preferred_Channel_List_t)(pTlv->pfn) )(pCtx, ( tBtampTLVAMP_Assoc_Preferred_Channel_List* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9072 if (status2) status |= status2;
9073 break;
9074 case SigPackTlvFlow_Spec:
9075 status2 = ( (pfnPackTlvFlow_Spec_t)(pTlv->pfn) )(pCtx, ( tBtampTLVFlow_Spec* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9076 if (status2) status |= status2;
9077 break;
9078 case SigPackTlvHCI_Accept_Logical_Link_Cmd:
9079 status2 = ( (pfnPackTlvHCI_Accept_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Accept_Logical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9080 if (status2) status |= status2;
9081 break;
9082 case SigPackTlvHCI_Accept_Physical_Link_Cmd:
9083 status2 = ( (pfnPackTlvHCI_Accept_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Accept_Physical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9084 if (status2) status |= status2;
9085 break;
9086 case SigPackTlvHCI_Channel_Selected_Event:
9087 status2 = ( (pfnPackTlvHCI_Channel_Selected_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Channel_Selected_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9088 if (status2) status |= status2;
9089 break;
9090 case SigPackTlvHCI_Command_Complete_Event:
9091 status2 = ( (pfnPackTlvHCI_Command_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Command_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9092 if (status2) status |= status2;
9093 break;
9094 case SigPackTlvHCI_Command_Status_Event:
9095 status2 = ( (pfnPackTlvHCI_Command_Status_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Command_Status_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9096 if (status2) status |= status2;
9097 break;
9098 case SigPackTlvHCI_Create_Logical_Link_Cmd:
9099 status2 = ( (pfnPackTlvHCI_Create_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Create_Logical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9100 if (status2) status |= status2;
9101 break;
9102 case SigPackTlvHCI_Create_Physical_Link_Cmd:
9103 status2 = ( (pfnPackTlvHCI_Create_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Create_Physical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9104 if (status2) status |= status2;
9105 break;
9106 case SigPackTlvHCI_Data_Buffer_Overflow_Event:
9107 status2 = ( (pfnPackTlvHCI_Data_Buffer_Overflow_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Data_Buffer_Overflow_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9108 if (status2) status |= status2;
9109 break;
9110 case SigPackTlvHCI_Disconnect_Logical_Link_Cmd:
9111 status2 = ( (pfnPackTlvHCI_Disconnect_Logical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Logical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9112 if (status2) status |= status2;
9113 break;
9114 case SigPackTlvHCI_Disconnect_Logical_Link_Complete_Event:
9115 status2 = ( (pfnPackTlvHCI_Disconnect_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Logical_Link_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9116 if (status2) status |= status2;
9117 break;
9118 case SigPackTlvHCI_Disconnect_Physical_Link_Cmd:
9119 status2 = ( (pfnPackTlvHCI_Disconnect_Physical_Link_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Physical_Link_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9120 if (status2) status |= status2;
9121 break;
9122 case SigPackTlvHCI_Disconnect_Physical_Link_Complete_Event:
9123 status2 = ( (pfnPackTlvHCI_Disconnect_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Disconnect_Physical_Link_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9124 if (status2) status |= status2;
9125 break;
9126 case SigPackTlvHCI_Flow_Spec_Modify_Cmd:
9127 status2 = ( (pfnPackTlvHCI_Flow_Spec_Modify_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flow_Spec_Modify_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9128 if (status2) status |= status2;
9129 break;
9130 case SigPackTlvHCI_Flow_Spec_Modify_Complete_Event:
9131 status2 = ( (pfnPackTlvHCI_Flow_Spec_Modify_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flow_Spec_Modify_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9132 if (status2) status |= status2;
9133 break;
9134 case SigPackTlvHCI_Flush_Cmd:
9135 status2 = ( (pfnPackTlvHCI_Flush_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flush_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9136 if (status2) status |= status2;
9137 break;
9138 case SigPackTlvHCI_Flush_Occurred_Event:
9139 status2 = ( (pfnPackTlvHCI_Flush_Occurred_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Flush_Occurred_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9140 if (status2) status |= status2;
9141 break;
9142 case SigPackTlvHCI_Generic_AMP_Link_Key_Notification_Event:
9143 status2 = ( (pfnPackTlvHCI_Generic_AMP_Link_Key_Notification_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Generic_AMP_Link_Key_Notification_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9144 if (status2) status |= status2;
9145 break;
9146 case SigPackTlvHCI_Hardware_Error_Event:
9147 status2 = ( (pfnPackTlvHCI_Hardware_Error_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Hardware_Error_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9148 if (status2) status |= status2;
9149 break;
9150 case SigPackTlvHCI_Logical_Link_Cancel_Cmd:
9151 status2 = ( (pfnPackTlvHCI_Logical_Link_Cancel_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Logical_Link_Cancel_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9152 if (status2) status |= status2;
9153 break;
9154 case SigPackTlvHCI_Logical_Link_Complete_Event:
9155 status2 = ( (pfnPackTlvHCI_Logical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Logical_Link_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9156 if (status2) status |= status2;
9157 break;
9158 case SigPackTlvHCI_Loopback_Command_Event:
9159 status2 = ( (pfnPackTlvHCI_Loopback_Command_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Loopback_Command_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9160 if (status2) status |= status2;
9161 break;
9162 case SigPackTlvHCI_Physical_Link_Complete_Event:
9163 status2 = ( (pfnPackTlvHCI_Physical_Link_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9164 if (status2) status |= status2;
9165 break;
9166 case SigPackTlvHCI_Physical_Link_Loss_Warning_Event:
9167 status2 = ( (pfnPackTlvHCI_Physical_Link_Loss_Warning_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Loss_Warning_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9168 if (status2) status |= status2;
9169 break;
9170 case SigPackTlvHCI_Physical_Link_Recovery_Event:
9171 status2 = ( (pfnPackTlvHCI_Physical_Link_Recovery_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Physical_Link_Recovery_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9172 if (status2) status |= status2;
9173 break;
9174 case SigPackTlvHCI_Qos_Violation_Event:
9175 status2 = ( (pfnPackTlvHCI_Qos_Violation_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Qos_Violation_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9176 if (status2) status |= status2;
9177 break;
9178 case SigPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd:
9179 status2 = ( (pfnPackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9180 if (status2) status |= status2;
9181 break;
9182 case SigPackTlvHCI_Read_Buffer_Size_Cmd:
9183 status2 = ( (pfnPackTlvHCI_Read_Buffer_Size_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Buffer_Size_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9184 if (status2) status |= status2;
9185 break;
9186 case SigPackTlvHCI_Read_Connection_Accept_Timeout_Cmd:
9187 status2 = ( (pfnPackTlvHCI_Read_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Connection_Accept_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9188 if (status2) status |= status2;
9189 break;
9190 case SigPackTlvHCI_Read_Data_Block_Size_Cmd:
9191 status2 = ( (pfnPackTlvHCI_Read_Data_Block_Size_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Data_Block_Size_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9192 if (status2) status |= status2;
9193 break;
9194 case SigPackTlvHCI_Read_Failed_Contact_Counter_Cmd:
9195 status2 = ( (pfnPackTlvHCI_Read_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9196 if (status2) status |= status2;
9197 break;
9198 case SigPackTlvHCI_Read_Flow_Control_Mode_Cmd:
9199 status2 = ( (pfnPackTlvHCI_Read_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Flow_Control_Mode_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9200 if (status2) status |= status2;
9201 break;
9202 case SigPackTlvHCI_Read_Link_Quality_Cmd:
9203 status2 = ( (pfnPackTlvHCI_Read_Link_Quality_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Link_Quality_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9204 if (status2) status |= status2;
9205 break;
9206 case SigPackTlvHCI_Read_Link_Supervision_Timeout_Cmd:
9207 status2 = ( (pfnPackTlvHCI_Read_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9208 if (status2) status |= status2;
9209 break;
9210 case SigPackTlvHCI_Read_Local_AMP_Assoc_Cmd:
9211 status2 = ( (pfnPackTlvHCI_Read_Local_AMP_Assoc_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9212 if (status2) status |= status2;
9213 break;
9214 case SigPackTlvHCI_Read_Local_AMP_Information_Cmd:
9215 status2 = ( (pfnPackTlvHCI_Read_Local_AMP_Information_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_AMP_Information_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9216 if (status2) status |= status2;
9217 break;
9218 case SigPackTlvHCI_Read_Local_Supported_Cmds_Cmd:
9219 status2 = ( (pfnPackTlvHCI_Read_Local_Supported_Cmds_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_Supported_Cmds_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9220 if (status2) status |= status2;
9221 break;
9222 case SigPackTlvHCI_Read_Local_Version_Info_Cmd:
9223 status2 = ( (pfnPackTlvHCI_Read_Local_Version_Info_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Local_Version_Info_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9224 if (status2) status |= status2;
9225 break;
9226 case SigPackTlvHCI_Read_Location_Data_Cmd:
9227 status2 = ( (pfnPackTlvHCI_Read_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Location_Data_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9228 if (status2) status |= status2;
9229 break;
9230 case SigPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd:
9231 status2 = ( (pfnPackTlvHCI_Read_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Logical_Link_Accept_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9232 if (status2) status |= status2;
9233 break;
9234 case SigPackTlvHCI_Read_Loopback_Mode_Cmd:
9235 status2 = ( (pfnPackTlvHCI_Read_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_Loopback_Mode_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9236 if (status2) status |= status2;
9237 break;
9238 case SigPackTlvHCI_Read_RSSI_Cmd:
9239 status2 = ( (pfnPackTlvHCI_Read_RSSI_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Read_RSSI_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9240 if (status2) status |= status2;
9241 break;
9242 case SigPackTlvHCI_Reset_Cmd:
9243 status2 = ( (pfnPackTlvHCI_Reset_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Reset_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9244 if (status2) status |= status2;
9245 break;
9246 case SigPackTlvHCI_Reset_Failed_Contact_Counter_Cmd:
9247 status2 = ( (pfnPackTlvHCI_Reset_Failed_Contact_Counter_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9248 if (status2) status |= status2;
9249 break;
9250 case SigPackTlvHCI_Set_Event_Mask_Cmd:
9251 status2 = ( (pfnPackTlvHCI_Set_Event_Mask_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Event_Mask_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9252 if (status2) status |= status2;
9253 break;
9254 case SigPackTlvHCI_Set_Event_Mask_Page_2_Cmd:
9255 status2 = ( (pfnPackTlvHCI_Set_Event_Mask_Page_2_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9256 if (status2) status |= status2;
9257 break;
9258 case SigPackTlvHCI_Set_Short_Range_Mode_Cmd:
9259 status2 = ( (pfnPackTlvHCI_Set_Short_Range_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Set_Short_Range_Mode_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9260 if (status2) status |= status2;
9261 break;
9262 case SigPackTlvHCI_Short_Range_Mode_Change_Complete_Event:
9263 status2 = ( (pfnPackTlvHCI_Short_Range_Mode_Change_Complete_Event_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Short_Range_Mode_Change_Complete_Event* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9264 if (status2) status |= status2;
9265 break;
9266 case SigPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd:
9267 status2 = ( (pfnPackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9268 if (status2) status |= status2;
9269 break;
9270 case SigPackTlvHCI_Write_Connection_Accept_Timeout_Cmd:
9271 status2 = ( (pfnPackTlvHCI_Write_Connection_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9272 if (status2) status |= status2;
9273 break;
9274 case SigPackTlvHCI_Write_Flow_Control_Mode_Cmd:
9275 status2 = ( (pfnPackTlvHCI_Write_Flow_Control_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Flow_Control_Mode_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9276 if (status2) status |= status2;
9277 break;
9278 case SigPackTlvHCI_Write_Link_Supervision_Timeout_Cmd:
9279 status2 = ( (pfnPackTlvHCI_Write_Link_Supervision_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9280 if (status2) status |= status2;
9281 break;
9282 case SigPackTlvHCI_Write_Location_Data_Cmd:
9283 status2 = ( (pfnPackTlvHCI_Write_Location_Data_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Location_Data_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9284 if (status2) status |= status2;
9285 break;
9286 case SigPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd:
9287 status2 = ( (pfnPackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9288 if (status2) status |= status2;
9289 break;
9290 case SigPackTlvHCI_Write_Loopback_Mode_Cmd:
9291 status2 = ( (pfnPackTlvHCI_Write_Loopback_Mode_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Loopback_Mode_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9292 if (status2) status |= status2;
9293 break;
9294 case SigPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd:
9295 status2 = ( (pfnPackTlvHCI_Write_Remote_AMP_ASSOC_Cmd_t)(pTlv->pfn) )(pCtx, ( tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd* )(pSrc + pTlv->offset), pBufRemaining, nBufRemaining, &len);
9296 if (status2) status |= status2;
9297 break;
9298 default:
9299 FRAMES_LOG1(pCtx, FRLOGE, FRFL("INTERNAL ERROR-- I don't "
9300 "know about the TLV %d; this is most likely a bug in "
9301 "'framesc'.\n"), pTlv->sig);
9302 return BTAMP_INTERNAL_ERROR;
9303 }
9304
9305 } /* End if on *pfFound */
9306 pBufRemaining += len;
9307 nBufRemaining -= len;
9308 *pnConsumed += len;
9309 ++pTlv;
9310 if(len) ++*pidx;
9311 }
9312
9313 return status;
9314
9315}
9316