Home | History | Annotate | Download | only in utils
      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  ************************************************************************/
     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 
    213 #endif  /* PRINTF_ROLLBACK */
    214 
    215 	/* Severity table description */
    216 
    217 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_INIT]),              "INIT", sizeof("INIT"));
    218 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_INFORMATION]),       "INFORMATION", sizeof("INFORMATION"));
    219 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_WARNING]),           "WARNING", sizeof("WARNING"));
    220 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_ERROR]),             "ERROR", sizeof("ERROR"));
    221 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_FATAL_ERROR]),       "FATAL_ERROR", sizeof("FATAL_ERROR"));
    222 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_SM]),                "SM", sizeof("SM"));
    223 	os_memoryCopy(hOs, (char *)(pReport->aSeverityDesc[REPORT_SEVERITY_CONSOLE]),           "CONSOLE", sizeof("CONSOLE"));
    224 
    225     return (TI_HANDLE)pReport;
    226 }
    227 
    228 /************************************************************************
    229  *                        report_SetDefaults                            *
    230  ************************************************************************/
    231 TI_STATUS report_SetDefaults (TI_HANDLE hReport, TReportInitParams *pInitParams)
    232 {
    233 	if( (NULL == hReport) || (NULL == pInitParams))
    234 	{
    235 		return TI_NOK;
    236 	}
    237 
    238     report_SetReportFilesTable (hReport, (TI_UINT8 *)pInitParams->aFileEnable);
    239     report_SetReportSeverityTable (hReport, (TI_UINT8 *)pInitParams->aSeverityTable);
    240 
    241     return TI_OK;
    242 }
    243 
    244 /************************************************************************
    245  *                        report_unLoad                                 *
    246  ************************************************************************/
    247 TI_STATUS report_Unload (TI_HANDLE hReport)
    248 {
    249     TReport *pReport = (TReport *)hReport;
    250 
    251 	if(NULL == pReport)
    252 	{
    253 		return TI_NOK;
    254 	}
    255 
    256 #if defined(TIWLN_WINCE30) && defined(TI_DBG)
    257     closeMyFile();
    258 #endif
    259 
    260     os_memoryFree(pReport->hOs, pReport, sizeof(TReport));
    261     return TI_OK;
    262 }
    263 
    264 
    265 TI_STATUS report_SetReportModule(TI_HANDLE hReport, TI_UINT8 module_index)
    266 {
    267 	if(NULL == hReport)
    268 	{
    269 		return TI_NOK;
    270 	}
    271 
    272     ((TReport *)hReport)->aFileEnable[module_index] = 1;
    273 
    274     return TI_OK;
    275 }
    276 
    277 
    278 TI_STATUS report_ClearReportModule(TI_HANDLE hReport, TI_UINT8 module_index)
    279 {
    280 	if(NULL == hReport)
    281 	{
    282 		return TI_NOK;
    283 	}
    284 
    285     ((TReport *)hReport)->aFileEnable[module_index] = 0;
    286 
    287     return TI_OK;
    288 }
    289 
    290 
    291 TI_STATUS report_GetReportFilesTable(TI_HANDLE hReport, TI_UINT8 *pFiles)
    292 {
    293     TI_UINT8 index;
    294 
    295 	if( (NULL == hReport) || (NULL == pFiles))
    296 	{
    297 		return TI_NOK;
    298 	}
    299 
    300     os_memoryCopy(((TReport *)hReport)->hOs,
    301                   (void *)pFiles,
    302                   (void *)(((TReport *)hReport)->aFileEnable),
    303                   sizeof(((TReport *)hReport)->aFileEnable));
    304 
    305     for (index = 0; index < sizeof(((TReport *)hReport)->aFileEnable); index++)
    306     {
    307         pFiles[index] += '0';
    308     }
    309 
    310     return TI_OK;
    311 }
    312 
    313 
    314 TI_STATUS report_SetReportFilesTable(TI_HANDLE hReport, TI_UINT8 *pFiles)
    315 {
    316     TI_UINT8 index;
    317 
    318 	if( (NULL == hReport) || (NULL == pFiles))
    319 	{
    320 		return TI_NOK;
    321 	}
    322 
    323 
    324     for (index = 0; index < sizeof(((TReport *)hReport)->aFileEnable); index++)
    325     {
    326         pFiles[index] -= '0';
    327     }
    328 
    329     os_memoryCopy(((TReport *)hReport)->hOs,
    330                   (void *)(((TReport *)hReport)->aFileEnable),
    331                   (void *)pFiles,
    332                   sizeof(((TReport *)hReport)->aFileEnable));
    333 
    334     return TI_OK;
    335 }
    336 
    337 
    338 TI_STATUS report_GetReportSeverityTable(TI_HANDLE hReport, TI_UINT8 *pSeverities)
    339 {
    340     TI_UINT8 index;
    341 
    342 	if( (NULL == hReport) || (NULL == pSeverities))
    343 	{
    344 
    345 		return TI_NOK;
    346 	}
    347 
    348 
    349     os_memoryCopy (((TReport *)hReport)->hOs,
    350                    (void *)pSeverities,
    351                    (void *)(((TReport *)hReport)->aSeverityTable),
    352                    sizeof(((TReport *)hReport)->aSeverityTable));
    353 
    354     for (index = 0; index < sizeof(((TReport *)hReport)->aSeverityTable); index++)
    355     {
    356         pSeverities[index] += '0';
    357     }
    358 
    359     return TI_OK;
    360 }
    361 
    362 
    363 TI_STATUS report_SetReportSeverityTable(TI_HANDLE hReport, TI_UINT8 *pSeverities)
    364 {
    365     TI_UINT8 index;
    366 
    367 	if( (NULL == hReport) || (NULL == pSeverities))
    368 	{
    369 		return TI_NOK;
    370 	}
    371 
    372     for (index = 0; index < sizeof(((TReport *)hReport)->aSeverityTable); index++)
    373     {
    374         pSeverities[index] -= '0';
    375     }
    376 
    377     os_memoryCopy(((TReport *)hReport)->hOs,
    378                   (void *)(((TReport *)hReport)->aSeverityTable),
    379                   (void *)pSeverities,
    380                   sizeof(((TReport *)hReport)->aSeverityTable));
    381 
    382     return TI_OK;
    383 }
    384 
    385 
    386 /***********************************************************************
    387 *                        report_setParam
    388 ***********************************************************************/
    389 TI_STATUS report_SetParam (TI_HANDLE hReport, TReportParamInfo *pParam)
    390 {
    391 	if( (NULL == hReport) || (NULL == pParam))
    392 	{
    393 		return TI_NOK;
    394 	}
    395 
    396 	switch (pParam->paramType)
    397 	{
    398 	case REPORT_MODULE_ON_PARAM:
    399 		report_SetReportModule(hReport, pParam->content.aFileEnable[0]);
    400 		break;
    401 
    402 	case REPORT_MODULE_OFF_PARAM:
    403 		report_ClearReportModule(hReport, pParam->content.aFileEnable[0]);
    404 		break;
    405 
    406 	case REPORT_MODULE_TABLE_PARAM:
    407 		report_SetReportFilesTable(hReport, (TI_UINT8 *)pParam->content.aFileEnable);
    408 		break;
    409 
    410 	case REPORT_SEVERITY_TABLE_PARAM:
    411 		report_SetReportSeverityTable(hReport, (TI_UINT8 *)pParam->content.aSeverityTable);
    412 		break;
    413 
    414 	case REPORT_PPMODE_VALUE_PARAM:
    415 		os_setDebugMode((TI_BOOL)pParam->content.uReportPPMode);
    416 		break;
    417 
    418 	case REPORT_OUTPUT_TO_LOGGER_ON:
    419 		os_setDebugOutputToLogger(TI_TRUE);
    420 		break;
    421 
    422 	case REPORT_OUTPUT_TO_LOGGER_OFF:
    423 		os_setDebugOutputToLogger(TI_FALSE);
    424         break;
    425 
    426 	default:
    427 		TRACE1(hReport, REPORT_SEVERITY_ERROR, "Set param, Params is not supported, %d\n", pParam->paramType);
    428 		return PARAM_NOT_SUPPORTED;
    429 	}
    430 
    431 	return TI_OK;
    432 }
    433 
    434 /***********************************************************************
    435  *                        report_getParam
    436  ***********************************************************************/
    437 TI_STATUS report_GetParam (TI_HANDLE hReport, TReportParamInfo *pParam)
    438 {
    439 	if( (NULL == hReport) || (NULL == pParam))
    440 	{
    441 		return TI_NOK;
    442 	}
    443 
    444     switch (pParam->paramType)
    445     {
    446     case REPORT_MODULE_TABLE_PARAM:
    447         report_GetReportFilesTable(hReport, (TI_UINT8 *)pParam->content.aFileEnable);
    448         break;
    449 
    450     case REPORT_SEVERITY_TABLE_PARAM:
    451         report_GetReportSeverityTable(hReport, (TI_UINT8 *)pParam->content.aSeverityTable);
    452         break;
    453 
    454     default:
    455         TRACE1(hReport, REPORT_SEVERITY_ERROR, "Get param, Params is not supported, %d\n", pParam->paramType);
    456         return PARAM_NOT_SUPPORTED;
    457     }
    458 
    459     return TI_OK;
    460 }
    461 
    462 
    463 /************************************************************************
    464  *                        report_Dump                                 *
    465  ************************************************************************/
    466 TI_STATUS report_Dump (TI_UINT8 *pBuffer, char *pString, TI_UINT32 size)
    467 {
    468     TI_UINT32 index;
    469     TI_UINT8  temp_nibble;
    470 	if( (NULL == pBuffer) || (NULL == pString))
    471 	{
    472 		return TI_NOK;
    473 }
    474 
    475     /* Go over pBuffer and convert it to chars */
    476     for (index = 0; index < size; index++)
    477 {
    478         /* First nibble */
    479         temp_nibble = (pBuffer[index] & 0x0F);
    480         if (temp_nibble <= 9)
    481 	{
    482             pString[(index << 1) + 1] = temp_nibble + '0';
    483 	}
    484         else
    485 	{
    486             pString[(index << 1) + 1] = temp_nibble - 10 + 'A';
    487 	}
    488 
    489         /* Second nibble */
    490         temp_nibble = ((pBuffer[index] & 0xF0) >> 4);
    491         if (temp_nibble <= 9)
    492 {
    493             pString[(index << 1)] = temp_nibble + '0';
    494 	}
    495         else
    496 {
    497             pString[(index << 1)] = temp_nibble - 10 + 'A';
    498 	 }
    499 	}
    500 
    501     /* Put string terminator */
    502     pString[(size * 2)] = 0;
    503 
    504     return TI_OK;
    505 	}
    506 
    507 
    508 /* HEX DUMP for BDs !!! Debug code only !!! */
    509 TI_STATUS report_PrintDump (TI_UINT8 *pData, TI_UINT32 datalen)
    510 {
    511 #ifdef TI_DBG
    512     TI_INT32  dbuflen=0;
    513     TI_UINT32 j;
    514     TI_CHAR   dbuf[50];
    515     static const TI_CHAR hexdigits[16] = "0123456789ABCDEF";
    516 
    517 
    518 	if((NULL == pData)||(datalen <= 0)
    519 )
    520 	{
    521 		return TI_NOK;
    522 	}
    523 
    524 
    525     for(j=0; j < datalen;)
    526     {
    527         /* Add a byte to the line*/
    528         dbuf[dbuflen] =  hexdigits[(pData[j] >> 4)&0x0f];
    529         dbuf[dbuflen+1] = hexdigits[pData[j] & 0x0f];
    530         dbuf[dbuflen+2] = ' ';
    531         dbuf[dbuflen+3] = '\0';
    532         dbuflen += 3;
    533         j++;
    534         if((j % 16) == 0)
    535         {
    536             /* Dump a line every 16 hex digits*/
    537             WLAN_OS_REPORT(("%04.4x  %s\n", j-16, dbuf));
    538             dbuflen = 0;
    539         }
    540     }
    541     /* Flush if something has left in the line*/
    542     if(dbuflen)
    543         WLAN_OS_REPORT(("%04.4x  %s\n", j & 0xfff0, dbuf));
    544 #endif
    545     return TI_OK;
    546 }
    547 
    548