2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
17 #define IDLE_MODE 0x00
19 #define STATION_MODE 0x02
21 #define CLIENT_MODE 0x04
25 #define ACTIVE_SCAN_TIME 10
26 #define PASSIVE_SCAN_TIME 1200
27 #define MIN_SCAN_TIME 10
28 #define MAX_SCAN_TIME 1200
29 #define DEFAULT_SCAN 0
30 #define USER_SCAN BIT(0)
31 #define OBSS_PERIODIC_SCAN BIT(1)
32 #define OBSS_ONETIME_SCAN BIT(2)
33 #define GTK_RX_KEY_BUFF_LEN 24
36 #define DEFAULTKEY 0x4
38 #define MAX_NUM_SCANNED_NETWORKS 100
39 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
40 #define MAX_NUM_PROBED_SSID 10
41 #define CHANNEL_SCAN_TIME 250
43 #define TX_MIC_KEY_LEN 8
44 #define RX_MIC_KEY_LEN 8
45 #define PTK_KEY_LEN 16
47 #define TX_MIC_KEY_MSG_LEN 26
48 #define RX_MIC_KEY_MSG_LEN 48
49 #define PTK_KEY_MSG_LEN 39
51 #define PMKSA_KEY_LEN 22
54 #define WILC_MAX_NUM_PMKIDS 16
55 #define WILC_SUPP_MCS_SET_SIZE 16
56 #define WILC_ADD_STA_LENGTH 40
57 #define SCAN_EVENT_DONE_ABORTED
58 #define NUM_CONCURRENT_IFC 2
66 typedef struct _tstrStatistics {
71 u32 u32TxFailureCount;
79 HOST_IF_CONNECTING = 2,
80 HOST_IF_WAITING_CONN_RESP = 3,
81 HOST_IF_CONNECTED = 4,
82 HOST_IF_P2P_LISTEN = 5,
83 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
86 typedef struct _tstrHostIFpmkid {
91 typedef struct _tstrHostIFpmkidAttr {
93 tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
94 } tstrHostIFpmkidAttr;
119 u16 short_retry_limit;
120 u16 long_retry_limit;
124 u8 short_slot_allowed;
125 u8 txop_prot_disabled;
128 SITE_SURVEY_T site_survey_enabled;
129 u16 site_survey_scan_time;
131 u16 active_scan_time;
132 u16 passive_scan_time;
133 CURRENT_TX_RATE_T curr_tx_rate;
138 RETRY_SHORT = BIT(0),
140 FRAG_THRESHOLD = BIT(2),
141 RTS_THRESHOLD = BIT(3),
144 AUTHEN_TIMEOUT = BIT(6),
145 POWER_MANAGEMENT = BIT(7),
147 SHORT_SLOT_ALLOWED = BIT(9),
148 TXOP_PROT_DISABLE = BIT(10),
149 BEACON_INTERVAL = BIT(11),
150 DTIM_PERIOD = BIT(12),
151 SITE_SURVEY = BIT(13),
152 SITE_SURVEY_SCAN_TIME = BIT(14),
153 ACTIVE_SCANTIME = BIT(15),
154 PASSIVE_SCANTIME = BIT(16),
155 CURRENT_TX_RATE = BIT(17),
162 } tstrFoundNetworkInfo;
164 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
166 SCAN_EVENT_ABORTED = 2,
167 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
170 CONN_DISCONN_EVENT_CONN_RESP = 0,
171 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
172 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
173 } tenuConnDisconnEvent;
183 /*Scan callBack function definition*/
184 typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
186 /*Connect callBack function definition*/
187 typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent,
190 tstrDisconnectNotifInfo *,
193 typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/
194 typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
196 /* typedef u32 WILC_WFIDrvHandle; */
199 } *WILC_WFIDrvHandle;
202 * @struct rcvd_net_info
203 * @brief Structure to hold Received Asynchronous Network info
207 * @author Mostafa Abu Bakr
208 * @date 25 March 2012
211 struct rcvd_net_info {
216 typedef struct _tstrHiddenNetworkInfo {
220 } tstrHiddenNetworkInfo;
222 typedef struct _tstrHiddenNetwork {
224 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
230 /* Scan user call back function */
231 tWILCpfScanResult pfUserScanResult;
233 /* User specific parameter to be delivered through the Scan User Callback function */
234 void *u32UserScanPvoid;
237 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
238 } tstrWILC_UsrScanReq;
244 AUTHTYPE_T tenuAuth_type;
247 size_t ConnReqIEsLen;
248 /* Connect user call back function */
249 tWILCpfConnectResult pfUserConnectResult;
251 /* User specific parameter to be delivered through the Connect User Callback function */
252 void *u32UserConnectPvoid;
253 } tstrWILC_UsrConnReq;
263 struct set_mac_addr {
264 u8 u8MacAddress[ETH_ALEN];
267 struct get_mac_addr {
271 struct ba_session_info {
272 u8 au8Bssid[ETH_ALEN];
275 u16 u16SessionTimeout;
281 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
282 tWILCpfRemainOnChanReady pRemainOnChanReady;
284 u32 u32ListenSessionID;
295 #define PROBE_REQ 0x40
296 #define PROBE_RESP 0x50
297 #define ACTION_FRM_IDX 0
298 #define PROBE_REQ_IDX 1
301 enum p2p_listen_state {
308 /* Scan user structure */
309 tstrWILC_UsrScanReq strWILC_UsrScanReq;
311 /* Connect User structure */
312 tstrWILC_UsrConnReq strWILC_UsrConnReq;
314 /*Remain on channel struvture*/
315 struct remain_ch strHostIfRemainOnChan;
316 u8 u8RemainOnChan_pendingreq;
317 u64 u64P2p_MgmtTimeout;
320 tenuHostIFstate enuHostIFstate;
322 u8 au8AssociatedBSSID[ETH_ALEN];
323 tstrCfgParamVal strCfgValues;
325 struct semaphore gtOsCfgValuesSem;
326 struct semaphore hSemTestKeyBlock;
328 struct semaphore hSemTestDisconnectBlock;
329 struct semaphore hSemGetRSSI;
330 struct semaphore hSemGetLINKSPEED;
331 struct semaphore hSemGetCHNL;
332 struct semaphore hSemInactiveTime;
334 struct timer_list hScanTimer;
335 struct timer_list hConnectTimer;
336 struct timer_list hRemainOnChannel;
342 * @enum tenuWILC_StaFlag
343 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
346 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
347 * @author Enumeraion's creator
349 * @version 1.0 Description
353 WILC_STA_FLAG_INVALID = 0,
354 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
355 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
356 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
357 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
358 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
361 struct add_sta_param {
362 u8 au8BSSID[ETH_ALEN];
369 u8 au8SuppMCsSet[16];
371 u32 u32TxBeamformingCap;
373 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
374 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
377 /*****************************************************************************/
379 /* Host Interface API */
381 /*****************************************************************************/
384 * @brief removes wpa/wpa2 keys
385 * @details only in BSS STA mode if External Supplicant support is enabled.
386 * removes all WPA/WPA2 station key entries from MAC hardware.
387 * @param[in,out] handle to the wifi driver
388 * @param[in] 6 bytes of Station Adress in the station entry table
389 * @return Error code indicating success/failure
395 s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress);
397 * @brief removes WEP key
398 * @details valid only in BSS STA mode if External Supplicant support is enabled.
399 * remove a WEP key entry from MAC HW.
400 * The BSS Station automatically finds the index of the entry using its
401 * BSS ID and removes that entry from the MAC hardware.
402 * @param[in,out] handle to the wifi driver
403 * @param[in] 6 bytes of Station Adress in the station entry table
404 * @return Error code indicating success/failure
405 * @note NO need for the STA add since it is not used for processing
410 s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
412 * @brief sets WEP deafault key
413 * @details Sets the index of the WEP encryption key in use,
415 * @param[in,out] handle to the wifi driver
416 * @param[in] key index ( 0, 1, 2, 3)
417 * @return Error code indicating success/failure
423 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
426 * @brief sets WEP deafault key
427 * @details valid only in BSS STA mode if External Supplicant support is enabled.
428 * sets WEP key entry into MAC hardware when it receives the
429 * corresponding request from NDIS.
430 * @param[in,out] handle to the wifi driver
431 * @param[in] message containing WEP Key in the following format
432 *|---------------------------------------|
433 *|Key ID Value | Key Length | Key |
434 *|-------------|------------|------------|
435 | 1byte | 1byte | Key Length |
436 ||---------------------------------------|
438 * @return Error code indicating success/failure
444 s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
446 * @brief host_int_add_wep_key_bss_ap
447 * @details valid only in AP mode if External Supplicant support is enabled.
448 * sets WEP key entry into MAC hardware when it receives the
449 * corresponding request from NDIS.
450 * @param[in,out] handle to the wifi driver
453 * @return Error code indicating success/failure
459 s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
462 * @brief adds ptk Key
464 * @param[in,out] handle to the wifi driver
465 * @param[in] message containing PTK Key in the following format
466 *|-------------------------------------------------------------------------|
467 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
468 *|-----------|------------|---------------|----------------|---------------|
469 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
470 ||-------------------------------------------------------------------------|
471 * @return Error code indicating success/failure
477 s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
478 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
481 * @brief host_int_get_inactive_time
483 * @param[in,out] handle to the wifi driver
484 * @param[in] message containing inactive time
486 * @return Error code indicating success/failure
489 * @date 15 April 2013
492 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
495 * @brief adds Rx GTk Key
497 * @param[in,out] handle to the wifi driver
498 * @param[in] message containing Rx GTK Key in the following format
499 *|----------------------------------------------------------------------------|
500 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
501 *|------------|---------|-------|------------|---------------|----------------|
502 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
503 ||----------------------------------------------------------------------------|
504 * @return Error code indicating success/failure
510 s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
511 u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
512 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
516 * @brief adds Tx GTk Key
518 * @param[in,out] handle to the wifi driver
519 * @param[in] message containing Tx GTK Key in the following format
520 *|----------------------------------------------------|
521 | KeyID | Key Length | Temporal Key | Tx Michael Key |
522 ||-------|------------|--------------|----------------|
523 ||1 byte | 1 byte | 16 bytes | 8 bytes |
524 ||----------------------------------------------------|
525 * @return Error code indicating success/failure
531 s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
534 * @brief caches the pmkid
535 * @details valid only in BSS STA mode if External Supplicant
536 * support is enabled. This Function sets the PMKID in firmware
537 * when host drivr receives the corresponding request from NDIS.
538 * The firmware then includes theset PMKID in the appropriate
540 * @param[in,out] handle to the wifi driver
541 * @param[in] message containing PMKID Info in the following format
542 *|-----------------------------------------------------------------|
543 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
544 *|-----------|------------|----------|-------|----------|----------|
545 | 1 | 6 | 16 | ... | 6 | 16 |
546 ||-----------------------------------------------------------------|
547 * @return Error code indicating success/failure
554 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
556 * @brief gets the cached the pmkid info
557 * @details valid only in BSS STA mode if External Supplicant
558 * support is enabled. This Function sets the PMKID in firmware
559 * when host drivr receives the corresponding request from NDIS.
560 * The firmware then includes theset PMKID in the appropriate
562 * @param[in,out] handle to the wifi driver,
564 * 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 ||-----------------------------------------------------------------|
571 * @return Error code indicating success/failure
578 s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
579 u32 u32PmkidInfoLen);
582 * @brief sets the pass phrase
583 * @details AP/STA mode. This function gives the pass phrase used to
584 * generate the Pre-Shared Key when WPA/WPA2 is enabled
585 * The length of the field can vary from 8 to 64 bytes,
586 * the lower layer should get the
587 * @param[in,out] handle to the wifi driver,
588 * @param[in] String containing PSK
589 * @return Error code indicating success/failure
595 s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
598 * @brief gets the pass phrase
599 * @details AP/STA mode. This function gets the pass phrase used to
600 * generate the Pre-Shared Key when WPA/WPA2 is enabled
601 * The length of the field can vary from 8 to 64 bytes,
602 * the lower layer should get the
603 * @param[in,out] handle to the wifi driver,
604 * String containing PSK
605 * @return Error code indicating success/failure
611 s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
612 u8 *pu8PassPhrase, u8 u8Psklength);
615 * @brief gets mac address
617 * @param[in,out] handle to the wifi driver,
619 * @return Error code indicating success/failure
622 * @date 19 April 2012
625 s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
628 * @brief sets mac address
630 * @param[in,out] handle to the wifi driver,
632 * @return Error code indicating success/failure
638 s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
641 * @brief wait until msg q is empty
645 * @return Error code indicating success/failure
648 * @date 19 march 2014
651 s32 host_int_wait_msg_queue_idle(void);
654 * @brief sets a start scan request
656 * @param[in,out] handle to the wifi driver,
657 * @param[in] Scan Source one of the following values
660 * OBSS_PERIODIC_SCAN BIT1
661 * OBSS_ONETIME_SCAN BIT2
662 * @return Error code indicating success/failure
669 s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource);
671 * @brief gets scan source of the last scan
673 * @param[in,out] handle to the wifi driver,
674 * Scan Source one of the following values
677 * OBSS_PERIODIC_SCAN BIT1
678 * OBSS_ONETIME_SCAN BIT2
679 * @return Error code indicating success/failure
685 s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource);
688 * @brief sets a join request
690 * @param[in,out] handle to the wifi driver,
691 * @param[in] Index of the bss descriptor
692 * @return Error code indicating success/failure
699 s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
700 const u8 *pu8ssid, size_t ssidLen,
701 const u8 *pu8IEs, size_t IEsLen,
702 tWILCpfConnectResult pfConnectResult, void *pvUserArg,
703 u8 u8security, AUTHTYPE_T tenuAuth_type,
708 * @brief Flush a join request parameters to FW, but actual connection
709 * @details The function is called in situation where WILC is connected to AP and
710 * required to switch to hybrid FW for P2P connection
711 * @param[in] handle to the wifi driver,
712 * @return Error code indicating success/failure
714 * @author Amr Abdel-Moghny
719 s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv);
723 * @brief disconnects from the currently associated network
725 * @param[in,out] handle to the wifi driver,
726 * @param[in] Reason Code of the Disconnection
727 * @return Error code indicating success/failure
733 s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode);
736 * @brief disconnects a sta
738 * @param[in,out] handle to the wifi driver,
739 * @param[in] Association Id of the station to be disconnected
740 * @return Error code indicating success/failure
746 s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id);
748 * @brief gets a Association request info
750 * @param[in,out] handle to the wifi driver,
751 * Message containg assoc. req info in the following format
752 * ------------------------------------------------------------------------
753 | Management Frame Format |
754 ||-------------------------------------------------------------------|
755 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
756 ||-------------|--------|--|--|-----|----------------|----------|----|
757 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
758 ||-------------------------------------------------------------------|
760 | Association Request Frame - Frame Body |
761 ||-------------------------------------------------------------------|
762 | Capability Information | Listen Interval | SSID | Supported Rates |
763 ||------------------------|-----------------|------|-----------------|
764 | 2 | 2 | 2-34 | 3-10 |
765 | ---------------------------------------------------------------------
766 * @return Error code indicating success/failure
773 s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
774 u32 u32AssocReqInfoLen);
776 * @brief gets a Association Response info
778 * @param[in,out] handle to the wifi driver,
779 * Message containg assoc. resp info
780 * @return Error code indicating success/failure
787 s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
788 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
790 * @brief gets a Association Response info
791 * @details Valid only in STA mode. This function gives the RSSI
792 * values observed in all the channels at the time of scanning.
793 * The length of the field is 1 greater that the total number of
794 * channels supported. Byte 0 contains the number of channels while
795 * each of Byte N contains the observed RSSI value for the channel index N.
796 * @param[in,out] handle to the wifi driver,
797 * array of scanned channels' RSSI
798 * @return Error code indicating success/failure
804 s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
805 u32 u32RxPowerLevelLen);
808 * @brief sets a channel
810 * @param[in,out] handle to the wifi driver,
811 * @param[in] Index of the channel to be set
812 *|-------------------------------------------------------------------|
813 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
815 ||-------------------------------------------------------------------|
816 * @return Error code indicating success/failure
822 s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum);
825 * @brief gets the current channel index
827 * @param[in,out] handle to the wifi driver,
828 * current channel index
829 *|-----------------------------------------------------------------------|
830 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
832 ||-----------------------------------------------------------------------|
833 * @return Error code indicating success/failure
839 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo);
841 * @brief gets the sta rssi
842 * @details gets the currently maintained RSSI value for the station.
843 * The received signal strength value in dB.
844 * The range of valid values is -128 to 0.
845 * @param[in,out] handle to the wifi driver,
847 * @return Error code indicating success/failure
853 s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi);
854 s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd);
856 * @brief scans a set of channels
858 * @param[in,out] handle to the wifi driver,
859 * @param[in] Scan source
860 * Scan Type PASSIVE_SCAN = 0,
863 * Channels Array length
864 * Scan Callback function
865 * User Argument to be delivered back through the Scan Cllback function
866 * @return Error code indicating success/failure
872 s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
873 u8 u8ScanType, u8 *pu8ChnlFreqList,
874 u8 u8ChnlListLen, const u8 *pu8IEs,
875 size_t IEsLen, tWILCpfScanResult ScanResult,
876 void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork);
878 * @brief sets configuration wids values
880 * @param[in,out] handle to the wifi driver,
881 * @param[in] WID, WID value
882 * @return Error code indicating success/failure
888 s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal);
891 * @brief gets configuration wids values
893 * @param[in,out] handle to the wifi driver,
896 * @return Error code indicating success/failure
902 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
903 /*****************************************************************************/
904 /* Notification Functions */
905 /*****************************************************************************/
907 * @brief notifies host with join and leave requests
908 * @details This function prepares an Information frame having the
909 * information about a joining/leaving station.
910 * @param[in,out] handle to the wifi driver,
911 * @param[in] 6 byte Sta Adress
912 * Join or leave flag:
915 * @return Error code indicating success/failure
921 void host_int_send_join_leave_info_to_host
922 (u16 assocId, u8 *stationAddr, bool joining);
925 * @brief notifies host with stations found in scan
926 * @details sends the beacon/probe response from scan
927 * @param[in,out] handle to the wifi driver,
928 * @param[in] Sta Address,
930 * Rssi of the Station found
931 * @return Error code indicating success/failure
937 void host_int_send_network_info_to_host
938 (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi);
941 * @brief host interface initialization function
943 * @param[in,out] handle to the wifi driver,
949 s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv);
952 * @brief host interface initialization function
954 * @param[in,out] handle to the wifi driver,
960 s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv);
964 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
965 * @brief Sends a beacon to the firmware to be transmitted over the air
967 * @param[in,out] hWFIDrv handle to the wifi driver
968 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
969 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
970 * (including the current frame) appear before the next DTIM
971 * @param[in] u32Headlen Length of the head buffer in bytes
972 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
973 * is the part from the beacon's start till the TIM element, NOT including the TIM
974 * @param[in] u32Taillen Length of the tail buffer in bytes
975 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
976 * starts just after the TIM inormation element
977 * @return 0 for Success, error otherwise
980 * @author Adham Abozaeid
981 * @date 10 Julys 2012
982 * @version 1.0 Description
985 s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
987 u32 u32HeadLen, u8 *pu8Head,
988 u32 u32TailLen, u8 *pu8tail);
992 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
993 * @brief Removes the beacon and stops trawilctting it over the air
995 * @param[in,out] hWFIDrv handle to the wifi driver
996 * @return 0 for Success, error otherwise
999 * @author Adham Abozaeid
1000 * @date 10 Julys 2012
1001 * @version 1.0 Description
1003 s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv);
1006 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv,
1007 * struct add_sta_param *pstrStaParams)
1008 * @brief Notifies the firmware with a new associated stations
1010 * @param[in,out] hWFIDrv handle to the wifi driver
1011 * @param[in] pstrStaParams Station's parameters
1012 * @return 0 for Success, error otherwise
1015 * @author Adham Abozaeid
1016 * @date 12 July 2012
1017 * @version 1.0 Description
1019 s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv,
1020 struct add_sta_param *pstrStaParams);
1023 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1024 * @brief Deauthenticates clients when group is terminating
1026 * @param[in,out] hWFIDrv handle to the wifi driver
1027 * @param[in] pu8MacAddr Station's mac address
1028 * @return 0 for Success, error otherwise
1031 * @author Mai Daftedar
1032 * @date 09 April 2014
1033 * @version 1.0 Description
1035 s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1038 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1039 * @brief Notifies the firmware with a new deleted station
1041 * @param[in,out] hWFIDrv handle to the wifi driver
1042 * @param[in] pu8MacAddr Station's mac address
1043 * @return 0 for Success, error otherwise
1046 * @author Adham Abozaeid
1047 * @date 15 July 2012
1048 * @version 1.0 Description
1050 s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr);
1053 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv,
1054 * struct add_sta_param *pstrStaParams)
1055 * @brief Notifies the firmware with new parameters of an already associated station
1057 * @param[in,out] hWFIDrv handle to the wifi driver
1058 * @param[in] pstrStaParams Station's parameters
1059 * @return 0 for Success, error otherwise
1062 * @author Adham Abozaeid
1063 * @date 15 July 2012
1064 * @version 1.0 Description
1066 s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv,
1067 struct add_sta_param *pstrStaParams);
1070 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1071 * @brief Set the power management mode to enabled or disabled
1073 * @param[in,out] hWFIDrv handle to the wifi driver
1074 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1075 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1076 * the dynamic ps timeout value
1077 * @return 0 for Success, error otherwise
1080 * @author Adham Abozaeid
1081 * @date 24 November 2012
1082 * @version 1.0 Description
1084 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout);
1085 /* @param[in,out] hWFIDrv handle to the wifi driver
1086 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1087 * @param[in] u8count count of mac address entries in the filter table
1089 * @return 0 for Success, error otherwise
1092 * @author Adham Abozaeid
1093 * @date 24 November 2012
1094 * @version 1.0 Description
1096 s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count);
1098 * @brief host_int_setup_ipaddress
1099 * @details set IP address on firmware
1101 * @return Error code.
1102 * @author Abdelrahman Sobhy
1106 s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1110 * @brief host_int_delBASession
1111 * @details Delete single Rx BA session
1113 * @return Error code.
1114 * @author Abdelrahman Sobhy
1118 s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1121 * @brief host_int_delBASession
1122 * @details Delete all Rx BA session
1124 * @return Error code.
1125 * @author Abdelrahman Sobhy
1129 s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1133 * @brief host_int_get_ipaddress
1134 * @details get IP address on firmware
1136 * @return Error code.
1137 * @author Abdelrahman Sobhy
1141 s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1144 * @brief host_int_remain_on_channel
1147 * @return Error code.
1152 s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg);
1155 * @brief host_int_ListenStateExpired
1157 * @param[in] Handle to wifi driver
1158 * Duration to remain on channel
1159 * Channel to remain on
1160 * Pointer to fn to be called on receive frames in listen state
1161 * Pointer to remain-on-channel expired fn
1163 * @return Error code.
1168 s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID);
1171 * @brief host_int_frame_register
1174 * @return Error code.
1179 s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg);
1181 * @brief host_int_set_wfi_drv_handler
1184 * @return Error code.
1189 s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address);
1190 s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode);
1192 static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent);
1194 static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
1195 short int SessionTimeout, void *drvHandler);
1198 void host_int_freeJoinParams(void *pJoinParams);
1200 s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics);