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 (*wilc_scan_result)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
186 /*Connect callBack function definition*/
187 typedef void (*wilc_connect_result)(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 struct hidden_network {
224 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
229 /* Scan user call back function */
230 wilc_scan_result pfUserScanResult;
232 /* User specific parameter to be delivered through the Scan User Callback function */
233 void *u32UserScanPvoid;
236 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
237 } tstrWILC_UsrScanReq;
243 AUTHTYPE_T tenuAuth_type;
246 size_t ConnReqIEsLen;
247 /* Connect user call back function */
248 wilc_connect_result pfUserConnectResult;
250 /* User specific parameter to be delivered through the Connect User Callback function */
251 void *u32UserConnectPvoid;
252 } tstrWILC_UsrConnReq;
262 struct set_mac_addr {
263 u8 u8MacAddress[ETH_ALEN];
266 struct get_mac_addr {
270 struct ba_session_info {
271 u8 au8Bssid[ETH_ALEN];
274 u16 u16SessionTimeout;
280 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
281 tWILCpfRemainOnChanReady pRemainOnChanReady;
283 u32 u32ListenSessionID;
294 #define PROBE_REQ 0x40
295 #define PROBE_RESP 0x50
296 #define ACTION_FRM_IDX 0
297 #define PROBE_REQ_IDX 1
300 enum p2p_listen_state {
307 /* Scan user structure */
308 tstrWILC_UsrScanReq strWILC_UsrScanReq;
310 /* Connect User structure */
311 tstrWILC_UsrConnReq strWILC_UsrConnReq;
313 /*Remain on channel struvture*/
314 struct remain_ch strHostIfRemainOnChan;
315 u8 u8RemainOnChan_pendingreq;
316 u64 u64P2p_MgmtTimeout;
319 tenuHostIFstate enuHostIFstate;
321 u8 au8AssociatedBSSID[ETH_ALEN];
322 tstrCfgParamVal strCfgValues;
324 struct semaphore gtOsCfgValuesSem;
325 struct semaphore hSemTestKeyBlock;
327 struct semaphore hSemTestDisconnectBlock;
328 struct semaphore hSemGetRSSI;
329 struct semaphore hSemGetLINKSPEED;
330 struct semaphore hSemGetCHNL;
331 struct semaphore hSemInactiveTime;
333 struct timer_list hScanTimer;
334 struct timer_list hConnectTimer;
335 struct timer_list hRemainOnChannel;
341 * @enum tenuWILC_StaFlag
342 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
345 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
346 * @author Enumeraion's creator
348 * @version 1.0 Description
352 WILC_STA_FLAG_INVALID = 0,
353 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
354 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
355 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
356 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
357 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
360 struct add_sta_param {
361 u8 au8BSSID[ETH_ALEN];
368 u8 au8SuppMCsSet[16];
370 u32 u32TxBeamformingCap;
372 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
373 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
376 /*****************************************************************************/
378 /* Host Interface API */
380 /*****************************************************************************/
383 * @brief removes wpa/wpa2 keys
384 * @details only in BSS STA mode if External Supplicant support is enabled.
385 * removes all WPA/WPA2 station key entries from MAC hardware.
386 * @param[in,out] handle to the wifi driver
387 * @param[in] 6 bytes of Station Adress in the station entry table
388 * @return Error code indicating success/failure
394 s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress);
396 * @brief removes WEP key
397 * @details valid only in BSS STA mode if External Supplicant support is enabled.
398 * remove a WEP key entry from MAC HW.
399 * The BSS Station automatically finds the index of the entry using its
400 * BSS ID and removes that entry from the MAC hardware.
401 * @param[in,out] handle to the wifi driver
402 * @param[in] 6 bytes of Station Adress in the station entry table
403 * @return Error code indicating success/failure
404 * @note NO need for the STA add since it is not used for processing
409 s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
411 * @brief sets WEP deafault key
412 * @details Sets the index of the WEP encryption key in use,
414 * @param[in,out] handle to the wifi driver
415 * @param[in] key index ( 0, 1, 2, 3)
416 * @return Error code indicating success/failure
422 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
425 * @brief sets WEP deafault key
426 * @details valid only in BSS STA mode if External Supplicant support is enabled.
427 * sets WEP key entry into MAC hardware when it receives the
428 * corresponding request from NDIS.
429 * @param[in,out] handle to the wifi driver
430 * @param[in] message containing WEP Key in the following format
431 *|---------------------------------------|
432 *|Key ID Value | Key Length | Key |
433 *|-------------|------------|------------|
434 | 1byte | 1byte | Key Length |
435 ||---------------------------------------|
437 * @return Error code indicating success/failure
443 s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
445 * @brief host_int_add_wep_key_bss_ap
446 * @details valid only in AP mode if External Supplicant support is enabled.
447 * sets WEP key entry into MAC hardware when it receives the
448 * corresponding request from NDIS.
449 * @param[in,out] handle to the wifi driver
452 * @return Error code indicating success/failure
458 s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
461 * @brief adds ptk Key
463 * @param[in,out] handle to the wifi driver
464 * @param[in] message containing PTK Key in the following format
465 *|-------------------------------------------------------------------------|
466 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
467 *|-----------|------------|---------------|----------------|---------------|
468 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
469 ||-------------------------------------------------------------------------|
470 * @return Error code indicating success/failure
476 s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
477 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
480 * @brief host_int_get_inactive_time
482 * @param[in,out] handle to the wifi driver
483 * @param[in] message containing inactive time
485 * @return Error code indicating success/failure
488 * @date 15 April 2013
491 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
494 * @brief adds Rx GTk Key
496 * @param[in,out] handle to the wifi driver
497 * @param[in] message containing Rx GTK Key in the following format
498 *|----------------------------------------------------------------------------|
499 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
500 *|------------|---------|-------|------------|---------------|----------------|
501 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
502 ||----------------------------------------------------------------------------|
503 * @return Error code indicating success/failure
509 s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
510 u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
511 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
515 * @brief adds Tx GTk Key
517 * @param[in,out] handle to the wifi driver
518 * @param[in] message containing Tx GTK Key in the following format
519 *|----------------------------------------------------|
520 | KeyID | Key Length | Temporal Key | Tx Michael Key |
521 ||-------|------------|--------------|----------------|
522 ||1 byte | 1 byte | 16 bytes | 8 bytes |
523 ||----------------------------------------------------|
524 * @return Error code indicating success/failure
530 s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
533 * @brief caches the pmkid
534 * @details valid only in BSS STA mode if External Supplicant
535 * support is enabled. This Function sets the PMKID in firmware
536 * when host drivr receives the corresponding request from NDIS.
537 * The firmware then includes theset PMKID in the appropriate
539 * @param[in,out] handle to the wifi driver
540 * @param[in] message containing PMKID Info in the following format
541 *|-----------------------------------------------------------------|
542 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
543 *|-----------|------------|----------|-------|----------|----------|
544 | 1 | 6 | 16 | ... | 6 | 16 |
545 ||-----------------------------------------------------------------|
546 * @return Error code indicating success/failure
553 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
555 * @brief gets the cached the pmkid info
556 * @details valid only in BSS STA mode if External Supplicant
557 * support is enabled. This Function sets the PMKID in firmware
558 * when host drivr receives the corresponding request from NDIS.
559 * The firmware then includes theset PMKID in the appropriate
561 * @param[in,out] handle to the wifi driver,
563 * message containing PMKID Info in the following format
564 *|-----------------------------------------------------------------|
565 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
566 *|-----------|------------|----------|-------|----------|----------|
567 | 1 | 6 | 16 | ... | 6 | 16 |
568 ||-----------------------------------------------------------------|
570 * @return Error code indicating success/failure
577 s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
578 u32 u32PmkidInfoLen);
581 * @brief sets the pass phrase
582 * @details AP/STA mode. This function gives the pass phrase used to
583 * generate the Pre-Shared Key when WPA/WPA2 is enabled
584 * The length of the field can vary from 8 to 64 bytes,
585 * the lower layer should get the
586 * @param[in,out] handle to the wifi driver,
587 * @param[in] String containing PSK
588 * @return Error code indicating success/failure
594 s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
597 * @brief gets the pass phrase
598 * @details AP/STA mode. This function gets the pass phrase used to
599 * generate the Pre-Shared Key when WPA/WPA2 is enabled
600 * The length of the field can vary from 8 to 64 bytes,
601 * the lower layer should get the
602 * @param[in,out] handle to the wifi driver,
603 * String containing PSK
604 * @return Error code indicating success/failure
610 s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
611 u8 *pu8PassPhrase, u8 u8Psklength);
614 * @brief gets mac address
616 * @param[in,out] handle to the wifi driver,
618 * @return Error code indicating success/failure
621 * @date 19 April 2012
624 s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
627 * @brief sets mac address
629 * @param[in,out] handle to the wifi driver,
631 * @return Error code indicating success/failure
637 s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
640 * @brief wait until msg q is empty
644 * @return Error code indicating success/failure
647 * @date 19 march 2014
650 int host_int_wait_msg_queue_idle(void);
653 * @brief sets a start scan request
655 * @param[in,out] handle to the wifi driver,
656 * @param[in] Scan Source one of the following values
659 * OBSS_PERIODIC_SCAN BIT1
660 * OBSS_ONETIME_SCAN BIT2
661 * @return Error code indicating success/failure
668 s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource);
670 * @brief gets scan source of the last scan
672 * @param[in,out] handle to the wifi driver,
673 * Scan Source one of the following values
676 * OBSS_PERIODIC_SCAN BIT1
677 * OBSS_ONETIME_SCAN BIT2
678 * @return Error code indicating success/failure
684 s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource);
687 * @brief sets a join request
689 * @param[in,out] handle to the wifi driver,
690 * @param[in] Index of the bss descriptor
691 * @return Error code indicating success/failure
698 s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
699 const u8 *pu8ssid, size_t ssidLen,
700 const u8 *pu8IEs, size_t IEsLen,
701 wilc_connect_result pfConnectResult, void *pvUserArg,
702 u8 u8security, AUTHTYPE_T tenuAuth_type,
707 * @brief Flush a join request parameters to FW, but actual connection
708 * @details The function is called in situation where WILC is connected to AP and
709 * required to switch to hybrid FW for P2P connection
710 * @param[in] handle to the wifi driver,
711 * @return Error code indicating success/failure
713 * @author Amr Abdel-Moghny
718 s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv);
722 * @brief disconnects from the currently associated network
724 * @param[in,out] handle to the wifi driver,
725 * @param[in] Reason Code of the Disconnection
726 * @return Error code indicating success/failure
732 s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode);
735 * @brief disconnects a sta
737 * @param[in,out] handle to the wifi driver,
738 * @param[in] Association Id of the station to be disconnected
739 * @return Error code indicating success/failure
745 s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id);
747 * @brief gets a Association request info
749 * @param[in,out] handle to the wifi driver,
750 * Message containg assoc. req info in the following format
751 * ------------------------------------------------------------------------
752 | Management Frame Format |
753 ||-------------------------------------------------------------------|
754 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
755 ||-------------|--------|--|--|-----|----------------|----------|----|
756 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
757 ||-------------------------------------------------------------------|
759 | Association Request Frame - Frame Body |
760 ||-------------------------------------------------------------------|
761 | Capability Information | Listen Interval | SSID | Supported Rates |
762 ||------------------------|-----------------|------|-----------------|
763 | 2 | 2 | 2-34 | 3-10 |
764 | ---------------------------------------------------------------------
765 * @return Error code indicating success/failure
772 s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
773 u32 u32AssocReqInfoLen);
775 * @brief gets a Association Response info
777 * @param[in,out] handle to the wifi driver,
778 * Message containg assoc. resp info
779 * @return Error code indicating success/failure
786 s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
787 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
789 * @brief gets a Association Response info
790 * @details Valid only in STA mode. This function gives the RSSI
791 * values observed in all the channels at the time of scanning.
792 * The length of the field is 1 greater that the total number of
793 * channels supported. Byte 0 contains the number of channels while
794 * each of Byte N contains the observed RSSI value for the channel index N.
795 * @param[in,out] handle to the wifi driver,
796 * array of scanned channels' RSSI
797 * @return Error code indicating success/failure
803 s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
804 u32 u32RxPowerLevelLen);
807 * @brief sets a channel
809 * @param[in,out] handle to the wifi driver,
810 * @param[in] Index of the channel to be set
811 *|-------------------------------------------------------------------|
812 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
814 ||-------------------------------------------------------------------|
815 * @return Error code indicating success/failure
821 int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel);
824 * @brief gets the current channel index
826 * @param[in,out] handle to the wifi driver,
827 * current channel index
828 *|-----------------------------------------------------------------------|
829 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
831 ||-----------------------------------------------------------------------|
832 * @return Error code indicating success/failure
838 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo);
840 * @brief gets the sta rssi
841 * @details gets the currently maintained RSSI value for the station.
842 * The received signal strength value in dB.
843 * The range of valid values is -128 to 0.
844 * @param[in,out] handle to the wifi driver,
846 * @return Error code indicating success/failure
852 s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi);
853 s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd);
855 * @brief scans a set of channels
857 * @param[in,out] handle to the wifi driver,
858 * @param[in] Scan source
859 * Scan Type PASSIVE_SCAN = 0,
862 * Channels Array length
863 * Scan Callback function
864 * User Argument to be delivered back through the Scan Cllback function
865 * @return Error code indicating success/failure
871 s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
872 u8 u8ScanType, u8 *pu8ChnlFreqList,
873 u8 u8ChnlListLen, const u8 *pu8IEs,
874 size_t IEsLen, wilc_scan_result ScanResult,
876 struct hidden_network *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);