Home | History | Annotate | Download | only in inc
      1 /****************************************************************************
      2 **+-----------------------------------------------------------------------+**
      3 **|                                                                       |**
      4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
      5 **| All rights reserved.                                                  |**
      6 **|                                                                       |**
      7 **| Redistribution and use in source and binary forms, with or without    |**
      8 **| modification, are permitted provided that the following conditions    |**
      9 **| are met:                                                              |**
     10 **|                                                                       |**
     11 **|  * Redistributions of source code must retain the above copyright     |**
     12 **|    notice, this list of conditions and the following disclaimer.      |**
     13 **|  * Redistributions in binary form must reproduce the above copyright  |**
     14 **|    notice, this list of conditions and the following disclaimer in    |**
     15 **|    the documentation and/or other materials provided with the         |**
     16 **|    distribution.                                                      |**
     17 **|  * Neither the name Texas Instruments nor the names of its            |**
     18 **|    contributors may be used to endorse or promote products derived    |**
     19 **|    from this software without specific prior written permission.      |**
     20 **|                                                                       |**
     21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     32 **|                                                                       |**
     33 **+-----------------------------------------------------------------------+**
     34 ****************************************************************************/
     35 
     36 #ifndef _WHAL_SECURITY_H
     37 #define _WHAL_SECURITY_H
     38 
     39 #include "whalCommon.h"
     40 #include "whalCtrl_api.h"
     41 #include "whalWep.h"
     42 #include "whalWpa.h"
     43 #ifdef CKIP_ENABLED
     44 #include "whalExc.h"
     45 #endif /* CKIP_ENABLED*/
     46 
     47 #define NO_OF_RECONF_SECUR_KEYS_PER_STATION		1 /* define the number of keys allocated on reconfigure
     48 													 data structure for each station*/
     49 #define NO_OF_EXTRA_RECONF_SECUR_KEYS			3
     50 
     51 typedef struct
     52 {
     53 	TI_HANDLE hReport; /* handle to the reporter module*/
     54 	TI_HANDLE hMemMgr; /* handle to the memory manager module*/
     55 } whalSecur_config_t;
     56 
     57 
     58 /* reconfigure security structure for reconfigure (FW reload) time*/
     59 typedef struct
     60 {
     61 	BOOL reconfHwEncEnable;	  	/* save the last HW encryption Enable flag for reconfigure time*/
     62 	BOOL reconfHwDecrEnable;	/* save the last HW decryption Enable flag for reconfigure time*/
     63 	BOOL isHwEncDecrEnableValid;
     64 
     65 	UINT8 reconfDefaultKeyId;	/* save the last configured defualt key ID for reconfigure time*/
     66 	BOOL  isDefaultKeyIdValid;
     67 
     68 	securityKeys_t* reconfKeys; /* save all the configured keys for reconfigure time, keys which
     69 								   it's keyType are not NULL_KEY, are valid*/
     70 } securReconf_t;
     71 
     72 
     73 /* CLASS WHAL_SECURITY*/
     74 typedef struct _WHAL_SECURITY
     75 {
     76 	UINT32 numOfStations;
     77 	cipherSuite_e securityMode;
     78 	securReconf_t reconfData;      /* reconfigure security structure for reconfigure (FW reload) time*/
     79 
     80 	WHAL_CTRL	*pWhalCtrl;		/* Pointer to the HL_HAL control module*/
     81 	WHAL_WEP	*pWhalWep;
     82 	WHAL_WPA	*pWhalWpa;
     83 #ifdef CKIP_ENABLED
     84 	privacy_t   *pWhalPrivacy;
     85 	WHAL_EXC	*pWhalExc;
     86 #endif /*CKIP_ENABLED*/
     87 	TI_HANDLE hOs;
     88 	TI_HANDLE hReport;
     89 	TI_HANDLE hMemMgr;
     90 } WHAL_SECURITY;
     91 
     92 /* WHAL SECURITY Class API*/
     93 TI_HANDLE whalSecur_Create (TI_HANDLE hOs, TI_HANDLE hWhalCtrl, UINT16 numOfStations);
     94 
     95 int whalSecur_Config (TI_HANDLE hWhalSecur, whalSecur_config_t* pWhalSecurCfg);
     96 
     97 int whalSecur_KeyAdd (TI_HANDLE hWhalSecur, securityKeys_t* apKey, BOOL reconfFlag, void *CB_Func, TI_HANDLE CB_handle);
     98 
     99 int whalSecur_KeyRemove (TI_HANDLE hWhalSecur, securityKeys_t* apKey, BOOL reconfFlag, void *CB_Func, TI_HANDLE CB_handle);
    100 
    101 int whalSecur_DefaultKeyIdSet (TI_HANDLE hWhalSecur, UINT8 aKeyId, void *CB_Func, TI_HANDLE CB_handle);
    102 
    103 int whalSecur_HwEncDecrEnable (TI_HANDLE hWhalSecur, BOOL aHwEncEnable);
    104 
    105 int whalSecur_SwEncEnable (TI_HANDLE hWhalSecur, BOOL aSwEncEnable);
    106 
    107 int whalSecur_MicFieldEnable (TI_HANDLE hWhalSecur, BOOL aMicFieldEnable);
    108 
    109 int whalSecur_SecurModeSet (TI_HANDLE hWhalSecur, cipherSuite_e aSecurMode);
    110 
    111 cipherSuite_e whalSecur_SecurModeGet (TI_HANDLE hWhalSecur);
    112 
    113 int whalSecur_KeysReconfig (TI_HANDLE hWhalSecur);
    114 
    115 int whalSecur_Destroy (TI_HANDLE hWhalSecur, UINT16 numOfStations);
    116 
    117 #endif /* _WHAL_SECURITY_H*/
    118