2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
14 #include "coreconfigsimulator.h"
15 /*****************************************************************************/
17 /*****************************************************************************/
19 #define SUCCESS 0x0001
23 #define BIT2 ((u32)(1 << 2))
24 #define BIT1 ((u32)(1 << 1))
25 #define BIT0 ((u32)(1 << 0))
28 #define STATION_MODE 0x02
30 #define CLIENT_MODE 0x04
34 #define ACTIVE_SCAN_TIME 10
35 #define PASSIVE_SCAN_TIME 1200
36 #define MIN_SCAN_TIME 10
37 #define MAX_SCAN_TIME 1200
38 #define DEFAULT_SCAN 0
39 #define USER_SCAN BIT0
40 #define OBSS_PERIODIC_SCAN BIT1
41 #define OBSS_ONETIME_SCAN BIT2
42 #define GTK_RX_KEY_BUFF_LEN 24
45 #define DEFAULTKEY 0x4
47 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
48 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
49 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
50 #define CHANNEL_SCAN_TIME 250 /* 250 */
52 #define TX_MIC_KEY_LEN 8
53 #define RX_MIC_KEY_LEN 8
54 #define PTK_KEY_LEN 16
56 #define TX_MIC_KEY_MSG_LEN 26
57 #define RX_MIC_KEY_MSG_LEN 48
58 #define PTK_KEY_MSG_LEN 39
60 #define PMKSA_KEY_LEN 22
63 #define WILC_MAX_NUM_PMKIDS 16
64 #define WILC_SUPP_MCS_SET_SIZE 16
65 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
66 #define SCAN_EVENT_DONE_ABORTED
67 /*****************************************************************************/
69 /*****************************************************************************/
70 /* typedef unsigned char uint8; */
71 /* typedef signed char int8; */
72 /* typedef unsigned short uint16; */
73 /* typedef unsigned long uint32; */
74 /* typedef uint32 Bool; */
82 typedef struct _tstrStatistics
{
87 u32 u32TxFailureCount
;
95 HOST_IF_CONNECTING
= 2,
96 HOST_IF_WAITING_CONN_RESP
= 3,
97 HOST_IF_CONNECTED
= 4,
98 HOST_IF_P2P_LISTEN
= 5,
99 HOST_IF_FORCE_32BIT
= 0xFFFFFFFF
102 typedef struct _tstrHostIFpmkid
{
107 typedef struct _tstrHostIFpmkidAttr
{
109 tstrHostIFpmkid pmkidlist
[WILC_MAX_NUM_PMKIDS
];
110 } tstrHostIFpmkidAttr
;
135 u16 short_retry_limit
;
136 u16 long_retry_limit
;
140 u8 short_slot_allowed
;
141 u8 txop_prot_disabled
;
144 SITE_SURVEY_T site_survey_enabled
;
145 u16 site_survey_scan_time
;
147 u16 active_scan_time
;
148 u16 passive_scan_time
;
149 CURRENT_TX_RATE_T curr_tx_rate
;
154 RETRY_SHORT
= 1 << 0,
156 FRAG_THRESHOLD
= 1 << 2,
157 RTS_THRESHOLD
= 1 << 3,
160 AUTHEN_TIMEOUT
= 1 << 6,
161 POWER_MANAGEMENT
= 1 << 7,
163 SHORT_SLOT_ALLOWED
= 1 << 9,
164 TXOP_PROT_DISABLE
= 1 << 10,
165 BEACON_INTERVAL
= 1 << 11,
166 DTIM_PERIOD
= 1 << 12,
167 SITE_SURVEY
= 1 << 13,
168 SITE_SURVEY_SCAN_TIME
= 1 << 14,
169 ACTIVE_SCANTIME
= 1 << 15,
170 PASSIVE_SCANTIME
= 1 << 16,
171 CURRENT_TX_RATE
= 1 << 17,
178 } tstrFoundNetworkInfo
;
180 typedef enum {SCAN_EVENT_NETWORK_FOUND
= 0,
182 SCAN_EVENT_ABORTED
= 2,
183 SCAN_EVENT_FORCE_32BIT
= 0xFFFFFFFF} tenuScanEvent
;
186 CONN_DISCONN_EVENT_CONN_RESP
= 0,
187 CONN_DISCONN_EVENT_DISCONN_NOTIF
= 1,
188 CONN_DISCONN_EVENT_FORCE_32BIT
= 0xFFFFFFFF
189 } tenuConnDisconnEvent
;
200 /*Scan callBack function definition*/
201 typedef void (*tWILCpfScanResult
)(tenuScanEvent
, tstrNetworkInfo
*, void *, void *);
203 /*Connect callBack function definition*/
204 typedef void (*tWILCpfConnectResult
)(tenuConnDisconnEvent
,
207 tstrDisconnectNotifInfo
*,
211 typedef void (*tWILCpfRemainOnChanExpired
)(void *, u32
); /*Remain on channel expiration callback function*/
212 typedef void (*tWILCpfRemainOnChanReady
)(void *); /*Remain on channel callback function*/
215 /* typedef u32 WILC_WFIDrvHandle; */
218 } *WILC_WFIDrvHandle
;
221 * @struct tstrRcvdNetworkInfo
222 * @brief Structure to hold Received Asynchronous Network info
226 * @author Mostafa Abu Bakr
227 * @date 25 March 2012
230 typedef struct _tstrRcvdNetworkInfo
{
233 } tstrRcvdNetworkInfo
;
236 typedef struct _tstrHiddenNetworkInfo
{
240 } tstrHiddenNetworkInfo
;
242 typedef struct _tstrHiddenNetwork
{
244 tstrHiddenNetworkInfo
*pstrHiddenNetworkInfo
;
250 /* Scan user call back function */
251 tWILCpfScanResult pfUserScanResult
;
253 /* User specific parameter to be delivered through the Scan User Callback function */
254 void *u32UserScanPvoid
;
257 tstrFoundNetworkInfo astrFoundNetworkInfo
[MAX_NUM_SCANNED_NETWORKS
];
258 } tstrWILC_UsrScanReq
;
264 AUTHTYPE_T tenuAuth_type
;
267 size_t ConnReqIEsLen
;
268 /* Connect user call back function */
269 tWILCpfConnectResult pfUserConnectResult
;
271 /* User specific parameter to be delivered through the Connect User Callback function */
272 void *u32UserConnectPvoid
;
273 } tstrWILC_UsrConnReq
;
277 } tstrHostIfSetDrvHandler
;
281 } tstrHostIfSetOperationMode
;
285 u8 u8MacAddress
[ETH_ALEN
];
286 } tstrHostIfSetMacAddress
;
291 } tstrHostIfGetMacAddress
;
295 u8 au8Bssid
[ETH_ALEN
];
298 u16 u16SessionTimeout
;
299 } tstrHostIfBASessionInfo
;
305 tWILCpfRemainOnChanExpired pRemainOnChanExpired
;
306 tWILCpfRemainOnChanReady pRemainOnChanReady
;
308 u32 u32ListenSessionID
;
309 } tstrHostIfRemainOnChan
;
318 } tstrHostIfRegisterFrame
;
322 #define PROBE_REQ 0x40
323 #define PROBE_RESP 0x50
324 #define ACTION_FRM_IDX 0
325 #define PROBE_REQ_IDX 1
328 enum p2p_listen_state
{
336 /* Scan user structure */
337 tstrWILC_UsrScanReq strWILC_UsrScanReq
;
339 /* Connect User structure */
340 tstrWILC_UsrConnReq strWILC_UsrConnReq
;
343 /*Remain on channel struvture*/
344 tstrHostIfRemainOnChan strHostIfRemainOnChan
;
345 u8 u8RemainOnChan_pendingreq
;
346 u64 u64P2p_MgmtTimeout
;
350 tenuHostIFstate enuHostIFstate
;
352 /* bool bPendingConnRequest; */
354 #ifndef CONNECT_DIRECT
355 u32 u32SurveyResultsCount
;
356 wid_site_survey_reslts_s astrSurveyResults
[MAX_NUM_SCANNED_NETWORKS
];
359 u8 au8AssociatedBSSID
[ETH_ALEN
];
360 tstrCfgParamVal strCfgValues
;
362 struct semaphore gtOsCfgValuesSem
;
363 struct semaphore hSemTestKeyBlock
;
365 struct semaphore hSemTestDisconnectBlock
;
366 struct semaphore hSemGetRSSI
;
367 struct semaphore hSemGetLINKSPEED
;
368 struct semaphore hSemGetCHNL
;
369 struct semaphore hSemInactiveTime
;
371 WILC_TimerHandle hScanTimer
;
372 WILC_TimerHandle hConnectTimer
;
374 WILC_TimerHandle hRemainOnChannel
;
381 * @enum tenuWILC_StaFlag
382 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
385 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
386 * @author Enumeraion's creator
388 * @version 1.0 Description
392 WILC_STA_FLAG_INVALID
= 0,
393 WILC_STA_FLAG_AUTHORIZED
, /*!< station is authorized (802.1X)*/
394 WILC_STA_FLAG_SHORT_PREAMBLE
, /*!< station is capable of receiving frames with short barker preamble*/
395 WILC_STA_FLAG_WME
, /*!< station is WME/QoS capable*/
396 WILC_STA_FLAG_MFP
, /*!< station uses management frame protection*/
397 WILC_STA_FLAG_AUTHENTICATED
/*!< station is authenticated*/
401 u8 au8BSSID
[ETH_ALEN
];
408 u8 au8SuppMCsSet
[16];
410 u32 u32TxBeamformingCap
;
412 u16 u16FlagsMask
; /*<! Determines which of u16FlagsSet were changed>*/
413 u16 u16FlagsSet
; /*<! Decoded according to tenuWILC_StaFlag */
414 } tstrWILC_AddStaParam
;
416 /* extern void CfgDisconnected(void* pUserVoid, u16 u16reason, u8 * ie, size_t ie_len); */
418 /*****************************************************************************/
420 /* Host Interface API */
422 /*****************************************************************************/
425 * @brief removes wpa/wpa2 keys
426 * @details only in BSS STA mode if External Supplicant support is enabled.
427 * removes all WPA/WPA2 station key entries from MAC hardware.
428 * @param[in,out] handle to the wifi driver
429 * @param[in] 6 bytes of Station Adress in the station entry table
430 * @return Error code indicating success/failure
436 s32
host_int_remove_key(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8StaAddress
);
438 * @brief removes WEP key
439 * @details valid only in BSS STA mode if External Supplicant support is enabled.
440 * remove a WEP key entry from MAC HW.
441 * The BSS Station automatically finds the index of the entry using its
442 * BSS ID and removes that entry from the MAC hardware.
443 * @param[in,out] handle to the wifi driver
444 * @param[in] 6 bytes of Station Adress in the station entry table
445 * @return Error code indicating success/failure
446 * @note NO need for the STA add since it is not used for processing
451 s32
host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv
, u8 u8Index
);
453 * @brief sets WEP deafault key
454 * @details Sets the index of the WEP encryption key in use,
456 * @param[in,out] handle to the wifi driver
457 * @param[in] key index ( 0, 1, 2, 3)
458 * @return Error code indicating success/failure
464 s32
host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv
, u8 u8Index
);
467 * @brief sets WEP deafault key
468 * @details valid only in BSS STA mode if External Supplicant support is enabled.
469 * sets WEP key entry into MAC hardware when it receives the
470 * corresponding request from NDIS.
471 * @param[in,out] handle to the wifi driver
472 * @param[in] message containing WEP Key in the following format
473 *|---------------------------------------|
474 *|Key ID Value | Key Length | Key |
475 *|-------------|------------|------------|
476 | 1byte | 1byte | Key Length |
477 ||---------------------------------------|
479 * @return Error code indicating success/failure
485 s32
host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
);
487 * @brief host_int_add_wep_key_bss_ap
488 * @details valid only in AP mode if External Supplicant support is enabled.
489 * sets WEP key entry into MAC hardware when it receives the
490 * corresponding request from NDIS.
491 * @param[in,out] handle to the wifi driver
494 * @return Error code indicating success/failure
500 s32
host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
, u8 u8mode
, AUTHTYPE_T tenuAuth_type
);
503 * @brief adds ptk Key
505 * @param[in,out] handle to the wifi driver
506 * @param[in] message containing PTK Key in the following format
507 *|-------------------------------------------------------------------------|
508 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
509 *|-----------|------------|---------------|----------------|---------------|
510 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
511 ||-------------------------------------------------------------------------|
512 * @return Error code indicating success/failure
518 s32
host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8Ptk
, u8 u8PtkKeylen
,
519 const u8
*mac_addr
, const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
, u8 u8Idx
);
522 * @brief host_int_get_inactive_time
524 * @param[in,out] handle to the wifi driver
525 * @param[in] message containing inactive time
527 * @return Error code indicating success/failure
530 * @date 15 April 2013
533 s32
host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv
, const u8
*mac
, u32
*pu32InactiveTime
);
536 * @brief adds Rx GTk Key
538 * @param[in,out] handle to the wifi driver
539 * @param[in] message containing Rx GTK Key in the following format
540 *|----------------------------------------------------------------------------|
541 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
542 *|------------|---------|-------|------------|---------------|----------------|
543 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
544 ||----------------------------------------------------------------------------|
545 * @return Error code indicating success/failure
551 s32
host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8RxGtk
, u8 u8GtkKeylen
,
552 u8 u8KeyIdx
, u32 u32KeyRSClen
, const u8
*KeyRSC
,
553 const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
);
557 * @brief adds Tx GTk Key
559 * @param[in,out] handle to the wifi driver
560 * @param[in] message containing Tx GTK Key in the following format
561 *|----------------------------------------------------|
562 | KeyID | Key Length | Temporal Key | Tx Michael Key |
563 ||-------|------------|--------------|----------------|
564 ||1 byte | 1 byte | 16 bytes | 8 bytes |
565 ||----------------------------------------------------|
566 * @return Error code indicating success/failure
572 s32
host_int_add_tx_gtk(WILC_WFIDrvHandle hWFIDrv
, u8 u8KeyLen
, u8
*pu8TxGtk
, u8 u8KeyIdx
);
575 * @brief caches the pmkid
576 * @details valid only in BSS STA mode if External Supplicant
577 * support is enabled. This Function sets the PMKID in firmware
578 * when host drivr receives the corresponding request from NDIS.
579 * The firmware then includes theset PMKID in the appropriate
581 * @param[in,out] handle to the wifi driver
582 * @param[in] message containing PMKID Info in the following format
583 *|-----------------------------------------------------------------|
584 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
585 *|-----------|------------|----------|-------|----------|----------|
586 | 1 | 6 | 16 | ... | 6 | 16 |
587 ||-----------------------------------------------------------------|
588 * @return Error code indicating success/failure
595 s32
host_int_set_pmkid_info(WILC_WFIDrvHandle hWFIDrv
, tstrHostIFpmkidAttr
*pu8PmkidInfoArray
);
597 * @brief gets the cached the pmkid info
598 * @details valid only in BSS STA mode if External Supplicant
599 * support is enabled. This Function sets the PMKID in firmware
600 * when host drivr receives the corresponding request from NDIS.
601 * The firmware then includes theset PMKID in the appropriate
603 * @param[in,out] handle to the wifi driver,
605 * message containing PMKID Info in the following format
606 *|-----------------------------------------------------------------|
607 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
608 *|-----------|------------|----------|-------|----------|----------|
609 | 1 | 6 | 16 | ... | 6 | 16 |
610 ||-----------------------------------------------------------------|
612 * @return Error code indicating success/failure
619 s32
host_int_get_pmkid_info(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8PmkidInfoArray
,
620 u32 u32PmkidInfoLen
);
623 * @brief sets the pass phrase
624 * @details AP/STA mode. This function gives the pass phrase used to
625 * generate the Pre-Shared Key when WPA/WPA2 is enabled
626 * The length of the field can vary from 8 to 64 bytes,
627 * the lower layer should get the
628 * @param[in,out] handle to the wifi driver,
629 * @param[in] String containing PSK
630 * @return Error code indicating success/failure
636 s32
host_int_set_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8PassPhrase
,
639 * @brief gets the pass phrase
640 * @details AP/STA mode. This function gets the pass phrase used to
641 * generate the Pre-Shared Key when WPA/WPA2 is enabled
642 * The length of the field can vary from 8 to 64 bytes,
643 * the lower layer should get the
644 * @param[in,out] handle to the wifi driver,
645 * String containing PSK
646 * @return Error code indicating success/failure
652 s32
host_int_get_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv
,
653 u8
*pu8PassPhrase
, u8 u8Psklength
);
656 * @brief gets mac address
658 * @param[in,out] handle to the wifi driver,
660 * @return Error code indicating success/failure
663 * @date 19 April 2012
666 s32
host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8MacAddress
);
669 * @brief sets mac address
671 * @param[in,out] handle to the wifi driver,
673 * @return Error code indicating success/failure
679 s32
host_int_set_MacAddress(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8MacAddress
);
682 * @brief wait until msg q is empty
686 * @return Error code indicating success/failure
689 * @date 19 march 2014
692 s32
host_int_wait_msg_queue_idle(void);
695 * @brief gets the site survey results
697 * @param[in,out] handle to the wifi driver,
698 * Message containing site survey results in the
700 *|---------------------------------------------------|
701 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
702 ||-----------|-----------|---------------|-----------|
704 | ----------------------------------------- | ----------------
706 ||---------------------------------------|
707 | Network1 | Netweork2 | ... | Network5 |
708 ||---------------------------------------|
709 | 44 | 44 | ... | 44 |
710 | -------------------------- | ---------------------------------------
712 ||---------------------------------------------------------------------|
713 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
714 ||------|----------|---------|----------------|-------|------|---------|
715 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
716 ||---------------------------------------------------------------------|
717 * @return Error code indicating success/failure
723 #ifndef CONNECT_DIRECT
724 s32
host_int_get_site_survey_results(WILC_WFIDrvHandle hWFIDrv
,
725 u8 ppu8RcvdSiteSurveyResults
[][MAX_SURVEY_RESULT_FRAG_SIZE
],
726 u32 u32MaxSiteSrvyFragLen
);
730 * @brief sets a start scan request
732 * @param[in,out] handle to the wifi driver,
733 * @param[in] Scan Source one of the following values
736 * OBSS_PERIODIC_SCAN BIT1
737 * OBSS_ONETIME_SCAN BIT2
738 * @return Error code indicating success/failure
745 s32
host_int_set_start_scan_req(WILC_WFIDrvHandle hWFIDrv
, u8 scanSource
);
747 * @brief gets scan source of the last scan
749 * @param[in,out] handle to the wifi driver,
750 * Scan Source one of the following values
753 * OBSS_PERIODIC_SCAN BIT1
754 * OBSS_ONETIME_SCAN BIT2
755 * @return Error code indicating success/failure
761 s32
host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8ScanSource
);
764 * @brief sets a join request
766 * @param[in,out] handle to the wifi driver,
767 * @param[in] Index of the bss descriptor
768 * @return Error code indicating success/failure
775 s32
host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8bssid
,
776 const u8
*pu8ssid
, size_t ssidLen
,
777 const u8
*pu8IEs
, size_t IEsLen
,
778 tWILCpfConnectResult pfConnectResult
, void *pvUserArg
,
779 u8 u8security
, AUTHTYPE_T tenuAuth_type
,
784 * @brief Flush a join request parameters to FW, but actual connection
785 * @details The function is called in situation where WILC is connected to AP and
786 * required to switch to hybrid FW for P2P connection
787 * @param[in] handle to the wifi driver,
788 * @return Error code indicating success/failure
790 * @author Amr Abdel-Moghny
795 s32
host_int_flush_join_req(WILC_WFIDrvHandle hWFIDrv
);
799 * @brief disconnects from the currently associated network
801 * @param[in,out] handle to the wifi driver,
802 * @param[in] Reason Code of the Disconnection
803 * @return Error code indicating success/failure
809 s32
host_int_disconnect(WILC_WFIDrvHandle hWFIDrv
, u16 u16ReasonCode
);
812 * @brief disconnects a sta
814 * @param[in,out] handle to the wifi driver,
815 * @param[in] Association Id of the station to be disconnected
816 * @return Error code indicating success/failure
822 s32
host_int_disconnect_station(WILC_WFIDrvHandle hWFIDrv
, u8 assoc_id
);
824 * @brief gets a Association request info
826 * @param[in,out] handle to the wifi driver,
827 * Message containg assoc. req info in the following format
828 * ------------------------------------------------------------------------
829 | Management Frame Format |
830 ||-------------------------------------------------------------------|
831 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
832 ||-------------|--------|--|--|-----|----------------|----------|----|
833 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
834 ||-------------------------------------------------------------------|
836 | Association Request Frame - Frame Body |
837 ||-------------------------------------------------------------------|
838 | Capability Information | Listen Interval | SSID | Supported Rates |
839 ||------------------------|-----------------|------|-----------------|
840 | 2 | 2 | 2-34 | 3-10 |
841 | ---------------------------------------------------------------------
842 * @return Error code indicating success/failure
849 s32
host_int_get_assoc_req_info(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8AssocReqInfo
,
850 u32 u32AssocReqInfoLen
);
852 * @brief gets a Association Response info
854 * @param[in,out] handle to the wifi driver,
855 * Message containg assoc. resp info
856 * @return Error code indicating success/failure
863 s32
host_int_get_assoc_res_info(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8AssocRespInfo
,
864 u32 u32MaxAssocRespInfoLen
, u32
*pu32RcvdAssocRespInfoLen
);
866 * @brief gets a Association Response info
867 * @details Valid only in STA mode. This function gives the RSSI
868 * values observed in all the channels at the time of scanning.
869 * The length of the field is 1 greater that the total number of
870 * channels supported. Byte 0 contains the number of channels while
871 * each of Byte N contains the observed RSSI value for the channel index N.
872 * @param[in,out] handle to the wifi driver,
873 * array of scanned channels' RSSI
874 * @return Error code indicating success/failure
880 s32
host_int_get_rx_power_level(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8RxPowerLevel
,
881 u32 u32RxPowerLevelLen
);
884 * @brief sets a channel
886 * @param[in,out] handle to the wifi driver,
887 * @param[in] Index of the channel to be set
888 *|-------------------------------------------------------------------|
889 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
891 ||-------------------------------------------------------------------|
892 * @return Error code indicating success/failure
898 s32
host_int_set_mac_chnl_num(WILC_WFIDrvHandle hWFIDrv
, u8 u8ChNum
);
901 * @brief gets the current channel index
903 * @param[in,out] handle to the wifi driver,
904 * current channel index
905 *|-----------------------------------------------------------------------|
906 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
908 ||-----------------------------------------------------------------------|
909 * @return Error code indicating success/failure
915 s32
host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8ChNo
);
917 * @brief gets the sta rssi
918 * @details gets the currently maintained RSSI value for the station.
919 * The received signal strength value in dB.
920 * The range of valid values is -128 to 0.
921 * @param[in,out] handle to the wifi driver,
923 * @return Error code indicating success/failure
929 s32
host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv
, s8
*ps8Rssi
);
930 s32
host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv
, s8
*ps8lnkspd
);
932 * @brief scans a set of channels
934 * @param[in,out] handle to the wifi driver,
935 * @param[in] Scan source
936 * Scan Type PASSIVE_SCAN = 0,
939 * Channels Array length
940 * Scan Callback function
941 * User Argument to be delivered back through the Scan Cllback function
942 * @return Error code indicating success/failure
948 s32
host_int_scan(WILC_WFIDrvHandle hWFIDrv
, u8 u8ScanSource
,
949 u8 u8ScanType
, u8
*pu8ChnlFreqList
,
950 u8 u8ChnlListLen
, const u8
*pu8IEs
,
951 size_t IEsLen
, tWILCpfScanResult ScanResult
,
952 void *pvUserArg
, tstrHiddenNetwork
*pstrHiddenNetwork
);
954 * @brief sets configuration wids values
956 * @param[in,out] handle to the wifi driver,
957 * @param[in] WID, WID value
958 * @return Error code indicating success/failure
964 s32
hif_set_cfg(WILC_WFIDrvHandle hWFIDrv
, tstrCfgParamVal
*pstrCfgParamVal
);
967 * @brief gets configuration wids values
969 * @param[in,out] handle to the wifi driver,
972 * @return Error code indicating success/failure
978 s32
hif_get_cfg(WILC_WFIDrvHandle hWFIDrv
, u16 u16WID
, u16
*pu16WID_Value
);
979 /*****************************************************************************/
980 /* Notification Functions */
981 /*****************************************************************************/
983 * @brief notifies host with join and leave requests
984 * @details This function prepares an Information frame having the
985 * information about a joining/leaving station.
986 * @param[in,out] handle to the wifi driver,
987 * @param[in] 6 byte Sta Adress
988 * Join or leave flag:
991 * @return Error code indicating success/failure
997 void host_int_send_join_leave_info_to_host
998 (u16 assocId
, u8
*stationAddr
, bool joining
);
1001 * @brief notifies host with stations found in scan
1002 * @details sends the beacon/probe response from scan
1003 * @param[in,out] handle to the wifi driver,
1004 * @param[in] Sta Address,
1006 * Rssi of the Station found
1007 * @return Error code indicating success/failure
1010 * @date 8 March 2012
1013 void host_int_send_network_info_to_host
1014 (u8
*macStartAddress
, u16 u16RxFrameLen
, s8 s8Rssi
);
1017 * @brief host interface initialization function
1019 * @param[in,out] handle to the wifi driver,
1022 * @date 8 March 2012
1025 s32
host_int_init(WILC_WFIDrvHandle
*phWFIDrv
);
1028 * @brief host interface initialization function
1030 * @param[in,out] handle to the wifi driver,
1033 * @date 8 March 2012
1036 s32
host_int_deinit(WILC_WFIDrvHandle hWFIDrv
);
1040 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1041 * @brief Sends a beacon to the firmware to be transmitted over the air
1043 * @param[in,out] hWFIDrv handle to the wifi driver
1044 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1045 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1046 * (including the current frame) appear before the next DTIM
1047 * @param[in] u32Headlen Length of the head buffer in bytes
1048 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1049 * is the part from the beacon's start till the TIM element, NOT including the TIM
1050 * @param[in] u32Taillen Length of the tail buffer in bytes
1051 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1052 * starts just after the TIM inormation element
1053 * @return 0 for Success, error otherwise
1056 * @author Adham Abozaeid
1057 * @date 10 Julys 2012
1058 * @version 1.0 Description
1061 s32
host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv
, u32 u32Interval
,
1063 u32 u32HeadLen
, u8
*pu8Head
,
1064 u32 u32TailLen
, u8
*pu8tail
);
1068 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1069 * @brief Removes the beacon and stops trawilctting it over the air
1071 * @param[in,out] hWFIDrv handle to the wifi driver
1072 * @return 0 for Success, error otherwise
1075 * @author Adham Abozaeid
1076 * @date 10 Julys 2012
1077 * @version 1.0 Description
1079 s32
host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv
);
1082 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1083 * @brief Notifies the firmware with a new associated stations
1085 * @param[in,out] hWFIDrv handle to the wifi driver
1086 * @param[in] pstrStaParams Station's parameters
1087 * @return 0 for Success, error otherwise
1090 * @author Adham Abozaeid
1091 * @date 12 July 2012
1092 * @version 1.0 Description
1094 s32
host_int_add_station(WILC_WFIDrvHandle hWFIDrv
, tstrWILC_AddStaParam
*pstrStaParams
);
1097 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1098 * @brief Deauthenticates clients when group is terminating
1100 * @param[in,out] hWFIDrv handle to the wifi driver
1101 * @param[in] pu8MacAddr Station's mac address
1102 * @return 0 for Success, error otherwise
1105 * @author Mai Daftedar
1106 * @date 09 April 2014
1107 * @version 1.0 Description
1109 s32
host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv
, u8 pu8MacAddr
[][ETH_ALEN
]);
1112 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1113 * @brief Notifies the firmware with a new deleted station
1115 * @param[in,out] hWFIDrv handle to the wifi driver
1116 * @param[in] pu8MacAddr Station's mac address
1117 * @return 0 for Success, error otherwise
1120 * @author Adham Abozaeid
1121 * @date 15 July 2012
1122 * @version 1.0 Description
1124 s32
host_int_del_station(WILC_WFIDrvHandle hWFIDrv
, const u8
*pu8MacAddr
);
1127 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1128 * @brief Notifies the firmware with new parameters of an already associated station
1130 * @param[in,out] hWFIDrv handle to the wifi driver
1131 * @param[in] pstrStaParams Station's parameters
1132 * @return 0 for Success, error otherwise
1135 * @author Adham Abozaeid
1136 * @date 15 July 2012
1137 * @version 1.0 Description
1139 s32
host_int_edit_station(WILC_WFIDrvHandle hWFIDrv
, tstrWILC_AddStaParam
*pstrStaParams
);
1142 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1143 * @brief Set the power management mode to enabled or disabled
1145 * @param[in,out] hWFIDrv handle to the wifi driver
1146 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1147 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1148 * the dynamic ps timeout value
1149 * @return 0 for Success, error otherwise
1152 * @author Adham Abozaeid
1153 * @date 24 November 2012
1154 * @version 1.0 Description
1156 s32
host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv
, bool bIsEnabled
, u32 u32Timeout
);
1157 /* @param[in,out] hWFIDrv handle to the wifi driver
1158 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1159 * @param[in] u8count count of mac address entries in the filter table
1161 * @return 0 for Success, error otherwise
1164 * @author Adham Abozaeid
1165 * @date 24 November 2012
1166 * @version 1.0 Description
1168 s32
host_int_setup_multicast_filter(WILC_WFIDrvHandle hWFIDrv
, bool bIsEnabled
, u32 u32count
);
1170 * @brief host_int_setup_ipaddress
1171 * @details set IP address on firmware
1173 * @return Error code.
1174 * @author Abdelrahman Sobhy
1178 s32
host_int_setup_ipaddress(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1182 * @brief host_int_delBASession
1183 * @details Delete single Rx BA session
1185 * @return Error code.
1186 * @author Abdelrahman Sobhy
1190 s32
host_int_delBASession(WILC_WFIDrvHandle hWFIDrv
, char *pBSSID
, char TID
);
1193 * @brief host_int_delBASession
1194 * @details Delete all Rx BA session
1196 * @return Error code.
1197 * @author Abdelrahman Sobhy
1201 s32
host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv
, char *pBSSID
, char TID
);
1205 * @brief host_int_get_ipaddress
1206 * @details get IP address on firmware
1208 * @return Error code.
1209 * @author Abdelrahman Sobhy
1213 s32
host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1217 * @brief host_int_remain_on_channel
1220 * @return Error code.
1225 s32
host_int_remain_on_channel(WILC_WFIDrvHandle hWFIDrv
, u32 u32SessionID
, u32 u32duration
, u16 chan
, tWILCpfRemainOnChanExpired RemainOnChanExpired
, tWILCpfRemainOnChanReady RemainOnChanReady
, void *pvUserArg
);
1228 * @brief host_int_ListenStateExpired
1230 * @param[in] Handle to wifi driver
1231 * Duration to remain on channel
1232 * Channel to remain on
1233 * Pointer to fn to be called on receive frames in listen state
1234 * Pointer to remain-on-channel expired fn
1236 * @return Error code.
1241 s32
host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv
, u32 u32SessionID
);
1244 * @brief host_int_frame_register
1247 * @return Error code.
1252 s32
host_int_frame_register(WILC_WFIDrvHandle hWFIDrv
, u16 u16FrameType
, bool bReg
);
1255 * @brief host_int_set_wfi_drv_handler
1258 * @return Error code.
1263 s32
host_int_set_wfi_drv_handler(u32 u32address
);
1264 s32
host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv
, u32 u32mode
);
1266 static s32
Handle_ScanDone(void *drvHandler
, tenuScanEvent enuEvent
);
1268 static int host_int_addBASession(WILC_WFIDrvHandle hWFIDrv
, char *pBSSID
, char TID
, short int BufferSize
,
1269 short int SessionTimeout
, void *drvHandler
);
1272 void host_int_freeJoinParams(void *pJoinParams
);
1274 s32
host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv
, tstrStatistics
*pstrStatistics
);
1276 /*****************************************************************************/
1280 /*****************************************************************************/