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
60 typedef struct _tstrStatistics
{
65 u32 u32TxFailureCount
;
72 HOST_IF_CONNECTING
= 2,
73 HOST_IF_WAITING_CONN_RESP
= 3,
74 HOST_IF_CONNECTED
= 4,
75 HOST_IF_P2P_LISTEN
= 5,
76 HOST_IF_FORCE_32BIT
= 0xFFFFFFFF
79 struct host_if_pmkid
{
84 struct host_if_pmkid_attr
{
86 struct host_if_pmkid pmkidlist
[WILC_MAX_NUM_PMKIDS
];
105 struct cfg_param_val
{
112 u16 short_retry_limit
;
113 u16 long_retry_limit
;
117 u8 short_slot_allowed
;
118 u8 txop_prot_disabled
;
121 enum SITESURVEY site_survey_enabled
;
122 u16 site_survey_scan_time
;
124 u16 active_scan_time
;
125 u16 passive_scan_time
;
126 enum CURRENT_TXRATE curr_tx_rate
;
131 RETRY_SHORT
= BIT(0),
133 FRAG_THRESHOLD
= BIT(2),
134 RTS_THRESHOLD
= BIT(3),
137 AUTHEN_TIMEOUT
= BIT(6),
138 POWER_MANAGEMENT
= BIT(7),
140 SHORT_SLOT_ALLOWED
= BIT(9),
141 TXOP_PROT_DISABLE
= BIT(10),
142 BEACON_INTERVAL
= BIT(11),
143 DTIM_PERIOD
= BIT(12),
144 SITE_SURVEY
= BIT(13),
145 SITE_SURVEY_SCAN_TIME
= BIT(14),
146 ACTIVE_SCANTIME
= BIT(15),
147 PASSIVE_SCANTIME
= BIT(16),
148 CURRENT_TX_RATE
= BIT(17),
152 struct found_net_info
{
157 typedef enum {SCAN_EVENT_NETWORK_FOUND
= 0,
159 SCAN_EVENT_ABORTED
= 2,
160 SCAN_EVENT_FORCE_32BIT
= 0xFFFFFFFF} tenuScanEvent
;
163 CONN_DISCONN_EVENT_CONN_RESP
= 0,
164 CONN_DISCONN_EVENT_DISCONN_NOTIF
= 1,
165 CONN_DISCONN_EVENT_FORCE_32BIT
= 0xFFFFFFFF
166 } tenuConnDisconnEvent
;
176 /*Scan callBack function definition*/
177 typedef void (*wilc_scan_result
)(tenuScanEvent
, tstrNetworkInfo
*, void *, void *);
179 /*Connect callBack function definition*/
180 typedef void (*wilc_connect_result
)(tenuConnDisconnEvent
,
183 tstrDisconnectNotifInfo
*,
186 typedef void (*wilc_remain_on_chan_expired
)(void *, u32
); /*Remain on channel expiration callback function*/
187 typedef void (*wilc_remain_on_chan_ready
)(void *); /*Remain on channel callback function*/
190 * @struct rcvd_net_info
191 * @brief Structure to hold Received Asynchronous Network info
195 * @author Mostafa Abu Bakr
196 * @date 25 March 2012
199 struct rcvd_net_info
{
204 struct hidden_net_info
{
209 struct hidden_network
{
210 struct hidden_net_info
*pstrHiddenNetworkInfo
;
214 struct user_scan_req
{
215 /* Scan user call back function */
216 wilc_scan_result pfUserScanResult
;
218 /* User specific parameter to be delivered through the Scan User Callback function */
219 void *u32UserScanPvoid
;
222 struct found_net_info astrFoundNetworkInfo
[MAX_NUM_SCANNED_NETWORKS
];
225 struct user_conn_req
{
229 enum AUTHTYPE tenuAuth_type
;
232 size_t ConnReqIEsLen
;
233 /* Connect user call back function */
234 wilc_connect_result pfUserConnectResult
;
236 /* User specific parameter to be delivered through the Connect User Callback function */
237 void *u32UserConnectPvoid
;
248 struct set_mac_addr
{
249 u8 u8MacAddress
[ETH_ALEN
];
252 struct get_mac_addr
{
256 struct ba_session_info
{
257 u8 au8Bssid
[ETH_ALEN
];
260 u16 u16SessionTimeout
;
266 wilc_remain_on_chan_expired pRemainOnChanExpired
;
267 wilc_remain_on_chan_ready pRemainOnChanReady
;
269 u32 u32ListenSessionID
;
280 #define PROBE_REQ 0x40
281 #define PROBE_RESP 0x50
282 #define ACTION_FRM_IDX 0
283 #define PROBE_REQ_IDX 1
286 enum p2p_listen_state
{
293 struct user_scan_req strWILC_UsrScanReq
;
294 struct user_conn_req strWILC_UsrConnReq
;
296 /*Remain on channel struvture*/
297 struct remain_ch strHostIfRemainOnChan
;
298 u8 u8RemainOnChan_pendingreq
;
299 u64 u64P2p_MgmtTimeout
;
302 enum host_if_state enuHostIFstate
;
304 u8 au8AssociatedBSSID
[ETH_ALEN
];
305 struct cfg_param_val strCfgValues
;
307 struct semaphore gtOsCfgValuesSem
;
308 struct semaphore hSemTestKeyBlock
;
310 struct semaphore hSemTestDisconnectBlock
;
311 struct semaphore hSemGetRSSI
;
312 struct semaphore hSemGetLINKSPEED
;
313 struct semaphore hSemGetCHNL
;
314 struct semaphore hSemInactiveTime
;
316 struct timer_list hScanTimer
;
317 struct timer_list hConnectTimer
;
318 struct timer_list hRemainOnChannel
;
324 * @enum tenuWILC_StaFlag
325 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
328 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
329 * @author Enumeraion's creator
331 * @version 1.0 Description
335 WILC_STA_FLAG_INVALID
= 0,
336 WILC_STA_FLAG_AUTHORIZED
, /*!< station is authorized (802.1X)*/
337 WILC_STA_FLAG_SHORT_PREAMBLE
, /*!< station is capable of receiving frames with short barker preamble*/
338 WILC_STA_FLAG_WME
, /*!< station is WME/QoS capable*/
339 WILC_STA_FLAG_MFP
, /*!< station uses management frame protection*/
340 WILC_STA_FLAG_AUTHENTICATED
/*!< station is authenticated*/
343 struct add_sta_param
{
344 u8 au8BSSID
[ETH_ALEN
];
351 u8 au8SuppMCsSet
[16];
353 u32 u32TxBeamformingCap
;
355 u16 u16FlagsMask
; /*<! Determines which of u16FlagsSet were changed>*/
356 u16 u16FlagsSet
; /*<! Decoded according to tenuWILC_StaFlag */
359 /*****************************************************************************/
361 /* Host Interface API */
363 /*****************************************************************************/
366 * @brief removes wpa/wpa2 keys
367 * @details only in BSS STA mode if External Supplicant support is enabled.
368 * removes all WPA/WPA2 station key entries from MAC hardware.
369 * @param[in,out] handle to the wifi driver
370 * @param[in] 6 bytes of Station Adress in the station entry table
371 * @return Error code indicating success/failure
377 s32
host_int_remove_key(struct host_if_drv
*hWFIDrv
, const u8
*pu8StaAddress
);
379 * @brief removes WEP key
380 * @details valid only in BSS STA mode if External Supplicant support is enabled.
381 * remove a WEP key entry from MAC HW.
382 * The BSS Station automatically finds the index of the entry using its
383 * BSS ID and removes that entry from the MAC hardware.
384 * @param[in,out] handle to the wifi driver
385 * @param[in] 6 bytes of Station Adress in the station entry table
386 * @return Error code indicating success/failure
387 * @note NO need for the STA add since it is not used for processing
392 int host_int_remove_wep_key(struct host_if_drv
*wfi_drv
, u8 index
);
394 * @brief sets WEP deafault key
395 * @details Sets the index of the WEP encryption key in use,
397 * @param[in,out] handle to the wifi driver
398 * @param[in] key index ( 0, 1, 2, 3)
399 * @return Error code indicating success/failure
405 s32
host_int_set_WEPDefaultKeyID(struct host_if_drv
*hWFIDrv
, u8 u8Index
);
408 * @brief sets WEP deafault key
409 * @details valid only in BSS STA mode if External Supplicant support is enabled.
410 * sets WEP key entry into MAC hardware when it receives the
411 * corresponding request from NDIS.
412 * @param[in,out] handle to the wifi driver
413 * @param[in] message containing WEP Key in the following format
414 *|---------------------------------------|
415 *|Key ID Value | Key Length | Key |
416 *|-------------|------------|------------|
417 | 1byte | 1byte | Key Length |
418 ||---------------------------------------|
420 * @return Error code indicating success/failure
426 s32
host_int_add_wep_key_bss_sta(struct host_if_drv
*hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
);
428 * @brief host_int_add_wep_key_bss_ap
429 * @details valid only in AP mode if External Supplicant support is enabled.
430 * sets WEP key entry into MAC hardware when it receives the
431 * corresponding request from NDIS.
432 * @param[in,out] handle to the wifi driver
435 * @return Error code indicating success/failure
441 s32
host_int_add_wep_key_bss_ap(struct host_if_drv
*hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
, u8 u8mode
, enum AUTHTYPE tenuAuth_type
);
444 * @brief adds ptk Key
446 * @param[in,out] handle to the wifi driver
447 * @param[in] message containing PTK Key in the following format
448 *|-------------------------------------------------------------------------|
449 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
450 *|-----------|------------|---------------|----------------|---------------|
451 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
452 ||-------------------------------------------------------------------------|
453 * @return Error code indicating success/failure
459 s32
host_int_add_ptk(struct host_if_drv
*hWFIDrv
, const u8
*pu8Ptk
, u8 u8PtkKeylen
,
460 const u8
*mac_addr
, const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
, u8 u8Idx
);
463 * @brief host_int_get_inactive_time
465 * @param[in,out] handle to the wifi driver
466 * @param[in] message containing inactive time
468 * @return Error code indicating success/failure
471 * @date 15 April 2013
474 s32
host_int_get_inactive_time(struct host_if_drv
*hWFIDrv
, const u8
*mac
, u32
*pu32InactiveTime
);
477 * @brief adds Rx GTk Key
479 * @param[in,out] handle to the wifi driver
480 * @param[in] message containing Rx GTK Key in the following format
481 *|----------------------------------------------------------------------------|
482 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
483 *|------------|---------|-------|------------|---------------|----------------|
484 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
485 ||----------------------------------------------------------------------------|
486 * @return Error code indicating success/failure
492 s32
host_int_add_rx_gtk(struct host_if_drv
*hWFIDrv
, const u8
*pu8RxGtk
, u8 u8GtkKeylen
,
493 u8 u8KeyIdx
, u32 u32KeyRSClen
, const u8
*KeyRSC
,
494 const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
);
498 * @brief adds Tx GTk Key
500 * @param[in,out] handle to the wifi driver
501 * @param[in] message containing Tx GTK Key in the following format
502 *|----------------------------------------------------|
503 | KeyID | Key Length | Temporal Key | Tx Michael Key |
504 ||-------|------------|--------------|----------------|
505 ||1 byte | 1 byte | 16 bytes | 8 bytes |
506 ||----------------------------------------------------|
507 * @return Error code indicating success/failure
513 s32
host_int_add_tx_gtk(struct host_if_drv
*hWFIDrv
, u8 u8KeyLen
, u8
*pu8TxGtk
, u8 u8KeyIdx
);
516 * @brief caches the pmkid
517 * @details valid only in BSS STA mode if External Supplicant
518 * support is enabled. This Function sets the PMKID in firmware
519 * when host drivr receives the corresponding request from NDIS.
520 * The firmware then includes theset PMKID in the appropriate
522 * @param[in,out] handle to the wifi driver
523 * @param[in] message containing PMKID Info in the following format
524 *|-----------------------------------------------------------------|
525 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
526 *|-----------|------------|----------|-------|----------|----------|
527 | 1 | 6 | 16 | ... | 6 | 16 |
528 ||-----------------------------------------------------------------|
529 * @return Error code indicating success/failure
536 s32
host_int_set_pmkid_info(struct host_if_drv
*hWFIDrv
, struct host_if_pmkid_attr
*pu8PmkidInfoArray
);
538 * @brief gets the cached the pmkid info
539 * @details valid only in BSS STA mode if External Supplicant
540 * support is enabled. This Function sets the PMKID in firmware
541 * when host drivr receives the corresponding request from NDIS.
542 * The firmware then includes theset PMKID in the appropriate
544 * @param[in,out] handle to the wifi driver,
546 * message containing PMKID Info in the following format
547 *|-----------------------------------------------------------------|
548 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
549 *|-----------|------------|----------|-------|----------|----------|
550 | 1 | 6 | 16 | ... | 6 | 16 |
551 ||-----------------------------------------------------------------|
553 * @return Error code indicating success/failure
560 s32
host_int_get_pmkid_info(struct host_if_drv
*hWFIDrv
, u8
*pu8PmkidInfoArray
,
561 u32 u32PmkidInfoLen
);
564 * @brief sets the pass phrase
565 * @details AP/STA mode. This function gives the pass phrase used to
566 * generate the Pre-Shared Key when WPA/WPA2 is enabled
567 * The length of the field can vary from 8 to 64 bytes,
568 * the lower layer should get the
569 * @param[in,out] handle to the wifi driver,
570 * @param[in] String containing PSK
571 * @return Error code indicating success/failure
577 s32
host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv
*hWFIDrv
, u8
*pu8PassPhrase
,
580 * @brief gets the pass phrase
581 * @details AP/STA mode. This function gets the pass phrase used to
582 * generate the Pre-Shared Key when WPA/WPA2 is enabled
583 * The length of the field can vary from 8 to 64 bytes,
584 * the lower layer should get the
585 * @param[in,out] handle to the wifi driver,
586 * String containing PSK
587 * @return Error code indicating success/failure
593 s32
host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv
*hWFIDrv
,
594 u8
*pu8PassPhrase
, u8 u8Psklength
);
597 * @brief gets mac address
599 * @param[in,out] handle to the wifi driver,
601 * @return Error code indicating success/failure
604 * @date 19 April 2012
607 s32
host_int_get_MacAddress(struct host_if_drv
*hWFIDrv
, u8
*pu8MacAddress
);
610 * @brief sets mac address
612 * @param[in,out] handle to the wifi driver,
614 * @return Error code indicating success/failure
620 s32
host_int_set_MacAddress(struct host_if_drv
*hWFIDrv
, u8
*pu8MacAddress
);
623 * @brief wait until msg q is empty
627 * @return Error code indicating success/failure
630 * @date 19 march 2014
633 int host_int_wait_msg_queue_idle(void);
636 * @brief sets a start scan request
638 * @param[in,out] handle to the wifi driver,
639 * @param[in] Scan Source one of the following values
642 * OBSS_PERIODIC_SCAN BIT1
643 * OBSS_ONETIME_SCAN BIT2
644 * @return Error code indicating success/failure
651 s32
host_int_set_start_scan_req(struct host_if_drv
*hWFIDrv
, u8 scanSource
);
653 * @brief gets scan source of the last scan
655 * @param[in,out] handle to the wifi driver,
656 * Scan Source one of the following values
659 * OBSS_PERIODIC_SCAN BIT1
660 * OBSS_ONETIME_SCAN BIT2
661 * @return Error code indicating success/failure
667 s32
host_int_get_start_scan_req(struct host_if_drv
*hWFIDrv
, u8
*pu8ScanSource
);
670 * @brief sets a join request
672 * @param[in,out] handle to the wifi driver,
673 * @param[in] Index of the bss descriptor
674 * @return Error code indicating success/failure
681 s32
host_int_set_join_req(struct host_if_drv
*hWFIDrv
, u8
*pu8bssid
,
682 const u8
*pu8ssid
, size_t ssidLen
,
683 const u8
*pu8IEs
, size_t IEsLen
,
684 wilc_connect_result pfConnectResult
, void *pvUserArg
,
685 u8 u8security
, enum AUTHTYPE tenuAuth_type
,
690 * @brief Flush a join request parameters to FW, but actual connection
691 * @details The function is called in situation where WILC is connected to AP and
692 * required to switch to hybrid FW for P2P connection
693 * @param[in] handle to the wifi driver,
694 * @return Error code indicating success/failure
696 * @author Amr Abdel-Moghny
701 s32
host_int_flush_join_req(struct host_if_drv
*hWFIDrv
);
705 * @brief disconnects from the currently associated network
707 * @param[in,out] handle to the wifi driver,
708 * @param[in] Reason Code of the Disconnection
709 * @return Error code indicating success/failure
715 s32
host_int_disconnect(struct host_if_drv
*hWFIDrv
, u16 u16ReasonCode
);
718 * @brief disconnects a sta
720 * @param[in,out] handle to the wifi driver,
721 * @param[in] Association Id of the station to be disconnected
722 * @return Error code indicating success/failure
728 s32
host_int_disconnect_station(struct host_if_drv
*hWFIDrv
, u8 assoc_id
);
730 * @brief gets a Association request info
732 * @param[in,out] handle to the wifi driver,
733 * Message containg assoc. req info in the following format
734 * ------------------------------------------------------------------------
735 | Management Frame Format |
736 ||-------------------------------------------------------------------|
737 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
738 ||-------------|--------|--|--|-----|----------------|----------|----|
739 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
740 ||-------------------------------------------------------------------|
742 | Association Request Frame - Frame Body |
743 ||-------------------------------------------------------------------|
744 | Capability Information | Listen Interval | SSID | Supported Rates |
745 ||------------------------|-----------------|------|-----------------|
746 | 2 | 2 | 2-34 | 3-10 |
747 | ---------------------------------------------------------------------
748 * @return Error code indicating success/failure
755 s32
host_int_get_assoc_req_info(struct host_if_drv
*hWFIDrv
, u8
*pu8AssocReqInfo
,
756 u32 u32AssocReqInfoLen
);
758 * @brief gets a Association Response info
760 * @param[in,out] handle to the wifi driver,
761 * Message containg assoc. resp info
762 * @return Error code indicating success/failure
769 s32
host_int_get_assoc_res_info(struct host_if_drv
*hWFIDrv
, u8
*pu8AssocRespInfo
,
770 u32 u32MaxAssocRespInfoLen
, u32
*pu32RcvdAssocRespInfoLen
);
772 * @brief gets a Association Response info
773 * @details Valid only in STA mode. This function gives the RSSI
774 * values observed in all the channels at the time of scanning.
775 * The length of the field is 1 greater that the total number of
776 * channels supported. Byte 0 contains the number of channels while
777 * each of Byte N contains the observed RSSI value for the channel index N.
778 * @param[in,out] handle to the wifi driver,
779 * array of scanned channels' RSSI
780 * @return Error code indicating success/failure
786 s32
host_int_get_rx_power_level(struct host_if_drv
*hWFIDrv
, u8
*pu8RxPowerLevel
,
787 u32 u32RxPowerLevelLen
);
790 * @brief sets a channel
792 * @param[in,out] handle to the wifi driver,
793 * @param[in] Index of the channel to be set
794 *|-------------------------------------------------------------------|
795 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
797 ||-------------------------------------------------------------------|
798 * @return Error code indicating success/failure
804 int host_int_set_mac_chnl_num(struct host_if_drv
*wfi_drv
, u8 channel
);
807 * @brief gets the current channel index
809 * @param[in,out] handle to the wifi driver,
810 * current channel index
811 *|-----------------------------------------------------------------------|
812 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
814 ||-----------------------------------------------------------------------|
815 * @return Error code indicating success/failure
821 s32
host_int_get_host_chnl_num(struct host_if_drv
*hWFIDrv
, u8
*pu8ChNo
);
823 * @brief gets the sta rssi
824 * @details gets the currently maintained RSSI value for the station.
825 * The received signal strength value in dB.
826 * The range of valid values is -128 to 0.
827 * @param[in,out] handle to the wifi driver,
829 * @return Error code indicating success/failure
835 s32
host_int_get_rssi(struct host_if_drv
*hWFIDrv
, s8
*ps8Rssi
);
836 s32
host_int_get_link_speed(struct host_if_drv
*hWFIDrv
, s8
*ps8lnkspd
);
838 * @brief scans a set of channels
840 * @param[in,out] handle to the wifi driver,
841 * @param[in] Scan source
842 * Scan Type PASSIVE_SCAN = 0,
845 * Channels Array length
846 * Scan Callback function
847 * User Argument to be delivered back through the Scan Cllback function
848 * @return Error code indicating success/failure
854 s32
host_int_scan(struct host_if_drv
*hWFIDrv
, u8 u8ScanSource
,
855 u8 u8ScanType
, u8
*pu8ChnlFreqList
,
856 u8 u8ChnlListLen
, const u8
*pu8IEs
,
857 size_t IEsLen
, wilc_scan_result ScanResult
,
859 struct hidden_network
*pstrHiddenNetwork
);
861 * @brief sets configuration wids values
863 * @param[in,out] handle to the wifi driver,
864 * @param[in] WID, WID value
865 * @return Error code indicating success/failure
871 s32
hif_set_cfg(struct host_if_drv
*hWFIDrv
, struct cfg_param_val
*pstrCfgParamVal
);
874 * @brief gets configuration wids values
876 * @param[in,out] handle to the wifi driver,
879 * @return Error code indicating success/failure
885 s32
hif_get_cfg(struct host_if_drv
*hWFIDrv
, u16 u16WID
, u16
*pu16WID_Value
);
886 /*****************************************************************************/
887 /* Notification Functions */
888 /*****************************************************************************/
890 * @brief notifies host with join and leave requests
891 * @details This function prepares an Information frame having the
892 * information about a joining/leaving station.
893 * @param[in,out] handle to the wifi driver,
894 * @param[in] 6 byte Sta Adress
895 * Join or leave flag:
898 * @return Error code indicating success/failure
904 void host_int_send_join_leave_info_to_host
905 (u16 assocId
, u8
*stationAddr
, bool joining
);
908 * @brief notifies host with stations found in scan
909 * @details sends the beacon/probe response from scan
910 * @param[in,out] handle to the wifi driver,
911 * @param[in] Sta Address,
913 * Rssi of the Station found
914 * @return Error code indicating success/failure
920 void host_int_send_network_info_to_host
921 (u8
*macStartAddress
, u16 u16RxFrameLen
, s8 s8Rssi
);
924 * @brief host interface initialization function
926 * @param[in,out] handle to the wifi driver,
932 s32
host_int_init(struct host_if_drv
**phWFIDrv
);
935 * @brief host interface initialization function
937 * @param[in,out] handle to the wifi driver,
943 s32
host_int_deinit(struct host_if_drv
*hWFIDrv
);
947 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
948 * @brief Sends a beacon to the firmware to be transmitted over the air
950 * @param[in,out] hWFIDrv handle to the wifi driver
951 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
952 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
953 * (including the current frame) appear before the next DTIM
954 * @param[in] u32Headlen Length of the head buffer in bytes
955 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
956 * is the part from the beacon's start till the TIM element, NOT including the TIM
957 * @param[in] u32Taillen Length of the tail buffer in bytes
958 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
959 * starts just after the TIM inormation element
960 * @return 0 for Success, error otherwise
963 * @author Adham Abozaeid
964 * @date 10 Julys 2012
965 * @version 1.0 Description
968 s32
host_int_add_beacon(struct host_if_drv
*hWFIDrv
, u32 u32Interval
,
970 u32 u32HeadLen
, u8
*pu8Head
,
971 u32 u32TailLen
, u8
*pu8tail
);
975 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
976 * @brief Removes the beacon and stops trawilctting it over the air
978 * @param[in,out] hWFIDrv handle to the wifi driver
979 * @return 0 for Success, error otherwise
982 * @author Adham Abozaeid
983 * @date 10 Julys 2012
984 * @version 1.0 Description
986 s32
host_int_del_beacon(struct host_if_drv
*hWFIDrv
);
989 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv,
990 * struct add_sta_param *pstrStaParams)
991 * @brief Notifies the firmware with a new associated stations
993 * @param[in,out] hWFIDrv handle to the wifi driver
994 * @param[in] pstrStaParams Station's parameters
995 * @return 0 for Success, error otherwise
998 * @author Adham Abozaeid
1000 * @version 1.0 Description
1002 s32
host_int_add_station(struct host_if_drv
*hWFIDrv
,
1003 struct add_sta_param
*pstrStaParams
);
1006 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1007 * @brief Deauthenticates clients when group is terminating
1009 * @param[in,out] hWFIDrv handle to the wifi driver
1010 * @param[in] pu8MacAddr Station's mac address
1011 * @return 0 for Success, error otherwise
1014 * @author Mai Daftedar
1015 * @date 09 April 2014
1016 * @version 1.0 Description
1018 s32
host_int_del_allstation(struct host_if_drv
*hWFIDrv
, u8 pu8MacAddr
[][ETH_ALEN
]);
1021 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1022 * @brief Notifies the firmware with a new deleted station
1024 * @param[in,out] hWFIDrv handle to the wifi driver
1025 * @param[in] pu8MacAddr Station's mac address
1026 * @return 0 for Success, error otherwise
1029 * @author Adham Abozaeid
1030 * @date 15 July 2012
1031 * @version 1.0 Description
1033 s32
host_int_del_station(struct host_if_drv
*hWFIDrv
, const u8
*pu8MacAddr
);
1036 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv,
1037 * struct add_sta_param *pstrStaParams)
1038 * @brief Notifies the firmware with new parameters of an already associated station
1040 * @param[in,out] hWFIDrv handle to the wifi driver
1041 * @param[in] pstrStaParams Station's parameters
1042 * @return 0 for Success, error otherwise
1045 * @author Adham Abozaeid
1046 * @date 15 July 2012
1047 * @version 1.0 Description
1049 s32
host_int_edit_station(struct host_if_drv
*hWFIDrv
,
1050 struct add_sta_param
*pstrStaParams
);
1053 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1054 * @brief Set the power management mode to enabled or disabled
1056 * @param[in,out] hWFIDrv handle to the wifi driver
1057 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1058 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1059 * the dynamic ps timeout value
1060 * @return 0 for Success, error otherwise
1063 * @author Adham Abozaeid
1064 * @date 24 November 2012
1065 * @version 1.0 Description
1067 s32
host_int_set_power_mgmt(struct host_if_drv
*hWFIDrv
, bool bIsEnabled
, u32 u32Timeout
);
1068 /* @param[in,out] hWFIDrv handle to the wifi driver
1069 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1070 * @param[in] u8count count of mac address entries in the filter table
1072 * @return 0 for Success, error otherwise
1075 * @author Adham Abozaeid
1076 * @date 24 November 2012
1077 * @version 1.0 Description
1079 s32
host_int_setup_multicast_filter(struct host_if_drv
*hWFIDrv
, bool bIsEnabled
, u32 u32count
);
1081 * @brief host_int_setup_ipaddress
1082 * @details set IP address on firmware
1084 * @return Error code.
1085 * @author Abdelrahman Sobhy
1089 s32
host_int_setup_ipaddress(struct host_if_drv
*hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1093 * @brief host_int_delBASession
1094 * @details Delete single Rx BA session
1096 * @return Error code.
1097 * @author Abdelrahman Sobhy
1101 s32
host_int_delBASession(struct host_if_drv
*hWFIDrv
, char *pBSSID
, char TID
);
1104 * @brief host_int_delBASession
1105 * @details Delete all Rx BA session
1107 * @return Error code.
1108 * @author Abdelrahman Sobhy
1112 s32
host_int_del_All_Rx_BASession(struct host_if_drv
*hWFIDrv
, char *pBSSID
, char TID
);
1116 * @brief host_int_get_ipaddress
1117 * @details get IP address on firmware
1119 * @return Error code.
1120 * @author Abdelrahman Sobhy
1124 s32
host_int_get_ipaddress(struct host_if_drv
*hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1127 * @brief host_int_remain_on_channel
1130 * @return Error code.
1135 s32
host_int_remain_on_channel(struct host_if_drv
*hWFIDrv
, u32 u32SessionID
, u32 u32duration
, u16 chan
, wilc_remain_on_chan_expired RemainOnChanExpired
, wilc_remain_on_chan_ready RemainOnChanReady
, void *pvUserArg
);
1138 * @brief host_int_ListenStateExpired
1140 * @param[in] Handle to wifi driver
1141 * Duration to remain on channel
1142 * Channel to remain on
1143 * Pointer to fn to be called on receive frames in listen state
1144 * Pointer to remain-on-channel expired fn
1146 * @return Error code.
1151 s32
host_int_ListenStateExpired(struct host_if_drv
*hWFIDrv
, u32 u32SessionID
);
1154 * @brief host_int_frame_register
1157 * @return Error code.
1162 s32
host_int_frame_register(struct host_if_drv
*hWFIDrv
, u16 u16FrameType
, bool bReg
);
1164 * @brief host_int_set_wfi_drv_handler
1167 * @return Error code.
1172 int host_int_set_wfi_drv_handler(struct host_if_drv
*address
);
1173 int host_int_set_operation_mode(struct host_if_drv
*wfi_drv
, u32 mode
);
1175 static s32
Handle_ScanDone(struct host_if_drv
*drvHandler
, tenuScanEvent enuEvent
);
1177 void host_int_freeJoinParams(void *pJoinParams
);
1179 s32
host_int_get_statistics(struct host_if_drv
*hWFIDrv
, tstrStatistics
*pstrStatistics
);