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