2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
14 /*****************************************************************************/
16 /*****************************************************************************/
18 #define SUCCESS 0x0001
22 #define IDLE_MODE 0x00
24 #define STATION_MODE 0x02
26 #define CLIENT_MODE 0x04
30 #define ACTIVE_SCAN_TIME 10
31 #define PASSIVE_SCAN_TIME 1200
32 #define MIN_SCAN_TIME 10
33 #define MAX_SCAN_TIME 1200
34 #define DEFAULT_SCAN 0
35 #define USER_SCAN BIT(0)
36 #define OBSS_PERIODIC_SCAN BIT(1)
37 #define OBSS_ONETIME_SCAN BIT(2)
38 #define GTK_RX_KEY_BUFF_LEN 24
41 #define DEFAULTKEY 0x4
43 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
44 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
45 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
46 #define CHANNEL_SCAN_TIME 250 /* 250 */
48 #define TX_MIC_KEY_LEN 8
49 #define RX_MIC_KEY_LEN 8
50 #define PTK_KEY_LEN 16
52 #define TX_MIC_KEY_MSG_LEN 26
53 #define RX_MIC_KEY_MSG_LEN 48
54 #define PTK_KEY_MSG_LEN 39
56 #define PMKSA_KEY_LEN 22
59 #define WILC_MAX_NUM_PMKIDS 16
60 #define WILC_SUPP_MCS_SET_SIZE 16
61 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
62 #define SCAN_EVENT_DONE_ABORTED
63 #define NUM_CONCURRENT_IFC 2
71 typedef struct _tstrStatistics {
76 u32 u32TxFailureCount;
84 HOST_IF_CONNECTING = 2,
85 HOST_IF_WAITING_CONN_RESP = 3,
86 HOST_IF_CONNECTED = 4,
87 HOST_IF_P2P_LISTEN = 5,
88 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
91 typedef struct _tstrHostIFpmkid {
96 typedef struct _tstrHostIFpmkidAttr {
98 tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
99 } tstrHostIFpmkidAttr;
124 u16 short_retry_limit;
125 u16 long_retry_limit;
129 u8 short_slot_allowed;
130 u8 txop_prot_disabled;
133 SITE_SURVEY_T site_survey_enabled;
134 u16 site_survey_scan_time;
136 u16 active_scan_time;
137 u16 passive_scan_time;
138 CURRENT_TX_RATE_T curr_tx_rate;
143 RETRY_SHORT = 1 << 0,
145 FRAG_THRESHOLD = 1 << 2,
146 RTS_THRESHOLD = 1 << 3,
149 AUTHEN_TIMEOUT = 1 << 6,
150 POWER_MANAGEMENT = 1 << 7,
152 SHORT_SLOT_ALLOWED = 1 << 9,
153 TXOP_PROT_DISABLE = 1 << 10,
154 BEACON_INTERVAL = 1 << 11,
155 DTIM_PERIOD = 1 << 12,
156 SITE_SURVEY = 1 << 13,
157 SITE_SURVEY_SCAN_TIME = 1 << 14,
158 ACTIVE_SCANTIME = 1 << 15,
159 PASSIVE_SCANTIME = 1 << 16,
160 CURRENT_TX_RATE = 1 << 17,
167 } tstrFoundNetworkInfo;
169 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
171 SCAN_EVENT_ABORTED = 2,
172 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
175 CONN_DISCONN_EVENT_CONN_RESP = 0,
176 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
177 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
178 } tenuConnDisconnEvent;
188 /*Scan callBack function definition*/
189 typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
191 /*Connect callBack function definition*/
192 typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent,
195 tstrDisconnectNotifInfo *,
199 typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/
200 typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
203 /* typedef u32 WILC_WFIDrvHandle; */
206 } *WILC_WFIDrvHandle;
209 * @struct tstrRcvdNetworkInfo
210 * @brief Structure to hold Received Asynchronous Network info
214 * @author Mostafa Abu Bakr
215 * @date 25 March 2012
218 typedef struct _tstrRcvdNetworkInfo {
221 } tstrRcvdNetworkInfo;
224 typedef struct _tstrHiddenNetworkInfo {
228 } tstrHiddenNetworkInfo;
230 typedef struct _tstrHiddenNetwork {
232 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
238 /* Scan user call back function */
239 tWILCpfScanResult pfUserScanResult;
241 /* User specific parameter to be delivered through the Scan User Callback function */
242 void *u32UserScanPvoid;
245 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
246 } tstrWILC_UsrScanReq;
252 AUTHTYPE_T tenuAuth_type;
255 size_t ConnReqIEsLen;
256 /* Connect user call back function */
257 tWILCpfConnectResult pfUserConnectResult;
259 /* User specific parameter to be delivered through the Connect User Callback function */
260 void *u32UserConnectPvoid;
261 } tstrWILC_UsrConnReq;
265 } tstrHostIfSetDrvHandler;
269 } tstrHostIfSetOperationMode;
273 u8 u8MacAddress[ETH_ALEN];
274 } tstrHostIfSetMacAddress;
279 } tstrHostIfGetMacAddress;
283 u8 au8Bssid[ETH_ALEN];
286 u16 u16SessionTimeout;
287 } tstrHostIfBASessionInfo;
293 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
294 tWILCpfRemainOnChanReady pRemainOnChanReady;
296 u32 u32ListenSessionID;
297 } tstrHostIfRemainOnChan;
306 } tstrHostIfRegisterFrame;
310 #define PROBE_REQ 0x40
311 #define PROBE_RESP 0x50
312 #define ACTION_FRM_IDX 0
313 #define PROBE_REQ_IDX 1
316 enum p2p_listen_state {
324 /* Scan user structure */
325 tstrWILC_UsrScanReq strWILC_UsrScanReq;
327 /* Connect User structure */
328 tstrWILC_UsrConnReq strWILC_UsrConnReq;
331 /*Remain on channel struvture*/
332 tstrHostIfRemainOnChan strHostIfRemainOnChan;
333 u8 u8RemainOnChan_pendingreq;
334 u64 u64P2p_MgmtTimeout;
338 tenuHostIFstate enuHostIFstate;
340 #ifndef CONNECT_DIRECT
341 u32 u32SurveyResultsCount;
342 wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS];
345 u8 au8AssociatedBSSID[ETH_ALEN];
346 tstrCfgParamVal strCfgValues;
348 struct semaphore gtOsCfgValuesSem;
349 struct semaphore hSemTestKeyBlock;
351 struct semaphore hSemTestDisconnectBlock;
352 struct semaphore hSemGetRSSI;
353 struct semaphore hSemGetLINKSPEED;
354 struct semaphore hSemGetCHNL;
355 struct semaphore hSemInactiveTime;
357 struct timer_list hScanTimer;
358 struct timer_list hConnectTimer;
360 struct timer_list hRemainOnChannel;
367 * @enum tenuWILC_StaFlag
368 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
371 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
372 * @author Enumeraion's creator
374 * @version 1.0 Description
378 WILC_STA_FLAG_INVALID = 0,
379 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
380 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
381 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
382 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
383 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
387 u8 au8BSSID[ETH_ALEN];
394 u8 au8SuppMCsSet[16];
396 u32 u32TxBeamformingCap;
398 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
399 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
400 } tstrWILC_AddStaParam;
402 /*****************************************************************************/
404 /* Host Interface API */
406 /*****************************************************************************/
409 * @brief removes wpa/wpa2 keys
410 * @details only in BSS STA mode if External Supplicant support is enabled.
411 * removes all WPA/WPA2 station key entries from MAC hardware.
412 * @param[in,out] handle to the wifi driver
413 * @param[in] 6 bytes of Station Adress in the station entry table
414 * @return Error code indicating success/failure
420 s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress);
422 * @brief removes WEP key
423 * @details valid only in BSS STA mode if External Supplicant support is enabled.
424 * remove a WEP key entry from MAC HW.
425 * The BSS Station automatically finds the index of the entry using its
426 * BSS ID and removes that entry from the MAC hardware.
427 * @param[in,out] handle to the wifi driver
428 * @param[in] 6 bytes of Station Adress in the station entry table
429 * @return Error code indicating success/failure
430 * @note NO need for the STA add since it is not used for processing
435 s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
437 * @brief sets WEP deafault key
438 * @details Sets the index of the WEP encryption key in use,
440 * @param[in,out] handle to the wifi driver
441 * @param[in] key index ( 0, 1, 2, 3)
442 * @return Error code indicating success/failure
448 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
451 * @brief sets WEP deafault key
452 * @details valid only in BSS STA mode if External Supplicant support is enabled.
453 * sets WEP key entry into MAC hardware when it receives the
454 * corresponding request from NDIS.
455 * @param[in,out] handle to the wifi driver
456 * @param[in] message containing WEP Key in the following format
457 *|---------------------------------------|
458 *|Key ID Value | Key Length | Key |
459 *|-------------|------------|------------|
460 | 1byte | 1byte | Key Length |
461 ||---------------------------------------|
463 * @return Error code indicating success/failure
469 s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
471 * @brief host_int_add_wep_key_bss_ap
472 * @details valid only in AP mode if External Supplicant support is enabled.
473 * sets WEP key entry into MAC hardware when it receives the
474 * corresponding request from NDIS.
475 * @param[in,out] handle to the wifi driver
478 * @return Error code indicating success/failure
484 s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
487 * @brief adds ptk Key
489 * @param[in,out] handle to the wifi driver
490 * @param[in] message containing PTK Key in the following format
491 *|-------------------------------------------------------------------------|
492 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
493 *|-----------|------------|---------------|----------------|---------------|
494 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
495 ||-------------------------------------------------------------------------|
496 * @return Error code indicating success/failure
502 s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
503 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
506 * @brief host_int_get_inactive_time
508 * @param[in,out] handle to the wifi driver
509 * @param[in] message containing inactive time
511 * @return Error code indicating success/failure
514 * @date 15 April 2013
517 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
520 * @brief adds Rx GTk Key
522 * @param[in,out] handle to the wifi driver
523 * @param[in] message containing Rx GTK Key in the following format
524 *|----------------------------------------------------------------------------|
525 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
526 *|------------|---------|-------|------------|---------------|----------------|
527 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
528 ||----------------------------------------------------------------------------|
529 * @return Error code indicating success/failure
535 s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
536 u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
537 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
541 * @brief adds Tx GTk Key
543 * @param[in,out] handle to the wifi driver
544 * @param[in] message containing Tx GTK Key in the following format
545 *|----------------------------------------------------|
546 | KeyID | Key Length | Temporal Key | Tx Michael Key |
547 ||-------|------------|--------------|----------------|
548 ||1 byte | 1 byte | 16 bytes | 8 bytes |
549 ||----------------------------------------------------|
550 * @return Error code indicating success/failure
556 s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
559 * @brief caches the pmkid
560 * @details valid only in BSS STA mode if External Supplicant
561 * support is enabled. This Function sets the PMKID in firmware
562 * when host drivr receives the corresponding request from NDIS.
563 * The firmware then includes theset PMKID in the appropriate
565 * @param[in,out] handle to the wifi driver
566 * @param[in] message containing PMKID Info in the following format
567 *|-----------------------------------------------------------------|
568 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
569 *|-----------|------------|----------|-------|----------|----------|
570 | 1 | 6 | 16 | ... | 6 | 16 |
571 ||-----------------------------------------------------------------|
572 * @return Error code indicating success/failure
579 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
581 * @brief gets the cached the pmkid info
582 * @details valid only in BSS STA mode if External Supplicant
583 * support is enabled. This Function sets the PMKID in firmware
584 * when host drivr receives the corresponding request from NDIS.
585 * The firmware then includes theset PMKID in the appropriate
587 * @param[in,out] handle to the wifi driver,
589 * message containing PMKID Info in the following format
590 *|-----------------------------------------------------------------|
591 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
592 *|-----------|------------|----------|-------|----------|----------|
593 | 1 | 6 | 16 | ... | 6 | 16 |
594 ||-----------------------------------------------------------------|
596 * @return Error code indicating success/failure
603 s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
604 u32 u32PmkidInfoLen);
607 * @brief sets the pass phrase
608 * @details AP/STA mode. This function gives the pass phrase used to
609 * generate the Pre-Shared Key when WPA/WPA2 is enabled
610 * The length of the field can vary from 8 to 64 bytes,
611 * the lower layer should get the
612 * @param[in,out] handle to the wifi driver,
613 * @param[in] String containing PSK
614 * @return Error code indicating success/failure
620 s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
623 * @brief gets the pass phrase
624 * @details AP/STA mode. This function gets the pass phrase used to
625 * generate the Pre-Shared Key when WPA/WPA2 is enabled
626 * The length of the field can vary from 8 to 64 bytes,
627 * the lower layer should get the
628 * @param[in,out] handle to the wifi driver,
629 * String containing PSK
630 * @return Error code indicating success/failure
636 s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
637 u8 *pu8PassPhrase, u8 u8Psklength);
640 * @brief gets mac address
642 * @param[in,out] handle to the wifi driver,
644 * @return Error code indicating success/failure
647 * @date 19 April 2012
650 s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
653 * @brief sets mac address
655 * @param[in,out] handle to the wifi driver,
657 * @return Error code indicating success/failure
663 s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
666 * @brief wait until msg q is empty
670 * @return Error code indicating success/failure
673 * @date 19 march 2014
676 s32 host_int_wait_msg_queue_idle(void);
679 * @brief gets the site survey results
681 * @param[in,out] handle to the wifi driver,
682 * Message containing site survey results in the
684 *|---------------------------------------------------|
685 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
686 ||-----------|-----------|---------------|-----------|
688 | ----------------------------------------- | ----------------
690 ||---------------------------------------|
691 | Network1 | Netweork2 | ... | Network5 |
692 ||---------------------------------------|
693 | 44 | 44 | ... | 44 |
694 | -------------------------- | ---------------------------------------
696 ||---------------------------------------------------------------------|
697 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
698 ||------|----------|---------|----------------|-------|------|---------|
699 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
700 ||---------------------------------------------------------------------|
701 * @return Error code indicating success/failure
707 #ifndef CONNECT_DIRECT
708 s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
709 u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
710 u32 u32MaxSiteSrvyFragLen);
714 * @brief sets a start scan request
716 * @param[in,out] handle to the wifi driver,
717 * @param[in] Scan Source one of the following values
720 * OBSS_PERIODIC_SCAN BIT1
721 * OBSS_ONETIME_SCAN BIT2
722 * @return Error code indicating success/failure
729 s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource);
731 * @brief gets scan source of the last scan
733 * @param[in,out] handle to the wifi driver,
734 * Scan Source one of the following values
737 * OBSS_PERIODIC_SCAN BIT1
738 * OBSS_ONETIME_SCAN BIT2
739 * @return Error code indicating success/failure
745 s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource);
748 * @brief sets a join request
750 * @param[in,out] handle to the wifi driver,
751 * @param[in] Index of the bss descriptor
752 * @return Error code indicating success/failure
759 s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
760 const u8 *pu8ssid, size_t ssidLen,
761 const u8 *pu8IEs, size_t IEsLen,
762 tWILCpfConnectResult pfConnectResult, void *pvUserArg,
763 u8 u8security, AUTHTYPE_T tenuAuth_type,
768 * @brief Flush a join request parameters to FW, but actual connection
769 * @details The function is called in situation where WILC is connected to AP and
770 * required to switch to hybrid FW for P2P connection
771 * @param[in] handle to the wifi driver,
772 * @return Error code indicating success/failure
774 * @author Amr Abdel-Moghny
779 s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv);
783 * @brief disconnects from the currently associated network
785 * @param[in,out] handle to the wifi driver,
786 * @param[in] Reason Code of the Disconnection
787 * @return Error code indicating success/failure
793 s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode);
796 * @brief disconnects a sta
798 * @param[in,out] handle to the wifi driver,
799 * @param[in] Association Id of the station to be disconnected
800 * @return Error code indicating success/failure
806 s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id);
808 * @brief gets a Association request info
810 * @param[in,out] handle to the wifi driver,
811 * Message containg assoc. req info in the following format
812 * ------------------------------------------------------------------------
813 | Management Frame Format |
814 ||-------------------------------------------------------------------|
815 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
816 ||-------------|--------|--|--|-----|----------------|----------|----|
817 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
818 ||-------------------------------------------------------------------|
820 | Association Request Frame - Frame Body |
821 ||-------------------------------------------------------------------|
822 | Capability Information | Listen Interval | SSID | Supported Rates |
823 ||------------------------|-----------------|------|-----------------|
824 | 2 | 2 | 2-34 | 3-10 |
825 | ---------------------------------------------------------------------
826 * @return Error code indicating success/failure
833 s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
834 u32 u32AssocReqInfoLen);
836 * @brief gets a Association Response info
838 * @param[in,out] handle to the wifi driver,
839 * Message containg assoc. resp info
840 * @return Error code indicating success/failure
847 s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
848 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
850 * @brief gets a Association Response info
851 * @details Valid only in STA mode. This function gives the RSSI
852 * values observed in all the channels at the time of scanning.
853 * The length of the field is 1 greater that the total number of
854 * channels supported. Byte 0 contains the number of channels while
855 * each of Byte N contains the observed RSSI value for the channel index N.
856 * @param[in,out] handle to the wifi driver,
857 * array of scanned channels' RSSI
858 * @return Error code indicating success/failure
864 s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
865 u32 u32RxPowerLevelLen);
868 * @brief sets a channel
870 * @param[in,out] handle to the wifi driver,
871 * @param[in] Index of the channel to be set
872 *|-------------------------------------------------------------------|
873 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
875 ||-------------------------------------------------------------------|
876 * @return Error code indicating success/failure
882 s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum);
885 * @brief gets the current channel index
887 * @param[in,out] handle to the wifi driver,
888 * current channel index
889 *|-----------------------------------------------------------------------|
890 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
892 ||-----------------------------------------------------------------------|
893 * @return Error code indicating success/failure
899 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo);
901 * @brief gets the sta rssi
902 * @details gets the currently maintained RSSI value for the station.
903 * The received signal strength value in dB.
904 * The range of valid values is -128 to 0.
905 * @param[in,out] handle to the wifi driver,
907 * @return Error code indicating success/failure
913 s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi);
914 s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd);
916 * @brief scans a set of channels
918 * @param[in,out] handle to the wifi driver,
919 * @param[in] Scan source
920 * Scan Type PASSIVE_SCAN = 0,
923 * Channels Array length
924 * Scan Callback function
925 * User Argument to be delivered back through the Scan Cllback function
926 * @return Error code indicating success/failure
932 s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
933 u8 u8ScanType, u8 *pu8ChnlFreqList,
934 u8 u8ChnlListLen, const u8 *pu8IEs,
935 size_t IEsLen, tWILCpfScanResult ScanResult,
936 void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork);
938 * @brief sets configuration wids values
940 * @param[in,out] handle to the wifi driver,
941 * @param[in] WID, WID value
942 * @return Error code indicating success/failure
948 s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal);
951 * @brief gets configuration wids values
953 * @param[in,out] handle to the wifi driver,
956 * @return Error code indicating success/failure
962 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
963 /*****************************************************************************/
964 /* Notification Functions */
965 /*****************************************************************************/
967 * @brief notifies host with join and leave requests
968 * @details This function prepares an Information frame having the
969 * information about a joining/leaving station.
970 * @param[in,out] handle to the wifi driver,
971 * @param[in] 6 byte Sta Adress
972 * Join or leave flag:
975 * @return Error code indicating success/failure
981 void host_int_send_join_leave_info_to_host
982 (u16 assocId, u8 *stationAddr, bool joining);
985 * @brief notifies host with stations found in scan
986 * @details sends the beacon/probe response from scan
987 * @param[in,out] handle to the wifi driver,
988 * @param[in] Sta Address,
990 * Rssi of the Station found
991 * @return Error code indicating success/failure
997 void host_int_send_network_info_to_host
998 (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi);
1001 * @brief host interface initialization function
1003 * @param[in,out] handle to the wifi driver,
1006 * @date 8 March 2012
1009 s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv);
1012 * @brief host interface initialization function
1014 * @param[in,out] handle to the wifi driver,
1017 * @date 8 March 2012
1020 s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv);
1024 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1025 * @brief Sends a beacon to the firmware to be transmitted over the air
1027 * @param[in,out] hWFIDrv handle to the wifi driver
1028 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1029 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1030 * (including the current frame) appear before the next DTIM
1031 * @param[in] u32Headlen Length of the head buffer in bytes
1032 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1033 * is the part from the beacon's start till the TIM element, NOT including the TIM
1034 * @param[in] u32Taillen Length of the tail buffer in bytes
1035 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1036 * starts just after the TIM inormation element
1037 * @return 0 for Success, error otherwise
1040 * @author Adham Abozaeid
1041 * @date 10 Julys 2012
1042 * @version 1.0 Description
1045 s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
1047 u32 u32HeadLen, u8 *pu8Head,
1048 u32 u32TailLen, u8 *pu8tail);
1052 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1053 * @brief Removes the beacon and stops trawilctting it over the air
1055 * @param[in,out] hWFIDrv handle to the wifi driver
1056 * @return 0 for Success, error otherwise
1059 * @author Adham Abozaeid
1060 * @date 10 Julys 2012
1061 * @version 1.0 Description
1063 s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv);
1066 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1067 * @brief Notifies the firmware with a new associated stations
1069 * @param[in,out] hWFIDrv handle to the wifi driver
1070 * @param[in] pstrStaParams Station's parameters
1071 * @return 0 for Success, error otherwise
1074 * @author Adham Abozaeid
1075 * @date 12 July 2012
1076 * @version 1.0 Description
1078 s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1081 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1082 * @brief Deauthenticates clients when group is terminating
1084 * @param[in,out] hWFIDrv handle to the wifi driver
1085 * @param[in] pu8MacAddr Station's mac address
1086 * @return 0 for Success, error otherwise
1089 * @author Mai Daftedar
1090 * @date 09 April 2014
1091 * @version 1.0 Description
1093 s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1096 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1097 * @brief Notifies the firmware with a new deleted station
1099 * @param[in,out] hWFIDrv handle to the wifi driver
1100 * @param[in] pu8MacAddr Station's mac address
1101 * @return 0 for Success, error otherwise
1104 * @author Adham Abozaeid
1105 * @date 15 July 2012
1106 * @version 1.0 Description
1108 s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr);
1111 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1112 * @brief Notifies the firmware with new parameters of an already associated station
1114 * @param[in,out] hWFIDrv handle to the wifi driver
1115 * @param[in] pstrStaParams Station's parameters
1116 * @return 0 for Success, error otherwise
1119 * @author Adham Abozaeid
1120 * @date 15 July 2012
1121 * @version 1.0 Description
1123 s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1126 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1127 * @brief Set the power management mode to enabled or disabled
1129 * @param[in,out] hWFIDrv handle to the wifi driver
1130 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1131 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1132 * the dynamic ps timeout value
1133 * @return 0 for Success, error otherwise
1136 * @author Adham Abozaeid
1137 * @date 24 November 2012
1138 * @version 1.0 Description
1140 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout);
1141 /* @param[in,out] hWFIDrv handle to the wifi driver
1142 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1143 * @param[in] u8count count of mac address entries in the filter table
1145 * @return 0 for Success, error otherwise
1148 * @author Adham Abozaeid
1149 * @date 24 November 2012
1150 * @version 1.0 Description
1152 s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count);
1154 * @brief host_int_setup_ipaddress
1155 * @details set IP address on firmware
1157 * @return Error code.
1158 * @author Abdelrahman Sobhy
1162 s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1166 * @brief host_int_delBASession
1167 * @details Delete single Rx BA session
1169 * @return Error code.
1170 * @author Abdelrahman Sobhy
1174 s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1177 * @brief host_int_delBASession
1178 * @details Delete all Rx BA session
1180 * @return Error code.
1181 * @author Abdelrahman Sobhy
1185 s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1189 * @brief host_int_get_ipaddress
1190 * @details get IP address on firmware
1192 * @return Error code.
1193 * @author Abdelrahman Sobhy
1197 s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1201 * @brief host_int_remain_on_channel
1204 * @return Error code.
1209 s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg);
1212 * @brief host_int_ListenStateExpired
1214 * @param[in] Handle to wifi driver
1215 * Duration to remain on channel
1216 * Channel to remain on
1217 * Pointer to fn to be called on receive frames in listen state
1218 * Pointer to remain-on-channel expired fn
1220 * @return Error code.
1225 s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID);
1228 * @brief host_int_frame_register
1231 * @return Error code.
1236 s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg);
1239 * @brief host_int_set_wfi_drv_handler
1242 * @return Error code.
1247 s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address);
1248 s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode);
1250 static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent);
1252 static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
1253 short int SessionTimeout, void *drvHandler);
1256 void host_int_freeJoinParams(void *pJoinParams);
1258 s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics);
1260 /*****************************************************************************/
1264 /*****************************************************************************/