sec_fsm.h 8.3 KB

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