blob: 8b1326bdb9d144eeb04f1fe67065dabb7fe899b6 [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//
44// File: utilsApi.cc
45//
46// Description: Implemention of a few utility routines.
47//
48// Author: Neelay Das
49//
50// Copyright 2003, Woodside Networks, Inc. All rights reserved.
51//
52// Change gHistory:
53// 12/15/2003 - NDA - Initial version.
54//
55//===================================================================
56
57
58#include "utilsApi.h"
59
Jeff Johnson295189b2012-06-20 16:38:30 -070060
61
62
Jeff Johnson295189b2012-06-20 16:38:30 -070063
64// -------------------------------------------------------------------
65/**
66 * sirDumpBuf()
67 *
68 * FUNCTION:
69 * This function is called to dump a buffer with a certain level
70 *
71 * LOGIC:
72 *
73 * ASSUMPTIONS:
74 * None.
75 *
76 * NOTE:
77 *
78 * @param pBuf: buffer pointer
79 * @return None.
80 */
81void
82sirDumpBuf(tpAniSirGlobal pMac, tANI_U8 modId, tANI_U32 level, tANI_U8 *buf, tANI_U32 size)
83{
84 tANI_U32 i;
85
86 if (level > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE(modId)])
87 return;
88
89 logDbg(pMac, modId, level, FL("Dumping %d bytes in host order\n"), size);
90
91 for (i=0; (i+7)<size; i+=8)
92 {
93 logDbg(pMac, modId, level,
94 "%02x %02x %02x %02x %02x %02x %02x %02x \n",
95 buf[i],
96 buf[i+1],
97 buf[i+2],
98 buf[i+3],
99 buf[i+4],
100 buf[i+5],
101 buf[i+6],
102 buf[i+7]);
103 }
104
105 // Dump the bytes in the last line
106 for (; i < size; i++)
107 {
108 logDbg(pMac, modId, level, "%02x ", buf[i]);
109
110 if((i+1) == size)
111 logDbg(pMac, modId, level, "\n");
112 }
113
114}/*** end sirDumpBuf() ***/