import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / conn_soc / drv_wlan / mt_wifi / wlan / include / mgmt / bow_fsm.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/bow_fsm.h#1 $
3 */
4
5 /*! \file bow_fsm.h
6 \brief Declaration of functions and finite state machine for BOW Module.
7
8 Declaration of functions and finite state machine for BOW Module.
9 */
10
11
12
13 /*
14 ** $Log: bow_fsm.h $
15 *
16 * 05 22 2011 terry.wu
17 * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
18 * Submit missing BoW header files.
19 *
20 * 03 27 2011 chinghwa.yu
21 * [WCXRP00000065] Update BoW design and settings
22 * Support multiple physical link.
23 *
24 * 02 16 2011 chinghwa.yu
25 * [WCXRP00000065] Update BoW design and settings
26 * Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting..
27 *
28 * 02 15 2011 chinghwa.yu
29 * [WCXRP00000065] Update BoW design and settings
30 * Add channel previledge into _BOW_FSM_INFO_T.
31 *
32 * 09 16 2010 chinghwa.yu
33 * NULL
34 * update bowChangeMediaState.
35 *
36 * 08 24 2010 chinghwa.yu
37 * NULL
38 * Update BOW for the 1st time.
39 */
40
41 #ifndef _BOW_FSM_H
42 #define _BOW_FSM_H
43
44 /*******************************************************************************
45 * C O M P I L E R F L A G S
46 ********************************************************************************
47 */
48
49 /*******************************************************************************
50 * E X T E R N A L R E F E R E N C E S
51 ********************************************************************************
52 */
53
54 /*******************************************************************************
55 * C O N S T A N T S
56 ********************************************************************************
57 */
58
59 #define BOW_BG_SCAN_INTERVAL_MIN_SEC 2 //30 // exponential to 960
60 #define BOW_BG_SCAN_INTERVAL_MAX_SEC 2 //960 // 16min
61
62 #define BOW_DELAY_TIME_OF_DISCONNECT_SEC 10
63
64 #define BOW_BEACON_TIMEOUT_COUNT_STARTING 10
65 #define BOW_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
66
67 #define BOW_BEACON_MAX_TIMEOUT_TU 100
68 #define BOW_BEACON_MIN_TIMEOUT_TU 5
69 #define BOW_BEACON_MAX_TIMEOUT_VALID TRUE
70 #define BOW_BEACON_MIN_TIMEOUT_VALID TRUE
71
72 #define BOW_BMC_MAX_TIMEOUT_TU 100
73 #define BOW_BMC_MIN_TIMEOUT_TU 5
74 #define BOW_BMC_MAX_TIMEOUT_VALID TRUE
75 #define BOW_BMC_MIN_TIMEOUT_VALID TRUE
76
77 #define BOW_JOIN_CH_GRANT_THRESHOLD 10
78 #define BOW_JOIN_CH_REQUEST_INTERVAL 2000
79
80 /*******************************************************************************
81 * D A T A T Y P E S
82 ********************************************************************************
83 */
84
85 typedef enum _ENUM_BOW_STATE_T {
86 BOW_STATE_IDLE = 0,
87 BOW_STATE_SEARCH,
88 BOW_STATE_SCAN,
89 BOW_STATE_ONLINE_SCAN,
90 BOW_STATE_LOOKING_FOR,
91 BOW_STATE_WAIT_FOR_NEXT_SCAN,
92 BOW_STATE_REQ_CHANNEL_JOIN,
93 BOW_STATE_REQ_CHANNEL_ALONE,
94 BOW_STATE_REQ_CHANNEL_MERGE,
95 BOW_STATE_JOIN,
96 BOW_STATE_IBSS_ALONE,
97 BOW_STATE_IBSS_MERGE,
98 BOW_STATE_NORMAL_TR,
99 BOW_STATE_NUM
100 } ENUM_BOW_STATE_T;
101
102 typedef struct _BOW_FSM_INFO_T {
103 ENUM_BOW_STATE_T ePreviousState;
104 ENUM_BOW_STATE_T eCurrentState;
105
106 BOOLEAN fgTryScan;
107
108 /* Channel Privilege */
109
110 BOOLEAN fgIsInfraChannelFinished;
111 BOOLEAN fgIsChannelRequested;
112 BOOLEAN fgIsChannelGranted;
113 BOOLEAN fgIsScanPending;
114 UINT_32 u4ChGrantedInterval;
115
116
117 UINT_8 ucPrimaryChannel;
118 ENUM_BAND_T eBand;
119 UINT_16 u2BeaconInterval;
120
121 ENUM_BOW_STATE_T eReturnState; /* Return state after current activity finished or abort. */
122 ENUM_BOW_STATE_T eForwardState; /* Step to next state if ACTION frame is TX successfully. */
123
124 P_BSS_DESC_T prTargetBss; /* BSS of target P2P Device. For Connection/Service Discovery */
125
126 P_STA_RECORD_T prTargetStaRec;
127 P_BSS_DESC_T prTargetBssDesc; /* For destination */
128
129 UINT_8 aucPeerAddress[6];
130
131 UINT_8 ucRole;
132
133 BOOLEAN fgSupportQoS;
134
135 BOOLEAN fgIsRsponseProbe; /* Indicate if BOW can response probe request frame. */
136
137 /* Sequence number of requested message. */
138 UINT_8 ucSeqNumOfChReq;
139 UINT_8 ucSeqNumOfReqMsg;
140 UINT_8 ucSeqNumOfScnMsg;
141 UINT_8 ucSeqNumOfScanReq;
142
143 UINT_8 ucSeqNumOfCancelMsg;
144
145 UINT_8 ucDialogToken;
146
147 /* Timer */
148 TIMER_T rStartingBeaconTimer; /* For device discovery time of each discovery request from user.*/
149 TIMER_T rStartingDiscoveryTimer;
150 TIMER_T rOperationListenTimer; /* For Find phase under operational state. */
151 TIMER_T rFSMTimer; /* A timer used for Action frame timeout usage. */
152 TIMER_T rIndicationOfDisconnectTimer;
153 TIMER_T rChGrantedTimer;
154
155 UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
156
157 } BOW_FSM_INFO_T, *P_BOW_FSM_INFO_T;
158
159
160 /*******************************************************************************
161 * P U B L I C D A T A
162 ********************************************************************************
163 */
164
165 /*******************************************************************************
166 * P R I V A T E D A T A
167 ********************************************************************************
168 */
169
170 /*******************************************************************************
171 * M A C R O S
172 ********************************************************************************
173 */
174
175 #define bowChangeMediaState(_prAdapter, _eNewMediaState) \
176 (_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX].eConnectionState = (_eNewMediaState));
177
178 /*******************************************************************************
179 * F U N C T I O N D E C L A R A T I O N S
180 ********************************************************************************
181 */
182
183 /*******************************************************************************
184 * F U N C T I O N S
185 ********************************************************************************
186 */
187
188
189
190 #endif