2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
14 /*****************************************************************************/
16 /*****************************************************************************/
20 #define IDLE_MODE 0x00
22 #define STATION_MODE 0x02
24 #define CLIENT_MODE 0x04
28 #define ACTIVE_SCAN_TIME 10
29 #define PASSIVE_SCAN_TIME 1200
30 #define MIN_SCAN_TIME 10
31 #define MAX_SCAN_TIME 1200
32 #define DEFAULT_SCAN 0
33 #define USER_SCAN BIT(0)
34 #define OBSS_PERIODIC_SCAN BIT(1)
35 #define OBSS_ONETIME_SCAN BIT(2)
36 #define GTK_RX_KEY_BUFF_LEN 24
39 #define DEFAULTKEY 0x4
41 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
42 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
43 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
44 #define CHANNEL_SCAN_TIME 250 /* 250 */
46 #define TX_MIC_KEY_LEN 8
47 #define RX_MIC_KEY_LEN 8
48 #define PTK_KEY_LEN 16
50 #define TX_MIC_KEY_MSG_LEN 26
51 #define RX_MIC_KEY_MSG_LEN 48
52 #define PTK_KEY_MSG_LEN 39
54 #define PMKSA_KEY_LEN 22
57 #define WILC_MAX_NUM_PMKIDS 16
58 #define WILC_SUPP_MCS_SET_SIZE 16
59 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
60 #define SCAN_EVENT_DONE_ABORTED
61 #define NUM_CONCURRENT_IFC 2
69 typedef struct _tstrStatistics
{
74 u32 u32TxFailureCount
;
82 HOST_IF_CONNECTING
= 2,
83 HOST_IF_WAITING_CONN_RESP
= 3,
84 HOST_IF_CONNECTED
= 4,
85 HOST_IF_P2P_LISTEN
= 5,
86 HOST_IF_FORCE_32BIT
= 0xFFFFFFFF
89 typedef struct _tstrHostIFpmkid
{
94 typedef struct _tstrHostIFpmkidAttr
{
96 tstrHostIFpmkid pmkidlist
[WILC_MAX_NUM_PMKIDS
];
97 } tstrHostIFpmkidAttr
;
122 u16 short_retry_limit
;
123 u16 long_retry_limit
;
127 u8 short_slot_allowed
;
128 u8 txop_prot_disabled
;
131 SITE_SURVEY_T site_survey_enabled
;
132 u16 site_survey_scan_time
;
134 u16 active_scan_time
;
135 u16 passive_scan_time
;
136 CURRENT_TX_RATE_T curr_tx_rate
;
141 RETRY_SHORT
= 1 << 0,
143 FRAG_THRESHOLD
= 1 << 2,
144 RTS_THRESHOLD
= 1 << 3,
147 AUTHEN_TIMEOUT
= 1 << 6,
148 POWER_MANAGEMENT
= 1 << 7,
150 SHORT_SLOT_ALLOWED
= 1 << 9,
151 TXOP_PROT_DISABLE
= 1 << 10,
152 BEACON_INTERVAL
= 1 << 11,
153 DTIM_PERIOD
= 1 << 12,
154 SITE_SURVEY
= 1 << 13,
155 SITE_SURVEY_SCAN_TIME
= 1 << 14,
156 ACTIVE_SCANTIME
= 1 << 15,
157 PASSIVE_SCANTIME
= 1 << 16,
158 CURRENT_TX_RATE
= 1 << 17,
165 } tstrFoundNetworkInfo
;
167 typedef enum {SCAN_EVENT_NETWORK_FOUND
= 0,
169 SCAN_EVENT_ABORTED
= 2,
170 SCAN_EVENT_FORCE_32BIT
= 0xFFFFFFFF} tenuScanEvent
;
173 CONN_DISCONN_EVENT_CONN_RESP
= 0,
174 CONN_DISCONN_EVENT_DISCONN_NOTIF
= 1,
175 CONN_DISCONN_EVENT_FORCE_32BIT
= 0xFFFFFFFF
176 } tenuConnDisconnEvent
;
186 /*Scan callBack function definition*/
187 typedef void (*tWILCpfScanResult
)(tenuScanEvent
, tstrNetworkInfo
*, void *, void *);
189 /*Connect callBack function definition*/
190 typedef void (*tWILCpfConnectResult
)(tenuConnDisconnEvent
,
193 tstrDisconnectNotifInfo
*,
197 typedef void (*tWILCpfRemainOnChanExpired
)(void *, u32
); /*Remain on channel expiration callback function*/
198 typedef void (*tWILCpfRemainOnChanReady
)(void *); /*Remain on channel callback function*/
201 /* typedef u32 WILC_WFIDrvHandle; */
204 } *WILC_WFIDrvHandle
;
207 * @struct tstrRcvdNetworkInfo
208 * @brief Structure to hold Received Asynchronous Network info
212 * @author Mostafa Abu Bakr
213 * @date 25 March 2012
216 typedef struct _tstrRcvdNetworkInfo
{
219 } tstrRcvdNetworkInfo
;
222 typedef struct _tstrHiddenNetworkInfo
{
226 } tstrHiddenNetworkInfo
;
228 typedef struct _tstrHiddenNetwork
{
230 tstrHiddenNetworkInfo
*pstrHiddenNetworkInfo
;
236 /* Scan user call back function */
237 tWILCpfScanResult pfUserScanResult
;
239 /* User specific parameter to be delivered through the Scan User Callback function */
240 void *u32UserScanPvoid
;
243 tstrFoundNetworkInfo astrFoundNetworkInfo
[MAX_NUM_SCANNED_NETWORKS
];
244 } tstrWILC_UsrScanReq
;
250 AUTHTYPE_T tenuAuth_type
;
253 size_t ConnReqIEsLen
;
254 /* Connect user call back function */
255 tWILCpfConnectResult pfUserConnectResult
;
257 /* User specific parameter to be delivered through the Connect User Callback function */
258 void *u32UserConnectPvoid
;
259 } tstrWILC_UsrConnReq
;
263 } tstrHostIfSetDrvHandler
;
267 } tstrHostIfSetOperationMode
;
271 u8 u8MacAddress
[ETH_ALEN
];
272 } tstrHostIfSetMacAddress
;
277 } tstrHostIfGetMacAddress
;
281 u8 au8Bssid
[ETH_ALEN
];
284 u16 u16SessionTimeout
;
285 } tstrHostIfBASessionInfo
;
291 tWILCpfRemainOnChanExpired pRemainOnChanExpired
;
292 tWILCpfRemainOnChanReady pRemainOnChanReady
;
294 u32 u32ListenSessionID
;
295 } tstrHostIfRemainOnChan
;
304 } tstrHostIfRegisterFrame
;
308 #define PROBE_REQ 0x40
309 #define PROBE_RESP 0x50
310 #define ACTION_FRM_IDX 0
311 #define PROBE_REQ_IDX 1
314 enum p2p_listen_state
{
322 /* Scan user structure */
323 tstrWILC_UsrScanReq strWILC_UsrScanReq
;
325 /* Connect User structure */
326 tstrWILC_UsrConnReq strWILC_UsrConnReq
;
329 /*Remain on channel struvture*/
330 tstrHostIfRemainOnChan strHostIfRemainOnChan
;
331 u8 u8RemainOnChan_pendingreq
;
332 u64 u64P2p_MgmtTimeout
;
336 tenuHostIFstate enuHostIFstate
;
338 #ifndef CONNECT_DIRECT
339 u32 u32SurveyResultsCount
;
340 wid_site_survey_reslts_s astrSurveyResults
[MAX_NUM_SCANNED_NETWORKS
];
343 u8 au8AssociatedBSSID
[ETH_ALEN
];
344 tstrCfgParamVal strCfgValues
;
346 struct semaphore gtOsCfgValuesSem
;
347 struct semaphore hSemTestKeyBlock
;
349 struct semaphore hSemTestDisconnectBlock
;
350 struct semaphore hSemGetRSSI
;
351 struct semaphore hSemGetLINKSPEED
;
352 struct semaphore hSemGetCHNL
;
353 struct semaphore hSemInactiveTime
;
355 struct timer_list hScanTimer
;
356 struct timer_list hConnectTimer
;
358 struct timer_list hRemainOnChannel
;
365 * @enum tenuWILC_StaFlag
366 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
369 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
370 * @author Enumeraion's creator
372 * @version 1.0 Description
376 WILC_STA_FLAG_INVALID
= 0,
377 WILC_STA_FLAG_AUTHORIZED
, /*!< station is authorized (802.1X)*/
378 WILC_STA_FLAG_SHORT_PREAMBLE
, /*!< station is capable of receiving frames with short barker preamble*/
379 WILC_STA_FLAG_WME
, /*!< station is WME/QoS capable*/
380 WILC_STA_FLAG_MFP
, /*!< station uses management frame protection*/
381 WILC_STA_FLAG_AUTHENTICATED
/*!< station is authenticated*/
385 u8 au8BSSID
[ETH_ALEN
];
392 u8 au8SuppMCsSet
[16];
394 u32 u32TxBeamformingCap
;
396 u16 u16FlagsMask
; /*<! Determines which of u16FlagsSet were changed>*/
397 u16 u16FlagsSet
; /*<! Decoded according to tenuWILC_StaFlag */
398 } tstrWILC_AddStaParam
;
400 /*****************************************************************************/
402 /* Host Interface API */
404 /*****************************************************************************/
407 * @brief removes wpa/wpa2 keys
408 * @details only in BSS STA mode if External Supplicant support is enabled.
409 * removes all WPA/WPA2 station key entries from MAC hardware.
410 * @param[in,out] handle to the wifi driver
411 * @param[in] 6 bytes of Station Adress in the station entry table
412 * @return Error code indicating success/failure
418 s32
host_int_remove_key(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8StaAddress
);
420 * @brief removes WEP key
421 * @details valid only in BSS STA mode if External Supplicant support is enabled.
422 * remove a WEP key entry from MAC HW.
423 * The BSS Station automatically finds the index of the entry using its
424 * BSS ID and removes that entry from the MAC hardware.
425 * @param[in,out] handle to the wifi driver
426 * @param[in] 6 bytes of Station Adress in the station entry table
427 * @return Error code indicating success/failure
428 * @note NO need for the STA add since it is not used for processing
433 s32
host_int_remove_wep_key(tstrWILC_WFIDrv
*hWFIDrv
, u8 u8Index
);
435 * @brief sets WEP deafault key
436 * @details Sets the index of the WEP encryption key in use,
438 * @param[in,out] handle to the wifi driver
439 * @param[in] key index ( 0, 1, 2, 3)
440 * @return Error code indicating success/failure
446 s32
host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv
*hWFIDrv
, u8 u8Index
);
449 * @brief sets WEP deafault key
450 * @details valid only in BSS STA mode if External Supplicant support is enabled.
451 * sets WEP key entry into MAC hardware when it receives the
452 * corresponding request from NDIS.
453 * @param[in,out] handle to the wifi driver
454 * @param[in] message containing WEP Key in the following format
455 *|---------------------------------------|
456 *|Key ID Value | Key Length | Key |
457 *|-------------|------------|------------|
458 | 1byte | 1byte | Key Length |
459 ||---------------------------------------|
461 * @return Error code indicating success/failure
467 s32
host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
);
469 * @brief host_int_add_wep_key_bss_ap
470 * @details valid only in AP mode if External Supplicant support is enabled.
471 * sets WEP key entry into MAC hardware when it receives the
472 * corresponding request from NDIS.
473 * @param[in,out] handle to the wifi driver
476 * @return Error code indicating success/failure
482 s32
host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8WepKey
, u8 u8WepKeylen
, u8 u8Keyidx
, u8 u8mode
, AUTHTYPE_T tenuAuth_type
);
485 * @brief adds ptk Key
487 * @param[in,out] handle to the wifi driver
488 * @param[in] message containing PTK Key in the following format
489 *|-------------------------------------------------------------------------|
490 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
491 *|-----------|------------|---------------|----------------|---------------|
492 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
493 ||-------------------------------------------------------------------------|
494 * @return Error code indicating success/failure
500 s32
host_int_add_ptk(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8Ptk
, u8 u8PtkKeylen
,
501 const u8
*mac_addr
, const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
, u8 u8Idx
);
504 * @brief host_int_get_inactive_time
506 * @param[in,out] handle to the wifi driver
507 * @param[in] message containing inactive time
509 * @return Error code indicating success/failure
512 * @date 15 April 2013
515 s32
host_int_get_inactive_time(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*mac
, u32
*pu32InactiveTime
);
518 * @brief adds Rx GTk Key
520 * @param[in,out] handle to the wifi driver
521 * @param[in] message containing Rx GTK Key in the following format
522 *|----------------------------------------------------------------------------|
523 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
524 *|------------|---------|-------|------------|---------------|----------------|
525 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
526 ||----------------------------------------------------------------------------|
527 * @return Error code indicating success/failure
533 s32
host_int_add_rx_gtk(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8RxGtk
, u8 u8GtkKeylen
,
534 u8 u8KeyIdx
, u32 u32KeyRSClen
, const u8
*KeyRSC
,
535 const u8
*pu8RxMic
, const u8
*pu8TxMic
, u8 mode
, u8 u8Ciphermode
);
539 * @brief adds Tx GTk Key
541 * @param[in,out] handle to the wifi driver
542 * @param[in] message containing Tx GTK Key in the following format
543 *|----------------------------------------------------|
544 | KeyID | Key Length | Temporal Key | Tx Michael Key |
545 ||-------|------------|--------------|----------------|
546 ||1 byte | 1 byte | 16 bytes | 8 bytes |
547 ||----------------------------------------------------|
548 * @return Error code indicating success/failure
554 s32
host_int_add_tx_gtk(tstrWILC_WFIDrv
*hWFIDrv
, u8 u8KeyLen
, u8
*pu8TxGtk
, u8 u8KeyIdx
);
557 * @brief caches the pmkid
558 * @details valid only in BSS STA mode if External Supplicant
559 * support is enabled. This Function sets the PMKID in firmware
560 * when host drivr receives the corresponding request from NDIS.
561 * The firmware then includes theset PMKID in the appropriate
563 * @param[in,out] handle to the wifi driver
564 * @param[in] message containing PMKID Info in the following format
565 *|-----------------------------------------------------------------|
566 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
567 *|-----------|------------|----------|-------|----------|----------|
568 | 1 | 6 | 16 | ... | 6 | 16 |
569 ||-----------------------------------------------------------------|
570 * @return Error code indicating success/failure
577 s32
host_int_set_pmkid_info(tstrWILC_WFIDrv
*hWFIDrv
, tstrHostIFpmkidAttr
*pu8PmkidInfoArray
);
579 * @brief gets the cached the pmkid info
580 * @details valid only in BSS STA mode if External Supplicant
581 * support is enabled. This Function sets the PMKID in firmware
582 * when host drivr receives the corresponding request from NDIS.
583 * The firmware then includes theset PMKID in the appropriate
585 * @param[in,out] handle to the wifi driver,
587 * message containing PMKID Info in the following format
588 *|-----------------------------------------------------------------|
589 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
590 *|-----------|------------|----------|-------|----------|----------|
591 | 1 | 6 | 16 | ... | 6 | 16 |
592 ||-----------------------------------------------------------------|
594 * @return Error code indicating success/failure
601 s32
host_int_get_pmkid_info(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8PmkidInfoArray
,
602 u32 u32PmkidInfoLen
);
605 * @brief sets the pass phrase
606 * @details AP/STA mode. This function gives the pass phrase used to
607 * generate the Pre-Shared Key when WPA/WPA2 is enabled
608 * The length of the field can vary from 8 to 64 bytes,
609 * the lower layer should get the
610 * @param[in,out] handle to the wifi driver,
611 * @param[in] String containing PSK
612 * @return Error code indicating success/failure
618 s32
host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8PassPhrase
,
621 * @brief gets the pass phrase
622 * @details AP/STA mode. This function gets the pass phrase used to
623 * generate the Pre-Shared Key when WPA/WPA2 is enabled
624 * The length of the field can vary from 8 to 64 bytes,
625 * the lower layer should get the
626 * @param[in,out] handle to the wifi driver,
627 * String containing PSK
628 * @return Error code indicating success/failure
634 s32
host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv
*hWFIDrv
,
635 u8
*pu8PassPhrase
, u8 u8Psklength
);
638 * @brief gets mac address
640 * @param[in,out] handle to the wifi driver,
642 * @return Error code indicating success/failure
645 * @date 19 April 2012
648 s32
host_int_get_MacAddress(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8MacAddress
);
651 * @brief sets mac address
653 * @param[in,out] handle to the wifi driver,
655 * @return Error code indicating success/failure
661 s32
host_int_set_MacAddress(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8MacAddress
);
664 * @brief wait until msg q is empty
668 * @return Error code indicating success/failure
671 * @date 19 march 2014
674 s32
host_int_wait_msg_queue_idle(void);
677 * @brief gets the site survey results
679 * @param[in,out] handle to the wifi driver,
680 * Message containing site survey results in the
682 *|---------------------------------------------------|
683 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
684 ||-----------|-----------|---------------|-----------|
686 | ----------------------------------------- | ----------------
688 ||---------------------------------------|
689 | Network1 | Netweork2 | ... | Network5 |
690 ||---------------------------------------|
691 | 44 | 44 | ... | 44 |
692 | -------------------------- | ---------------------------------------
694 ||---------------------------------------------------------------------|
695 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
696 ||------|----------|---------|----------------|-------|------|---------|
697 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
698 ||---------------------------------------------------------------------|
699 * @return Error code indicating success/failure
705 #ifndef CONNECT_DIRECT
706 s32
host_int_get_site_survey_results(tstrWILC_WFIDrv
*hWFIDrv
,
707 u8 ppu8RcvdSiteSurveyResults
[][MAX_SURVEY_RESULT_FRAG_SIZE
],
708 u32 u32MaxSiteSrvyFragLen
);
712 * @brief sets a start scan request
714 * @param[in,out] handle to the wifi driver,
715 * @param[in] Scan Source one of the following values
718 * OBSS_PERIODIC_SCAN BIT1
719 * OBSS_ONETIME_SCAN BIT2
720 * @return Error code indicating success/failure
727 s32
host_int_set_start_scan_req(tstrWILC_WFIDrv
*hWFIDrv
, u8 scanSource
);
729 * @brief gets scan source of the last scan
731 * @param[in,out] handle to the wifi driver,
732 * Scan Source one of the following values
735 * OBSS_PERIODIC_SCAN BIT1
736 * OBSS_ONETIME_SCAN BIT2
737 * @return Error code indicating success/failure
743 s32
host_int_get_start_scan_req(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8ScanSource
);
746 * @brief sets a join request
748 * @param[in,out] handle to the wifi driver,
749 * @param[in] Index of the bss descriptor
750 * @return Error code indicating success/failure
757 s32
host_int_set_join_req(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8bssid
,
758 const u8
*pu8ssid
, size_t ssidLen
,
759 const u8
*pu8IEs
, size_t IEsLen
,
760 tWILCpfConnectResult pfConnectResult
, void *pvUserArg
,
761 u8 u8security
, AUTHTYPE_T tenuAuth_type
,
766 * @brief Flush a join request parameters to FW, but actual connection
767 * @details The function is called in situation where WILC is connected to AP and
768 * required to switch to hybrid FW for P2P connection
769 * @param[in] handle to the wifi driver,
770 * @return Error code indicating success/failure
772 * @author Amr Abdel-Moghny
777 s32
host_int_flush_join_req(tstrWILC_WFIDrv
*hWFIDrv
);
781 * @brief disconnects from the currently associated network
783 * @param[in,out] handle to the wifi driver,
784 * @param[in] Reason Code of the Disconnection
785 * @return Error code indicating success/failure
791 s32
host_int_disconnect(tstrWILC_WFIDrv
*hWFIDrv
, u16 u16ReasonCode
);
794 * @brief disconnects a sta
796 * @param[in,out] handle to the wifi driver,
797 * @param[in] Association Id of the station to be disconnected
798 * @return Error code indicating success/failure
804 s32
host_int_disconnect_station(tstrWILC_WFIDrv
*hWFIDrv
, u8 assoc_id
);
806 * @brief gets a Association request info
808 * @param[in,out] handle to the wifi driver,
809 * Message containg assoc. req info in the following format
810 * ------------------------------------------------------------------------
811 | Management Frame Format |
812 ||-------------------------------------------------------------------|
813 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
814 ||-------------|--------|--|--|-----|----------------|----------|----|
815 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
816 ||-------------------------------------------------------------------|
818 | Association Request Frame - Frame Body |
819 ||-------------------------------------------------------------------|
820 | Capability Information | Listen Interval | SSID | Supported Rates |
821 ||------------------------|-----------------|------|-----------------|
822 | 2 | 2 | 2-34 | 3-10 |
823 | ---------------------------------------------------------------------
824 * @return Error code indicating success/failure
831 s32
host_int_get_assoc_req_info(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8AssocReqInfo
,
832 u32 u32AssocReqInfoLen
);
834 * @brief gets a Association Response info
836 * @param[in,out] handle to the wifi driver,
837 * Message containg assoc. resp info
838 * @return Error code indicating success/failure
845 s32
host_int_get_assoc_res_info(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8AssocRespInfo
,
846 u32 u32MaxAssocRespInfoLen
, u32
*pu32RcvdAssocRespInfoLen
);
848 * @brief gets a Association Response info
849 * @details Valid only in STA mode. This function gives the RSSI
850 * values observed in all the channels at the time of scanning.
851 * The length of the field is 1 greater that the total number of
852 * channels supported. Byte 0 contains the number of channels while
853 * each of Byte N contains the observed RSSI value for the channel index N.
854 * @param[in,out] handle to the wifi driver,
855 * array of scanned channels' RSSI
856 * @return Error code indicating success/failure
862 s32
host_int_get_rx_power_level(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8RxPowerLevel
,
863 u32 u32RxPowerLevelLen
);
866 * @brief sets a channel
868 * @param[in,out] handle to the wifi driver,
869 * @param[in] Index of the channel to be set
870 *|-------------------------------------------------------------------|
871 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
873 ||-------------------------------------------------------------------|
874 * @return Error code indicating success/failure
880 s32
host_int_set_mac_chnl_num(tstrWILC_WFIDrv
*hWFIDrv
, u8 u8ChNum
);
883 * @brief gets the current channel index
885 * @param[in,out] handle to the wifi driver,
886 * current channel index
887 *|-----------------------------------------------------------------------|
888 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
890 ||-----------------------------------------------------------------------|
891 * @return Error code indicating success/failure
897 s32
host_int_get_host_chnl_num(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8ChNo
);
899 * @brief gets the sta rssi
900 * @details gets the currently maintained RSSI value for the station.
901 * The received signal strength value in dB.
902 * The range of valid values is -128 to 0.
903 * @param[in,out] handle to the wifi driver,
905 * @return Error code indicating success/failure
911 s32
host_int_get_rssi(tstrWILC_WFIDrv
*hWFIDrv
, s8
*ps8Rssi
);
912 s32
host_int_get_link_speed(tstrWILC_WFIDrv
*hWFIDrv
, s8
*ps8lnkspd
);
914 * @brief scans a set of channels
916 * @param[in,out] handle to the wifi driver,
917 * @param[in] Scan source
918 * Scan Type PASSIVE_SCAN = 0,
921 * Channels Array length
922 * Scan Callback function
923 * User Argument to be delivered back through the Scan Cllback function
924 * @return Error code indicating success/failure
930 s32
host_int_scan(tstrWILC_WFIDrv
*hWFIDrv
, u8 u8ScanSource
,
931 u8 u8ScanType
, u8
*pu8ChnlFreqList
,
932 u8 u8ChnlListLen
, const u8
*pu8IEs
,
933 size_t IEsLen
, tWILCpfScanResult ScanResult
,
934 void *pvUserArg
, tstrHiddenNetwork
*pstrHiddenNetwork
);
936 * @brief sets configuration wids values
938 * @param[in,out] handle to the wifi driver,
939 * @param[in] WID, WID value
940 * @return Error code indicating success/failure
946 s32
hif_set_cfg(tstrWILC_WFIDrv
*hWFIDrv
, tstrCfgParamVal
*pstrCfgParamVal
);
949 * @brief gets configuration wids values
951 * @param[in,out] handle to the wifi driver,
954 * @return Error code indicating success/failure
960 s32
hif_get_cfg(tstrWILC_WFIDrv
*hWFIDrv
, u16 u16WID
, u16
*pu16WID_Value
);
961 /*****************************************************************************/
962 /* Notification Functions */
963 /*****************************************************************************/
965 * @brief notifies host with join and leave requests
966 * @details This function prepares an Information frame having the
967 * information about a joining/leaving station.
968 * @param[in,out] handle to the wifi driver,
969 * @param[in] 6 byte Sta Adress
970 * Join or leave flag:
973 * @return Error code indicating success/failure
979 void host_int_send_join_leave_info_to_host
980 (u16 assocId
, u8
*stationAddr
, bool joining
);
983 * @brief notifies host with stations found in scan
984 * @details sends the beacon/probe response from scan
985 * @param[in,out] handle to the wifi driver,
986 * @param[in] Sta Address,
988 * Rssi of the Station found
989 * @return Error code indicating success/failure
995 void host_int_send_network_info_to_host
996 (u8
*macStartAddress
, u16 u16RxFrameLen
, s8 s8Rssi
);
999 * @brief host interface initialization function
1001 * @param[in,out] handle to the wifi driver,
1004 * @date 8 March 2012
1007 s32
host_int_init(tstrWILC_WFIDrv
**phWFIDrv
);
1010 * @brief host interface initialization function
1012 * @param[in,out] handle to the wifi driver,
1015 * @date 8 March 2012
1018 s32
host_int_deinit(tstrWILC_WFIDrv
*hWFIDrv
);
1022 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1023 * @brief Sends a beacon to the firmware to be transmitted over the air
1025 * @param[in,out] hWFIDrv handle to the wifi driver
1026 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1027 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1028 * (including the current frame) appear before the next DTIM
1029 * @param[in] u32Headlen Length of the head buffer in bytes
1030 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1031 * is the part from the beacon's start till the TIM element, NOT including the TIM
1032 * @param[in] u32Taillen Length of the tail buffer in bytes
1033 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1034 * starts just after the TIM inormation element
1035 * @return 0 for Success, error otherwise
1038 * @author Adham Abozaeid
1039 * @date 10 Julys 2012
1040 * @version 1.0 Description
1043 s32
host_int_add_beacon(tstrWILC_WFIDrv
*hWFIDrv
, u32 u32Interval
,
1045 u32 u32HeadLen
, u8
*pu8Head
,
1046 u32 u32TailLen
, u8
*pu8tail
);
1050 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1051 * @brief Removes the beacon and stops trawilctting it over the air
1053 * @param[in,out] hWFIDrv handle to the wifi driver
1054 * @return 0 for Success, error otherwise
1057 * @author Adham Abozaeid
1058 * @date 10 Julys 2012
1059 * @version 1.0 Description
1061 s32
host_int_del_beacon(tstrWILC_WFIDrv
*hWFIDrv
);
1064 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1065 * @brief Notifies the firmware with a new associated stations
1067 * @param[in,out] hWFIDrv handle to the wifi driver
1068 * @param[in] pstrStaParams Station's parameters
1069 * @return 0 for Success, error otherwise
1072 * @author Adham Abozaeid
1073 * @date 12 July 2012
1074 * @version 1.0 Description
1076 s32
host_int_add_station(tstrWILC_WFIDrv
*hWFIDrv
, tstrWILC_AddStaParam
*pstrStaParams
);
1079 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1080 * @brief Deauthenticates clients when group is terminating
1082 * @param[in,out] hWFIDrv handle to the wifi driver
1083 * @param[in] pu8MacAddr Station's mac address
1084 * @return 0 for Success, error otherwise
1087 * @author Mai Daftedar
1088 * @date 09 April 2014
1089 * @version 1.0 Description
1091 s32
host_int_del_allstation(tstrWILC_WFIDrv
*hWFIDrv
, u8 pu8MacAddr
[][ETH_ALEN
]);
1094 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1095 * @brief Notifies the firmware with a new deleted station
1097 * @param[in,out] hWFIDrv handle to the wifi driver
1098 * @param[in] pu8MacAddr Station's mac address
1099 * @return 0 for Success, error otherwise
1102 * @author Adham Abozaeid
1103 * @date 15 July 2012
1104 * @version 1.0 Description
1106 s32
host_int_del_station(tstrWILC_WFIDrv
*hWFIDrv
, const u8
*pu8MacAddr
);
1109 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1110 * @brief Notifies the firmware with new parameters of an already associated station
1112 * @param[in,out] hWFIDrv handle to the wifi driver
1113 * @param[in] pstrStaParams Station's parameters
1114 * @return 0 for Success, error otherwise
1117 * @author Adham Abozaeid
1118 * @date 15 July 2012
1119 * @version 1.0 Description
1121 s32
host_int_edit_station(tstrWILC_WFIDrv
*hWFIDrv
, tstrWILC_AddStaParam
*pstrStaParams
);
1124 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1125 * @brief Set the power management mode to enabled or disabled
1127 * @param[in,out] hWFIDrv handle to the wifi driver
1128 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1129 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1130 * the dynamic ps timeout value
1131 * @return 0 for Success, error otherwise
1134 * @author Adham Abozaeid
1135 * @date 24 November 2012
1136 * @version 1.0 Description
1138 s32
host_int_set_power_mgmt(tstrWILC_WFIDrv
*hWFIDrv
, bool bIsEnabled
, u32 u32Timeout
);
1139 /* @param[in,out] hWFIDrv handle to the wifi driver
1140 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1141 * @param[in] u8count count of mac address entries in the filter table
1143 * @return 0 for Success, error otherwise
1146 * @author Adham Abozaeid
1147 * @date 24 November 2012
1148 * @version 1.0 Description
1150 s32
host_int_setup_multicast_filter(tstrWILC_WFIDrv
*hWFIDrv
, bool bIsEnabled
, u32 u32count
);
1152 * @brief host_int_setup_ipaddress
1153 * @details set IP address on firmware
1155 * @return Error code.
1156 * @author Abdelrahman Sobhy
1160 s32
host_int_setup_ipaddress(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1164 * @brief host_int_delBASession
1165 * @details Delete single Rx BA session
1167 * @return Error code.
1168 * @author Abdelrahman Sobhy
1172 s32
host_int_delBASession(tstrWILC_WFIDrv
*hWFIDrv
, char *pBSSID
, char TID
);
1175 * @brief host_int_delBASession
1176 * @details Delete all Rx BA session
1178 * @return Error code.
1179 * @author Abdelrahman Sobhy
1183 s32
host_int_del_All_Rx_BASession(tstrWILC_WFIDrv
*hWFIDrv
, char *pBSSID
, char TID
);
1187 * @brief host_int_get_ipaddress
1188 * @details get IP address on firmware
1190 * @return Error code.
1191 * @author Abdelrahman Sobhy
1195 s32
host_int_get_ipaddress(tstrWILC_WFIDrv
*hWFIDrv
, u8
*pu8IPAddr
, u8 idx
);
1199 * @brief host_int_remain_on_channel
1202 * @return Error code.
1207 s32
host_int_remain_on_channel(tstrWILC_WFIDrv
*hWFIDrv
, u32 u32SessionID
, u32 u32duration
, u16 chan
, tWILCpfRemainOnChanExpired RemainOnChanExpired
, tWILCpfRemainOnChanReady RemainOnChanReady
, void *pvUserArg
);
1210 * @brief host_int_ListenStateExpired
1212 * @param[in] Handle to wifi driver
1213 * Duration to remain on channel
1214 * Channel to remain on
1215 * Pointer to fn to be called on receive frames in listen state
1216 * Pointer to remain-on-channel expired fn
1218 * @return Error code.
1223 s32
host_int_ListenStateExpired(tstrWILC_WFIDrv
*hWFIDrv
, u32 u32SessionID
);
1226 * @brief host_int_frame_register
1229 * @return Error code.
1234 s32
host_int_frame_register(tstrWILC_WFIDrv
*hWFIDrv
, u16 u16FrameType
, bool bReg
);
1237 * @brief host_int_set_wfi_drv_handler
1240 * @return Error code.
1245 s32
host_int_set_wfi_drv_handler(tstrWILC_WFIDrv
*u32address
);
1246 s32
host_int_set_operation_mode(tstrWILC_WFIDrv
*hWFIDrv
, u32 u32mode
);
1248 static s32
Handle_ScanDone(tstrWILC_WFIDrv
*drvHandler
, tenuScanEvent enuEvent
);
1250 static int host_int_addBASession(tstrWILC_WFIDrv
*hWFIDrv
, char *pBSSID
, char TID
, short int BufferSize
,
1251 short int SessionTimeout
, void *drvHandler
);
1254 void host_int_freeJoinParams(void *pJoinParams
);
1256 s32
host_int_get_statistics(tstrWILC_WFIDrv
*hWFIDrv
, tstrStatistics
*pstrStatistics
);
1258 /*****************************************************************************/
1262 /*****************************************************************************/