TWD/MacServices/MacServices.c
author shahar_levi@ti.com
Tue, 29 Jun 2010 12:36:40 +0100
changeset 1 37559704e0d0
parent 0 10c42ec6c05f
permissions -rw-r--r--
Added tag WiLink_Driver_6.1.1.0.8 for changeset 10c42ec6c05f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     1
/*
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     2
 * MacServices.c
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     3
 *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     4
 * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     5
 * All rights reserved.      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     6
 * 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     7
 * This program and the accompanying materials are made available under the 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     8
 * terms of the Eclipse Public License v1.0 or BSD License which accompanies
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
     9
 * this distribution. The Eclipse Public License is available at
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    10
 * http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.                                   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    11
 *                                                                       
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    12
 * Redistribution and use in source and binary forms, with or without    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    13
 * modification, are permitted provided that the following conditions    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    14
 * are met:                                                              
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    15
 *                                                                       
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    16
 *  * Redistributions of source code must retain the above copyright     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    17
 *    notice, this list of conditions and the following disclaimer.      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    18
 *  * Redistributions in binary form must reproduce the above copyright  
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    19
 *    notice, this list of conditions and the following disclaimer in    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    20
 *    the documentation and/or other materials provided with the         
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    21
 *    distribution.                                                      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    22
 *  * Neither the name Texas Instruments nor the names of its            
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    23
 *    contributors may be used to endorse or promote products derived    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    24
 *    from this software without specific prior written permission.      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    25
 *                                                                       
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    26
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    27
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    28
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    29
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    30
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    31
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    32
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    33
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    34
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    35
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    36
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    37
 */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    38
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    39
/** \file MacServices.c
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    40
 *  \brief This file include public definitions for the scan SRV module, comprising its API.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    41
 *  \date 6-Oct-2005
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    42
 */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    43
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    44
#define __FILE_ID__  FILE_ID_109
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    45
#include "report.h"
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    46
#include "ScanSrv.h"
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    47
#include "MeasurementSrv.h"
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    48
#include "MacServices.h"
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    49
#include "PowerSrv_API.h"
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    50
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    51
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    52
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    53
 *                        MacServices_create                                                     *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    54
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    55
DESCRIPTION: Creates MacServices module
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    56
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    57
INPUT:          hOS - handle to the OS object.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    58
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    59
RETURN:     handle to MacServices Object, NULL on failure .
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    60
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    61
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    62
TI_HANDLE MacServices_create( TI_HANDLE hOS) 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    63
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    64
    MacServices_t *pMacServices = (MacServices_t*)os_memoryAlloc( hOS, sizeof(MacServices_t),MemoryNormal );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    65
    if ( NULL == pMacServices )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    66
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    67
        WLAN_OS_REPORT( ("ERROR: Failed to create Mac SRV module") );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    68
        return NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    69
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    70
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    71
    /* nullify all handles, so that only handles in existence will be released */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    72
    pMacServices->hScanSRV = NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    73
    pMacServices->hPowerSrv = NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    74
 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    75
    /* create the scanSRV handle */ 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    76
    pMacServices->hScanSRV = MacServices_scanSRV_create(hOS);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    77
    if ( NULL == pMacServices->hScanSRV )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    78
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    79
        MacServices_destroy( pMacServices );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    80
        return NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    81
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    82
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    83
/* create the measurment handle */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    84
    pMacServices->hMeasurementSRV = MacServices_measurementSRV_create( hOS );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    85
    if ( NULL == pMacServices->hMeasurementSRV )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    86
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    87
            MacServices_destroy(pMacServices);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    88
        return NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    89
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    90
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    91
    pMacServices->hPowerSrv = powerSrv_create(hOS);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    92
    if (NULL == pMacServices->hPowerSrv  )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    93
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    94
        MacServices_destroy(pMacServices);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    95
        return NULL;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    96
     }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    97
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    98
    /* store OS handle */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
    99
    pMacServices->hOS      = hOS;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   100
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   101
    return pMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   102
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   103
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   104
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   105
 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   106
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   107
 *                        MacServices_destroy                                                    *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   108
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   109
DESCRIPTION: destroys MacServices module
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   110
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   111
INPUT:          hMacServices - handle to the Mac Services object.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   112
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   113
RETURN:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   114
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   115
void MacServices_destroy( TI_HANDLE hMacServices ) 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   116
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   117
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   118
    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   119
    /* destroy all SRV modules */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   120
    if ( NULL != pMacServices->hScanSRV )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   121
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   122
        MacServices_scanSRV_destroy( pMacServices->hScanSRV );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   123
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   124
    if ( NULL != pMacServices->hMeasurementSRV )
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   125
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   126
        MacServices_measurementSRV_destroy( pMacServices->hMeasurementSRV );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   127
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   128
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   129
    if(pMacServices->hPowerSrv)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   130
    powerSrv_destroy(pMacServices->hPowerSrv);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   131
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   132
    /* free the Mac services allocated context */
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   133
    os_memoryFree( pMacServices->hOS, (TI_HANDLE)pMacServices , sizeof(MacServices_t) );
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   134
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   135
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   136
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   137
 /****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   138
 *                        MacServices_init                                                   *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   139
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   140
DESCRIPTION: Initializes the MacServices module
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   141
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   142
INPUT:    hMacServices - handle to the Mac Services object.\n   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   143
        hReport - handle to the report object.\n
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   144
        hHalCtrl - handle to the HAL ctrl object.\n
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   145
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   146
RETURN:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   147
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   148
void MacServices_init (TI_HANDLE hMacServices, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   149
                       TI_HANDLE hReport, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   150
                       TI_HANDLE hTWD, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   151
                       TI_HANDLE hCmdBld, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   152
                       TI_HANDLE hEventMbox, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   153
                       TI_HANDLE hTimer) 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   154
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   155
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   156
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   157
    MacServices_scanSRV_init (hMacServices, hReport, hTWD, hTimer, hEventMbox, hCmdBld);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   158
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   159
    MacServices_measurementSRV_init (pMacServices->hMeasurementSRV, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   160
                                     hReport, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   161
                                     hCmdBld, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   162
                                     hEventMbox, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   163
                                     pMacServices->hPowerSrv,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   164
                                     hTimer);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   165
    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   166
    if (powerSrv_init (pMacServices->hPowerSrv, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   167
                       hReport, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   168
                       hEventMbox, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   169
                       hCmdBld,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   170
                       hTimer) != TI_OK)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   171
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   172
        WLAN_OS_REPORT(("\n.....PowerSRV_init configuration failure \n"));
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   173
        /*return TI_NOK;*/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   174
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   175
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   176
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   177
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   178
 /****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   179
 *                        MacServices_config                                                     *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   180
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   181
DESCRIPTION: config the MacServices moduleand sub modules
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   182
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   183
INPUT:    hMacServices - handle to the Mac Services object.\n   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   184
        pInitParams  - pointer to the init params
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   185
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   186
RETURN:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   187
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   188
void MacServices_config( TI_HANDLE hMacServices, TTwdInitParams *pInitParams) 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   189
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   190
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   191
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   192
    if (powerSrv_config(pMacServices->hPowerSrv,&pInitParams->tPowerSrv) != TI_OK)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   193
    {
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   194
        WLAN_OS_REPORT(("\n.....PowerSRV_config failure \n"));
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   195
    }
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   196
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   197
    MacServices_scanSrv_config (pMacServices, &pInitParams->tScanSrv);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   198
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   199
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   200
 /****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   201
 *                        MacServices_restart                                                     *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   202
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   203
DESCRIPTION: restart the MacServices moduleand sub modules upon recovery
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   204
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   205
INPUT:    hMacServices - handle to the Mac Services object.\n   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   206
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   207
RETURN:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   208
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   209
void MacServices_restart (TI_HANDLE hMacServices) 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   210
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   211
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   212
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   213
    scanSRV_restart (pMacServices->hScanSRV);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   214
    measurementSRV_restart (pMacServices->hMeasurementSRV);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   215
    powerSrv_restart (pMacServices->hPowerSrv);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   216
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   217
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   218
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   219
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   220
 *                        MacServices_registerFailureEventCB                                                     *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   221
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   222
DESCRIPTION: register the centeral error function from the health monitor to the MacService's sub modules
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   223
                                                                                                                               
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   224
INPUT:    hMacServices      - handle to the Mac Services object.    
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   225
        failureEventCB  - pointer ro the call back
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   226
        hFailureEventObj    -handle of the Callback Object
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   227
OUTPUT:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   228
RETURN:     
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   229
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   230
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   231
void MacServices_registerFailureEventCB (TI_HANDLE hMacServices, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   232
                                         void * failureEventCB, 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   233
                                         TI_HANDLE hFailureEventObj)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   234
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   235
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   236
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   237
    powerSrvRegisterFailureEventCB (pMacServices->hPowerSrv,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   238
                                    failureEventCB,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   239
                                    hFailureEventObj);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   240
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   241
    measurementSRVRegisterFailureEventCB (pMacServices->hMeasurementSRV,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   242
                                          failureEventCB,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   243
                                          hFailureEventObj);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   244
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   245
    scanSRV_registerFailureEventCB (pMacServices->hScanSRV,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   246
                                    failureEventCB,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   247
                                    hFailureEventObj);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   248
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   249
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   250
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   251
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   252
 *                        MacServices_powerSrv_SetPsMode                                                            *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   253
 ****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   254
DESCRIPTION: This function is a wrapper for the power server's powerSrv_SetPsMode function
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   255
                                                                                                                   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   256
INPUT:      - hMacServices          - handle to the Mac services object.        
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   257
            - psMode                    - Power save/Active request
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   258
            - sendNullDataOnExit        - 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   259
            - powerSaveCBObject     - handle to the Callback function module.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   260
            - powerSaveCompleteCB   - Callback function - for success/faild notification.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   261
OUTPUT: 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   262
RETURN:    TI_STATUS - TI_OK / PENDING / TI_NOK.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   263
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   264
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   265
TI_STATUS MacServices_powerSrv_SetPsMode (TI_HANDLE                   hMacServices,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   266
                                          E80211PsMode                psMode,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   267
                                          TI_BOOL                        sendNullDataOnExit,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   268
                                          void *                      powerSaveCompleteCBObject,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   269
                                          TPowerSaveCompleteCb        powerSaveCompleteCB,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   270
                                          TPowerSaveResponseCb        powerSavecmdResponseCB)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   271
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   272
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   273
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   274
    return powerSrv_SetPsMode (pMacServices->hPowerSrv,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   275
                               psMode,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   276
                               sendNullDataOnExit,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   277
                               powerSaveCompleteCBObject,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   278
                               powerSaveCompleteCB,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   279
                               powerSavecmdResponseCB);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   280
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   281
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   282
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   283
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   284
 *                        MacServices_powerSrv_ReservePS                                                        *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   285
 ****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   286
DESCRIPTION: This function is a wrapper for the power server's powerSrv_ReservePS function
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   287
                                                                                                                   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   288
INPUT:      - hMacServices                  - handle to the Mac services object.        
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   289
            - psMode                            - Power save/Active request
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   290
            - sendNullDataOnExit                - 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   291
            - powerSaveCBObject             - handle to the Callback function module.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   292
            - powerSaveCompleteCB           - Callback function - for success/faild notification.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   293
OUTPUT: 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   294
RETURN:    TI_STATUS - TI_OK / PENDING / TI_NOK.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   295
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   296
TI_STATUS MacServices_powerSrv_ReservePS(   TI_HANDLE               hMacServices,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   297
                                            E80211PsMode psMode,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   298
                                            TI_BOOL                    sendNullDataOnExit,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   299
                                            void *                  powerSaveCBObject,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   300
                                            TPowerSaveCompleteCb    powerSaveCompleteCB)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   301
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   302
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   303
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   304
    return powerSrv_ReservePS(pMacServices->hPowerSrv,psMode,sendNullDataOnExit,powerSaveCBObject,powerSaveCompleteCB);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   305
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   306
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   307
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   308
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   309
 *                        MacServices_powerSrv_ReleasePS                                                        *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   310
 ****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   311
DESCRIPTION: This function is a wrapper for the power server's powerSrv_ReleasePS function
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   312
                                                                                                                   
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   313
INPUT:      - hPowerSrv                         - handle to the PowerSrv object.        
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   314
            - sendNullDataOnExit                - 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   315
            - powerSaveCBObject     - handle to the Callback function module.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   316
            - powerSaveCompleteCB           - Callback function - for success/faild notification.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   317
OUTPUT: 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   318
RETURN:    TI_STATUS - TI_OK / PENDING / TI_NOK.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   319
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   320
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   321
TI_STATUS MacServices_powerSrv_ReleasePS(   TI_HANDLE                   hMacServices,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   322
                                    TI_BOOL                        sendNullDataOnExit,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   323
                                    void *                          powerSaveCBObject,
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   324
                                    TPowerSaveCompleteCb              powerSaveCompleteCB)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   325
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   326
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   327
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   328
    return powerSrv_ReleasePS(pMacServices->hPowerSrv,sendNullDataOnExit,powerSaveCBObject,powerSaveCompleteCB);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   329
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   330
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   331
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   332
/****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   333
 *                        MacServices_powerSrv_getPsStatus                                                       *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   334
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   335
DESCRIPTION: This function is a wrapper for the power server's powerSrv_getPsStatus function
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   336
                                                                                                                                                                       
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   337
INPUT:      - hPowerSrv                         - handle to the PowerSrv object.        
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   338
            
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   339
OUTPUT: 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   340
RETURN:    TI_BOOL - true if the SM is in PS state -  false otherwise
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   341
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   342
TI_BOOL MacServices_powerSrv_getPsStatus(TI_HANDLE hMacServices)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   343
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   344
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   345
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   346
    return powerSrv_getPsStatus( pMacServices->hPowerSrv);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   347
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   348
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   349
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   350
 /****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   351
 *                        MacServices_powerSrv_SetRateModulation                                                         *
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   352
 *****************************************************************************************
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   353
DESCRIPTION: This function is a wrapper for the power server's powerSrv_SetRateModulation function
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   354
                                                                                                                                                                       
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   355
INPUT:      - hPowerSrv                         - handle to the PowerSrv object.
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   356
            - dot11mode_e - The current radio mode (A or G)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   357
            
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   358
OUTPUT: 
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   359
RETURN:    TI_BOOL - true if the SM is in PS state -  false otherwise
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   360
****************************************************************************************/
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   361
void MacServices_powerSrv_SetRateModulation(TI_HANDLE hMacServices, TI_UINT16  rate)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   362
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   363
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   364
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   365
    powerSrv_SetRateModulation( pMacServices->hPowerSrv,   rate);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   366
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   367
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   368
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   369
TI_UINT32 MacServices_powerSrv_GetRateModulation(TI_HANDLE hMacServices)
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   370
{
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   371
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   372
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   373
    return powerSrv_GetRateModulation( pMacServices->hPowerSrv);
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   374
}
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   375
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   376
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   377
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   378
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   379
10c42ec6c05f version WiLink_Driver_6.1.1.0.8
shahar_levi@ti.com
parents:
diff changeset
   380