PageRenderTime 27ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/hal/inc/whalSecurity.h

http://github.com/CyanogenMod/cm-kernel
C Header | 117 lines | 54 code | 24 blank | 39 comment | 0 complexity | e08742c2b5193aa0341add13bd4c6bd5 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  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. #ifndef _WHAL_SECURITY_H
  36. #define _WHAL_SECURITY_H
  37. #include "whalCommon.h"
  38. #include "whalCtrl_api.h"
  39. #include "whalWep.h"
  40. #include "whalWpa.h"
  41. #ifdef CKIP_ENABLED
  42. #include "whalExc.h"
  43. #endif /* CKIP_ENABLED*/
  44. #define NO_OF_RECONF_SECUR_KEYS_PER_STATION 1 /* define the number of keys allocated on reconfigure
  45. data structure for each station*/
  46. #define NO_OF_EXTRA_RECONF_SECUR_KEYS 3
  47. typedef struct
  48. {
  49. TI_HANDLE hReport; /* handle to the reporter module*/
  50. TI_HANDLE hMemMgr; /* handle to the memory manager module*/
  51. } whalSecur_config_t;
  52. /* reconfigure security structure for reconfigure (FW reload) time*/
  53. typedef struct
  54. {
  55. BOOL reconfHwEncEnable; /* save the last HW encryption Enable flag for reconfigure time*/
  56. BOOL reconfHwDecrEnable; /* save the last HW decryption Enable flag for reconfigure time*/
  57. BOOL isHwEncDecrEnableValid;
  58. UINT8 reconfDefaultKeyId; /* save the last configured defualt key ID for reconfigure time*/
  59. BOOL isDefaultKeyIdValid;
  60. securityKeys_t* reconfKeys; /* save all the configured keys for reconfigure time, keys which
  61. it's keyType are not NULL_KEY, are valid*/
  62. } securReconf_t;
  63. /* CLASS WHAL_SECURITY*/
  64. typedef struct _WHAL_SECURITY
  65. {
  66. UINT32 numOfStations;
  67. cipherSuite_e securityMode;
  68. securReconf_t reconfData; /* reconfigure security structure for reconfigure (FW reload) time*/
  69. WHAL_CTRL *pWhalCtrl; /* Pointer to the HL_HAL control module*/
  70. WHAL_WEP *pWhalWep;
  71. WHAL_WPA *pWhalWpa;
  72. #ifdef CKIP_ENABLED
  73. privacy_t *pWhalPrivacy;
  74. WHAL_EXC *pWhalExc;
  75. #endif /*CKIP_ENABLED*/
  76. TI_HANDLE hOs;
  77. TI_HANDLE hReport;
  78. TI_HANDLE hMemMgr;
  79. } WHAL_SECURITY;
  80. /* WHAL SECURITY Class API*/
  81. TI_HANDLE whalSecur_Create (TI_HANDLE hOs, TI_HANDLE hWhalCtrl, UINT16 numOfStations);
  82. int whalSecur_Config (TI_HANDLE hWhalSecur, whalSecur_config_t* pWhalSecurCfg);
  83. int whalSecur_KeyAdd (TI_HANDLE hWhalSecur, securityKeys_t* apKey, BOOL reconfFlag, void *CB_Func, TI_HANDLE CB_handle);
  84. int whalSecur_KeyRemove (TI_HANDLE hWhalSecur, securityKeys_t* apKey, BOOL reconfFlag, void *CB_Func, TI_HANDLE CB_handle);
  85. int whalSecur_DefaultKeyIdSet (TI_HANDLE hWhalSecur, UINT8 aKeyId, void *CB_Func, TI_HANDLE CB_handle);
  86. int whalSecur_HwEncDecrEnable (TI_HANDLE hWhalSecur, BOOL aHwEncEnable);
  87. int whalSecur_SwEncEnable (TI_HANDLE hWhalSecur, BOOL aSwEncEnable);
  88. int whalSecur_MicFieldEnable (TI_HANDLE hWhalSecur, BOOL aMicFieldEnable);
  89. int whalSecur_SecurModeSet (TI_HANDLE hWhalSecur, cipherSuite_e aSecurMode);
  90. cipherSuite_e whalSecur_SecurModeGet (TI_HANDLE hWhalSecur);
  91. int whalSecur_KeysReconfig (TI_HANDLE hWhalSecur);
  92. int whalSecur_Destroy (TI_HANDLE hWhalSecur, UINT16 numOfStations);
  93. #endif /* _WHAL_SECURITY_H*/