platforms/os/Symbian/wlanhwinit_stub/inc/wlanhwinitmain.h
changeset 0 10c42ec6c05f
equal deleted inserted replaced
-1:000000000000 0:10c42ec6c05f
       
     1 /*
       
     2  * wlanhwinitmain.h
       
     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 /**********************************************************************************************************************
       
    41 
       
    42   FILENAME:       wlanhwinitmain.h
       
    43 */
       
    44 
       
    45 #ifndef WLANHWINITMAIN_H
       
    46 #define WLANHWINITMAIN_H
       
    47 
       
    48 #include <e32base.h>
       
    49 #include <wlanhwinit.h>
       
    50 #include <e32std.h>
       
    51 
       
    52 //#include "wlanhwinittypes.h"
       
    53 #include "wlanhwinitinterface.h"
       
    54 
       
    55 
       
    56 /**
       
    57 * This class implements the actual HW specific initialization functionality.
       
    58 */
       
    59 NONSHARABLE_CLASS( CWlanHwInitMain ): public CBase, public MWlanHwInitInterface
       
    60     {
       
    61     public:  
       
    62         /* constructor */
       
    63         static CWlanHwInitMain* NewL();
       
    64 
       
    65         /* Destructor */
       
    66         virtual ~CWlanHwInitMain();
       
    67 
       
    68        /** 
       
    69        * \fn     GetHwInitData
       
    70        * \brief  From MWlanHwInitInterface Get pointer to hardware specific initialization data
       
    71        * (reference wlanhwinit.h) 
       
    72        *          
       
    73        * \note    
       
    74        * \param aInitData Pointer to initialization data, NULL if none.  
       
    75        * \param aInitLength Length of initialization data. 
       
    76        * \param aFwData Pointer to firmware data, NULL if none.
       
    77        * \param FwLength Length of firmware data.
       
    78        * \return 
       
    79        * \sa      
       
    80        */ 
       
    81         void GetHwInitData(const TUint8** aInitData, TUint& aInitLength, const TUint8** aFwData, TUint& aFwLength);
       
    82 
       
    83         /** 
       
    84         * \fn     GetMacAddress
       
    85         * \brief  
       
    86         * (reference wlanhwinit.h) 
       
    87         *          
       
    88         * \note    
       
    89         * \param aMacAddress MAC address of the device.  
       
    90         * \return A Symbian error code.
       
    91         * \sa      
       
    92         */ 
       
    93         TInt GetMacAddress(TMacAddr& aMacAddress);
       
    94 
       
    95        /** 
       
    96         * \fn     GetHwTestInitData
       
    97         * \brief  Get pointer to hardware specific initialization data for production testing.
       
    98         * (reference wlanhwinit.h) 
       
    99         *          
       
   100         * \note    
       
   101         * \param aInitData Pointer to initialization data, NULL if none.
       
   102         * \param aInitLength Length of initialization data.
       
   103         * \param aFwData Pointer to firmware data, NULL if none.
       
   104         * \param aFwLength Length of firmware data.
       
   105         * \return
       
   106         * \sa      
       
   107         */ 
       
   108         void GetHwTestInitData(const TUint8** aInitData, TUint& aInitLength, const TUint8** aFwData, TUint& aFwLength);
       
   109 
       
   110         /** 
       
   111          * \fn     GetHwTestInitData
       
   112          * \brief  Get hardware specific production testing data.
       
   113          * (reference wlanhwinit.h) 
       
   114          *          
       
   115          * \note    
       
   116          * \param aId Id of the parameter to read.
       
   117          * \param aData Buffer for read data.
       
   118          * \return A Symbian error code.
       
   119          * \sa      
       
   120          */ 
       
   121         TInt GetHwTestData(TUint aId, TDes8& aData);
       
   122 
       
   123         /** 
       
   124          * \fn     SetHwTestData
       
   125          * \brief  Set hardware specific production testing data.
       
   126          * (reference wlanhwinit.h) 
       
   127          *          
       
   128          * \note    
       
   129          * \param aId Id of the parameter to store.
       
   130          * \param aData Data to be stored.
       
   131          * \return A Symbian error code.
       
   132          * \sa      
       
   133          */ 
       
   134         TInt SetHwTestData(TUint aId, TDesC8& aData);
       
   135 
       
   136     private:
       
   137 
       
   138         CWlanHwInitMain();
       
   139 
       
   140         void ConstructL();
       
   141 
       
   142         void GetMacAddressL(TMacAddr& aMacAddress);
       
   143 
       
   144         void GetTuningDataL(TDes8& aTuningData);
       
   145 
       
   146         void SetTuningDataL(TDesC8& aTuningData);
       
   147                      
       
   148         void FillRadioData(TUint8 *bob10mradio);
       
   149 
       
   150     private:    
       
   151 
       
   152         TUint8* ipaData;
       
   153         
       
   154         /**
       
   155         * Checks if a firmware file can be found from
       
   156         * the memory card.
       
   157         * return False if not found or error occured, True if 
       
   158         * the firmware was successfully read.
       
   159         * The firmware is loaded only once.
       
   160         */
       
   161         TBool IsMMCFirmwareFound();
       
   162  
       
   163  
       
   164       /** 
       
   165      * \fn     IsMMCNvsFound() 
       
   166      * \brief  Checks if a NVS file can be found from the memory card.
       
   167      * 
       
   168      * To success read the NVS file from a card the NVS bin file should be
       
   169      * in nvs directory in the root of the card
       
   170      * 
       
   171      * \param  None
       
   172      * \return false if not found or error occured, True if 
       
   173      * the nvs was successfully read.
       
   174      * The nvs is loaded only once.
       
   175      * \sa     IsMMCNvsFound
       
   176      */ 
       
   177         TBool IsMMCNvsFound();
       
   178  
       
   179  
       
   180         /** Buffer for possible firmware loaded from MC. */
       
   181         HBufC8* iFirmwareMC;
       
   182         
       
   183         /** Buffer for possible NVS loaded from MC. */
       
   184         HBufC8* pNvsMC;
       
   185         
       
   186     };
       
   187 
       
   188 #endif // WLANHWINITMAIN_H