blob: 0dde12d89dd6794ae055cfca854fa7657d89bdb5 [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 * Airgo Networks, Inc proprietary. All rights reserved.
45 * This file schDebug.cc contains some debug functions.
46 *
47 * Author: Sandesh Goel
48 * Date: 02/25/02
49 * History:-
50 * Date Modified by Modification Information
51 * --------------------------------------------------------------------
52 *
53 */
54
55
56#include "schDebug.h"
57
58void schLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)
59{
60#ifdef WLAN_DEBUG
61 // Verify against current log level
62 if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SCH_MODULE_ID )] )
63 return;
64 else
65 {
66 va_list marker;
67
68 va_start( marker, pString ); /* Initialize variable arguments. */
69
70 logDebug(pMac, SIR_SCH_MODULE_ID, loglevel, pString, marker);
71
72 va_end( marker ); /* Reset variable arguments. */
73 }
74#endif
75}
76
77#if (WNI_POLARIS_FW_PRODUCT==AP)
78#ifdef WMM_SA
79
80#include "schClass.h"
81#include "schDebug.h"
82
83
84void dumpSchedule(tANI_U8 index)
85{
86 tpSchSchedule s = &schedule[index];
87
88 PELOG2(schLog(pMac, LOG2, FL("============== SCHEDULE %d ===============\n"), index);)
89 dumpSchedule(s);
90}
91
92void schClass::dumpSchedule(tpSchSchedule s)
93{
94 PELOG2(schLog(pMac, LOG2, FL("\ttotTxop %d totInst %d curInst %d\n"),
95 s->totTxopLo+0x100*s->totTxopHi, s->totInst, s->curInst);)
96 for(tANI_U32 i=0; i<s->totInst; i++)
97 {
98 PELOG2(schLog(pMac, LOG2, FL("\t[%d] "), i);)
99 dumpInstruction(&s->inst[i]);
100 }
101 PELOG2(schLog(pMac, LOG2, FL("\t+++++++++++++++++++++++++++++++++++++++++++\n"));)
102}
103
104void dumpInstruction(tpSchInstruction t)
105{
106 if (t->type == SCH_INST_DATA)
107 PELOG2(schLog(pMac, LOG2, "DATA (%d,%d) txop %d feedback %d\n",
108 t->staidLo+0x10*t->staidHi, t->pri,
109 t->txopLo+0x100*t->txopHi, t->feedback);)
110 else
111 PELOG2(schLog(pMac, LOG2, "POLL (%d,%d) txop %d feedback %d\n",
112 t->staidLo+0x10*t->staidHi, t->pri,
113 t->txopLo+0x100*t->txopHi, t->feedback);)
114}
115
116void dumpQueueSizes()
117{
118 PELOG3(schLog(pMac, LOG3, FL("------- QUEUE SIZES [sta][pri][DL(0)/UL(1)] -------\n"));)
119 for(int i=0; i<256; i++)
120 for(int j=0; j<8; j++)
121 for(int k=0; k<2; k++)
122 {
123 if (queue[i][j][k].packets > 0)
124 PELOG3(schLog(pMac, LOG3, FL("\tQueueLength[%d][%d][%d] = %d packets %d txop (serviced %d)\n"),
125 i, j, k,
126 queue[i][j][k].packets, queue[i][j][k].txop, queue[i][j][k].serviced);)
127 }
128}
129
130void printQosClass(tANI_U8 classId)
131{
132 schQoSClass *q = &qosClass[classId];
133
134 if (q->activeNext == NULL)
135 PELOG3(schLog(pMac, LOG3, FL("printQosClass[%d] : Active list empty\n"), classId);)
136 else
137 {
138 tpSchQueueState ptr = q->activeNext->next;
139 tANI_U16 i;
140 for(i=1; ptr != q->activeNext; ptr = ptr->next, i++);
141 PELOG3(schLog(pMac, LOG3, FL("printQosClass[%d] : Active Qs %d nextPtr %x prevPtr %x creditsRem %d\n"),
142 classId, i, (tANI_U32) q->activeNext, (tANI_U32) q->activePrev, q->creditsRemaining);)
143 }
144}
145
146#endif /* WMM_SA */
147#endif // (WNI_POLARIS_FW_PRODUCT==AP)
148
149// --------------------------------------------------------------------