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