• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * report.c
3  *
4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 /** \file report.c
36  *  \brief report module implementation
37  *
38  *  \see report.h
39  */
40 
41 #define __FILE_ID__  FILE_ID_132
42 #include "tidef.h"
43 #include "osApi.h"
44 #include "report.h"
45 #include "commonTypes.h"
46 #include "CmdInterfaceCodes.h"
47 
48 
49 
50 
51 /************************************************************************
52  *                        report_create                              	*
53  ************************************************************************/
report_Create(TI_HANDLE hOs)54 TI_HANDLE report_Create (TI_HANDLE hOs)
55 {
56     TReport *pReport;
57 
58     pReport = os_memoryAlloc(hOs, sizeof(TReport));
59     if (!pReport)
60     {
61         return NULL;
62     }
63 
64     pReport->hOs = hOs;
65 
66     os_memoryZero(hOs, pReport->aSeverityTable, sizeof(pReport->aSeverityTable));
67     os_memoryZero(hOs, pReport->aFileEnable, sizeof(pReport->aFileEnable));
68 
69 
70 #ifdef PRINTF_ROLLBACK
71 
72 	/* Fill the files names table */
73 
74     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_0  ]),  "timer                   "  ,  sizeof("timer                   "));
75     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_1  ]),  "measurementMgr          "  ,  sizeof("measurementMgr          "));
76     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_2  ]),  "measurementMgrSM        "  ,  sizeof("measurementMgrSM        "));
77     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_3  ]),  "regulatoryDomain        "  ,  sizeof("regulatoryDomain        "));
78     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_4  ]),  "requestHandler          "  ,  sizeof("requestHandler          "));
79     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_5  ]),  "SoftGemini              "  ,  sizeof("SoftGemini              "));
80     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_6  ]),  "spectrumMngmntMgr       "  ,  sizeof("spectrumMngmntMgr       "));
81     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_7  ]),  "SwitchChannel           "  ,  sizeof("SwitchChannel           "));
82     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_8  ]),  "roamingMngr             "  ,  sizeof("roamingMngr             "));
83     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_9  ]),  "scanMngr                "  ,  sizeof("scanMngr                "));
84     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_10 ]),  "admCtrlXCC              "  ,  sizeof("admCtrlXCC              "));
85     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_11 ]),  "XCCMngr                 "  ,  sizeof("XCCMngr                 "));
86     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_12 ]),  "XCCRMMngr               "  ,  sizeof("XCCRMMngr               "));
87     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_13 ]),  "XCCTSMngr               "  ,  sizeof("XCCTSMngr               "));
88     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_14 ]),  "rogueAp                 "  ,  sizeof("rogueAp                 "));
89     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_15 ]),  "TransmitPowerXCC        "  ,  sizeof("TransmitPowerXCC        "));
90     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_16 ]),  "admCtrl                 "  ,  sizeof("admCtrl                 "));
91     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_17 ]),  "admCtrlNone             "  ,  sizeof("admCtrlNone             "));
92     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_18 ]),  "admCtrlWep              "  ,  sizeof("admCtrlWep              "));
93     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_19 ]),  "admCtrlWpa              "  ,  sizeof("admCtrlWpa              "));
94     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_20 ]),  "admCtrlWpa2             "  ,  sizeof("admCtrlWpa2             "));
95     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_21 ]),  "apConn                  "  ,  sizeof("apConn                  "));
96     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_22 ]),  "broadcastKey802_1x      "  ,  sizeof("broadcastKey802_1x      "));
97     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_23 ]),  "broadcastKeyNone        "  ,  sizeof("broadcastKeyNone        "));
98     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_24 ]),  "broadcastKeySM          "  ,  sizeof("broadcastKeySM          "));
99     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_25 ]),  "conn                    "  ,  sizeof("conn                    "));
100     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_26 ]),  "connIbss                "  ,  sizeof("connIbss                "));
101     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_27 ]),  "connInfra               "  ,  sizeof("connInfra               "));
102     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_28 ]),  "keyDerive               "  ,  sizeof("keyDerive               "));
103     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_29 ]),  "keyDeriveAes            "  ,  sizeof("keyDeriveAes            "));
104     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_30 ]),  "keyDeriveCkip           "  ,  sizeof("keyDeriveCkip           "));
105     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_31 ]),  "keyDeriveTkip           "  ,  sizeof("keyDeriveTkip           "));
106     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_32 ]),  "keyDeriveWep            "  ,  sizeof("keyDeriveWep            "));
107     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_33 ]),  "keyParser               "  ,  sizeof("keyParser               "));
108     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_34 ]),  "keyParserExternal       "  ,  sizeof("keyParserExternal       "));
109     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_35 ]),  "keyParserWep            "  ,  sizeof("keyParserWep            "));
110     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_36 ]),  "mainKeysSm              "  ,  sizeof("mainKeysSm              "));
111     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_37 ]),  "mainSecKeysOnly         "  ,  sizeof("mainSecKeysOnly         "));
112     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_38 ]),  "mainSecNull             "  ,  sizeof("mainSecNull             "));
113     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_39 ]),  "mainSecSm               "  ,  sizeof("mainSecSm               "));
114     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_40 ]),  "rsn                     "  ,  sizeof("rsn                     "));
115     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_41 ]),  "sme                     "  ,  sizeof("sme                     "));
116     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_42 ]),  "smeSelect               "  ,  sizeof("smeSelect               "));
117     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_43 ]),  "smeSm                   "  ,  sizeof("smeSm                   "));
118     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_44 ]),  "unicastKey802_1x        "  ,  sizeof("unicastKey802_1x        "));
119     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_45 ]),  "unicastKeyNone          "  ,  sizeof("unicastKeyNone          "));
120     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_46 ]),  "unicastKeySM            "  ,  sizeof("unicastKeySM            "));
121     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_47 ]),  "CmdDispatcher           "  ,  sizeof("CmdDispatcher           "));
122     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_48 ]),  "CmdHndlr                "  ,  sizeof("CmdHndlr                "));
123     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_49 ]),  "DrvMain                 "  ,  sizeof("DrvMain                 "));
124     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_50 ]),  "EvHandler               "  ,  sizeof("EvHandler               "));
125     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_51 ]),  "Ctrl                    "  ,  sizeof("Ctrl                    "));
126     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_52 ]),  "GeneralUtil             "  ,  sizeof("GeneralUtil             "));
127     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_53 ]),  "RateAdaptation          "  ,  sizeof("RateAdaptation          "));
128     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_54 ]),  "rx                      "  ,  sizeof("rx                      "));
129     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_55 ]),  "TrafficMonitor          "  ,  sizeof("TrafficMonitor          "));
130     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_56 ]),  "txCtrl                  "  ,  sizeof("txCtrl                  "));
131     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_57 ]),  "txCtrlParams            "  ,  sizeof("txCtrlParams            "));
132     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_58 ]),  "txCtrlServ              "  ,  sizeof("txCtrlServ              "));
133     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_59 ]),  "TxDataClsfr             "  ,  sizeof("TxDataClsfr             "));
134     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_60 ]),  "txDataQueue             "  ,  sizeof("txDataQueue             "));
135     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_61 ]),  "txMgmtQueue             "  ,  sizeof("txMgmtQueue             "));
136     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_62 ]),  "txPort                  "  ,  sizeof("txPort                  "));
137     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_63 ]),  "assocSM                 "  ,  sizeof("assocSM                 "));
138     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_64 ]),  "authSm                  "  ,  sizeof("authSm                  "));
139     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_65 ]),  "currBss                 "  ,  sizeof("currBss                 "));
140     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_66 ]),  "healthMonitor           "  ,  sizeof("healthMonitor           "));
141     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_67 ]),  "mlmeBuilder             "  ,  sizeof("mlmeBuilder             "));
142     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_68 ]),  "mlmeParser              "  ,  sizeof("mlmeParser              "));
143     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_69 ]),  "mlmeSm                  "  ,  sizeof("mlmeSm                  "));
144     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_70 ]),  "openAuthSm              "  ,  sizeof("openAuthSm              "));
145     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_71 ]),  "PowerMgr                "  ,  sizeof("PowerMgr                "));
146     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_72 ]),  "PowerMgrDbgPrint        "  ,  sizeof("PowerMgrDbgPrint        "));
147     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_73 ]),  "PowerMgrKeepAlive       "  ,  sizeof("PowerMgrKeepAlive       "));
148     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_74 ]),  "qosMngr                 "  ,  sizeof("qosMngr                 "));
149     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_75 ]),  "roamingInt              "  ,  sizeof("roamingInt              "));
150     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_76 ]),  "ScanCncn                "  ,  sizeof("ScanCncn                "));
151     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_77 ]),  "ScanCncnApp             "  ,  sizeof("ScanCncnApp             "));
152     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_78 ]),  "ScanCncnOsSm            "  ,  sizeof("ScanCncnOsSm            "));
153     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_79 ]),  "ScanCncnSm              "  ,  sizeof("ScanCncnSm              "));
154     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_80 ]),  "ScanCncnSmSpecific      "  ,  sizeof("ScanCncnSmSpecific      "));
155     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_81 ]),  "scanResultTable         "  ,  sizeof("scanResultTable         "));
156     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_82 ]),  "scr                     "  ,  sizeof("scr                     "));
157     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_83 ]),  "sharedKeyAuthSm         "  ,  sizeof("sharedKeyAuthSm         "));
158     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_84 ]),  "siteHash                "  ,  sizeof("siteHash                "));
159     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_85 ]),  "siteMgr                 "  ,  sizeof("siteMgr                 "));
160     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_86 ]),  "StaCap                  "  ,  sizeof("StaCap                  "));
161     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_87 ]),  "systemConfig            "  ,  sizeof("systemConfig            "));
162     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_88 ]),  "templates               "  ,  sizeof("templates               "));
163     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_89 ]),  "trafficAdmControl       "  ,  sizeof("trafficAdmControl       "));
164     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_90 ]),  "CmdBld                  "  ,  sizeof("CmdBld                  "));
165     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_91 ]),  "CmdBldCfg               "  ,  sizeof("CmdBldCfg               "));
166     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_92 ]),  "CmdBldCfgIE             "  ,  sizeof("CmdBldCfgIE             "));
167     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_93 ]),  "CmdBldCmd               "  ,  sizeof("CmdBldCmd               "));
168     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_94 ]),  "CmdBldCmdIE             "  ,  sizeof("CmdBldCmdIE             "));
169     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_95 ]),  "CmdBldItr               "  ,  sizeof("CmdBldItr               "));
170     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_96 ]),  "CmdBldItrIE             "  ,  sizeof("CmdBldItrIE             "));
171     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_97 ]),  "CmdQueue                "  ,  sizeof("CmdQueue                "));
172     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_98 ]),  "RxQueue                 "  ,  sizeof("RxQueue                 "));
173     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_99 ]),  "txCtrlBlk               "  ,  sizeof("txCtrlBlk               "));
174     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_100]),  "txHwQueue               "  ,  sizeof("txHwQueue               "));
175     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_101]),  "CmdMBox                 "  ,  sizeof("CmdMBox                 "));
176     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_102]),  "eventMbox               "  ,  sizeof("eventMbox               "));
177     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_103]),  "fwDebug                 "  ,  sizeof("fwDebug                 "));
178     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_104]),  "FwEvent                 "  ,  sizeof("FwEvent                 "));
179     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_105]),  "HwInit                  "  ,  sizeof("HwInit                  "));
180     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_106]),  "RxXfer                  "  ,  sizeof("RxXfer                  "));
181     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_107]),  "txResult                "  ,  sizeof("txResult                "));
182     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_108]),  "txXfer                  "  ,  sizeof("txXfer                  "));
183     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_109]),  "MacServices             "  ,  sizeof("MacServices             "));
184     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_110]),  "MeasurementSrv          "  ,  sizeof("MeasurementSrv          "));
185     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_111]),  "measurementSrvDbgPrint  "  ,  sizeof("measurementSrvDbgPrint  "));
186     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_112]),  "MeasurementSrvSM        "  ,  sizeof("MeasurementSrvSM        "));
187     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_113]),  "PowerSrv                "  ,  sizeof("PowerSrv                "));
188     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_114]),  "PowerSrvSM              "  ,  sizeof("PowerSrvSM              "));
189     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_115]),  "ScanSrv                 "  ,  sizeof("ScanSrv                 "));
190     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_116]),  "ScanSrvSM               "  ,  sizeof("ScanSrvSM               "));
191     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_117]),  "TWDriver                "  ,  sizeof("TWDriver                "));
192     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_118]),  "TWDriverCtrl            "  ,  sizeof("TWDriverCtrl            "));
193     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_119]),  "TWDriverRadio           "  ,  sizeof("TWDriverRadio           "));
194     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_120]),  "TWDriverTx              "  ,  sizeof("TWDriverTx              "));
195     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_121]),  "TwIf                    "  ,  sizeof("TwIf                    "));
196     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_122]),  "SdioBusDrv              "  ,  sizeof("SdioBusDrv              "));
197     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_123]),  "TxnQueue                "  ,  sizeof("TxnQueue                "));
198     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_124]),  "WspiBusDrv              "  ,  sizeof("WspiBusDrv              "));
199     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_125]),  "context                 "  ,  sizeof("context                 "));
200     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_126]),  "freq                    "  ,  sizeof("freq                    "));
201     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_127]),  "fsm                     "  ,  sizeof("fsm                     "));
202     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_128]),  "GenSM                   "  ,  sizeof("GenSM                   "));
203     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_129]),  "mem                     "  ,  sizeof("mem                     "));
204     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_130]),  "queue                   "  ,  sizeof("queue                   "));
205     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_131]),  "rate                    "  ,  sizeof("rate                    "));
206     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_132]),  "report                  "  ,  sizeof("report                  "));
207     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_133]),  "stack                   "  ,  sizeof("stack                   "));
208     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_134]),  "externalSec             "  ,  sizeof("externalSec             "));
209     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_135]),  "roamingMngr_autoSM      "  ,  sizeof("roamingMngr_autoSM      "));
210     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_136]),  "roamingMngr_manualSM    "  ,  sizeof("roamingMngr_manualSM    "));
211     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_137]),  "cmdinterpretoid         "  ,  sizeof("cmdinterpretoid         "));
212     os_memoryCopy(hOs, (void *)(pReport->aFileName[FILE_ID_138]),  "WlanDrvIf               "  ,  sizeof("WlanDrvIf               "));
213 
214 #endif  /* PRINTF_ROLLBACK */
215 
216 	/* Severity table description */
217 
218 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_INIT]),              "INIT", sizeof("INIT"));
219 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_INFORMATION]),       "INFORMATION", sizeof("INFORMATION"));
220 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_WARNING]),           "WARNING", sizeof("WARNING"));
221 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_ERROR]),             "ERROR", sizeof("ERROR"));
222 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_FATAL_ERROR]),       "FATAL_ERROR", sizeof("FATAL_ERROR"));
223 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_SM]),                "SM", sizeof("SM"));
224 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_CONSOLE]),           "CONSOLE", sizeof("CONSOLE"));
225 
226     return (TI_HANDLE)pReport;
227 }
228 
229 /************************************************************************
230  *                        report_SetDefaults                            *
231  ************************************************************************/
report_SetDefaults(TI_HANDLE hReport,TReportInitParams * pInitParams)232 TI_STATUS report_SetDefaults (TI_HANDLE hReport, TReportInitParams *pInitParams)
233 {
234 	if( (NULL == hReport) || (NULL == pInitParams))
235 	{
236 		return TI_NOK;
237 	}
238 
239     report_SetReportFilesTable (hReport, (TI_UINT8 *)pInitParams->aFileEnable);
240     report_SetReportSeverityTable (hReport, (TI_UINT8 *)pInitParams->aSeverityTable);
241 
242     return TI_OK;
243 }
244 
245 /************************************************************************
246  *                        report_unLoad                                 *
247  ************************************************************************/
report_Unload(TI_HANDLE hReport)248 TI_STATUS report_Unload (TI_HANDLE hReport)
249 {
250     TReport *pReport = (TReport *)hReport;
251 
252 	if(NULL == pReport)
253 	{
254 		return TI_NOK;
255 	}
256 
257 #if defined(TIWLN_WINCE30) && defined(TI_DBG)
258     closeMyFile();
259 #endif
260 
261     os_memoryFree(pReport->hOs, pReport, sizeof(TReport));
262     return TI_OK;
263 }
264 
265 
report_SetReportModule(TI_HANDLE hReport,TI_UINT8 module_index)266 TI_STATUS report_SetReportModule(TI_HANDLE hReport, TI_UINT8 module_index)
267 {
268 	if(NULL == hReport)
269 	{
270 		return TI_NOK;
271 	}
272 
273     ((TReport *)hReport)->aFileEnable[module_index] = 1;
274 
275     return TI_OK;
276 }
277 
278 
report_ClearReportModule(TI_HANDLE hReport,TI_UINT8 module_index)279 TI_STATUS report_ClearReportModule(TI_HANDLE hReport, TI_UINT8 module_index)
280 {
281 	if(NULL == hReport)
282 	{
283 		return TI_NOK;
284 	}
285 
286     ((TReport *)hReport)->aFileEnable[module_index] = 0;
287 
288     return TI_OK;
289 }
290 
291 
report_GetReportFilesTable(TI_HANDLE hReport,TI_UINT8 * pFiles)292 TI_STATUS report_GetReportFilesTable(TI_HANDLE hReport, TI_UINT8 *pFiles)
293 {
294     TI_UINT8 index;
295 
296 	if( (NULL == hReport) || (NULL == pFiles))
297 	{
298 		return TI_NOK;
299 	}
300 
301     os_memoryCopy(((TReport *)hReport)->hOs,
302                   (void *)pFiles,
303                   (void *)(((TReport *)hReport)->aFileEnable),
304                   sizeof(((TReport *)hReport)->aFileEnable));
305 
306     for (index = 0; index < sizeof(((TReport *)hReport)->aFileEnable); index++)
307     {
308         pFiles[index] += '0';
309     }
310 
311     return TI_OK;
312 }
313 
314 
report_SetReportFilesTable(TI_HANDLE hReport,TI_UINT8 * pFiles)315 TI_STATUS report_SetReportFilesTable(TI_HANDLE hReport, TI_UINT8 *pFiles)
316 {
317     TI_UINT8 index;
318 
319 	if( (NULL == hReport) || (NULL == pFiles))
320 	{
321 		return TI_NOK;
322 	}
323 
324 
325     for (index = 0; index < sizeof(((TReport *)hReport)->aFileEnable); index++)
326     {
327         pFiles[index] -= '0';
328     }
329 
330     os_memoryCopy(((TReport *)hReport)->hOs,
331                   (void *)(((TReport *)hReport)->aFileEnable),
332                   (void *)pFiles,
333                   sizeof(((TReport *)hReport)->aFileEnable));
334 
335     return TI_OK;
336 }
337 
338 
report_GetReportSeverityTable(TI_HANDLE hReport,TI_UINT8 * pSeverities)339 TI_STATUS report_GetReportSeverityTable(TI_HANDLE hReport, TI_UINT8 *pSeverities)
340 {
341     TI_UINT8 index;
342 
343 	if( (NULL == hReport) || (NULL == pSeverities))
344 	{
345 
346 		return TI_NOK;
347 	}
348 
349 
350     os_memoryCopy (((TReport *)hReport)->hOs,
351                    (void *)pSeverities,
352                    (void *)(((TReport *)hReport)->aSeverityTable),
353                    sizeof(((TReport *)hReport)->aSeverityTable));
354 
355     for (index = 0; index < sizeof(((TReport *)hReport)->aSeverityTable); index++)
356     {
357         pSeverities[index] += '0';
358     }
359 
360     return TI_OK;
361 }
362 
363 
report_SetReportSeverityTable(TI_HANDLE hReport,TI_UINT8 * pSeverities)364 TI_STATUS report_SetReportSeverityTable(TI_HANDLE hReport, TI_UINT8 *pSeverities)
365 {
366     TI_UINT8 index;
367 
368 	if( (NULL == hReport) || (NULL == pSeverities))
369 	{
370 		return TI_NOK;
371 	}
372 
373     for (index = 0; index < sizeof(((TReport *)hReport)->aSeverityTable); index++)
374     {
375         pSeverities[index] -= '0';
376     }
377 
378     os_memoryCopy(((TReport *)hReport)->hOs,
379                   (void *)(((TReport *)hReport)->aSeverityTable),
380                   (void *)pSeverities,
381                   sizeof(((TReport *)hReport)->aSeverityTable));
382 
383     return TI_OK;
384 }
385 
386 
387 /***********************************************************************
388 *                        report_setParam
389 ***********************************************************************/
report_SetParam(TI_HANDLE hReport,TReportParamInfo * pParam)390 TI_STATUS report_SetParam (TI_HANDLE hReport, TReportParamInfo *pParam)
391 {
392 	if( (NULL == hReport) || (NULL == pParam))
393 	{
394 		return TI_NOK;
395 	}
396 
397 	switch (pParam->paramType)
398 	{
399 	case REPORT_MODULE_ON_PARAM:
400 		report_SetReportModule(hReport, pParam->content.aFileEnable[0]);
401 		break;
402 
403 	case REPORT_MODULE_OFF_PARAM:
404 		report_ClearReportModule(hReport, pParam->content.aFileEnable[0]);
405 		break;
406 
407 	case REPORT_MODULE_TABLE_PARAM:
408 		report_SetReportFilesTable(hReport, (TI_UINT8 *)pParam->content.aFileEnable);
409 		break;
410 
411 	case REPORT_SEVERITY_TABLE_PARAM:
412 		report_SetReportSeverityTable(hReport, (TI_UINT8 *)pParam->content.aSeverityTable);
413 		break;
414 
415 	case REPORT_PPMODE_VALUE_PARAM:
416 		os_setDebugMode((TI_BOOL)pParam->content.uReportPPMode);
417 		break;
418 
419 	case REPORT_OUTPUT_TO_LOGGER_ON:
420 		os_setDebugOutputToLogger(TI_TRUE);
421 		break;
422 
423 	case REPORT_OUTPUT_TO_LOGGER_OFF:
424 		os_setDebugOutputToLogger(TI_FALSE);
425         break;
426 
427 	default:
428 		TRACE1(hReport, REPORT_SEVERITY_ERROR, "Set param, Params is not supported, %d\n", pParam->paramType);
429 		return PARAM_NOT_SUPPORTED;
430 	}
431 
432 	return TI_OK;
433 }
434 
435 /***********************************************************************
436  *                        report_getParam
437  ***********************************************************************/
report_GetParam(TI_HANDLE hReport,TReportParamInfo * pParam)438 TI_STATUS report_GetParam (TI_HANDLE hReport, TReportParamInfo *pParam)
439 {
440 	if( (NULL == hReport) || (NULL == pParam))
441 	{
442 		return TI_NOK;
443 	}
444 
445     switch (pParam->paramType)
446     {
447     case REPORT_MODULE_TABLE_PARAM:
448         report_GetReportFilesTable(hReport, (TI_UINT8 *)pParam->content.aFileEnable);
449         break;
450 
451     case REPORT_SEVERITY_TABLE_PARAM:
452         report_GetReportSeverityTable(hReport, (TI_UINT8 *)pParam->content.aSeverityTable);
453         break;
454 
455     default:
456         TRACE1(hReport, REPORT_SEVERITY_ERROR, "Get param, Params is not supported, %d\n", pParam->paramType);
457         return PARAM_NOT_SUPPORTED;
458     }
459 
460     return TI_OK;
461 }
462 
463 
464 /************************************************************************
465  *                        report_Dump                                 *
466  ************************************************************************/
report_Dump(TI_UINT8 * pBuffer,char * pString,TI_UINT32 size)467 TI_STATUS report_Dump (TI_UINT8 *pBuffer, char *pString, TI_UINT32 size)
468 {
469     TI_UINT32 index;
470     TI_UINT8  temp_nibble;
471 	if( (NULL == pBuffer) || (NULL == pString))
472 	{
473 		return TI_NOK;
474 }
475 
476     /* Go over pBuffer and convert it to chars */
477     for (index = 0; index < size; index++)
478 {
479         /* First nibble */
480         temp_nibble = (pBuffer[index] & 0x0F);
481         if (temp_nibble <= 9)
482 	{
483             pString[(index << 1) + 1] = temp_nibble + '0';
484 	}
485         else
486 	{
487             pString[(index << 1) + 1] = temp_nibble - 10 + 'A';
488 	}
489 
490         /* Second nibble */
491         temp_nibble = ((pBuffer[index] & 0xF0) >> 4);
492         if (temp_nibble <= 9)
493 {
494             pString[(index << 1)] = temp_nibble + '0';
495 	}
496         else
497 {
498             pString[(index << 1)] = temp_nibble - 10 + 'A';
499 	 }
500 	}
501 
502     /* Put string terminator */
503     pString[(size * 2)] = 0;
504 
505     return TI_OK;
506 	}
507 
508 
509 /* HEX DUMP for BDs !!! Debug code only !!! */
report_PrintDump(TI_UINT8 * pData,TI_UINT32 datalen)510 TI_STATUS report_PrintDump (TI_UINT8 *pData, TI_UINT32 datalen)
511 {
512 #ifdef TI_DBG
513     TI_INT32  dbuflen=0;
514     TI_UINT32 j;
515     TI_CHAR   dbuf[50];
516     static const TI_CHAR hexdigits[16] = "0123456789ABCDEF";
517 
518 
519 	if((NULL == pData)||(datalen <= 0)
520 )
521 	{
522 		return TI_NOK;
523 	}
524 
525 
526     for(j=0; j < datalen;)
527     {
528         /* Add a byte to the line*/
529         dbuf[dbuflen] =  hexdigits[(pData[j] >> 4)&0x0f];
530         dbuf[dbuflen+1] = hexdigits[pData[j] & 0x0f];
531         dbuf[dbuflen+2] = ' ';
532         dbuf[dbuflen+3] = '\0';
533         dbuflen += 3;
534         j++;
535         if((j % 16) == 0)
536         {
537             /* Dump a line every 16 hex digits*/
538             WLAN_OS_REPORT(("%04.4x  %s\n", j-16, dbuf));
539             dbuflen = 0;
540         }
541     }
542     /* Flush if something has left in the line*/
543     if(dbuflen)
544         WLAN_OS_REPORT(("%04.4x  %s\n", j & 0xfff0, dbuf));
545 #endif
546     return TI_OK;
547 }
548 
handleRunProblem(EProblemType prType)549 void handleRunProblem(EProblemType prType)
550 {
551     /* Here problem handling methods can be specified per problem type.
552        They can be OS dependent and can contain debug prints, traceBack,
553        fatal error initiation etc.
554     */
555     return; /* empty for now */
556 }
557