sec_fsm.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/sec_fsm.h#1
  3. */
  4. /*! \file sec_fsm.h
  5. \brief Declaration of functions and finite state machine for SECURITY Module.
  6. Function declaration for privacy.c and SEC_STATE for SECURITY FSM.
  7. */
  8. /*
  9. ** Log: sec_fsm.h
  10. **
  11. ** 09 17 2012 cm.chang
  12. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  13. ** Duplicate source from MT6620 v2.3 driver branch
  14. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  15. *
  16. * 09 29 2010 wh.su
  17. * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue
  18. * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue.
  19. *
  20. * 09 21 2010 kevin.huang
  21. * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
  22. * Eliminate Linux Compile Warning
  23. *
  24. * 09 03 2010 kevin.huang
  25. * NULL
  26. * Refine #include sequence and solve recursive/nested #include issue
  27. *
  28. * 08 20 2010 wh.su
  29. * NULL
  30. * adding the eapol callback setting.
  31. *
  32. * 08 19 2010 wh.su
  33. * NULL
  34. * adding the tx pkt call back handle for countermeasure.
  35. *
  36. * 07 08 2010 cp.wu
  37. *
  38. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  39. *
  40. * 06 21 2010 wh.su
  41. * [WPD00003840][MT6620 5931] Security migration
  42. * modify some code for concurrent network.
  43. *
  44. * 06 19 2010 wh.su
  45. * [WPD00003840][MT6620 5931] Security migration
  46. * consdier the concurrent network setting.
  47. *
  48. * 03 04 2010 wh.su
  49. * [BORA00000605][WIFISYS] Phase3 Integration
  50. * Code refine, and remove non-used code.
  51. *
  52. * 03 03 2010 wh.su
  53. * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
  54. * Fixed the pre-authentication timer not correctly init issue, and modify the security
  55. * related callback function prototype.
  56. *
  57. * 03 01 2010 wh.su
  58. * [BORA00000605][WIFISYS] Phase3 Integration
  59. * Refine the variable and parameter for security.
  60. *
  61. * 12 18 2009 cm.chang
  62. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  63. * .
  64. *
  65. * Dec 7 2009 mtk01088
  66. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  67. * fixed the deauth Tx done callback parameter
  68. *
  69. * Dec 4 2009 mtk01088
  70. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  71. * adding the reference function declaration
  72. *
  73. * Dec 3 2009 mtk01088
  74. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  75. * delete non-used code
  76. *
  77. * Dec 1 2009 mtk01088
  78. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  79. * adjust the function prototype
  80. *
  81. * Nov 23 2009 mtk01088
  82. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  83. * adjust the function declaration
  84. *
  85. * Nov 19 2009 mtk01088
  86. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  87. * adding the security variable
  88. *
  89. * Nov 18 2009 mtk01088
  90. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  91. *
  92. ** \main\maintrunk.MT5921\14 2009-04-06 15:35:47 GMT mtk01088
  93. ** add the variable to set the disable AP selection for privacy check, for wps open networking.
  94. ** \main\maintrunk.MT5921\13 2008-11-19 11:46:01 GMT mtk01088
  95. ** rename some variable with pre-fix to avoid the misunderstanding
  96. ** \main\maintrunk.MT5921\12 2008-08-28 20:37:11 GMT mtk01088
  97. ** remove non-used code
  98. **
  99. ** \main\maintrunk.MT5921\11 2008-03-18 09:51:52 GMT mtk01088
  100. ** Add function declaration for timer to indicate pmkid candidate
  101. ** \main\maintrunk.MT5921\10 2008-02-29 15:12:08 GMT mtk01088
  102. ** add variable for sw port control
  103. ** \main\maintrunk.MT5921\9 2008-02-29 12:37:30 GMT mtk01088
  104. ** rename the security related function declaration
  105. ** \main\maintrunk.MT5921\8 2007-12-27 13:59:08 GMT mtk01088
  106. ** adjust the wlan table and sec fsm init timing
  107. ** \main\maintrunk.MT5921\7 2007-11-20 10:39:49 GMT mtk01088
  108. ** add function timer for wait EAPoL Error timeout
  109. ** \main\maintrunk.MT5921\6 2007-11-06 20:39:08 GMT mtk01088
  110. ** rename the counter measure timer
  111. ** \main\maintrunk.MT5921\5 2007-11-06 20:14:31 GMT mtk01088
  112. ** add a abort function
  113. ** Revision 1.5 2007/07/16 02:33:42 MTK01088
  114. ** change the ENUM declaration structure prefix from r to e
  115. **
  116. ** Revision 1.4 2007/07/09 06:23:10 MTK01088
  117. ** update
  118. **
  119. ** Revision 1.3 2007/07/04 10:09:04 MTK01088
  120. ** adjust the state for security fsm
  121. ** change function name
  122. **
  123. ** Revision 1.2 2007/07/03 08:13:22 MTK01088
  124. ** change the sec fsm state
  125. ** add the event for sec fsm
  126. **
  127. ** Revision 1.1 2007/06/27 06:20:35 MTK01088
  128. ** add the sec fsm header file
  129. **
  130. **
  131. */
  132. #ifndef _SEC_FSM_H
  133. #define _SEC_FSM_H
  134. /*******************************************************************************
  135. * C O M P I L E R F L A G S
  136. ********************************************************************************
  137. */
  138. /*******************************************************************************
  139. * E X T E R N A L R E F E R E N C E S
  140. ********************************************************************************
  141. */
  142. /*******************************************************************************
  143. * C O N S T A N T S
  144. ********************************************************************************
  145. */
  146. /* TKIP CounterMeasure interval for Rejoin to Network. */
  147. #define COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC 60
  148. /* Timeout to wait the EAPoL Error Report frame Send out. */
  149. #define EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC 1
  150. /*******************************************************************************
  151. * D A T A T Y P E S
  152. ********************************************************************************
  153. */
  154. typedef UINT_32 SEC_STATUS, *P_SEC_STATUS;
  155. #if 0
  156. /* WPA2 PMKID candicate structure */
  157. typedef struct _PMKID_CANDICATE_T {
  158. UINT_8 aucBssid[MAC_ADDR_LEN]; /* MAC address */
  159. UINT_32 u4PreAuthFlags;
  160. } PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
  161. #endif
  162. typedef SEC_STATUS(*PFN_SEC_FSM_STATE_HANDLER) (VOID);
  163. /*******************************************************************************
  164. * P U B L I C D A T A
  165. ********************************************************************************
  166. */
  167. /*******************************************************************************
  168. * P R I V A T E D A T A
  169. ********************************************************************************
  170. */
  171. /*******************************************************************************
  172. * M A C R O S
  173. ********************************************************************************
  174. */
  175. #define SEC_STATE_TRANSITION_FLAG fgIsTransition
  176. #define SEC_NEXT_STATE_VAR eNextState
  177. #define SEC_STATE_TRANSITION(prAdapter, prSta, eFromState, eToState) \
  178. { secFsmTrans_ ## eFromState ## _to_ ## eToState(prAdapter, prSta); \
  179. SEC_NEXT_STATE_VAR = SEC_STATE_ ## eToState; \
  180. SEC_STATE_TRANSITION_FLAG = (BOOLEAN)TRUE; \
  181. }
  182. /*******************************************************************************
  183. * F U N C T I O N D E C L A R A T I O N S
  184. ********************************************************************************
  185. */
  186. /*--------------------------------------------------------------*/
  187. /* Routines to handle the sec check */
  188. /*--------------------------------------------------------------*/
  189. /***** Routines in sec_fsm.c *****/
  190. VOID secFsmInit(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  191. VOID secFsmEventInit(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  192. VOID secFsmEventStart(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  193. VOID secFsmEventAbort(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  194. BOOLEAN secFsmEventPTKInstalled(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  195. VOID secFsmEvent2ndEapolTx(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  196. VOID secFsmEvent4ndEapolTxDone(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  197. VOID
  198. secFsmEventEapolTxDone(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  199. VOID secFsmEventEapolTxTimeout(IN P_ADAPTER_T prAdapter, IN ULONG ulParamPtr);
  200. VOID
  201. secFsmEventDeauthTxDone(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  202. VOID secFsmEventStartCounterMeasure(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
  203. VOID secFsmEventEndOfCounterMeasure(IN P_ADAPTER_T prAdapter, IN ULONG ulParamPtr);
  204. /*******************************************************************************
  205. * F U N C T I O N S
  206. ********************************************************************************
  207. */
  208. #endif /* _SEC_FSM_H */