platforms/os/Symbian/WVSS/src/wha/TIWhaAdaptCb.cpp
changeset 0 10c42ec6c05f
equal deleted inserted replaced
-1:000000000000 0:10c42ec6c05f
       
     1 /*
       
     2  * TIWhaAdaptCb.cpp
       
     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 /** \file  WhaAdaptCB.cpp 
       
    42  *  \brief  Adapt CB between C code and C++ code (i.e TWD to TIWha functions)
       
    43  *
       
    44  *  \see   
       
    45  */
       
    46 #include "external_inc.h"
       
    47 #include "TIWhaAdaptCb.h"
       
    48 
       
    49 #define __FILE_ID__								FILE_ID_145
       
    50 
       
    51 #define pTIWha (reinterpret_cast<TIWha*>(hTIWha))
       
    52 
       
    53 
       
    54 
       
    55 /** 
       
    56  * \fn     ConnectBus
       
    57  * \brief  
       
    58  *          ConnectBus Callback called in two contexts:  
       
    59  *          1. From Bus driver context on an A-sync bus init transaction
       
    60  *          2. From MWlanDfcClient context, on a Sync bus init transaction
       
    61  * \note
       
    62  * \param  hTIWha - handle to TIWha class
       
    63  * \return  
       
    64  * \sa      
       
    65  */ 
       
    66 void TIWhaAdaptCB::ConnectBus (TI_HANDLE hTIWha)
       
    67 {
       
    68     pTIWha->ConnectBusCb ((WHA::TStatus)0); 
       
    69 }
       
    70 
       
    71 void TIWhaAdaptCB::ConnectBusDFC (TI_HANDLE hTIWha)
       
    72 {    
       
    73     pTIWha->pConnectDfcClient->pConnectDfc->Enqueue(*(pTIWha->pConnectDfcClient) ,(TInt)hTIWha);
       
    74 }
       
    75 
       
    76 
       
    77 /** 
       
    78  * \fn     InitHw
       
    79  * \brief  
       
    80  *              Init HW Callback called after all software init is done  
       
    81  *              and NVS configuration was saved as defaults, will download the FW
       
    82  * \note    call member function of TIWha class
       
    83  * \param  hTIWha - handle to TIWha class
       
    84  * \return  
       
    85  * \sa      
       
    86  */ 
       
    87 void TIWhaAdaptCB::InitHw (TI_HANDLE hTIWha, TI_STATUS status)
       
    88 {
       
    89     pTIWha->InitHwCb ((WHA::TStatus)status);    
       
    90 }
       
    91 
       
    92 /** 
       
    93  * \fn     InitFw
       
    94  * \brief  
       
    95  *             Init FW Callback called after Fw was downloaded will configure the FW
       
    96  * \note    call member function of TIWha class
       
    97  * \param  hTIWha - handle to TIWha class
       
    98  * \return  
       
    99  * \sa      
       
   100  */ 
       
   101 void TIWhaAdaptCB::InitFw (TI_HANDLE hTIWha, TI_STATUS status)
       
   102 {
       
   103     pTIWha->InitFwCb ((WHA::TStatus)status);    
       
   104 }
       
   105 
       
   106 /** 
       
   107  * \fn     InitFw
       
   108  * \brief  
       
   109  *              Config  FW Callback will set the defaults
       
   110  * \note    call member function of TIWha class
       
   111  * \param  hTIWha - handle to TIWha class
       
   112  * \return  
       
   113  * \sa      
       
   114  */ 
       
   115 void TIWhaAdaptCB::ConfigFw (TI_HANDLE hTIWha, TI_STATUS status)
       
   116 {
       
   117     pTIWha->ConfigFwCb ((WHA::TStatus)status);    
       
   118 }
       
   119 
       
   120 /** 
       
   121  * \fn     InitFail
       
   122  * \brief  
       
   123  *              
       
   124  * \note    call member function of TIWha class
       
   125  * \param  hTIWha - handle to TIWha class
       
   126  * \return  
       
   127  * \sa      
       
   128  */ 
       
   129 void TIWhaAdaptCB::InitFail (TI_HANDLE hTIWha, TI_STATUS status)
       
   130 {    
       
   131     pTIWha->InitFailCb ((WHA::TStatus)status);    
       
   132 }
       
   133 
       
   134 /** 
       
   135  * \fn     ScanComplete
       
   136  * \brief  
       
   137  *              Scan Complete Callback
       
   138  * \note    call member function of TIWha class
       
   139  * \param  hTIWha - handle to TIWha class
       
   140  * \return  
       
   141  * \sa      
       
   142  */ 
       
   143 void TIWhaAdaptCB::ScanComplete (TI_HANDLE hTIWha, EScanResultTag eTag,TI_UINT32 uResultCount, 
       
   144 					                                    TI_UINT16 SPSStatus, TI_BOOL TSFError, TI_STATUS ScanStatus,
       
   145 					                                    TI_STATUS PSMode)
       
   146 {
       
   147 	/* save the Scan result and PS for furder use */
       
   148 	pTIWha->aScanResultCount = uResultCount;
       
   149 	pTIWha->aPsMode = PSMode;
       
   150 	pTIWha->aScanStatus = ScanStatus;
       
   151 
       
   152 #ifdef TI_DBG
       
   153 	WLAN_OS_REPORT(("ScanComplete -- uResultCount = %d",uResultCount));
       
   154     WLAN_OS_REPORT(("ScanComplete -- aScanResultCount = %d, SentScanResult= %d",pTIWha->aScanResultCount, pTIWha->SentScanResult));
       
   155     WLAN_OS_REPORT(("ScanComplete -- ScanStatus = %d, PSMode= %d",ScanStatus, PSMode));
       
   156 #endif
       
   157 
       
   158     /* Pass to TIWha only relevant parameters */
       
   159 	if (pTIWha->aScanResultCount <= pTIWha->SentScanResult)
       
   160 	{
       
   161 		//os_printf("TIWhaAdaptCB::ScanComplete Call ScanCompleteCb");
       
   162 		pTIWha->ScanCompleteCb ( (WHA::TStatus)ScanStatus,  (E80211PsStatus)PSMode);
       
   163 	}
       
   164 }
       
   165 
       
   166 /** 
       
   167  * \fn     SetPsModeComplete
       
   168  * \brief  
       
   169  *              Power Save Complete Callback
       
   170  * \note    call member function of TIWha class
       
   171  * \param  hTIWha - handle to TIWha class
       
   172  * \return  
       
   173  * \sa      
       
   174  */ 
       
   175 void TIWhaAdaptCB::SetPsModeComplete             (TI_HANDLE hTIWha, TI_UINT8 PSMode, TI_UINT8 transStatus)
       
   176 {
       
   177     pTIWha->SetPsModeCompleteCb (PSMode, transStatus);
       
   178 }
       
   179 
       
   180 /** 
       
   181  * \fn     SetPsModeCompleteDummy
       
   182  * \brief  
       
   183  *              Power Save Complete Dummy Callback
       
   184  * \note    call member function of TIWha class
       
   185  * \param  hTIWha - handle to TIWha class
       
   186  * \return  
       
   187  * \sa      
       
   188  */ 
       
   189 void TIWhaAdaptCB::SetPsModeCompleteDummy        (TI_HANDLE hTIWha, TI_UINT8 PSMode, TI_UINT8 transStatus)
       
   190 {
       
   191 }
       
   192 
       
   193 /** 
       
   194  * \fn     FailureIndication
       
   195  * \brief  
       
   196  *         Failure Indication Callback
       
   197  * \note   call member function of TIWha class
       
   198  * \param  hTIWha - handle to TIWha class
       
   199  * \return  
       
   200  * \sa      
       
   201  */ 
       
   202 void TIWhaAdaptCB::FailureIndication             (TI_HANDLE hTIWha, EFailureEvent failureEvent)
       
   203 {    
       
   204     /* Save the failure event reason, so we will have after we context swith to iFailureDfc */
       
   205     pTIWha->iFailureEvent = failureEvent;
       
   206     /* Register FailureDfcClient to handle the failure from a different context */
       
   207     pTIWha->pFailureDfcClient->pFailureDfc->Enqueue(*(pTIWha->pFailureDfcClient) ,(TInt)hTIWha);            
       
   208 }
       
   209 
       
   210 
       
   211 /** 
       
   212  * \fn     FailureIndicationDFC
       
   213  * \brief  
       
   214  *         Failure Indication DFC Callback - Called from MWlanDfcClient context
       
   215  * \note
       
   216  * \param  hTIWha - handle to TIWha class
       
   217  * \return  
       
   218  * \sa      
       
   219  */ 
       
   220 void TIWhaAdaptCB::FailureIndicationDFC (TI_HANDLE hTIWha)
       
   221 {    
       
   222     pTIWha->FailureIndicationCb(pTIWha->iFailureEvent);
       
   223 }
       
   224 
       
   225 /** 
       
   226  * \fn     ConnectionTimeOut
       
   227  * \brief  
       
   228  *              End of connection phase
       
   229  * \return  
       
   230  * \sa      
       
   231  */ 
       
   232 void TIWhaAdaptCB::ConnectionTimeOut             (TI_HANDLE hTIWha)
       
   233 {
       
   234     pTIWha->ConnectionTimeOut ();
       
   235 }
       
   236 
       
   237 /** 
       
   238  * \fn     InitializeAfterTimer
       
   239  * \brief  call second part of initialization after timer expired
       
   240  *          
       
   241  * \note    
       
   242  * \param  hTIWha - handle to TIWha class
       
   243  * \return  
       
   244  * \sa      
       
   245  */ 
       
   246 void TIWhaAdaptCB::InitializeAfterTimer           (TI_HANDLE hTIWha)
       
   247 {
       
   248     pTIWha->InitializeAfterTimer();
       
   249 }
       
   250 
       
   251 /** 
       
   252  * \fn     RcpiIndication
       
   253  * \brief  
       
   254  *              RCPI Indication Callback
       
   255  * \note    call member function of TIWha class
       
   256  * \param  hTIWha - handle to TIWha class
       
   257  * \return  
       
   258  * \sa      
       
   259  */ 
       
   260 void TIWhaAdaptCB::RcpiIndication                (TI_HANDLE hTIWha, TI_UINT8* buffer, TI_UINT32 len)
       
   261 {
       
   262     pTIWha->RcpiIndicationCb ( buffer, len);  
       
   263 }
       
   264 
       
   265 /** 
       
   266  * \fn     LostBssIndication
       
   267  * \brief  
       
   268  *              Lost Beacon Indication Callback 
       
   269  * \note    call member function of TIWha class
       
   270  * \param  hTIWha - handle to TIWha class
       
   271  * \return  
       
   272  * \sa      
       
   273  */ 
       
   274 void TIWhaAdaptCB::LostBssIndication             (TI_HANDLE hTIWha)
       
   275 {
       
   276     pTIWha->LostBssIndicationCb ( );  
       
   277 }
       
   278 
       
   279 /** 
       
   280  * \fn     RegainBssIndication
       
   281  * \brief  
       
   282  *              Regain Bss Indication Callback 
       
   283  * \note    call member function of TIWha class
       
   284  * \param  hTIWha - handle to TIWha class
       
   285  * \return  
       
   286  * \sa      
       
   287  */ 
       
   288 void TIWhaAdaptCB::RegainBssIndication           (TI_HANDLE hTIWha)
       
   289 {
       
   290     pTIWha->RegainBssIndicationCb ( );  
       
   291 }
       
   292 
       
   293 /** 
       
   294  * \fn     btCoexSenseIndication
       
   295  * \brief  
       
   296  *              
       
   297  * \note    call member function of TIWha class
       
   298  * \param  hTIWha - handle to TIWha class
       
   299  * \return  
       
   300  * \sa      
       
   301  */ 
       
   302 void TIWhaAdaptCB::btCoexSenseIndication         (TI_HANDLE hTIWha, TI_UINT8* buffer, TI_UINT32 len)
       
   303 {
       
   304     pTIWha->btCoexSenseIndicationCb ( buffer, len);  
       
   305 }
       
   306 
       
   307 /** 
       
   308  * \fn     btCoexProtectiveIndication
       
   309  * \brief  
       
   310  * \note    call member function of TIWha class
       
   311  * \param  hTIWha - handle to TIWha class
       
   312  * \return  
       
   313  * \sa      
       
   314  */ 
       
   315 void TIWhaAdaptCB::btCoexProtectiveIndication    (TI_HANDLE hTIWha, TI_UINT8* buffer, TI_UINT32 len)
       
   316 {
       
   317     pTIWha->btCoexProtectiveIndicationCb ( buffer, len);  
       
   318 }
       
   319 
       
   320 /** 
       
   321  * \fn     btCoexAvalancheIndication
       
   322  * \brief  
       
   323  * \note    call member function of TIWha class
       
   324  * \param  hTIWha - handle to TIWha class
       
   325  * \return  
       
   326  * \sa      
       
   327  */ 
       
   328 void TIWhaAdaptCB::btCoexAvalancheIndication     (TI_HANDLE hTIWha, TI_UINT8* buffer, TI_UINT32 len)
       
   329 {
       
   330     pTIWha->btCoexAvalancheIndicationCb ( buffer, len);  
       
   331 }
       
   332 
       
   333 /** 
       
   334  * \fn     GenericCommandResponse
       
   335  * \brief  
       
   336  *              CB for every CMD without a specific CB
       
   337  * \note    call member function of TIWha class
       
   338  * \param  hTIWha - handle to TIWha class
       
   339  * \return  
       
   340  * \sa      
       
   341  */ 
       
   342 void TIWhaAdaptCB::GenericCommandResponse (TI_HANDLE hTIWha, TI_UINT16 CmdType, TI_UINT16 CmdID, TI_UINT32 aStatus)
       
   343 {
       
   344     pTIWha->GenericCommandResponseCb ( CmdType, CmdID, aStatus);
       
   345 }
       
   346 
       
   347 /** 
       
   348  * \fn     DummyResponse
       
   349  * \brief  
       
   350  * \note    call member function of TIWha class
       
   351  * \param  hTIWha - handle to TIWha class
       
   352  * \return  
       
   353  * \sa      
       
   354  */ 
       
   355 void TIWhaAdaptCB::DummyResponse (TI_HANDLE Dummy, TI_STATUS aStatus)
       
   356 {
       
   357 }
       
   358 
       
   359 /** 
       
   360  * \fn     ScanResponse
       
   361  * \brief  
       
   362  * \note    call member function of TIWha class
       
   363  * \param  hTIWha - handle to TIWha class
       
   364  * \return  
       
   365  * \sa      
       
   366  */ 
       
   367 void TIWhaAdaptCB::ScanResponse(TI_HANDLE hTIWha,TI_STATUS aStatus)
       
   368 {
       
   369     pTIWha->ScanResponseCb ( (WHA::TStatus)aStatus);
       
   370 }
       
   371 
       
   372 /** 
       
   373  * \fn     JoinComplete
       
   374  * \brief  
       
   375  *              Actually join complete...
       
   376  * \note    call member function of TIWha class
       
   377  * \param  hTIWha - handle to TIWha class
       
   378  * \return  
       
   379  * \sa      
       
   380  */ 
       
   381 void TIWhaAdaptCB::JoinComplete                  (TI_HANDLE hTIWha)
       
   382 {
       
   383     pTIWha->JoinCompleteCb ();
       
   384 }
       
   385 
       
   386 /** 
       
   387  * \fn     StopScanResponse
       
   388  * \brief  
       
   389  * \note    call member function of TIWha class
       
   390  * \param  hTIWha - handle to TIWha class
       
   391  * \return  
       
   392  * \sa      
       
   393  */ 
       
   394 void TIWhaAdaptCB::StopScanResponse              (TI_HANDLE hTIWha, TI_STATUS aStatus)
       
   395 {
       
   396     pTIWha->StopScanResponseCb ( (WHA::TStatus)aStatus);
       
   397 }
       
   398 
       
   399 /** 
       
   400  * \fn     SetPsModeResponse
       
   401  * \brief  
       
   402  * \note    call member function of TIWha class
       
   403  * \param  hTIWha - handle to TIWha class
       
   404  * \return  
       
   405  * \sa      
       
   406  */ 
       
   407 void TIWhaAdaptCB::SetPsModeResponse             (TI_HANDLE hTIWha, TI_UINT8 aStatus)
       
   408 {
       
   409     pTIWha->SetPsModeResponseCb (aStatus);
       
   410 }
       
   411 
       
   412 /** 
       
   413  * \fn     SetPsModeResponseDummy
       
   414  * \brief  
       
   415  * \note    call member function of TIWha class
       
   416  * \param  hTIWha - handle to TIWha class
       
   417  * \return  
       
   418  * \sa      
       
   419  */ 
       
   420 void TIWhaAdaptCB::SetPsModeResponseDummy        (TI_HANDLE hTIWha, TI_UINT8 aStatus)
       
   421 {
       
   422 }
       
   423 
       
   424 /** 
       
   425  * \fn     ReadMIBResponse
       
   426  * \brief  
       
   427  * \note    call member function of TIWha class
       
   428  * \param  hTIWha - handle to TIWha class
       
   429  * \return  
       
   430  * \sa      
       
   431  */ 
       
   432 void TIWhaAdaptCB::ReadMIBResponse               (TI_HANDLE hTIWha, TI_UINT16 aStatus,  void *InterrogateParamsBuf)
       
   433 {
       
   434     pTIWha->ReadMIBResponseCb ( aStatus, InterrogateParamsBuf);
       
   435 }
       
   436 
       
   437 /** 
       
   438  * \fn     MeasureResponse
       
   439  * \brief  
       
   440  * \note    call member function of TIWha class
       
   441  * \param  hTIWha - handle to TIWha class
       
   442  * \return  
       
   443  * \sa      
       
   444  */ 
       
   445 void TIWhaAdaptCB::MeasureResponse               (TI_HANDLE hTIWha, TI_UINT16 aStatus)
       
   446 { 
       
   447 }
       
   448 
       
   449 /** 
       
   450  * \fn     StopMeasureResponse
       
   451  * \brief  
       
   452  * \note    call member function of TIWha class
       
   453  * \param  hTIWha - handle to TIWha class
       
   454  * \return  
       
   455  * \sa      
       
   456  */ 
       
   457 void TIWhaAdaptCB::StopMeasureResponse           (TI_HANDLE hTIWha, TI_UINT16 aStatus)
       
   458 { 
       
   459 }
       
   460 
       
   461 /** 
       
   462  * \fn     StopMeasureResponse
       
   463  * \brief  
       
   464  * \note    call member function of TIWha class
       
   465  * \param  hTIWha - handle to TIWha class
       
   466  * \return  
       
   467  * \sa      
       
   468  */ 
       
   469 void TIWhaAdaptCB::AddKeyResponse			(TI_HANDLE hTIWha, TI_STATUS aStatus)
       
   470 {
       
   471     pTIWha->AddKeyResponseCb (aStatus);
       
   472     
       
   473 }
       
   474 
       
   475 /* RX CallBacks */
       
   476 /** 
       
   477  * \fn     RequestForBuffer
       
   478  * \brief  
       
   479  * \note    call member function of TIWha class
       
   480  * \param  hTIWha - handle to TIWha class
       
   481  * \return  
       
   482  * \sa      
       
   483  */ 
       
   484 ERxBufferStatus TIWhaAdaptCB::RequestForBuffer (TI_HANDLE hTIWha, void **pWbuf, TI_UINT16 aLength, TI_UINT32 uEncryptionFlag)
       
   485 {
       
   486     return pTIWha->RequestForBufferCb (pWbuf, aLength, uEncryptionFlag);
       
   487 }
       
   488 
       
   489 /** 
       
   490  * \fn     ReceivePacket
       
   491  * \brief  
       
   492  * \note    call member function of TIWha class
       
   493  * \param  hTIWha - handle to TIWha class
       
   494  * \return  
       
   495  * \sa      
       
   496  */ 
       
   497 void TIWhaAdaptCB::ReceivePacket (TI_HANDLE        hTIWha,
       
   498                              const void    *aFrame)
       
   499 {
       
   500 	pTIWha->ReceivePacketCb (aFrame);
       
   501 }
       
   502 
       
   503 
       
   504 /** 
       
   505  * \fn     ReceivePacketWhileScan
       
   506  * \brief  
       
   507  * \note    Use while Scan only to count the scan resault
       
   508  * \param  hTIWha - handle to TIWha class
       
   509  * \return  
       
   510  * \sa      
       
   511  */ 
       
   512 void TIWhaAdaptCB::ReceivePacketWhileScan(TI_HANDLE hTIWha, const void *aFrame)
       
   513 {
       
   514         RxIfDescriptor_t*  pRxParams = (RxIfDescriptor_t*)aFrame;
       
   515 
       
   516 	pTIWha->ReceivePacketCb (aFrame);
       
   517 
       
   518 	if (pRxParams->packet_class_tag == TAG_CLASS_BCN_PRBRSP)
       
   519 	{
       
   520 		pTIWha->SentScanResult++;
       
   521         if (pTIWha->aScanResultCount <= pTIWha->SentScanResult)
       
   522 		{
       
   523 			/* Send the scan complete CB */
       
   524 			#ifdef TI_DBG
       
   525 				WLAN_OS_REPORT(("ReceivePacketWhileScan Call Scan Complete"));
       
   526 			#endif
       
   527 			pTIWha->ScanCompleteCb (pTIWha->aScanStatus, (E80211PsStatus)pTIWha->aPsMode);			
       
   528 		}
       
   529 	}
       
   530 }
       
   531 
       
   532 /** 
       
   533  * \fn     ReceivePacket
       
   534  * \brief  Frame was written to FW 
       
   535  * \note    call member function of TIWha class
       
   536  * \param  hTIWha - handle to TIWha class
       
   537  * \return  
       
   538  * \sa      
       
   539  */ 
       
   540 void TIWhaAdaptCB::TxXfer ( TI_HANDLE hTIWha, TTxCtrlBlk *pPktCtrlBlk)
       
   541 {
       
   542     pTIWha->TxXferCb (pPktCtrlBlk);
       
   543 }
       
   544 
       
   545 /** 
       
   546  * \fn     TxComplete
       
   547  * \brief  Frame was transmitted over the air (or failed to be transmitted)
       
   548  * \note    call member function of TIWha class
       
   549  * \param  hTIWha - handle to TIWha class
       
   550  * \return  
       
   551  * \sa      
       
   552  */ 
       
   553 void TIWhaAdaptCB::TxComplete ( TI_HANDLE hTIWha, TxResultDescriptor_t *pTxResultInfo, TI_UINT32 backpressure)
       
   554 {
       
   555     pTIWha->TxCompleteCb ( pTxResultInfo, backpressure);
       
   556 }
       
   557 
       
   558 
       
   559 /** 
       
   560  * \fn     TxBipResponse
       
   561  * \brief   TxBIP Response Callback 
       
   562  * \note    call member function of TIWha class
       
   563  * \param  hTIWha - handle to TIWha class
       
   564  * \return  
       
   565  * \sa      
       
   566  */ 
       
   567 void TIWhaAdaptCB::TxBipResponse (TI_HANDLE hTIWha, TI_STATUS aStatus,  void *InterrogateParamsBuf)
       
   568 {
       
   569 	// Convert from FW result to NVS file All manipulation is done on buffer
       
   570 	// supplied by Symbian
       
   571 	os_printf("BipResponse call ConvertBip2Nvs");
       
   572     /* ConvertRxBip2Nvs() will update only the Tx part of the NVS */
       
   573 	pTIWha->ConvertTxBip2Nvs(InterrogateParamsBuf); 
       
   574 
       
   575 	// After convertion finished calling Regular PLT response to indicate that NVS file is ready
       
   576 	PltResponse(hTIWha,aStatus,InterrogateParamsBuf);
       
   577 }
       
   578 
       
   579 
       
   580 /** 
       
   581  * \fn     RxBipResponse
       
   582  * \brief   RxBIP Response Callback 
       
   583  * \note    call member function of TIWha class
       
   584  * \param  hTIWha - handle to TIWha class
       
   585  * \return  
       
   586  * \sa      
       
   587  */ 
       
   588 void TIWhaAdaptCB::RxBipResponse (TI_HANDLE hTIWha, TI_STATUS aStatus,  void *InterrogateParamsBuf)
       
   589 {
       
   590 	// Convert from FW result to NVS file All manipulation is done on buffer
       
   591 	// supplied by Symbian
       
   592     /* ConvertRxBip2Nvs() will update only the Rx part of the NVS */
       
   593 	os_printf("BipResponse call ConvertBip2Nvs");
       
   594 	pTIWha->ConvertRxBip2Nvs(InterrogateParamsBuf); 
       
   595 
       
   596 	// After convertion finished calling Regular PLT response to indicate that NVS file is ready
       
   597 	PltResponse(hTIWha,aStatus,InterrogateParamsBuf);
       
   598 }
       
   599 
       
   600 /** 
       
   601  * \fn     RxStatResponse
       
   602  * \brief   Get Statistic Response Callback 
       
   603  * \note    call member function of TIWha class
       
   604  * \param  hTIWha - handle to TIWha class
       
   605  * \return  
       
   606  * \sa      
       
   607  */ 
       
   608 void TIWhaAdaptCB::RxStatResponse				  (TI_HANDLE hTIWha, TI_STATUS aStatus,  void *InterrogateParamsBuf)
       
   609 {
       
   610 
       
   611 	//normalize the RSSI to RCPI in 0.5DB scale
       
   612 
       
   613 	/*valus are in db/8
       
   614 	so if RCPI = (db +110) * 2 then to have it in valus of db/2 -> RCPI = (db/4 +220) */
       
   615 
       
   616 	if ((*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi > 0)
       
   617 	{
       
   618 		(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi = 220;
       
   619 	}
       
   620 	else
       
   621 	{
       
   622 		if ((*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi/8 < -110)
       
   623 		{
       
   624 			(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi = 0;
       
   625 		}
       
   626 		else
       
   627 		{
       
   628 			(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi=
       
   629 			(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi/4 +220;
       
   630 		}
       
   631 	}
       
   632 
       
   633 
       
   634 	/* On RX Statistic we move thru this function to print the RX statistic */
       
   635 
       
   636 	WLAN_OS_REPORT(("Received Valid Packet no.: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedValidPacketsNumber,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedValidPacketsNumber));
       
   637 	WLAN_OS_REPORT(("Received FCS Error Packet no.: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedFcsErrorPacketsNumber,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedFcsErrorPacketsNumber));
       
   638 	WLAN_OS_REPORT(("Received Address missmatch Error Packet no.: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedPlcpErrorPacketsNumber,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.ReceivedPlcpErrorPacketsNumber));
       
   639 	WLAN_OS_REPORT(("Sequence Number Missing Count: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.SeqNumMissCount,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.SeqNumMissCount));
       
   640 	WLAN_OS_REPORT(("Average SNR: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageSnr,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageSnr));
       
   641 	WLAN_OS_REPORT(("Average RSSI: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi,(*((RadioRxStatistics*)InterrogateParamsBuf)).oRxPathStatistics.AverageRssi));
       
   642 	WLAN_OS_REPORT(("Base Packet ID: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oBasePacketId,(*((RadioRxStatistics*)InterrogateParamsBuf)).oBasePacketId));
       
   643 	WLAN_OS_REPORT(("Number of Packets: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).ioNumberOfPackets,(*((RadioRxStatistics*)InterrogateParamsBuf)).ioNumberOfPackets));
       
   644 	WLAN_OS_REPORT(("Number of Missed Packets: %d(0x%x)\n", (*((RadioRxStatistics*)InterrogateParamsBuf)).oNumberOfMissedPackets,(*((RadioRxStatistics*)InterrogateParamsBuf)).oNumberOfMissedPackets));
       
   645 
       
   646 	PltResponse(hTIWha,aStatus,InterrogateParamsBuf);
       
   647 }
       
   648 
       
   649 
       
   650 /** 
       
   651  * \fn     RunRssiResponse
       
   652  * \brief   Print the RSSI value 
       
   653  * \note    call member function of TIWha class
       
   654  * \param  hTIWha - handle to TIWha class
       
   655  * \return  
       
   656  * \sa      
       
   657  */ 
       
   658 void TIWhaAdaptCB::RunRssiResponse (TI_HANDLE hTIWha, TI_STATUS aStatus,  void *InterrogateParamsBuf)
       
   659 {
       
   660     /* Print the Rssi value, the value is RSSI * 8 */
       
   661     WLAN_OS_REPORT (("PltResponseCb : FLALI Command Respons -- Status = %d",((TTestCmdFreeRSSI*)InterrogateParamsBuf)->oRadioStatus));
       
   662     WLAN_OS_REPORT (("PltResponseCb : FLALI Command Respons -- RSSI = %d",((TTestCmdFreeRSSI*)InterrogateParamsBuf)->RSSIVal));
       
   663 
       
   664 	PltResponse(hTIWha,aStatus,InterrogateParamsBuf);
       
   665 }
       
   666 
       
   667 /** 
       
   668  * \fn     PltResponse
       
   669  * \brief   PLT Response Callback 
       
   670  * \note    call member function of TIWha class
       
   671  * \param  hTIWha - handle to TIWha class
       
   672  * \return  
       
   673  * \sa      
       
   674  */ 
       
   675 void TIWhaAdaptCB::PltResponse (TI_HANDLE hTIWha, TI_STATUS aStatus,  void *InterrogateParamsBuf)
       
   676 {
       
   677     pTIWha->PltResponseCb ( aStatus, InterrogateParamsBuf);
       
   678 }
       
   679 
       
   680 
       
   681 /** 
       
   682  * \fn     ReadMemResponse
       
   683  * \brief  
       
   684  * \note    call member function of TIWha class
       
   685  * \param  hTIWha - handle to TIWha class
       
   686  * \return  
       
   687  * \sa      
       
   688  */ 
       
   689 void TIWhaAdaptCB::ReadMemResponse          (TI_HANDLE hTIWha, TFwDebugParams* params)
       
   690 {
       
   691     pTIWha->ReadMemResponseCb (params);
       
   692 	
       
   693 }
       
   694 
       
   695 
       
   696 /** 
       
   697  * \fn     WriteMemResponse
       
   698  * \brief  
       
   699  * \note    call member function of TIWha class
       
   700  * \param  hTIWha - handle to TIWha class
       
   701  * \return  
       
   702  * \sa      
       
   703  */ 
       
   704 void TIWhaAdaptCB::WriteMemResponse         (TI_HANDLE hTIWha, TFwDebugParams* params)
       
   705 {
       
   706     pTIWha->WriteMemResponseCb (params);
       
   707 }
       
   708 
       
   709 
       
   710 /** 
       
   711  * \fn     ReadDot11StationIdCb
       
   712  * \brief  
       
   713  * \note    call  ReadMIBResponseCb after timer context change
       
   714  * \param  hTIWha - handle to TIWha class
       
   715  * \return  
       
   716  * \sa      
       
   717  */ 
       
   718 void TIWhaAdaptCB::ReadDot11StationIdCb         (TI_HANDLE hTIWha)
       
   719 {
       
   720     /* Call ReadMIBResponse from the ReadDot11StationIdCb since we have the CHIP ID */
       
   721     pTIWha->ReadMIBResponseCb ( WHA::KSuccess, pTIWha->getMacAddress());
       
   722 }
       
   723 
       
   724 /** 
       
   725  * \fn     RxMemFailTimerCb
       
   726  * \brief  
       
   727  * \note    call  TIWha::RxMemFailTimerCb
       
   728  * \param  hTIWha - handle to TIWha class
       
   729  * \return  
       
   730  * \sa      
       
   731  */ 
       
   732 void TIWhaAdaptCB::RxMemFailTimerCb         (TI_HANDLE hTIWha)
       
   733 {
       
   734     pTIWha->RxMemFailTimerCb ();
       
   735 }
       
   736 
       
   737 /** 
       
   738  * \fn     AvrRssiReadResponse
       
   739  * \brief  
       
   740  * \note    call member function of TIWha class
       
   741  * \param  hTIWha - handle to TIWha class
       
   742  * \return  
       
   743  * \sa      
       
   744  */ 
       
   745 void TIWhaAdaptCB::AvrRssiReadResponse (TI_HANDLE hTIWha, TI_UINT16 MboxStatus, ACXRoamingStatisticsTable_t* roamingStatistics)
       
   746 {
       
   747     pTIWha->TWD_AvrRssiReadCB (hTIWha, MboxStatus, roamingStatistics);
       
   748 }
       
   749 
       
   750 
       
   751 /** 
       
   752  * \fn     StatisticsReadResponse
       
   753  * \brief  
       
   754  * \note    call member function of TIWha class
       
   755  * \param  hTIWha - handle to TIWha class
       
   756  * \return  
       
   757  * \sa      
       
   758  */ 
       
   759 void TIWhaAdaptCB::StatisticsReadResponse (TI_HANDLE hTIWha, TI_UINT16 MboxStatus, ACXStatistics_t* pElem)
       
   760 {
       
   761     pTIWha->TWD_StatisticsReadCB (hTIWha, MboxStatus, pElem);
       
   762 }