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