2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/bow.h#1 $
10 * 01 16 2012 chinghwa.yu
11 * [WCXRP00000065] Update BoW design and settings
12 * Support BOW for 5GHz band.
15 * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
16 * Add BoW Cancel Scan Request and Turn On deactive network function.
19 * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
20 * Submit missing BoW header files.
22 * 03 27 2011 chinghwa.yu
23 * [WCXRP00000065] Update BoW design and settings
24 * Support multiple physical link.
26 * 03 06 2011 chinghwa.yu
27 * [WCXRP00000065] Update BoW design and settings
28 * Sync BOW Driver to latest person development branch version..
30 * 02 10 2011 chinghwa.yu
31 * [WCXRP00000065] Update BoW design and settings
32 * Fix kernel API change issue.
33 * Before ALPS 2.2 (2.2 included), kfifo_alloc() is
34 * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock);
35 * After ALPS 2.3, kfifo_alloc() is changed to
36 * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask);
38 * 02 10 2011 chinghwa.yu
39 * [WCXRP00000065] Update BoW design and settings
40 * Update BOW structure.
43 * [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3
44 * create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031
45 * with BOW and P2P enabled as default
47 * 02 08 2011 chinghwa.yu
48 * [WCXRP00000065] Update BoW design and settings
49 * Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in.
50 * Update BOW get MAC status, remove returning event for AIS network type.
52 * 01 11 2011 chinghwa.yu
53 * [WCXRP00000065] Update BoW design and settings
54 * Add Activity Report definition.
56 * 10 18 2010 chinghwa.yu
57 * [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size
58 * Fix wrong BoW event size.
62 * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6.
66 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
68 * 06 06 2010 kevin.huang
69 * [WPD00003832][MT6620 5931] Create driver base
70 * [MT6620 5931] Create driver base
73 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
74 * 1) all BT physical handles shares the same RSSI/Link Quality.
75 * 2) simplify BT command composing
78 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
79 * change prefix for data structure used to communicate with 802.11 PAL
80 * to avoid ambiguous naming with firmware interface
83 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
84 * basic implementation for EVENT_BT_OVER_WIFI
87 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
88 * add framework for BT-over-Wi-Fi support.
89 * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
90 * * * * * * * 2) command sequence number is now increased atomically
91 * * * * * * * 3) private data could be hold and taken use for other purpose
94 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
95 * sync. with design document for interface change.
98 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
99 * Wi-Fi driver no longer needs to implement 802.11 PAL, thus replaced by wrapping command/event definitions
102 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
106 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
107 * update for all command/event needed to be supported by 802.11 PAL.
110 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
111 * build up basic data structure and definitions to support BT-over-WiFi
118 /*******************************************************************************
119 * C O M P I L E R F L A G S
120 ********************************************************************************
123 /*******************************************************************************
124 * E X T E R N A L R E F E R E N C E S
125 ********************************************************************************
128 /*******************************************************************************
130 ********************************************************************************
133 #define BOWDEVNAME "bow0"
135 #define MAX_BOW_NUMBER_OF_CHANNEL_2G4 14
136 #define MAX_BOW_NUMBER_OF_CHANNEL_5G 4
137 #define MAX_BOW_NUMBER_OF_CHANNEL 18 //(MAX_BOW_NUMBER_OF_CHANNEL_2G4 + MAX_BOW_NUMBER_OF_CHANNEL_5G)
139 #define MAX_ACTIVITY_REPORT 2
140 #define MAX_ACTIVITY_REPROT_TIME 660
142 #define ACTIVITY_REPORT_STATUS_SUCCESS 0
143 #define ACTIVITY_REPORT_STATUS_FAILURE 1
144 #define ACTIVITY_REPORT_STATUS_TIME_INVALID 2
145 #define ACTIVITY_REPORT_STATUS_OTHERS 3
147 #define ACTIVITY_REPORT_SCHEDULE_UNKNOWN 0 //Does not know the schedule of the interference
148 #define ACTIVITY_REPORT_SCHEDULE_KNOWN 1
150 /*******************************************************************************
152 ********************************************************************************
155 /*******************************************************************************
157 ********************************************************************************
159 typedef struct _BT_OVER_WIFI_COMMAND_HEADER_T {
162 UINT_16 u2PayloadLength;
163 } AMPC_COMMAND_HEADER_T, *P_AMPC_COMMAND_HEADER_T;
165 typedef struct _BT_OVER_WIFI_COMMAND {
166 AMPC_COMMAND_HEADER_T rHeader;
167 UINT_8 aucPayload[0];
168 } AMPC_COMMAND, *P_AMPC_COMMAND;
170 typedef struct _BT_OVER_WIFI_EVENT_HEADER_T {
173 UINT_16 u2PayloadLength;
174 } AMPC_EVENT_HEADER_T, *P_AMPC_EVENT_HEADER_T;
176 typedef struct _BT_OVER_WIFI_EVENT {
177 AMPC_EVENT_HEADER_T rHeader;
178 UINT_8 aucPayload[0];
179 } AMPC_EVENT, *P_AMPC_EVENT;
181 typedef struct _CHANNEL_DESC_T {
182 UINT_8 ucChannelBand;
184 } CHANNEL_DESC, P_CHANNEL_DESC;
186 // Command Structures
187 typedef struct _BOW_SETUP_CONNECTION {
191 UINT_8 aucPeerAddress[6];
192 UINT_16 u2BeaconInterval;
193 UINT_8 ucTimeoutDiscovery;
194 UINT_8 ucTimeoutInactivity;
196 UINT_8 ucPAL_Capabilities;
200 //Pending, for future BOW 5G supporting.
201 /* UINT_8 aucPeerAddress[6];
202 UINT_16 u2BeaconInterval;
203 UINT_8 ucTimeoutDiscovery;
204 UINT_8 ucTimeoutInactivity;
206 UINT_8 ucPAL_Capabilities;
208 UINT_8 ucChannelListNum;
209 CHANNEL_DESC arChannelList[1];
211 } BOW_SETUP_CONNECTION, *P_BOW_SETUP_CONNECTION;
213 typedef struct _BOW_DESTROY_CONNECTION {
214 UINT_8 aucPeerAddress[6];
215 UINT_8 aucReserved[2];
216 } BOW_DESTROY_CONNECTION, *P_BOW_DESTROY_CONNECTION;
218 typedef struct _BOW_SET_PTK {
219 UINT_8 aucPeerAddress[6];
220 UINT_8 aucReserved[2];
221 UINT_8 aucTemporalKey[16];
222 } BOW_SET_PTK, *P_BOW_SET_PTK;
224 typedef struct _BOW_READ_RSSI {
225 UINT_8 aucPeerAddress[6];
226 UINT_8 aucReserved[2];
227 } BOW_READ_RSSI, *P_BOW_READ_RSSI;
229 typedef struct _BOW_READ_LINK_QUALITY {
230 UINT_8 aucPeerAddress[6];
231 UINT_8 aucReserved[2];
232 } BOW_READ_LINK_QUALITY, *P_BOW_READ_LINK_QUALITY;
234 typedef struct _BOW_SHORT_RANGE_MODE {
235 UINT_8 aucPeerAddress[6];
238 } BOW_SHORT_RANGE_MODE, *P_BOW_SHORT_RANGE_MODE;
241 typedef struct _BOW_COMMAND_STATUS {
243 UINT_8 ucReserved[3];
244 } BOW_COMMAND_STATUS, *P_BOW_COMMAND_STATUS;
246 typedef struct _BOW_MAC_STATUS {
247 UINT_8 aucMacAddr[6];
248 UINT_8 ucAvailability;
249 UINT_8 ucNumOfChannel;
250 CHANNEL_DESC arChannelList[MAX_BOW_NUMBER_OF_CHANNEL];
251 } BOW_MAC_STATUS, *P_BOW_MAC_STATUS;
253 typedef struct _BOW_LINK_CONNECTED {
254 CHANNEL_DESC rChannel;
256 UINT_8 aucPeerAddress[6];
257 } BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;
259 typedef struct _BOW_LINK_DISCONNECTED {
262 UINT_8 aucPeerAddress[6];
263 } BOW_LINK_DISCONNECTED, *P_BOW_LINK_DISCONNECTED;
265 typedef struct _BOW_RSSI {
267 UINT_8 aucReserved[3];
268 } BOW_RSSI, *P_BOW_RSSI;
270 typedef struct _BOW_LINK_QUALITY {
271 UINT_8 ucLinkQuality;
272 UINT_8 aucReserved[3];
273 } BOW_LINK_QUALITY, *P_BOW_LINK_QUALITY;
275 typedef enum _ENUM_BOW_CMD_ID_T {
276 BOW_CMD_ID_GET_MAC_STATUS = 1,
277 BOW_CMD_ID_SETUP_CONNECTION,
278 BOW_CMD_ID_DESTROY_CONNECTION,
280 BOW_CMD_ID_READ_RSSI,
281 BOW_CMD_ID_READ_LINK_QUALITY,
282 BOW_CMD_ID_SHORT_RANGE_MODE,
283 BOW_CMD_ID_GET_CHANNEL_LIST,
284 } ENUM_BOW_CMD_ID_T, *P_ENUM_BOW_CMD_ID_T;
286 typedef enum _ENUM_BOW_EVENT_ID_T {
287 BOW_EVENT_ID_COMMAND_STATUS = 1,
288 BOW_EVENT_ID_MAC_STATUS,
289 BOW_EVENT_ID_LINK_CONNECTED,
290 BOW_EVENT_ID_LINK_DISCONNECTED,
292 BOW_EVENT_ID_LINK_QUALITY,
293 BOW_EVENT_ID_CHANNEL_LIST,
294 BOW_EVENT_ID_CHANNEL_SELECTED,
295 } ENUM_BOW_EVENT_ID_T, *P_ENUM_BOW_EVENT_ID_T;
297 typedef enum _ENUM_BOW_DEVICE_STATE {
298 BOW_DEVICE_STATE_DISCONNECTED = 0,
299 BOW_DEVICE_STATE_DISCONNECTING,
300 BOW_DEVICE_STATE_ACQUIRING_CHANNEL,
301 BOW_DEVICE_STATE_STARTING,
302 BOW_DEVICE_STATE_SCANNING,
303 BOW_DEVICE_STATE_CONNECTING,
304 BOW_DEVICE_STATE_CONNECTED,
306 } ENUM_BOW_DEVICE_STATE, *P_ENUM_BOW_DEVICE_STATE;
308 /*******************************************************************************
309 * P U B L I C D A T A
310 ********************************************************************************
313 /*******************************************************************************
314 * P R I V A T E D A T A
315 ********************************************************************************
318 /*******************************************************************************
319 * F U N C T I O N D E C L A R A T I O N S
320 ********************************************************************************