2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
14 #include "coreconfigsimulator.h"
15 /*****************************************************************************/
17 /*****************************************************************************/
19 #define WID_BSS_TYPE 0x0000
20 #define WID_CURRENT_TX_RATE 0x0001
21 #define WID_CURRENT_CHANNEL 0x0002
22 #define WID_PREAMBLE 0x0003
23 #define WID_STATUS 0x0005
24 #define WID_SCAN_TYPE 0x0007
25 #define WID_KEY_ID 0x0009
26 #define WID_DTIM_PERIOD 0x0010
27 #define WID_POWER_MANAGEMENT 0x000B
28 #define WID_AUTH_TYPE 0x000D
29 #define WID_SITE_SURVEY 0x000E
30 #define WID_DTIM_PERIOD 0x0010
31 #define WID_DISCONNECT 0x0016
32 #define WID_SHORT_SLOT_ALLOWED 0x001A
33 #define WID_START_SCAN_REQ 0x001E
34 #define WID_RSSI 0x001F
35 #define WID_JOIN_REQ 0x0020
36 #define WID_11N_TXOP_PROT_DISABLE 0x00B0
37 #define WID_RTS_THRESHOLD 0x1000
38 #define WID_FRAG_THRESHOLD 0x1001
39 #define WID_SHORT_RETRY_LIMIT 0x1002
40 #define WID_LONG_RETRY_LIMIT 0x1003
41 #define WID_BEACON_INTERVAL 0x1006
42 #define WID_ACTIVE_SCAN_TIME 0x100C
43 #define WID_PASSIVE_SCAN_TIME 0x100D
44 #define WID_SITE_SURVEY_SCAN_TIME 0x100E
45 #define WID_AUTH_TIMEOUT 0x1010
46 #define WID_11I_PSK 0x3008
47 #define WID_SITE_SURVEY_RESULTS 0x3012
48 #define WID_ADD_PTK 0x301B
49 #define WID_ADD_RX_GTK 0x301C
50 #define WID_ADD_TX_GTK 0x301D
51 #define WID_ADD_WEP_KEY 0x3019
52 #define WID_REMOVE_WEP_KEY 0x301A
53 #define WID_REMOVE_KEY 0x301E
54 #define WID_ASSOC_REQ_INFO 0x301F
55 #define WID_ASSOC_RES_INFO 0x3020
56 #define WID_PMKID_INFO 0x3082
57 #define WID_SCAN_CHANNEL_LIST 0x4084
58 #define WID_11I_MODE 0x000C
61 #define SUCCESS 0x0001
65 #define BIT2 ((WILC_Uint32)(1 << 2))
66 #define BIT1 ((WILC_Uint32)(1 << 1))
67 #define BIT0 ((WILC_Uint32)(1 << 0))
70 #define STATION_MODE 0x02
72 #define CLIENT_MODE 0x04
76 #define ACTIVE_SCAN_TIME 10
77 #define PASSIVE_SCAN_TIME 1200
78 #define MIN_SCAN_TIME 10
79 #define MAX_SCAN_TIME 1200
80 #define DEFAULT_SCAN 0
81 #define USER_SCAN BIT0
82 #define OBSS_PERIODIC_SCAN BIT1
83 #define OBSS_ONETIME_SCAN BIT2
84 #define GTK_RX_KEY_BUFF_LEN 24
87 #define DEFAULTKEY 0x4
89 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
90 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
91 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
92 #define CHANNEL_SCAN_TIME 250 /* 250 */
94 #define TX_MIC_KEY_LEN 8
95 #define RX_MIC_KEY_LEN 8
96 #define PTK_KEY_LEN 16
98 #define TX_MIC_KEY_MSG_LEN 26
99 #define RX_MIC_KEY_MSG_LEN 48
100 #define PTK_KEY_MSG_LEN 39
102 #define PMKSA_KEY_LEN 22
105 #define WILC_MAX_NUM_PMKIDS 16
106 #define WILC_SUPP_MCS_SET_SIZE 16
107 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
108 #define SCAN_EVENT_DONE_ABORTED
109 /*****************************************************************************/
111 /*****************************************************************************/
112 /* typedef unsigned char uint8; */
113 /* typedef signed char int8; */
114 /* typedef unsigned short uint16; */
115 /* typedef unsigned long uint32; */
116 /* typedef uint32 Bool; */
119 typedef enum {WID_CHAR = 0,
126 WID_UNDEF = 7} WID_TYPE_T;
134 typedef struct _tstrStatistics {
137 WILC_Uint32 u32TxCount;
138 WILC_Uint32 u32RxCount;
139 WILC_Uint32 u32TxFailureCount;
146 HOST_IF_SCANNING = 1,
147 HOST_IF_CONNECTING = 2,
148 HOST_IF_WAITING_CONN_RESP = 3,
149 HOST_IF_CONNECTED = 4,
150 HOST_IF_P2P_LISTEN = 5,
151 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
154 typedef struct _tstrHostIFpmkid {
159 typedef struct _tstrHostIFpmkidAttr {
161 tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
162 } tstrHostIFpmkidAttr;
164 /* Scan type parameter for scan request */
171 typedef enum {SITE_SURVEY_1CH = 0,
172 SITE_SURVEY_ALL_CH = 1,
173 SITE_SURVEY_OFF = 2} SITE_SURVEY_T;
192 WILC_Uint32 u32SetCfgFlag;
198 u16 short_retry_limit;
199 u16 long_retry_limit;
203 u8 short_slot_allowed;
204 u8 txop_prot_disabled;
207 SITE_SURVEY_T site_survey_enabled;
208 u16 site_survey_scan_time;
210 u16 active_scan_time;
211 u16 passive_scan_time;
212 CURRENT_TX_RATE_T curr_tx_rate;
217 RETRY_SHORT = 1 << 0,
219 FRAG_THRESHOLD = 1 << 2,
220 RTS_THRESHOLD = 1 << 3,
223 AUTHEN_TIMEOUT = 1 << 6,
224 POWER_MANAGEMENT = 1 << 7,
226 SHORT_SLOT_ALLOWED = 1 << 9,
227 TXOP_PROT_DISABLE = 1 << 10,
228 BEACON_INTERVAL = 1 << 11,
229 DTIM_PERIOD = 1 << 12,
230 SITE_SURVEY = 1 << 13,
231 SITE_SURVEY_SCAN_TIME = 1 << 14,
232 ACTIVE_SCANTIME = 1 << 15,
233 PASSIVE_SCANTIME = 1 << 16,
234 CURRENT_TX_RATE = 1 << 17,
241 } tstrFoundNetworkInfo;
243 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
245 SCAN_EVENT_ABORTED = 2,
246 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
249 CONN_DISCONN_EVENT_CONN_RESP = 0,
250 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
251 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
252 } tenuConnDisconnEvent;
263 /*Scan callBack function definition*/
264 typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
266 /*Connect callBack function definition*/
267 typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent,
270 tstrDisconnectNotifInfo *,
274 typedef void (*tWILCpfRemainOnChanExpired)(void *, WILC_Uint32); /*Remain on channel expiration callback function*/
275 typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
278 /* typedef WILC_Uint32 WILC_WFIDrvHandle; */
280 WILC_Sint32 s32Dummy;
281 } *WILC_WFIDrvHandle;
284 * @struct tstrRcvdNetworkInfo
285 * @brief Structure to hold Received Asynchronous Network info
289 * @author Mostafa Abu Bakr
290 * @date 25 March 2012
293 typedef struct _tstrRcvdNetworkInfo {
295 WILC_Uint32 u32Length;
296 } tstrRcvdNetworkInfo;
299 typedef struct _tstrHiddenNetworkInfo {
303 } tstrHiddenNetworkInfo;
305 typedef struct _tstrHiddenNetwork {
307 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
313 /* Scan user call back function */
314 tWILCpfScanResult pfUserScanResult;
316 /* User specific parameter to be delivered through the Scan User Callback function */
317 void *u32UserScanPvoid;
319 WILC_Uint32 u32RcvdChCount;
320 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
321 } tstrWILC_UsrScanReq;
327 AUTHTYPE_T tenuAuth_type;
330 size_t ConnReqIEsLen;
331 /* Connect user call back function */
332 tWILCpfConnectResult pfUserConnectResult;
333 WILC_Bool IsHTCapable;
334 /* User specific parameter to be delivered through the Connect User Callback function */
335 void *u32UserConnectPvoid;
336 } tstrWILC_UsrConnReq;
339 WILC_Uint32 u32Address;
340 } tstrHostIfSetDrvHandler;
344 } tstrHostIfSetOperationMode;
348 u8 u8MacAddress[ETH_ALEN];
349 } tstrHostIfSetMacAddress;
354 } tstrHostIfGetMacAddress;
358 u8 au8Bssid[ETH_ALEN];
361 u16 u16SessionTimeout;
362 } tstrHostIfBASessionInfo;
367 WILC_Uint32 u32duration;
368 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
369 tWILCpfRemainOnChanReady pRemainOnChanReady;
371 WILC_Uint32 u32ListenSessionID;
372 } tstrHostIfRemainOnChan;
381 } tstrHostIfRegisterFrame;
385 #define PROBE_REQ 0x40
386 #define PROBE_RESP 0x50
387 #define ACTION_FRM_IDX 0
388 #define PROBE_REQ_IDX 1
391 enum p2p_listen_state {
399 /* Scan user structure */
400 tstrWILC_UsrScanReq strWILC_UsrScanReq;
402 /* Connect User structure */
403 tstrWILC_UsrConnReq strWILC_UsrConnReq;
406 /*Remain on channel struvture*/
407 tstrHostIfRemainOnChan strHostIfRemainOnChan;
408 u8 u8RemainOnChan_pendingreq;
409 WILC_Uint64 u64P2p_MgmtTimeout;
413 tenuHostIFstate enuHostIFstate;
415 /* WILC_Bool bPendingConnRequest; */
417 #ifndef CONNECT_DIRECT
418 WILC_Uint32 u32SurveyResultsCount;
419 wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS];
422 u8 au8AssociatedBSSID[ETH_ALEN];
423 tstrCfgParamVal strCfgValues;
425 struct semaphore gtOsCfgValuesSem;
426 struct semaphore hSemTestKeyBlock;
428 struct semaphore hSemTestDisconnectBlock;
429 struct semaphore hSemGetRSSI;
430 struct semaphore hSemGetLINKSPEED;
431 struct semaphore hSemGetCHNL;
432 struct semaphore hSemInactiveTime;
434 WILC_TimerHandle hScanTimer;
435 WILC_TimerHandle hConnectTimer;
437 WILC_TimerHandle hRemainOnChannel;
444 * @enum tenuWILC_StaFlag
445 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
448 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
449 * @author Enumeraion's creator
451 * @version 1.0 Description
455 WILC_STA_FLAG_INVALID = 0,
456 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
457 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
458 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
459 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
460 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
464 u8 au8BSSID[ETH_ALEN];
468 WILC_Bool bIsHTSupported;
471 u8 au8SuppMCsSet[16];
473 WILC_Uint32 u32TxBeamformingCap;
475 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
476 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
477 } tstrWILC_AddStaParam;
479 /* extern void CfgDisconnected(void* pUserVoid, u16 u16reason, u8 * ie, size_t ie_len); */
481 /*****************************************************************************/
483 /* Host Interface API */
485 /*****************************************************************************/
488 * @brief removes wpa/wpa2 keys
489 * @details only in BSS STA mode if External Supplicant support is enabled.
490 * removes all WPA/WPA2 station key entries from MAC hardware.
491 * @param[in,out] handle to the wifi driver
492 * @param[in] 6 bytes of Station Adress in the station entry table
493 * @return Error code indicating success/failure
499 WILC_Sint32 host_int_remove_key(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8StaAddress);
501 * @brief removes WEP key
502 * @details valid only in BSS STA mode if External Supplicant support is enabled.
503 * remove a WEP key entry from MAC HW.
504 * The BSS Station automatically finds the index of the entry using its
505 * BSS ID and removes that entry from the MAC hardware.
506 * @param[in,out] handle to the wifi driver
507 * @param[in] 6 bytes of Station Adress in the station entry table
508 * @return Error code indicating success/failure
509 * @note NO need for the STA add since it is not used for processing
514 WILC_Sint32 host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv, u8 u8Index);
516 * @brief sets WEP deafault key
517 * @details Sets the index of the WEP encryption key in use,
519 * @param[in,out] handle to the wifi driver
520 * @param[in] key index ( 0, 1, 2, 3)
521 * @return Error code indicating success/failure
527 WILC_Sint32 host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv, u8 u8Index);
530 * @brief sets WEP deafault key
531 * @details valid only in BSS STA mode if External Supplicant support is enabled.
532 * sets WEP key entry into MAC hardware when it receives the
533 * corresponding request from NDIS.
534 * @param[in,out] handle to the wifi driver
535 * @param[in] message containing WEP Key in the following format
536 *|---------------------------------------|
537 *|Key ID Value | Key Length | Key |
538 *|-------------|------------|------------|
539 | 1byte | 1byte | Key Length |
540 ||---------------------------------------|
542 * @return Error code indicating success/failure
548 WILC_Sint32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
550 * @brief host_int_add_wep_key_bss_ap
551 * @details valid only in AP mode if External Supplicant support is enabled.
552 * sets WEP key entry into MAC hardware when it receives the
553 * corresponding request from NDIS.
554 * @param[in,out] handle to the wifi driver
557 * @return Error code indicating success/failure
563 WILC_Sint32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
566 * @brief adds ptk Key
568 * @param[in,out] handle to the wifi driver
569 * @param[in] message containing PTK Key in the following format
570 *|-------------------------------------------------------------------------|
571 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
572 *|-----------|------------|---------------|----------------|---------------|
573 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
574 ||-------------------------------------------------------------------------|
575 * @return Error code indicating success/failure
581 WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
582 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
585 * @brief host_int_get_inactive_time
587 * @param[in,out] handle to the wifi driver
588 * @param[in] message containing inactive time
590 * @return Error code indicating success/failure
593 * @date 15 April 2013
596 WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, WILC_Uint32 *pu32InactiveTime);
599 * @brief adds Rx GTk Key
601 * @param[in,out] handle to the wifi driver
602 * @param[in] message containing Rx GTK Key in the following format
603 *|----------------------------------------------------------------------------|
604 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
605 *|------------|---------|-------|------------|---------------|----------------|
606 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
607 ||----------------------------------------------------------------------------|
608 * @return Error code indicating success/failure
614 WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
615 u8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, const u8 *KeyRSC,
616 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
620 * @brief adds Tx GTk Key
622 * @param[in,out] handle to the wifi driver
623 * @param[in] message containing Tx GTK Key in the following format
624 *|----------------------------------------------------|
625 | KeyID | Key Length | Temporal Key | Tx Michael Key |
626 ||-------|------------|--------------|----------------|
627 ||1 byte | 1 byte | 16 bytes | 8 bytes |
628 ||----------------------------------------------------|
629 * @return Error code indicating success/failure
635 WILC_Sint32 host_int_add_tx_gtk(WILC_WFIDrvHandle hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
638 * @brief caches the pmkid
639 * @details valid only in BSS STA mode if External Supplicant
640 * support is enabled. This Function sets the PMKID in firmware
641 * when host drivr receives the corresponding request from NDIS.
642 * The firmware then includes theset PMKID in the appropriate
644 * @param[in,out] handle to the wifi driver
645 * @param[in] message containing PMKID Info in the following format
646 *|-----------------------------------------------------------------|
647 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
648 *|-----------|------------|----------|-------|----------|----------|
649 | 1 | 6 | 16 | ... | 6 | 16 |
650 ||-----------------------------------------------------------------|
651 * @return Error code indicating success/failure
658 WILC_Sint32 host_int_set_pmkid_info(WILC_WFIDrvHandle hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
660 * @brief gets the cached the pmkid info
661 * @details valid only in BSS STA mode if External Supplicant
662 * support is enabled. This Function sets the PMKID in firmware
663 * when host drivr receives the corresponding request from NDIS.
664 * The firmware then includes theset PMKID in the appropriate
666 * @param[in,out] handle to the wifi driver,
668 * message containing PMKID Info in the following format
669 *|-----------------------------------------------------------------|
670 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
671 *|-----------|------------|----------|-------|----------|----------|
672 | 1 | 6 | 16 | ... | 6 | 16 |
673 ||-----------------------------------------------------------------|
675 * @return Error code indicating success/failure
682 WILC_Sint32 host_int_get_pmkid_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PmkidInfoArray,
683 WILC_Uint32 u32PmkidInfoLen);
686 * @brief sets the pass phrase
687 * @details AP/STA mode. This function gives the pass phrase used to
688 * generate the Pre-Shared Key when WPA/WPA2 is enabled
689 * The length of the field can vary from 8 to 64 bytes,
690 * the lower layer should get the
691 * @param[in,out] handle to the wifi driver,
692 * @param[in] String containing PSK
693 * @return Error code indicating success/failure
699 WILC_Sint32 host_int_set_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PassPhrase,
702 * @brief gets the pass phrase
703 * @details AP/STA mode. This function gets the pass phrase used to
704 * generate the Pre-Shared Key when WPA/WPA2 is enabled
705 * The length of the field can vary from 8 to 64 bytes,
706 * the lower layer should get the
707 * @param[in,out] handle to the wifi driver,
708 * String containing PSK
709 * @return Error code indicating success/failure
715 WILC_Sint32 host_int_get_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv,
716 u8 *pu8PassPhrase, u8 u8Psklength);
719 * @brief gets mac address
721 * @param[in,out] handle to the wifi driver,
723 * @return Error code indicating success/failure
726 * @date 19 April 2012
729 WILC_Sint32 host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress);
732 * @brief sets mac address
734 * @param[in,out] handle to the wifi driver,
736 * @return Error code indicating success/failure
742 WILC_Sint32 host_int_set_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress);
745 * @brief wait until msg q is empty
749 * @return Error code indicating success/failure
752 * @date 19 march 2014
755 WILC_Sint32 host_int_wait_msg_queue_idle(void);
758 * @brief gets the site survey results
760 * @param[in,out] handle to the wifi driver,
761 * Message containing site survey results in the
763 *|---------------------------------------------------|
764 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
765 ||-----------|-----------|---------------|-----------|
767 | ----------------------------------------- | ----------------
769 ||---------------------------------------|
770 | Network1 | Netweork2 | ... | Network5 |
771 ||---------------------------------------|
772 | 44 | 44 | ... | 44 |
773 | -------------------------- | ---------------------------------------
775 ||---------------------------------------------------------------------|
776 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
777 ||------|----------|---------|----------------|-------|------|---------|
778 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
779 ||---------------------------------------------------------------------|
780 * @return Error code indicating success/failure
786 #ifndef CONNECT_DIRECT
787 WILC_Sint32 host_int_get_site_survey_results(WILC_WFIDrvHandle hWFIDrv,
788 u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
789 WILC_Uint32 u32MaxSiteSrvyFragLen);
793 * @brief sets a start scan request
795 * @param[in,out] handle to the wifi driver,
796 * @param[in] Scan Source one of the following values
799 * OBSS_PERIODIC_SCAN BIT1
800 * OBSS_ONETIME_SCAN BIT2
801 * @return Error code indicating success/failure
808 WILC_Sint32 host_int_set_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 scanSource);
810 * @brief gets scan source of the last scan
812 * @param[in,out] handle to the wifi driver,
813 * Scan Source one of the following values
816 * OBSS_PERIODIC_SCAN BIT1
817 * OBSS_ONETIME_SCAN BIT2
818 * @return Error code indicating success/failure
824 WILC_Sint32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ScanSource);
827 * @brief sets a join request
829 * @param[in,out] handle to the wifi driver,
830 * @param[in] Index of the bss descriptor
831 * @return Error code indicating success/failure
838 WILC_Sint32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
839 const u8 *pu8ssid, size_t ssidLen,
840 const u8 *pu8IEs, size_t IEsLen,
841 tWILCpfConnectResult pfConnectResult, void *pvUserArg,
842 u8 u8security, AUTHTYPE_T tenuAuth_type,
847 * @brief Flush a join request parameters to FW, but actual connection
848 * @details The function is called in situation where WILC is connected to AP and
849 * required to switch to hybrid FW for P2P connection
850 * @param[in] handle to the wifi driver,
851 * @return Error code indicating success/failure
853 * @author Amr Abdel-Moghny
858 WILC_Sint32 host_int_flush_join_req(WILC_WFIDrvHandle hWFIDrv);
862 * @brief disconnects from the currently associated network
864 * @param[in,out] handle to the wifi driver,
865 * @param[in] Reason Code of the Disconnection
866 * @return Error code indicating success/failure
872 WILC_Sint32 host_int_disconnect(WILC_WFIDrvHandle hWFIDrv, u16 u16ReasonCode);
875 * @brief disconnects a sta
877 * @param[in,out] handle to the wifi driver,
878 * @param[in] Association Id of the station to be disconnected
879 * @return Error code indicating success/failure
885 WILC_Sint32 host_int_disconnect_station(WILC_WFIDrvHandle hWFIDrv, u8 assoc_id);
887 * @brief gets a Association request info
889 * @param[in,out] handle to the wifi driver,
890 * Message containg assoc. req info in the following format
891 * ------------------------------------------------------------------------
892 | Management Frame Format |
893 ||-------------------------------------------------------------------|
894 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
895 ||-------------|--------|--|--|-----|----------------|----------|----|
896 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
897 ||-------------------------------------------------------------------|
899 | Association Request Frame - Frame Body |
900 ||-------------------------------------------------------------------|
901 | Capability Information | Listen Interval | SSID | Supported Rates |
902 ||------------------------|-----------------|------|-----------------|
903 | 2 | 2 | 2-34 | 3-10 |
904 | ---------------------------------------------------------------------
905 * @return Error code indicating success/failure
912 WILC_Sint32 host_int_get_assoc_req_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocReqInfo,
913 WILC_Uint32 u32AssocReqInfoLen);
915 * @brief gets a Association Response info
917 * @param[in,out] handle to the wifi driver,
918 * Message containg assoc. resp info
919 * @return Error code indicating success/failure
926 WILC_Sint32 host_int_get_assoc_res_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocRespInfo,
927 WILC_Uint32 u32MaxAssocRespInfoLen, WILC_Uint32 *pu32RcvdAssocRespInfoLen);
929 * @brief gets a Association Response info
930 * @details Valid only in STA mode. This function gives the RSSI
931 * values observed in all the channels at the time of scanning.
932 * The length of the field is 1 greater that the total number of
933 * channels supported. Byte 0 contains the number of channels while
934 * each of Byte N contains the observed RSSI value for the channel index N.
935 * @param[in,out] handle to the wifi driver,
936 * array of scanned channels' RSSI
937 * @return Error code indicating success/failure
943 WILC_Sint32 host_int_get_rx_power_level(WILC_WFIDrvHandle hWFIDrv, u8 *pu8RxPowerLevel,
944 WILC_Uint32 u32RxPowerLevelLen);
947 * @brief sets a channel
949 * @param[in,out] handle to the wifi driver,
950 * @param[in] Index of the channel to be set
951 *|-------------------------------------------------------------------|
952 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
954 ||-------------------------------------------------------------------|
955 * @return Error code indicating success/failure
961 WILC_Sint32 host_int_set_mac_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 u8ChNum);
964 * @brief gets the current channel index
966 * @param[in,out] handle to the wifi driver,
967 * current channel index
968 *|-----------------------------------------------------------------------|
969 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
971 ||-----------------------------------------------------------------------|
972 * @return Error code indicating success/failure
978 WILC_Sint32 host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ChNo);
980 * @brief gets the sta rssi
981 * @details gets the currently maintained RSSI value for the station.
982 * The received signal strength value in dB.
983 * The range of valid values is -128 to 0.
984 * @param[in,out] handle to the wifi driver,
986 * @return Error code indicating success/failure
992 WILC_Sint32 host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv, WILC_Sint8 *ps8Rssi);
993 WILC_Sint32 host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv, WILC_Sint8 *ps8lnkspd);
995 * @brief scans a set of channels
997 * @param[in,out] handle to the wifi driver,
998 * @param[in] Scan source
999 * Scan Type PASSIVE_SCAN = 0,
1002 * Channels Array length
1003 * Scan Callback function
1004 * User Argument to be delivered back through the Scan Cllback function
1005 * @return Error code indicating success/failure
1008 * @date 8 March 2012
1011 WILC_Sint32 host_int_scan(WILC_WFIDrvHandle hWFIDrv, u8 u8ScanSource,
1012 u8 u8ScanType, u8 *pu8ChnlFreqList,
1013 u8 u8ChnlListLen, const u8 *pu8IEs,
1014 size_t IEsLen, tWILCpfScanResult ScanResult,
1015 void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork);
1017 * @brief sets configuration wids values
1019 * @param[in,out] handle to the wifi driver,
1020 * @param[in] WID, WID value
1021 * @return Error code indicating success/failure
1024 * @date 8 March 2012
1027 WILC_Sint32 hif_set_cfg(WILC_WFIDrvHandle hWFIDrv, tstrCfgParamVal *pstrCfgParamVal);
1030 * @brief gets configuration wids values
1032 * @param[in,out] handle to the wifi driver,
1035 * @return Error code indicating success/failure
1038 * @date 8 March 2012
1041 WILC_Sint32 hif_get_cfg(WILC_WFIDrvHandle hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
1042 /*****************************************************************************/
1043 /* Notification Functions */
1044 /*****************************************************************************/
1046 * @brief notifies host with join and leave requests
1047 * @details This function prepares an Information frame having the
1048 * information about a joining/leaving station.
1049 * @param[in,out] handle to the wifi driver,
1050 * @param[in] 6 byte Sta Adress
1051 * Join or leave flag:
1054 * @return Error code indicating success/failure
1057 * @date 8 March 2012
1060 void host_int_send_join_leave_info_to_host
1061 (u16 assocId, u8 *stationAddr, WILC_Bool joining);
1064 * @brief notifies host with stations found in scan
1065 * @details sends the beacon/probe response from scan
1066 * @param[in,out] handle to the wifi driver,
1067 * @param[in] Sta Address,
1069 * Rssi of the Station found
1070 * @return Error code indicating success/failure
1073 * @date 8 March 2012
1076 void host_int_send_network_info_to_host
1077 (u8 *macStartAddress, u16 u16RxFrameLen, WILC_Sint8 s8Rssi);
1080 * @brief host interface initialization function
1082 * @param[in,out] handle to the wifi driver,
1085 * @date 8 March 2012
1088 WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv);
1091 * @brief host interface initialization function
1093 * @param[in,out] handle to the wifi driver,
1096 * @date 8 March 2012
1099 WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv);
1103 * @fn WILC_Sint32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1104 * @brief Sends a beacon to the firmware to be transmitted over the air
1106 * @param[in,out] hWFIDrv handle to the wifi driver
1107 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1108 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1109 * (including the current frame) appear before the next DTIM
1110 * @param[in] u32Headlen Length of the head buffer in bytes
1111 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1112 * is the part from the beacon's start till the TIM element, NOT including the TIM
1113 * @param[in] u32Taillen Length of the tail buffer in bytes
1114 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1115 * starts just after the TIM inormation element
1116 * @return 0 for Success, error otherwise
1119 * @author Adham Abozaeid
1120 * @date 10 Julys 2012
1121 * @version 1.0 Description
1124 WILC_Sint32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32Interval,
1125 WILC_Uint32 u32DTIMPeriod,
1126 WILC_Uint32 u32HeadLen, u8 *pu8Head,
1127 WILC_Uint32 u32TailLen, u8 *pu8tail);
1131 * @fn WILC_Sint32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1132 * @brief Removes the beacon and stops trawilctting it over the air
1134 * @param[in,out] hWFIDrv handle to the wifi driver
1135 * @return 0 for Success, error otherwise
1138 * @author Adham Abozaeid
1139 * @date 10 Julys 2012
1140 * @version 1.0 Description
1142 WILC_Sint32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv);
1145 * @fn WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1146 * @brief Notifies the firmware with a new associated stations
1148 * @param[in,out] hWFIDrv handle to the wifi driver
1149 * @param[in] pstrStaParams Station's parameters
1150 * @return 0 for Success, error otherwise
1153 * @author Adham Abozaeid
1154 * @date 12 July 2012
1155 * @version 1.0 Description
1157 WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1160 * @fn WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1161 * @brief Deauthenticates clients when group is terminating
1163 * @param[in,out] hWFIDrv handle to the wifi driver
1164 * @param[in] pu8MacAddr Station's mac address
1165 * @return 0 for Success, error otherwise
1168 * @author Mai Daftedar
1169 * @date 09 April 2014
1170 * @version 1.0 Description
1172 WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1175 * @fn WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1176 * @brief Notifies the firmware with a new deleted station
1178 * @param[in,out] hWFIDrv handle to the wifi driver
1179 * @param[in] pu8MacAddr Station's mac address
1180 * @return 0 for Success, error otherwise
1183 * @author Adham Abozaeid
1184 * @date 15 July 2012
1185 * @version 1.0 Description
1187 WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr);
1190 * @fn WILC_Sint32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1191 * @brief Notifies the firmware with new parameters of an already associated station
1193 * @param[in,out] hWFIDrv handle to the wifi driver
1194 * @param[in] pstrStaParams Station's parameters
1195 * @return 0 for Success, error otherwise
1198 * @author Adham Abozaeid
1199 * @date 15 July 2012
1200 * @version 1.0 Description
1202 WILC_Sint32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1205 * @fn WILC_Sint32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, WILC_Bool bIsEnabled, WILC_Uint32 u32Timeout)
1206 * @brief Set the power management mode to enabled or disabled
1208 * @param[in,out] hWFIDrv handle to the wifi driver
1209 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1210 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1211 * the dynamic ps timeout value
1212 * @return 0 for Success, error otherwise
1215 * @author Adham Abozaeid
1216 * @date 24 November 2012
1217 * @version 1.0 Description
1219 WILC_Sint32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, WILC_Bool bIsEnabled, WILC_Uint32 u32Timeout);
1220 /* @param[in,out] hWFIDrv handle to the wifi driver
1221 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1222 * @param[in] u8count count of mac address entries in the filter table
1224 * @return 0 for Success, error otherwise
1227 * @author Adham Abozaeid
1228 * @date 24 November 2012
1229 * @version 1.0 Description
1231 WILC_Sint32 host_int_setup_multicast_filter(WILC_WFIDrvHandle hWFIDrv, WILC_Bool bIsEnabled, WILC_Uint32 u32count);
1233 * @brief host_int_setup_ipaddress
1234 * @details set IP address on firmware
1236 * @return Error code.
1237 * @author Abdelrahman Sobhy
1241 WILC_Sint32 host_int_setup_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8IPAddr, u8 idx);
1245 * @brief host_int_delBASession
1246 * @details Delete single Rx BA session
1248 * @return Error code.
1249 * @author Abdelrahman Sobhy
1253 WILC_Sint32 host_int_delBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID);
1256 * @brief host_int_delBASession
1257 * @details Delete all Rx BA session
1259 * @return Error code.
1260 * @author Abdelrahman Sobhy
1264 WILC_Sint32 host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID);
1268 * @brief host_int_get_ipaddress
1269 * @details get IP address on firmware
1271 * @return Error code.
1272 * @author Abdelrahman Sobhy
1276 WILC_Sint32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8IPAddr, u8 idx);
1280 * @brief host_int_remain_on_channel
1283 * @return Error code.
1288 WILC_Sint32 host_int_remain_on_channel(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32SessionID, WILC_Uint32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg);
1291 * @brief host_int_ListenStateExpired
1293 * @param[in] Handle to wifi driver
1294 * Duration to remain on channel
1295 * Channel to remain on
1296 * Pointer to fn to be called on receive frames in listen state
1297 * Pointer to remain-on-channel expired fn
1299 * @return Error code.
1304 WILC_Sint32 host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32SessionID);
1307 * @brief host_int_frame_register
1310 * @return Error code.
1315 WILC_Sint32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, u16 u16FrameType, WILC_Bool bReg);
1318 * @brief host_int_set_wfi_drv_handler
1321 * @return Error code.
1326 WILC_Sint32 host_int_set_wfi_drv_handler(WILC_Uint32 u32address);
1327 WILC_Sint32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32mode);
1329 static WILC_Sint32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent);
1331 static int host_int_addBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID, short int BufferSize,
1332 short int SessionTimeout, void *drvHandler);
1335 void host_int_freeJoinParams(void *pJoinParams);
1337 WILC_Sint32 host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv, tstrStatistics *pstrStatistics);
1339 /*****************************************************************************/
1343 /*****************************************************************************/