staging: wilc1000: fix alignment of defines
[deliverable/linux.git] / drivers / staging / wilc1000 / host_interface.h
1 /*!
2 * @file host_interface.h
3 * @brief File containg host interface APIs
4 * @author zsalah
5 * @sa host_interface.c
6 * @date 8 March 2012
7 * @version 1.0
8 */
9
10 #ifndef HOST_INT_H
11 #define HOST_INT_H
12
13 #include "coreconfigurator.h"
14 /*****************************************************************************/
15 /* Macros */
16 /*****************************************************************************/
17
18 #define IP_ALEN 4
19
20 #define IDLE_MODE 0x00
21 #define AP_MODE 0x01
22 #define STATION_MODE 0x02
23 #define GO_MODE 0x03
24 #define CLIENT_MODE 0x04
25
26
27 #define MAX_NUM_STA 9
28 #define ACTIVE_SCAN_TIME 10
29 #define PASSIVE_SCAN_TIME 1200
30 #define MIN_SCAN_TIME 10
31 #define MAX_SCAN_TIME 1200
32 #define DEFAULT_SCAN 0
33 #define USER_SCAN BIT(0)
34 #define OBSS_PERIODIC_SCAN BIT(1)
35 #define OBSS_ONETIME_SCAN BIT(2)
36 #define GTK_RX_KEY_BUFF_LEN 24
37 #define ADDKEY 0x1
38 #define REMOVEKEY 0x2
39 #define DEFAULTKEY 0x4
40 #define ADDKEY_AP 0x8
41 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
42 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
43 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
44 #define CHANNEL_SCAN_TIME 250 /* 250 */
45
46 #define TX_MIC_KEY_LEN 8
47 #define RX_MIC_KEY_LEN 8
48 #define PTK_KEY_LEN 16
49
50 #define TX_MIC_KEY_MSG_LEN 26
51 #define RX_MIC_KEY_MSG_LEN 48
52 #define PTK_KEY_MSG_LEN 39
53
54 #define PMKSA_KEY_LEN 22
55 #define ETH_ALEN 6
56 #define PMKID_LEN 16
57 #define WILC_MAX_NUM_PMKIDS 16
58 #define WILC_SUPP_MCS_SET_SIZE 16
59 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
60 #define SCAN_EVENT_DONE_ABORTED
61 #define NUM_CONCURRENT_IFC 2
62
63 typedef struct {
64 u16 cfg_wid;
65 WID_TYPE_T cfg_type;
66 s8 *pu8Para;
67 } cfg_param_t;
68
69 typedef struct _tstrStatistics {
70 u8 u8LinkSpeed;
71 s8 s8RSSI;
72 u32 u32TxCount;
73 u32 u32RxCount;
74 u32 u32TxFailureCount;
75
76 } tstrStatistics;
77
78
79 typedef enum {
80 HOST_IF_IDLE = 0,
81 HOST_IF_SCANNING = 1,
82 HOST_IF_CONNECTING = 2,
83 HOST_IF_WAITING_CONN_RESP = 3,
84 HOST_IF_CONNECTED = 4,
85 HOST_IF_P2P_LISTEN = 5,
86 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
87 } tenuHostIFstate;
88
89 typedef struct _tstrHostIFpmkid {
90 u8 bssid[ETH_ALEN];
91 u8 pmkid[PMKID_LEN];
92 } tstrHostIFpmkid;
93
94 typedef struct _tstrHostIFpmkidAttr {
95 u8 numpmkid;
96 tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
97 } tstrHostIFpmkidAttr;
98
99 typedef enum {
100 AUTORATE = 0,
101 MBPS_1 = 1,
102 MBPS_2 = 2,
103 MBPS_5_5 = 5,
104 MBPS_11 = 11,
105 MBPS_6 = 6,
106 MBPS_9 = 9,
107 MBPS_12 = 12,
108 MBPS_18 = 18,
109 MBPS_24 = 24,
110 MBPS_36 = 36,
111 MBPS_48 = 48,
112 MBPS_54 = 54
113 } CURRENT_TX_RATE_T;
114
115 typedef struct {
116 u32 u32SetCfgFlag;
117 u8 ht_enable;
118 u8 bss_type;
119 u8 auth_type;
120 u16 auth_timeout;
121 u8 power_mgmt_mode;
122 u16 short_retry_limit;
123 u16 long_retry_limit;
124 u16 frag_threshold;
125 u16 rts_threshold;
126 u16 preamble_type;
127 u8 short_slot_allowed;
128 u8 txop_prot_disabled;
129 u16 beacon_interval;
130 u16 dtim_period;
131 SITE_SURVEY_T site_survey_enabled;
132 u16 site_survey_scan_time;
133 u8 scan_source;
134 u16 active_scan_time;
135 u16 passive_scan_time;
136 CURRENT_TX_RATE_T curr_tx_rate;
137
138 } tstrCfgParamVal;
139
140 typedef enum {
141 RETRY_SHORT = 1 << 0,
142 RETRY_LONG = 1 << 1,
143 FRAG_THRESHOLD = 1 << 2,
144 RTS_THRESHOLD = 1 << 3,
145 BSS_TYPE = 1 << 4,
146 AUTH_TYPE = 1 << 5,
147 AUTHEN_TIMEOUT = 1 << 6,
148 POWER_MANAGEMENT = 1 << 7,
149 PREAMBLE = 1 << 8,
150 SHORT_SLOT_ALLOWED = 1 << 9,
151 TXOP_PROT_DISABLE = 1 << 10,
152 BEACON_INTERVAL = 1 << 11,
153 DTIM_PERIOD = 1 << 12,
154 SITE_SURVEY = 1 << 13,
155 SITE_SURVEY_SCAN_TIME = 1 << 14,
156 ACTIVE_SCANTIME = 1 << 15,
157 PASSIVE_SCANTIME = 1 << 16,
158 CURRENT_TX_RATE = 1 << 17,
159 HT_ENABLE = 1 << 18,
160 } tenuCfgParam;
161
162 typedef struct {
163 u8 au8bssid[6];
164 s8 s8rssi;
165 } tstrFoundNetworkInfo;
166
167 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
168 SCAN_EVENT_DONE = 1,
169 SCAN_EVENT_ABORTED = 2,
170 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
171
172 typedef enum {
173 CONN_DISCONN_EVENT_CONN_RESP = 0,
174 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
175 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
176 } tenuConnDisconnEvent;
177
178 typedef enum {
179 WEP,
180 WPARxGtk,
181 WPAPtk,
182 PMKSA,
183 } tenuKeyType;
184
185
186 /*Scan callBack function definition*/
187 typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
188
189 /*Connect callBack function definition*/
190 typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent,
191 tstrConnectInfo *,
192 u8,
193 tstrDisconnectNotifInfo *,
194 void *);
195
196 #ifdef WILC_P2P
197 typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/
198 typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
199 #endif
200
201 /* typedef u32 WILC_WFIDrvHandle; */
202 typedef struct {
203 s32 s32Dummy;
204 } *WILC_WFIDrvHandle;
205
206 /*!
207 * @struct tstrRcvdNetworkInfo
208 * @brief Structure to hold Received Asynchronous Network info
209 * @details
210 * @todo
211 * @sa
212 * @author Mostafa Abu Bakr
213 * @date 25 March 2012
214 * @version 1.0
215 */
216 typedef struct _tstrRcvdNetworkInfo {
217 u8 *pu8Buffer;
218 u32 u32Length;
219 } tstrRcvdNetworkInfo;
220
221 /*BugID_4156*/
222 typedef struct _tstrHiddenNetworkInfo {
223 u8 *pu8ssid;
224 u8 u8ssidlen;
225
226 } tstrHiddenNetworkInfo;
227
228 typedef struct _tstrHiddenNetwork {
229 /* MAX_SSID_LEN */
230 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
231 u8 u8ssidnum;
232
233 } tstrHiddenNetwork;
234
235 typedef struct {
236 /* Scan user call back function */
237 tWILCpfScanResult pfUserScanResult;
238
239 /* User specific parameter to be delivered through the Scan User Callback function */
240 void *u32UserScanPvoid;
241
242 u32 u32RcvdChCount;
243 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
244 } tstrWILC_UsrScanReq;
245
246 typedef struct {
247 u8 *pu8bssid;
248 u8 *pu8ssid;
249 u8 u8security;
250 AUTHTYPE_T tenuAuth_type;
251 size_t ssidLen;
252 u8 *pu8ConnReqIEs;
253 size_t ConnReqIEsLen;
254 /* Connect user call back function */
255 tWILCpfConnectResult pfUserConnectResult;
256 bool IsHTCapable;
257 /* User specific parameter to be delivered through the Connect User Callback function */
258 void *u32UserConnectPvoid;
259 } tstrWILC_UsrConnReq;
260
261 typedef struct {
262 u32 u32Address;
263 } tstrHostIfSetDrvHandler;
264
265 typedef struct {
266 u32 u32Mode;
267 } tstrHostIfSetOperationMode;
268
269 /*BugID_5077*/
270 typedef struct {
271 u8 u8MacAddress[ETH_ALEN];
272 } tstrHostIfSetMacAddress;
273
274 /*BugID_5213*/
275 typedef struct {
276 u8 *u8MacAddress;
277 } tstrHostIfGetMacAddress;
278
279 /*BugID_5222*/
280 typedef struct {
281 u8 au8Bssid[ETH_ALEN];
282 u8 u8Ted;
283 u16 u16BufferSize;
284 u16 u16SessionTimeout;
285 } tstrHostIfBASessionInfo;
286
287 #ifdef WILC_P2P
288 typedef struct {
289 u16 u16Channel;
290 u32 u32duration;
291 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
292 tWILCpfRemainOnChanReady pRemainOnChanReady;
293 void *pVoid;
294 u32 u32ListenSessionID;
295 } tstrHostIfRemainOnChan;
296
297 typedef struct {
298
299 bool bReg;
300 u16 u16FrameType;
301 u8 u8Regid;
302
303
304 } tstrHostIfRegisterFrame;
305
306
307 #define ACTION 0xD0
308 #define PROBE_REQ 0x40
309 #define PROBE_RESP 0x50
310 #define ACTION_FRM_IDX 0
311 #define PROBE_REQ_IDX 1
312
313
314 enum p2p_listen_state {
315 P2P_IDLE,
316 P2P_LISTEN,
317 P2P_GRP_FORMATION
318 };
319
320 #endif
321 typedef struct {
322 /* Scan user structure */
323 tstrWILC_UsrScanReq strWILC_UsrScanReq;
324
325 /* Connect User structure */
326 tstrWILC_UsrConnReq strWILC_UsrConnReq;
327
328 #ifdef WILC_P2P
329 /*Remain on channel struvture*/
330 tstrHostIfRemainOnChan strHostIfRemainOnChan;
331 u8 u8RemainOnChan_pendingreq;
332 u64 u64P2p_MgmtTimeout;
333 u8 u8P2PConnect;
334 #endif
335
336 tenuHostIFstate enuHostIFstate;
337
338 #ifndef CONNECT_DIRECT
339 u32 u32SurveyResultsCount;
340 wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS];
341 #endif
342
343 u8 au8AssociatedBSSID[ETH_ALEN];
344 tstrCfgParamVal strCfgValues;
345 /* semaphores */
346 struct semaphore gtOsCfgValuesSem;
347 struct semaphore hSemTestKeyBlock;
348
349 struct semaphore hSemTestDisconnectBlock;
350 struct semaphore hSemGetRSSI;
351 struct semaphore hSemGetLINKSPEED;
352 struct semaphore hSemGetCHNL;
353 struct semaphore hSemInactiveTime;
354 /* timer handlers */
355 struct timer_list hScanTimer;
356 struct timer_list hConnectTimer;
357 #ifdef WILC_P2P
358 struct timer_list hRemainOnChannel;
359 #endif
360
361 bool IFC_UP;
362 } tstrWILC_WFIDrv;
363
364 /*!
365 * @enum tenuWILC_StaFlag
366 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
367 * @details
368 * @todo
369 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
370 * @author Enumeraion's creator
371 * @date 12 July 2012
372 * @version 1.0 Description
373 */
374
375 typedef enum {
376 WILC_STA_FLAG_INVALID = 0,
377 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
378 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
379 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
380 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
381 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
382 } tenuWILC_StaFlag;
383
384 typedef struct {
385 u8 au8BSSID[ETH_ALEN];
386 u16 u16AssocID;
387 u8 u8NumRates;
388 const u8 *pu8Rates;
389 bool bIsHTSupported;
390 u16 u16HTCapInfo;
391 u8 u8AmpduParams;
392 u8 au8SuppMCsSet[16];
393 u16 u16HTExtParams;
394 u32 u32TxBeamformingCap;
395 u8 u8ASELCap;
396 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
397 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
398 } tstrWILC_AddStaParam;
399
400 /*****************************************************************************/
401 /* */
402 /* Host Interface API */
403 /* */
404 /*****************************************************************************/
405
406 /**
407 * @brief removes wpa/wpa2 keys
408 * @details only in BSS STA mode if External Supplicant support is enabled.
409 * removes all WPA/WPA2 station key entries from MAC hardware.
410 * @param[in,out] handle to the wifi driver
411 * @param[in] 6 bytes of Station Adress in the station entry table
412 * @return Error code indicating success/failure
413 * @note
414 * @author zsalah
415 * @date 8 March 2012
416 * @version 1.0
417 */
418 s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress);
419 /**
420 * @brief removes WEP key
421 * @details valid only in BSS STA mode if External Supplicant support is enabled.
422 * remove a WEP key entry from MAC HW.
423 * The BSS Station automatically finds the index of the entry using its
424 * BSS ID and removes that entry from the MAC hardware.
425 * @param[in,out] handle to the wifi driver
426 * @param[in] 6 bytes of Station Adress in the station entry table
427 * @return Error code indicating success/failure
428 * @note NO need for the STA add since it is not used for processing
429 * @author zsalah
430 * @date 8 March 2012
431 * @version 1.0
432 */
433 s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
434 /**
435 * @brief sets WEP deafault key
436 * @details Sets the index of the WEP encryption key in use,
437 * in the key table
438 * @param[in,out] handle to the wifi driver
439 * @param[in] key index ( 0, 1, 2, 3)
440 * @return Error code indicating success/failure
441 * @note
442 * @author zsalah
443 * @date 8 March 2012
444 * @version 1.0
445 */
446 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
447
448 /**
449 * @brief sets WEP deafault key
450 * @details valid only in BSS STA mode if External Supplicant support is enabled.
451 * sets WEP key entry into MAC hardware when it receives the
452 * corresponding request from NDIS.
453 * @param[in,out] handle to the wifi driver
454 * @param[in] message containing WEP Key in the following format
455 *|---------------------------------------|
456 *|Key ID Value | Key Length | Key |
457 *|-------------|------------|------------|
458 | 1byte | 1byte | Key Length |
459 ||---------------------------------------|
460 |
461 * @return Error code indicating success/failure
462 * @note
463 * @author zsalah
464 * @date 8 March 2012
465 * @version 1.0
466 */
467 s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
468 /**
469 * @brief host_int_add_wep_key_bss_ap
470 * @details valid only in AP mode if External Supplicant support is enabled.
471 * sets WEP key entry into MAC hardware when it receives the
472 * corresponding request from NDIS.
473 * @param[in,out] handle to the wifi driver
474 *
475 *
476 * @return Error code indicating success/failure
477 * @note
478 * @author mdaftedar
479 * @date 28 Feb 2013
480 * @version 1.0
481 */
482 s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
483
484 /**
485 * @brief adds ptk Key
486 * @details
487 * @param[in,out] handle to the wifi driver
488 * @param[in] message containing PTK Key in the following format
489 *|-------------------------------------------------------------------------|
490 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
491 *|-----------|------------|---------------|----------------|---------------|
492 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
493 ||-------------------------------------------------------------------------|
494 * @return Error code indicating success/failure
495 * @note
496 * @author zsalah
497 * @date 8 March 2012
498 * @version 1.0
499 */
500 s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
501 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
502
503 /**
504 * @brief host_int_get_inactive_time
505 * @details
506 * @param[in,out] handle to the wifi driver
507 * @param[in] message containing inactive time
508 *
509 * @return Error code indicating success/failure
510 * @note
511 * @author mdaftedar
512 * @date 15 April 2013
513 * @version 1.0
514 */
515 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
516
517 /**
518 * @brief adds Rx GTk Key
519 * @details
520 * @param[in,out] handle to the wifi driver
521 * @param[in] message containing Rx GTK Key in the following format
522 *|----------------------------------------------------------------------------|
523 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
524 *|------------|---------|-------|------------|---------------|----------------|
525 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
526 ||----------------------------------------------------------------------------|
527 * @return Error code indicating success/failure
528 * @note
529 * @author zsalah
530 * @date 8 March 2012
531 * @version 1.0
532 */
533 s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
534 u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
535 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
536
537
538 /**
539 * @brief adds Tx GTk Key
540 * @details
541 * @param[in,out] handle to the wifi driver
542 * @param[in] message containing Tx GTK Key in the following format
543 *|----------------------------------------------------|
544 | KeyID | Key Length | Temporal Key | Tx Michael Key |
545 ||-------|------------|--------------|----------------|
546 ||1 byte | 1 byte | 16 bytes | 8 bytes |
547 ||----------------------------------------------------|
548 * @return Error code indicating success/failure
549 * @note
550 * @author zsalah
551 * @date 8 March 2012
552 * @version 1.0
553 */
554 s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
555
556 /**
557 * @brief caches the pmkid
558 * @details valid only in BSS STA mode if External Supplicant
559 * support is enabled. This Function sets the PMKID in firmware
560 * when host drivr receives the corresponding request from NDIS.
561 * The firmware then includes theset PMKID in the appropriate
562 * management frames
563 * @param[in,out] handle to the wifi driver
564 * @param[in] message containing PMKID Info in the following format
565 *|-----------------------------------------------------------------|
566 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
567 *|-----------|------------|----------|-------|----------|----------|
568 | 1 | 6 | 16 | ... | 6 | 16 |
569 ||-----------------------------------------------------------------|
570 * @return Error code indicating success/failure
571 * @note
572 * @author zsalah
573 * @date 8 March 2012
574 * @version 1.0
575 */
576
577 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
578 /**
579 * @brief gets the cached the pmkid info
580 * @details valid only in BSS STA mode if External Supplicant
581 * support is enabled. This Function sets the PMKID in firmware
582 * when host drivr receives the corresponding request from NDIS.
583 * The firmware then includes theset PMKID in the appropriate
584 * management frames
585 * @param[in,out] handle to the wifi driver,
586 *
587 * message containing PMKID Info in the following format
588 *|-----------------------------------------------------------------|
589 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
590 *|-----------|------------|----------|-------|----------|----------|
591 | 1 | 6 | 16 | ... | 6 | 16 |
592 ||-----------------------------------------------------------------|
593 * @param[in]
594 * @return Error code indicating success/failure
595 * @note
596 * @author zsalah
597 * @date 8 March 2012
598 * @version 1.0
599 */
600
601 s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
602 u32 u32PmkidInfoLen);
603
604 /**
605 * @brief sets the pass phrase
606 * @details AP/STA mode. This function gives the pass phrase used to
607 * generate the Pre-Shared Key when WPA/WPA2 is enabled
608 * The length of the field can vary from 8 to 64 bytes,
609 * the lower layer should get the
610 * @param[in,out] handle to the wifi driver,
611 * @param[in] String containing PSK
612 * @return Error code indicating success/failure
613 * @note
614 * @author zsalah
615 * @date 8 March 2012
616 * @version 1.0
617 */
618 s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
619 u8 u8Psklength);
620 /**
621 * @brief gets the pass phrase
622 * @details AP/STA mode. This function gets the pass phrase used to
623 * generate the Pre-Shared Key when WPA/WPA2 is enabled
624 * The length of the field can vary from 8 to 64 bytes,
625 * the lower layer should get the
626 * @param[in,out] handle to the wifi driver,
627 * String containing PSK
628 * @return Error code indicating success/failure
629 * @note
630 * @author zsalah
631 * @date 8 March 2012
632 * @version 1.0
633 */
634 s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
635 u8 *pu8PassPhrase, u8 u8Psklength);
636
637 /**
638 * @brief gets mac address
639 * @details
640 * @param[in,out] handle to the wifi driver,
641 *
642 * @return Error code indicating success/failure
643 * @note
644 * @author mdaftedar
645 * @date 19 April 2012
646 * @version 1.0
647 */
648 s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
649
650 /**
651 * @brief sets mac address
652 * @details
653 * @param[in,out] handle to the wifi driver,
654 *
655 * @return Error code indicating success/failure
656 * @note
657 * @author mabubakr
658 * @date 16 July 2012
659 * @version 1.0
660 */
661 s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
662
663 /**
664 * @brief wait until msg q is empty
665 * @details
666 * @param[in,out]
667 *
668 * @return Error code indicating success/failure
669 * @note
670 * @author asobhy
671 * @date 19 march 2014
672 * @version 1.0
673 */
674 s32 host_int_wait_msg_queue_idle(void);
675
676 /**
677 * @brief gets the site survey results
678 * @details
679 * @param[in,out] handle to the wifi driver,
680 * Message containing site survey results in the
681 * following formate
682 *|---------------------------------------------------|
683 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
684 ||-----------|-----------|---------------|-----------|
685 | 1 | 1 | 1 | 1 |
686 | ----------------------------------------- | ----------------
687 |
688 ||---------------------------------------|
689 | Network1 | Netweork2 | ... | Network5 |
690 ||---------------------------------------|
691 | 44 | 44 | ... | 44 |
692 | -------------------------- | ---------------------------------------
693 |
694 ||---------------------------------------------------------------------|
695 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
696 ||------|----------|---------|----------------|-------|------|---------|
697 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
698 ||---------------------------------------------------------------------|
699 * @return Error code indicating success/failure
700 * @note
701 * @author zsalah
702 * @date 8 March 2012
703 * @version 1.0
704 */
705 #ifndef CONNECT_DIRECT
706 s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
707 u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
708 u32 u32MaxSiteSrvyFragLen);
709 #endif
710
711 /**
712 * @brief sets a start scan request
713 * @details
714 * @param[in,out] handle to the wifi driver,
715 * @param[in] Scan Source one of the following values
716 * DEFAULT_SCAN 0
717 * USER_SCAN BIT0
718 * OBSS_PERIODIC_SCAN BIT1
719 * OBSS_ONETIME_SCAN BIT2
720 * @return Error code indicating success/failure
721 * @note
722 * @author zsalah
723 * @date 8 March 2012
724 * @version 1.0
725 */
726
727 s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource);
728 /**
729 * @brief gets scan source of the last scan
730 * @details
731 * @param[in,out] handle to the wifi driver,
732 * Scan Source one of the following values
733 * DEFAULT_SCAN 0
734 * USER_SCAN BIT0
735 * OBSS_PERIODIC_SCAN BIT1
736 * OBSS_ONETIME_SCAN BIT2
737 * @return Error code indicating success/failure
738 * @note
739 * @author zsalah
740 * @date 8 March 2012
741 * @version 1.0
742 */
743 s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource);
744
745 /**
746 * @brief sets a join request
747 * @details
748 * @param[in,out] handle to the wifi driver,
749 * @param[in] Index of the bss descriptor
750 * @return Error code indicating success/failure
751 * @note
752 * @author zsalah
753 * @date 8 March 2012
754 * @version 1.0
755 */
756
757 s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
758 const u8 *pu8ssid, size_t ssidLen,
759 const u8 *pu8IEs, size_t IEsLen,
760 tWILCpfConnectResult pfConnectResult, void *pvUserArg,
761 u8 u8security, AUTHTYPE_T tenuAuth_type,
762 u8 u8channel,
763 void *pJoinParams);
764
765 /**
766 * @brief Flush a join request parameters to FW, but actual connection
767 * @details The function is called in situation where WILC is connected to AP and
768 * required to switch to hybrid FW for P2P connection
769 * @param[in] handle to the wifi driver,
770 * @return Error code indicating success/failure
771 * @note
772 * @author Amr Abdel-Moghny
773 * @date 19 DEC 2013
774 * @version 8.0
775 */
776
777 s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv);
778
779
780 /**
781 * @brief disconnects from the currently associated network
782 * @details
783 * @param[in,out] handle to the wifi driver,
784 * @param[in] Reason Code of the Disconnection
785 * @return Error code indicating success/failure
786 * @note
787 * @author zsalah
788 * @date 8 March 2012
789 * @version 1.0
790 */
791 s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode);
792
793 /**
794 * @brief disconnects a sta
795 * @details
796 * @param[in,out] handle to the wifi driver,
797 * @param[in] Association Id of the station to be disconnected
798 * @return Error code indicating success/failure
799 * @note
800 * @author zsalah
801 * @date 8 March 2012
802 * @version 1.0
803 */
804 s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id);
805 /**
806 * @brief gets a Association request info
807 * @details
808 * @param[in,out] handle to the wifi driver,
809 * Message containg assoc. req info in the following format
810 * ------------------------------------------------------------------------
811 | Management Frame Format |
812 ||-------------------------------------------------------------------|
813 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
814 ||-------------|--------|--|--|-----|----------------|----------|----|
815 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
816 ||-------------------------------------------------------------------|
817 | |
818 | Association Request Frame - Frame Body |
819 ||-------------------------------------------------------------------|
820 | Capability Information | Listen Interval | SSID | Supported Rates |
821 ||------------------------|-----------------|------|-----------------|
822 | 2 | 2 | 2-34 | 3-10 |
823 | ---------------------------------------------------------------------
824 * @return Error code indicating success/failure
825 * @note
826 * @author zsalah
827 * @date 8 March 2012
828 * @version 1.0
829 */
830
831 s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
832 u32 u32AssocReqInfoLen);
833 /**
834 * @brief gets a Association Response info
835 * @details
836 * @param[in,out] handle to the wifi driver,
837 * Message containg assoc. resp info
838 * @return Error code indicating success/failure
839 * @note
840 * @author zsalah
841 * @date 8 March 2012
842 * @version 1.0
843 */
844
845 s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
846 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
847 /**
848 * @brief gets a Association Response info
849 * @details Valid only in STA mode. This function gives the RSSI
850 * values observed in all the channels at the time of scanning.
851 * The length of the field is 1 greater that the total number of
852 * channels supported. Byte 0 contains the number of channels while
853 * each of Byte N contains the observed RSSI value for the channel index N.
854 * @param[in,out] handle to the wifi driver,
855 * array of scanned channels' RSSI
856 * @return Error code indicating success/failure
857 * @note
858 * @author zsalah
859 * @date 8 March 2012
860 * @version 1.0
861 */
862 s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
863 u32 u32RxPowerLevelLen);
864
865 /**
866 * @brief sets a channel
867 * @details
868 * @param[in,out] handle to the wifi driver,
869 * @param[in] Index of the channel to be set
870 *|-------------------------------------------------------------------|
871 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
872 | Input: 1 2 14 |
873 ||-------------------------------------------------------------------|
874 * @return Error code indicating success/failure
875 * @note
876 * @author zsalah
877 * @date 8 March 2012
878 * @version 1.0
879 */
880 s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum);
881
882 /**
883 * @brief gets the current channel index
884 * @details
885 * @param[in,out] handle to the wifi driver,
886 * current channel index
887 *|-----------------------------------------------------------------------|
888 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
889 | Input: 1 2 14 |
890 ||-----------------------------------------------------------------------|
891 * @return Error code indicating success/failure
892 * @note
893 * @author zsalah
894 * @date 8 March 2012
895 * @version 1.0
896 */
897 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo);
898 /**
899 * @brief gets the sta rssi
900 * @details gets the currently maintained RSSI value for the station.
901 * The received signal strength value in dB.
902 * The range of valid values is -128 to 0.
903 * @param[in,out] handle to the wifi driver,
904 * rssi value in dB
905 * @return Error code indicating success/failure
906 * @note
907 * @author zsalah
908 * @date 8 March 2012
909 * @version 1.0
910 */
911 s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi);
912 s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd);
913 /**
914 * @brief scans a set of channels
915 * @details
916 * @param[in,out] handle to the wifi driver,
917 * @param[in] Scan source
918 * Scan Type PASSIVE_SCAN = 0,
919 * ACTIVE_SCAN = 1
920 * Channels Array
921 * Channels Array length
922 * Scan Callback function
923 * User Argument to be delivered back through the Scan Cllback function
924 * @return Error code indicating success/failure
925 * @note
926 * @author zsalah
927 * @date 8 March 2012
928 * @version 1.0
929 */
930 s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
931 u8 u8ScanType, u8 *pu8ChnlFreqList,
932 u8 u8ChnlListLen, const u8 *pu8IEs,
933 size_t IEsLen, tWILCpfScanResult ScanResult,
934 void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork);
935 /**
936 * @brief sets configuration wids values
937 * @details
938 * @param[in,out] handle to the wifi driver,
939 * @param[in] WID, WID value
940 * @return Error code indicating success/failure
941 * @note
942 * @author zsalah
943 * @date 8 March 2012
944 * @version 1.0
945 */
946 s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal);
947
948 /**
949 * @brief gets configuration wids values
950 * @details
951 * @param[in,out] handle to the wifi driver,
952 * WID value
953 * @param[in] WID,
954 * @return Error code indicating success/failure
955 * @note
956 * @author zsalah
957 * @date 8 March 2012
958 * @version 1.0
959 */
960 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
961 /*****************************************************************************/
962 /* Notification Functions */
963 /*****************************************************************************/
964 /**
965 * @brief notifies host with join and leave requests
966 * @details This function prepares an Information frame having the
967 * information about a joining/leaving station.
968 * @param[in,out] handle to the wifi driver,
969 * @param[in] 6 byte Sta Adress
970 * Join or leave flag:
971 * Join = 1,
972 * Leave =0
973 * @return Error code indicating success/failure
974 * @note
975 * @author zsalah
976 * @date 8 March 2012
977 * @version 1.0
978 */
979 void host_int_send_join_leave_info_to_host
980 (u16 assocId, u8 *stationAddr, bool joining);
981
982 /**
983 * @brief notifies host with stations found in scan
984 * @details sends the beacon/probe response from scan
985 * @param[in,out] handle to the wifi driver,
986 * @param[in] Sta Address,
987 * Frame length,
988 * Rssi of the Station found
989 * @return Error code indicating success/failure
990 * @note
991 * @author zsalah
992 * @date 8 March 2012
993 * @version 1.0
994 */
995 void host_int_send_network_info_to_host
996 (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi);
997
998 /**
999 * @brief host interface initialization function
1000 * @details
1001 * @param[in,out] handle to the wifi driver,
1002 * @note
1003 * @author zsalah
1004 * @date 8 March 2012
1005 * @version 1.0
1006 */
1007 s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv);
1008
1009 /**
1010 * @brief host interface initialization function
1011 * @details
1012 * @param[in,out] handle to the wifi driver,
1013 * @note
1014 * @author zsalah
1015 * @date 8 March 2012
1016 * @version 1.0
1017 */
1018 s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv);
1019
1020
1021 /*!
1022 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1023 * @brief Sends a beacon to the firmware to be transmitted over the air
1024 * @details
1025 * @param[in,out] hWFIDrv handle to the wifi driver
1026 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1027 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1028 * (including the current frame) appear before the next DTIM
1029 * @param[in] u32Headlen Length of the head buffer in bytes
1030 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1031 * is the part from the beacon's start till the TIM element, NOT including the TIM
1032 * @param[in] u32Taillen Length of the tail buffer in bytes
1033 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1034 * starts just after the TIM inormation element
1035 * @return 0 for Success, error otherwise
1036 * @todo
1037 * @sa
1038 * @author Adham Abozaeid
1039 * @date 10 Julys 2012
1040 * @version 1.0 Description
1041 *
1042 */
1043 s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
1044 u32 u32DTIMPeriod,
1045 u32 u32HeadLen, u8 *pu8Head,
1046 u32 u32TailLen, u8 *pu8tail);
1047
1048
1049 /*!
1050 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1051 * @brief Removes the beacon and stops trawilctting it over the air
1052 * @details
1053 * @param[in,out] hWFIDrv handle to the wifi driver
1054 * @return 0 for Success, error otherwise
1055 * @todo
1056 * @sa
1057 * @author Adham Abozaeid
1058 * @date 10 Julys 2012
1059 * @version 1.0 Description
1060 */
1061 s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv);
1062
1063 /*!
1064 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1065 * @brief Notifies the firmware with a new associated stations
1066 * @details
1067 * @param[in,out] hWFIDrv handle to the wifi driver
1068 * @param[in] pstrStaParams Station's parameters
1069 * @return 0 for Success, error otherwise
1070 * @todo
1071 * @sa
1072 * @author Adham Abozaeid
1073 * @date 12 July 2012
1074 * @version 1.0 Description
1075 */
1076 s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1077
1078 /*!
1079 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1080 * @brief Deauthenticates clients when group is terminating
1081 * @details
1082 * @param[in,out] hWFIDrv handle to the wifi driver
1083 * @param[in] pu8MacAddr Station's mac address
1084 * @return 0 for Success, error otherwise
1085 * @todo
1086 * @sa
1087 * @author Mai Daftedar
1088 * @date 09 April 2014
1089 * @version 1.0 Description
1090 */
1091 s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1092
1093 /*!
1094 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1095 * @brief Notifies the firmware with a new deleted station
1096 * @details
1097 * @param[in,out] hWFIDrv handle to the wifi driver
1098 * @param[in] pu8MacAddr Station's mac address
1099 * @return 0 for Success, error otherwise
1100 * @todo
1101 * @sa
1102 * @author Adham Abozaeid
1103 * @date 15 July 2012
1104 * @version 1.0 Description
1105 */
1106 s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr);
1107
1108 /*!
1109 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1110 * @brief Notifies the firmware with new parameters of an already associated station
1111 * @details
1112 * @param[in,out] hWFIDrv handle to the wifi driver
1113 * @param[in] pstrStaParams Station's parameters
1114 * @return 0 for Success, error otherwise
1115 * @todo
1116 * @sa
1117 * @author Adham Abozaeid
1118 * @date 15 July 2012
1119 * @version 1.0 Description
1120 */
1121 s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1122
1123 /*!
1124 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1125 * @brief Set the power management mode to enabled or disabled
1126 * @details
1127 * @param[in,out] hWFIDrv handle to the wifi driver
1128 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1129 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1130 * the dynamic ps timeout value
1131 * @return 0 for Success, error otherwise
1132 * @todo
1133 * @sa
1134 * @author Adham Abozaeid
1135 * @date 24 November 2012
1136 * @version 1.0 Description
1137 */
1138 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout);
1139 /* @param[in,out] hWFIDrv handle to the wifi driver
1140 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1141 * @param[in] u8count count of mac address entries in the filter table
1142 *
1143 * @return 0 for Success, error otherwise
1144 * @todo
1145 * @sa
1146 * @author Adham Abozaeid
1147 * @date 24 November 2012
1148 * @version 1.0 Description
1149 */
1150 s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count);
1151 /**
1152 * @brief host_int_setup_ipaddress
1153 * @details set IP address on firmware
1154 * @param[in]
1155 * @return Error code.
1156 * @author Abdelrahman Sobhy
1157 * @date
1158 * @version 1.0
1159 */
1160 s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1161
1162
1163 /**
1164 * @brief host_int_delBASession
1165 * @details Delete single Rx BA session
1166 * @param[in]
1167 * @return Error code.
1168 * @author Abdelrahman Sobhy
1169 * @date
1170 * @version 1.0
1171 */
1172 s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1173
1174 /**
1175 * @brief host_int_delBASession
1176 * @details Delete all Rx BA session
1177 * @param[in]
1178 * @return Error code.
1179 * @author Abdelrahman Sobhy
1180 * @date
1181 * @version 1.0
1182 */
1183 s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1184
1185
1186 /**
1187 * @brief host_int_get_ipaddress
1188 * @details get IP address on firmware
1189 * @param[in]
1190 * @return Error code.
1191 * @author Abdelrahman Sobhy
1192 * @date
1193 * @version 1.0
1194 */
1195 s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1196
1197 #ifdef WILC_P2P
1198 /**
1199 * @brief host_int_remain_on_channel
1200 * @details
1201 * @param[in]
1202 * @return Error code.
1203 * @author
1204 * @date
1205 * @version 1.0
1206 */
1207 s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg);
1208
1209 /**
1210 * @brief host_int_ListenStateExpired
1211 * @details
1212 * @param[in] Handle to wifi driver
1213 * Duration to remain on channel
1214 * Channel to remain on
1215 * Pointer to fn to be called on receive frames in listen state
1216 * Pointer to remain-on-channel expired fn
1217 * Priv
1218 * @return Error code.
1219 * @author
1220 * @date
1221 * @version 1.0
1222 */
1223 s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID);
1224
1225 /**
1226 * @brief host_int_frame_register
1227 * @details
1228 * @param[in]
1229 * @return Error code.
1230 * @author
1231 * @date
1232 * @version 1.0
1233 */
1234 s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg);
1235 #endif
1236 /**
1237 * @brief host_int_set_wfi_drv_handler
1238 * @details
1239 * @param[in]
1240 * @return Error code.
1241 * @author
1242 * @date
1243 * @version 1.0
1244 */
1245 s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address);
1246 s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode);
1247
1248 static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent);
1249
1250 static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
1251 short int SessionTimeout, void *drvHandler);
1252
1253
1254 void host_int_freeJoinParams(void *pJoinParams);
1255
1256 s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics);
1257
1258 /*****************************************************************************/
1259 /* */
1260 /* EOF */
1261 /* */
1262 /*****************************************************************************/
1263 #endif
This page took 0.084249 seconds and 5 git commands to generate.