2 * @file host_interface.h
3 * @brief File containg host interface APIs
13 #include "coreconfigurator.h"
14 /*****************************************************************************/
16 /*****************************************************************************/
18 #define SUCCESS 0x0001
22 #define BIT2 ((u32)(1 << 2))
23 #define BIT1 ((u32)(1 << 1))
24 #define BIT0 ((u32)(1 << 0))
27 #define STATION_MODE 0x02
29 #define CLIENT_MODE 0x04
33 #define ACTIVE_SCAN_TIME 10
34 #define PASSIVE_SCAN_TIME 1200
35 #define MIN_SCAN_TIME 10
36 #define MAX_SCAN_TIME 1200
37 #define DEFAULT_SCAN 0
38 #define USER_SCAN BIT0
39 #define OBSS_PERIODIC_SCAN BIT1
40 #define OBSS_ONETIME_SCAN BIT2
41 #define GTK_RX_KEY_BUFF_LEN 24
44 #define DEFAULTKEY 0x4
46 #define MAX_NUM_SCANNED_NETWORKS 100 /* 30 // rachel */
47 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
48 #define MAX_NUM_PROBED_SSID 10 /*One more than the number of scanned ssids*/
49 #define CHANNEL_SCAN_TIME 250 /* 250 */
51 #define TX_MIC_KEY_LEN 8
52 #define RX_MIC_KEY_LEN 8
53 #define PTK_KEY_LEN 16
55 #define TX_MIC_KEY_MSG_LEN 26
56 #define RX_MIC_KEY_MSG_LEN 48
57 #define PTK_KEY_MSG_LEN 39
59 #define PMKSA_KEY_LEN 22
62 #define WILC_MAX_NUM_PMKIDS 16
63 #define WILC_SUPP_MCS_SET_SIZE 16
64 #define WILC_ADD_STA_LENGTH 40 /* Not including the rates field cause it has variable length*/
65 #define SCAN_EVENT_DONE_ABORTED
66 /*****************************************************************************/
68 /*****************************************************************************/
69 /* typedef unsigned char uint8; */
70 /* typedef signed char int8; */
71 /* typedef unsigned short uint16; */
72 /* typedef unsigned long uint32; */
73 /* typedef uint32 Bool; */
81 typedef struct _tstrStatistics {
86 u32 u32TxFailureCount;
94 HOST_IF_CONNECTING = 2,
95 HOST_IF_WAITING_CONN_RESP = 3,
96 HOST_IF_CONNECTED = 4,
97 HOST_IF_P2P_LISTEN = 5,
98 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
101 typedef struct _tstrHostIFpmkid {
106 typedef struct _tstrHostIFpmkidAttr {
108 tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
109 } tstrHostIFpmkidAttr;
134 u16 short_retry_limit;
135 u16 long_retry_limit;
139 u8 short_slot_allowed;
140 u8 txop_prot_disabled;
143 SITE_SURVEY_T site_survey_enabled;
144 u16 site_survey_scan_time;
146 u16 active_scan_time;
147 u16 passive_scan_time;
148 CURRENT_TX_RATE_T curr_tx_rate;
153 RETRY_SHORT = 1 << 0,
155 FRAG_THRESHOLD = 1 << 2,
156 RTS_THRESHOLD = 1 << 3,
159 AUTHEN_TIMEOUT = 1 << 6,
160 POWER_MANAGEMENT = 1 << 7,
162 SHORT_SLOT_ALLOWED = 1 << 9,
163 TXOP_PROT_DISABLE = 1 << 10,
164 BEACON_INTERVAL = 1 << 11,
165 DTIM_PERIOD = 1 << 12,
166 SITE_SURVEY = 1 << 13,
167 SITE_SURVEY_SCAN_TIME = 1 << 14,
168 ACTIVE_SCANTIME = 1 << 15,
169 PASSIVE_SCANTIME = 1 << 16,
170 CURRENT_TX_RATE = 1 << 17,
177 } tstrFoundNetworkInfo;
179 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
181 SCAN_EVENT_ABORTED = 2,
182 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
185 CONN_DISCONN_EVENT_CONN_RESP = 0,
186 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
187 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
188 } tenuConnDisconnEvent;
199 /*Scan callBack function definition*/
200 typedef void (*tWILCpfScanResult)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
202 /*Connect callBack function definition*/
203 typedef void (*tWILCpfConnectResult)(tenuConnDisconnEvent,
206 tstrDisconnectNotifInfo *,
210 typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/
211 typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
214 /* typedef u32 WILC_WFIDrvHandle; */
217 } *WILC_WFIDrvHandle;
220 * @struct tstrRcvdNetworkInfo
221 * @brief Structure to hold Received Asynchronous Network info
225 * @author Mostafa Abu Bakr
226 * @date 25 March 2012
229 typedef struct _tstrRcvdNetworkInfo {
232 } tstrRcvdNetworkInfo;
235 typedef struct _tstrHiddenNetworkInfo {
239 } tstrHiddenNetworkInfo;
241 typedef struct _tstrHiddenNetwork {
243 tstrHiddenNetworkInfo *pstrHiddenNetworkInfo;
249 /* Scan user call back function */
250 tWILCpfScanResult pfUserScanResult;
252 /* User specific parameter to be delivered through the Scan User Callback function */
253 void *u32UserScanPvoid;
256 tstrFoundNetworkInfo astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
257 } tstrWILC_UsrScanReq;
263 AUTHTYPE_T tenuAuth_type;
266 size_t ConnReqIEsLen;
267 /* Connect user call back function */
268 tWILCpfConnectResult pfUserConnectResult;
270 /* User specific parameter to be delivered through the Connect User Callback function */
271 void *u32UserConnectPvoid;
272 } tstrWILC_UsrConnReq;
276 } tstrHostIfSetDrvHandler;
280 } tstrHostIfSetOperationMode;
284 u8 u8MacAddress[ETH_ALEN];
285 } tstrHostIfSetMacAddress;
290 } tstrHostIfGetMacAddress;
294 u8 au8Bssid[ETH_ALEN];
297 u16 u16SessionTimeout;
298 } tstrHostIfBASessionInfo;
304 tWILCpfRemainOnChanExpired pRemainOnChanExpired;
305 tWILCpfRemainOnChanReady pRemainOnChanReady;
307 u32 u32ListenSessionID;
308 } tstrHostIfRemainOnChan;
317 } tstrHostIfRegisterFrame;
321 #define PROBE_REQ 0x40
322 #define PROBE_RESP 0x50
323 #define ACTION_FRM_IDX 0
324 #define PROBE_REQ_IDX 1
327 enum p2p_listen_state {
335 /* Scan user structure */
336 tstrWILC_UsrScanReq strWILC_UsrScanReq;
338 /* Connect User structure */
339 tstrWILC_UsrConnReq strWILC_UsrConnReq;
342 /*Remain on channel struvture*/
343 tstrHostIfRemainOnChan strHostIfRemainOnChan;
344 u8 u8RemainOnChan_pendingreq;
345 u64 u64P2p_MgmtTimeout;
349 tenuHostIFstate enuHostIFstate;
351 /* bool bPendingConnRequest; */
353 #ifndef CONNECT_DIRECT
354 u32 u32SurveyResultsCount;
355 wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS];
358 u8 au8AssociatedBSSID[ETH_ALEN];
359 tstrCfgParamVal strCfgValues;
361 struct semaphore gtOsCfgValuesSem;
362 struct semaphore hSemTestKeyBlock;
364 struct semaphore hSemTestDisconnectBlock;
365 struct semaphore hSemGetRSSI;
366 struct semaphore hSemGetLINKSPEED;
367 struct semaphore hSemGetCHNL;
368 struct semaphore hSemInactiveTime;
370 struct timer_list hScanTimer;
371 struct timer_list hConnectTimer;
373 struct timer_list hRemainOnChannel;
380 * @enum tenuWILC_StaFlag
381 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
384 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
385 * @author Enumeraion's creator
387 * @version 1.0 Description
391 WILC_STA_FLAG_INVALID = 0,
392 WILC_STA_FLAG_AUTHORIZED, /*!< station is authorized (802.1X)*/
393 WILC_STA_FLAG_SHORT_PREAMBLE, /*!< station is capable of receiving frames with short barker preamble*/
394 WILC_STA_FLAG_WME, /*!< station is WME/QoS capable*/
395 WILC_STA_FLAG_MFP, /*!< station uses management frame protection*/
396 WILC_STA_FLAG_AUTHENTICATED /*!< station is authenticated*/
400 u8 au8BSSID[ETH_ALEN];
407 u8 au8SuppMCsSet[16];
409 u32 u32TxBeamformingCap;
411 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
412 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
413 } tstrWILC_AddStaParam;
415 /* extern void CfgDisconnected(void* pUserVoid, u16 u16reason, u8 * ie, size_t ie_len); */
417 /*****************************************************************************/
419 /* Host Interface API */
421 /*****************************************************************************/
424 * @brief removes wpa/wpa2 keys
425 * @details only in BSS STA mode if External Supplicant support is enabled.
426 * removes all WPA/WPA2 station key entries from MAC hardware.
427 * @param[in,out] handle to the wifi driver
428 * @param[in] 6 bytes of Station Adress in the station entry table
429 * @return Error code indicating success/failure
435 s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress);
437 * @brief removes WEP key
438 * @details valid only in BSS STA mode if External Supplicant support is enabled.
439 * remove a WEP key entry from MAC HW.
440 * The BSS Station automatically finds the index of the entry using its
441 * BSS ID and removes that entry from the MAC hardware.
442 * @param[in,out] handle to the wifi driver
443 * @param[in] 6 bytes of Station Adress in the station entry table
444 * @return Error code indicating success/failure
445 * @note NO need for the STA add since it is not used for processing
450 s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
452 * @brief sets WEP deafault key
453 * @details Sets the index of the WEP encryption key in use,
455 * @param[in,out] handle to the wifi driver
456 * @param[in] key index ( 0, 1, 2, 3)
457 * @return Error code indicating success/failure
463 s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index);
466 * @brief sets WEP deafault key
467 * @details valid only in BSS STA mode if External Supplicant support is enabled.
468 * sets WEP key entry into MAC hardware when it receives the
469 * corresponding request from NDIS.
470 * @param[in,out] handle to the wifi driver
471 * @param[in] message containing WEP Key in the following format
472 *|---------------------------------------|
473 *|Key ID Value | Key Length | Key |
474 *|-------------|------------|------------|
475 | 1byte | 1byte | Key Length |
476 ||---------------------------------------|
478 * @return Error code indicating success/failure
484 s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
486 * @brief host_int_add_wep_key_bss_ap
487 * @details valid only in AP mode if External Supplicant support is enabled.
488 * sets WEP key entry into MAC hardware when it receives the
489 * corresponding request from NDIS.
490 * @param[in,out] handle to the wifi driver
493 * @return Error code indicating success/failure
499 s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type);
502 * @brief adds ptk Key
504 * @param[in,out] handle to the wifi driver
505 * @param[in] message containing PTK Key in the following format
506 *|-------------------------------------------------------------------------|
507 *|Sta Adress | Key Length | Temporal Key | Rx Michael Key |Tx Michael Key |
508 *|-----------|------------|---------------|----------------|---------------|
509 | 6 bytes | 1byte | 16 bytes | 8 bytes | 8 bytes |
510 ||-------------------------------------------------------------------------|
511 * @return Error code indicating success/failure
517 s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
518 const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx);
521 * @brief host_int_get_inactive_time
523 * @param[in,out] handle to the wifi driver
524 * @param[in] message containing inactive time
526 * @return Error code indicating success/failure
529 * @date 15 April 2013
532 s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
535 * @brief adds Rx GTk Key
537 * @param[in,out] handle to the wifi driver
538 * @param[in] message containing Rx GTK Key in the following format
539 *|----------------------------------------------------------------------------|
540 *|Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
541 *|------------|---------|-------|------------|---------------|----------------|
542 | 6 bytes | 8 byte |1 byte | 1 byte | 16 bytes | 8 bytes |
543 ||----------------------------------------------------------------------------|
544 * @return Error code indicating success/failure
550 s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
551 u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
552 const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode);
556 * @brief adds Tx GTk Key
558 * @param[in,out] handle to the wifi driver
559 * @param[in] message containing Tx GTK Key in the following format
560 *|----------------------------------------------------|
561 | KeyID | Key Length | Temporal Key | Tx Michael Key |
562 ||-------|------------|--------------|----------------|
563 ||1 byte | 1 byte | 16 bytes | 8 bytes |
564 ||----------------------------------------------------|
565 * @return Error code indicating success/failure
571 s32 host_int_add_tx_gtk(tstrWILC_WFIDrv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
574 * @brief caches the pmkid
575 * @details valid only in BSS STA mode if External Supplicant
576 * support is enabled. This Function sets the PMKID in firmware
577 * when host drivr receives the corresponding request from NDIS.
578 * The firmware then includes theset PMKID in the appropriate
580 * @param[in,out] handle to the wifi driver
581 * @param[in] message containing PMKID Info in the following format
582 *|-----------------------------------------------------------------|
583 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
584 *|-----------|------------|----------|-------|----------|----------|
585 | 1 | 6 | 16 | ... | 6 | 16 |
586 ||-----------------------------------------------------------------|
587 * @return Error code indicating success/failure
594 s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray);
596 * @brief gets the cached the pmkid info
597 * @details valid only in BSS STA mode if External Supplicant
598 * support is enabled. This Function sets the PMKID in firmware
599 * when host drivr receives the corresponding request from NDIS.
600 * The firmware then includes theset PMKID in the appropriate
602 * @param[in,out] handle to the wifi driver,
604 * message containing PMKID Info in the following format
605 *|-----------------------------------------------------------------|
606 *|NumEntries | BSSID[1] | PMKID[1] | ... | BSSID[K] | PMKID[K] |
607 *|-----------|------------|----------|-------|----------|----------|
608 | 1 | 6 | 16 | ... | 6 | 16 |
609 ||-----------------------------------------------------------------|
611 * @return Error code indicating success/failure
618 s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
619 u32 u32PmkidInfoLen);
622 * @brief sets the pass phrase
623 * @details AP/STA mode. This function gives the pass phrase used to
624 * generate the Pre-Shared Key when WPA/WPA2 is enabled
625 * The length of the field can vary from 8 to 64 bytes,
626 * the lower layer should get the
627 * @param[in,out] handle to the wifi driver,
628 * @param[in] String containing PSK
629 * @return Error code indicating success/failure
635 s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
638 * @brief gets the pass phrase
639 * @details AP/STA mode. This function gets the pass phrase used to
640 * generate the Pre-Shared Key when WPA/WPA2 is enabled
641 * The length of the field can vary from 8 to 64 bytes,
642 * the lower layer should get the
643 * @param[in,out] handle to the wifi driver,
644 * String containing PSK
645 * @return Error code indicating success/failure
651 s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
652 u8 *pu8PassPhrase, u8 u8Psklength);
655 * @brief gets mac address
657 * @param[in,out] handle to the wifi driver,
659 * @return Error code indicating success/failure
662 * @date 19 April 2012
665 s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
668 * @brief sets mac address
670 * @param[in,out] handle to the wifi driver,
672 * @return Error code indicating success/failure
678 s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress);
681 * @brief wait until msg q is empty
685 * @return Error code indicating success/failure
688 * @date 19 march 2014
691 s32 host_int_wait_msg_queue_idle(void);
694 * @brief gets the site survey results
696 * @param[in,out] handle to the wifi driver,
697 * Message containing site survey results in the
699 *|---------------------------------------------------|
700 | MsgLength | fragNo. | MsgBodyLength | MsgBody |
701 ||-----------|-----------|---------------|-----------|
703 | ----------------------------------------- | ----------------
705 ||---------------------------------------|
706 | Network1 | Netweork2 | ... | Network5 |
707 ||---------------------------------------|
708 | 44 | 44 | ... | 44 |
709 | -------------------------- | ---------------------------------------
711 ||---------------------------------------------------------------------|
712 | SSID | BSS Type | Channel | Security Status| BSSID | RSSI |Reserved |
713 ||------|----------|---------|----------------|-------|------|---------|
714 | 33 | 1 | 1 | 1 | 6 | 1 | 1 |
715 ||---------------------------------------------------------------------|
716 * @return Error code indicating success/failure
722 #ifndef CONNECT_DIRECT
723 s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
724 u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
725 u32 u32MaxSiteSrvyFragLen);
729 * @brief sets a start scan request
731 * @param[in,out] handle to the wifi driver,
732 * @param[in] Scan Source one of the following values
735 * OBSS_PERIODIC_SCAN BIT1
736 * OBSS_ONETIME_SCAN BIT2
737 * @return Error code indicating success/failure
744 s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource);
746 * @brief gets scan source of the last scan
748 * @param[in,out] handle to the wifi driver,
749 * Scan Source one of the following values
752 * OBSS_PERIODIC_SCAN BIT1
753 * OBSS_ONETIME_SCAN BIT2
754 * @return Error code indicating success/failure
760 s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource);
763 * @brief sets a join request
765 * @param[in,out] handle to the wifi driver,
766 * @param[in] Index of the bss descriptor
767 * @return Error code indicating success/failure
774 s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
775 const u8 *pu8ssid, size_t ssidLen,
776 const u8 *pu8IEs, size_t IEsLen,
777 tWILCpfConnectResult pfConnectResult, void *pvUserArg,
778 u8 u8security, AUTHTYPE_T tenuAuth_type,
783 * @brief Flush a join request parameters to FW, but actual connection
784 * @details The function is called in situation where WILC is connected to AP and
785 * required to switch to hybrid FW for P2P connection
786 * @param[in] handle to the wifi driver,
787 * @return Error code indicating success/failure
789 * @author Amr Abdel-Moghny
794 s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv);
798 * @brief disconnects from the currently associated network
800 * @param[in,out] handle to the wifi driver,
801 * @param[in] Reason Code of the Disconnection
802 * @return Error code indicating success/failure
808 s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode);
811 * @brief disconnects a sta
813 * @param[in,out] handle to the wifi driver,
814 * @param[in] Association Id of the station to be disconnected
815 * @return Error code indicating success/failure
821 s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id);
823 * @brief gets a Association request info
825 * @param[in,out] handle to the wifi driver,
826 * Message containg assoc. req info in the following format
827 * ------------------------------------------------------------------------
828 | Management Frame Format |
829 ||-------------------------------------------------------------------|
830 ||Frame Control|Duration|DA|SA|BSSID|Sequence Control|Frame Body|FCS |
831 ||-------------|--------|--|--|-----|----------------|----------|----|
832 | 2 |2 |6 |6 |6 | 2 |0 - 2312 | 4 |
833 ||-------------------------------------------------------------------|
835 | Association Request Frame - Frame Body |
836 ||-------------------------------------------------------------------|
837 | Capability Information | Listen Interval | SSID | Supported Rates |
838 ||------------------------|-----------------|------|-----------------|
839 | 2 | 2 | 2-34 | 3-10 |
840 | ---------------------------------------------------------------------
841 * @return Error code indicating success/failure
848 s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
849 u32 u32AssocReqInfoLen);
851 * @brief gets a Association Response info
853 * @param[in,out] handle to the wifi driver,
854 * Message containg assoc. resp info
855 * @return Error code indicating success/failure
862 s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
863 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
865 * @brief gets a Association Response info
866 * @details Valid only in STA mode. This function gives the RSSI
867 * values observed in all the channels at the time of scanning.
868 * The length of the field is 1 greater that the total number of
869 * channels supported. Byte 0 contains the number of channels while
870 * each of Byte N contains the observed RSSI value for the channel index N.
871 * @param[in,out] handle to the wifi driver,
872 * array of scanned channels' RSSI
873 * @return Error code indicating success/failure
879 s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
880 u32 u32RxPowerLevelLen);
883 * @brief sets a channel
885 * @param[in,out] handle to the wifi driver,
886 * @param[in] Index of the channel to be set
887 *|-------------------------------------------------------------------|
888 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
890 ||-------------------------------------------------------------------|
891 * @return Error code indicating success/failure
897 s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum);
900 * @brief gets the current channel index
902 * @param[in,out] handle to the wifi driver,
903 * current channel index
904 *|-----------------------------------------------------------------------|
905 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
907 ||-----------------------------------------------------------------------|
908 * @return Error code indicating success/failure
914 s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo);
916 * @brief gets the sta rssi
917 * @details gets the currently maintained RSSI value for the station.
918 * The received signal strength value in dB.
919 * The range of valid values is -128 to 0.
920 * @param[in,out] handle to the wifi driver,
922 * @return Error code indicating success/failure
928 s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi);
929 s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd);
931 * @brief scans a set of channels
933 * @param[in,out] handle to the wifi driver,
934 * @param[in] Scan source
935 * Scan Type PASSIVE_SCAN = 0,
938 * Channels Array length
939 * Scan Callback function
940 * User Argument to be delivered back through the Scan Cllback function
941 * @return Error code indicating success/failure
947 s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
948 u8 u8ScanType, u8 *pu8ChnlFreqList,
949 u8 u8ChnlListLen, const u8 *pu8IEs,
950 size_t IEsLen, tWILCpfScanResult ScanResult,
951 void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork);
953 * @brief sets configuration wids values
955 * @param[in,out] handle to the wifi driver,
956 * @param[in] WID, WID value
957 * @return Error code indicating success/failure
963 s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal);
966 * @brief gets configuration wids values
968 * @param[in,out] handle to the wifi driver,
971 * @return Error code indicating success/failure
977 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
978 /*****************************************************************************/
979 /* Notification Functions */
980 /*****************************************************************************/
982 * @brief notifies host with join and leave requests
983 * @details This function prepares an Information frame having the
984 * information about a joining/leaving station.
985 * @param[in,out] handle to the wifi driver,
986 * @param[in] 6 byte Sta Adress
987 * Join or leave flag:
990 * @return Error code indicating success/failure
996 void host_int_send_join_leave_info_to_host
997 (u16 assocId, u8 *stationAddr, bool joining);
1000 * @brief notifies host with stations found in scan
1001 * @details sends the beacon/probe response from scan
1002 * @param[in,out] handle to the wifi driver,
1003 * @param[in] Sta Address,
1005 * Rssi of the Station found
1006 * @return Error code indicating success/failure
1009 * @date 8 March 2012
1012 void host_int_send_network_info_to_host
1013 (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi);
1016 * @brief host interface initialization function
1018 * @param[in,out] handle to the wifi driver,
1021 * @date 8 March 2012
1024 s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv);
1027 * @brief host interface initialization function
1029 * @param[in,out] handle to the wifi driver,
1032 * @date 8 March 2012
1035 s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv);
1039 * @fn s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv,u8 u8Index)
1040 * @brief Sends a beacon to the firmware to be transmitted over the air
1042 * @param[in,out] hWFIDrv handle to the wifi driver
1043 * @param[in] u32Interval Beacon Interval. Period between two successive beacons on air
1044 * @param[in] u32DTIMPeriod DTIM Period. Indicates how many Beacon frames
1045 * (including the current frame) appear before the next DTIM
1046 * @param[in] u32Headlen Length of the head buffer in bytes
1047 * @param[in] pu8Head Pointer to the beacon's head buffer. Beacon's head
1048 * is the part from the beacon's start till the TIM element, NOT including the TIM
1049 * @param[in] u32Taillen Length of the tail buffer in bytes
1050 * @param[in] pu8Tail Pointer to the beacon's tail buffer. Beacon's tail
1051 * starts just after the TIM inormation element
1052 * @return 0 for Success, error otherwise
1055 * @author Adham Abozaeid
1056 * @date 10 Julys 2012
1057 * @version 1.0 Description
1060 s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
1062 u32 u32HeadLen, u8 *pu8Head,
1063 u32 u32TailLen, u8 *pu8tail);
1067 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
1068 * @brief Removes the beacon and stops trawilctting it over the air
1070 * @param[in,out] hWFIDrv handle to the wifi driver
1071 * @return 0 for Success, error otherwise
1074 * @author Adham Abozaeid
1075 * @date 10 Julys 2012
1076 * @version 1.0 Description
1078 s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv);
1081 * @fn s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1082 * @brief Notifies the firmware with a new associated stations
1084 * @param[in,out] hWFIDrv handle to the wifi driver
1085 * @param[in] pstrStaParams Station's parameters
1086 * @return 0 for Success, error otherwise
1089 * @author Adham Abozaeid
1090 * @date 12 July 2012
1091 * @version 1.0 Description
1093 s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1096 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1097 * @brief Deauthenticates clients when group is terminating
1099 * @param[in,out] hWFIDrv handle to the wifi driver
1100 * @param[in] pu8MacAddr Station's mac address
1101 * @return 0 for Success, error otherwise
1104 * @author Mai Daftedar
1105 * @date 09 April 2014
1106 * @version 1.0 Description
1108 s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1111 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1112 * @brief Notifies the firmware with a new deleted station
1114 * @param[in,out] hWFIDrv handle to the wifi driver
1115 * @param[in] pu8MacAddr Station's mac address
1116 * @return 0 for Success, error otherwise
1119 * @author Adham Abozaeid
1120 * @date 15 July 2012
1121 * @version 1.0 Description
1123 s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr);
1126 * @fn s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
1127 * @brief Notifies the firmware with new parameters of an already associated station
1129 * @param[in,out] hWFIDrv handle to the wifi driver
1130 * @param[in] pstrStaParams Station's parameters
1131 * @return 0 for Success, error otherwise
1134 * @author Adham Abozaeid
1135 * @date 15 July 2012
1136 * @version 1.0 Description
1138 s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
1141 * @fn s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
1142 * @brief Set the power management mode to enabled or disabled
1144 * @param[in,out] hWFIDrv handle to the wifi driver
1145 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1146 * @param[in] u32Timeout A timeout value of -1 allows the driver to adjust
1147 * the dynamic ps timeout value
1148 * @return 0 for Success, error otherwise
1151 * @author Adham Abozaeid
1152 * @date 24 November 2012
1153 * @version 1.0 Description
1155 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout);
1156 /* @param[in,out] hWFIDrv handle to the wifi driver
1157 * @param[in] bIsEnabled TRUE if enabled, FALSE otherwise
1158 * @param[in] u8count count of mac address entries in the filter table
1160 * @return 0 for Success, error otherwise
1163 * @author Adham Abozaeid
1164 * @date 24 November 2012
1165 * @version 1.0 Description
1167 s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count);
1169 * @brief host_int_setup_ipaddress
1170 * @details set IP address on firmware
1172 * @return Error code.
1173 * @author Abdelrahman Sobhy
1177 s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1181 * @brief host_int_delBASession
1182 * @details Delete single Rx BA session
1184 * @return Error code.
1185 * @author Abdelrahman Sobhy
1189 s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1192 * @brief host_int_delBASession
1193 * @details Delete all Rx BA session
1195 * @return Error code.
1196 * @author Abdelrahman Sobhy
1200 s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID);
1204 * @brief host_int_get_ipaddress
1205 * @details get IP address on firmware
1207 * @return Error code.
1208 * @author Abdelrahman Sobhy
1212 s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1216 * @brief host_int_remain_on_channel
1219 * @return Error code.
1224 s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg);
1227 * @brief host_int_ListenStateExpired
1229 * @param[in] Handle to wifi driver
1230 * Duration to remain on channel
1231 * Channel to remain on
1232 * Pointer to fn to be called on receive frames in listen state
1233 * Pointer to remain-on-channel expired fn
1235 * @return Error code.
1240 s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID);
1243 * @brief host_int_frame_register
1246 * @return Error code.
1251 s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg);
1254 * @brief host_int_set_wfi_drv_handler
1257 * @return Error code.
1262 s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address);
1263 s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode);
1265 static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent);
1267 static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
1268 short int SessionTimeout, void *drvHandler);
1271 void host_int_freeJoinParams(void *pJoinParams);
1273 s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics);
1275 /*****************************************************************************/
1279 /*****************************************************************************/