c3379ecb1b974ab5150870bdaed9ea4eaec9b78b
[deliverable/linux.git] / drivers / staging / wilc1000 / host_interface.h
1 /*!
2 * @file host_interface.h
3 * @brief File containg host interface APIs
4 * @author zsalah
5 * @sa host_interface.c
6 * @date 8 March 2012
7 * @version 1.0
8 */
9
10 #ifndef HOST_INT_H
11 #define HOST_INT_H
12
13 #include "coreconfigurator.h"
14
15 #define IP_ALEN 4
16
17 #define IDLE_MODE 0x00
18 #define AP_MODE 0x01
19 #define STATION_MODE 0x02
20 #define GO_MODE 0x03
21 #define CLIENT_MODE 0x04
22
23
24 #define MAX_NUM_STA 9
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
34 #define ADDKEY 0x1
35 #define REMOVEKEY 0x2
36 #define DEFAULTKEY 0x4
37 #define ADDKEY_AP 0x8
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
42
43 #define TX_MIC_KEY_LEN 8
44 #define RX_MIC_KEY_LEN 8
45 #define PTK_KEY_LEN 16
46
47 #define TX_MIC_KEY_MSG_LEN 26
48 #define RX_MIC_KEY_MSG_LEN 48
49 #define PTK_KEY_MSG_LEN 39
50
51 #define PMKSA_KEY_LEN 22
52 #define ETH_ALEN 6
53 #define PMKID_LEN 16
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
59
60 typedef struct _tstrStatistics {
61 u8 u8LinkSpeed;
62 s8 s8RSSI;
63 u32 u32TxCount;
64 u32 u32RxCount;
65 u32 u32TxFailureCount;
66
67 } tstrStatistics;
68
69 enum host_if_state {
70 HOST_IF_IDLE = 0,
71 HOST_IF_SCANNING = 1,
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
77 };
78
79 struct host_if_pmkid {
80 u8 bssid[ETH_ALEN];
81 u8 pmkid[PMKID_LEN];
82 };
83
84 struct host_if_pmkid_attr {
85 u8 numpmkid;
86 struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
87 };
88
89 enum CURRENT_TXRATE {
90 AUTORATE = 0,
91 MBPS_1 = 1,
92 MBPS_2 = 2,
93 MBPS_5_5 = 5,
94 MBPS_11 = 11,
95 MBPS_6 = 6,
96 MBPS_9 = 9,
97 MBPS_12 = 12,
98 MBPS_18 = 18,
99 MBPS_24 = 24,
100 MBPS_36 = 36,
101 MBPS_48 = 48,
102 MBPS_54 = 54
103 };
104
105 struct cfg_param_val {
106 u32 u32SetCfgFlag;
107 u8 ht_enable;
108 u8 bss_type;
109 u8 auth_type;
110 u16 auth_timeout;
111 u8 power_mgmt_mode;
112 u16 short_retry_limit;
113 u16 long_retry_limit;
114 u16 frag_threshold;
115 u16 rts_threshold;
116 u16 preamble_type;
117 u8 short_slot_allowed;
118 u8 txop_prot_disabled;
119 u16 beacon_interval;
120 u16 dtim_period;
121 enum SITESURVEY site_survey_enabled;
122 u16 site_survey_scan_time;
123 u8 scan_source;
124 u16 active_scan_time;
125 u16 passive_scan_time;
126 enum CURRENT_TXRATE curr_tx_rate;
127
128 };
129
130 typedef enum {
131 RETRY_SHORT = BIT(0),
132 RETRY_LONG = BIT(1),
133 FRAG_THRESHOLD = BIT(2),
134 RTS_THRESHOLD = BIT(3),
135 BSS_TYPE = BIT(4),
136 AUTH_TYPE = BIT(5),
137 AUTHEN_TIMEOUT = BIT(6),
138 POWER_MANAGEMENT = BIT(7),
139 PREAMBLE = BIT(8),
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),
149 HT_ENABLE = BIT(18),
150 } tenuCfgParam;
151
152 struct found_net_info {
153 u8 au8bssid[6];
154 s8 s8rssi;
155 };
156
157 typedef enum {SCAN_EVENT_NETWORK_FOUND = 0,
158 SCAN_EVENT_DONE = 1,
159 SCAN_EVENT_ABORTED = 2,
160 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF} tenuScanEvent;
161
162 typedef enum {
163 CONN_DISCONN_EVENT_CONN_RESP = 0,
164 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
165 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
166 } tenuConnDisconnEvent;
167
168 enum KEY_TYPE {
169 WEP,
170 WPARxGtk,
171 WPAPtk,
172 PMKSA,
173 };
174
175
176 /*Scan callBack function definition*/
177 typedef void (*wilc_scan_result)(tenuScanEvent, tstrNetworkInfo *, void *, void *);
178
179 /*Connect callBack function definition*/
180 typedef void (*wilc_connect_result)(tenuConnDisconnEvent,
181 tstrConnectInfo *,
182 u8,
183 tstrDisconnectNotifInfo *,
184 void *);
185
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*/
188
189 /*!
190 * @struct rcvd_net_info
191 * @brief Structure to hold Received Asynchronous Network info
192 * @details
193 * @todo
194 * @sa
195 * @author Mostafa Abu Bakr
196 * @date 25 March 2012
197 * @version 1.0
198 */
199 struct rcvd_net_info {
200 u8 *pu8Buffer;
201 u32 u32Length;
202 };
203
204 struct hidden_net_info {
205 u8 *pu8ssid;
206 u8 u8ssidlen;
207 };
208
209 struct hidden_network {
210 struct hidden_net_info *pstrHiddenNetworkInfo;
211 u8 u8ssidnum;
212 };
213
214 struct user_scan_req {
215 /* Scan user call back function */
216 wilc_scan_result pfUserScanResult;
217
218 /* User specific parameter to be delivered through the Scan User Callback function */
219 void *u32UserScanPvoid;
220
221 u32 u32RcvdChCount;
222 struct found_net_info astrFoundNetworkInfo[MAX_NUM_SCANNED_NETWORKS];
223 };
224
225 struct user_conn_req {
226 u8 *pu8bssid;
227 u8 *pu8ssid;
228 u8 u8security;
229 enum AUTHTYPE tenuAuth_type;
230 size_t ssidLen;
231 u8 *pu8ConnReqIEs;
232 size_t ConnReqIEsLen;
233 /* Connect user call back function */
234 wilc_connect_result pfUserConnectResult;
235 bool IsHTCapable;
236 /* User specific parameter to be delivered through the Connect User Callback function */
237 void *u32UserConnectPvoid;
238 };
239
240 struct drv_handler {
241 u32 u32Address;
242 };
243
244 struct op_mode {
245 u32 u32Mode;
246 };
247
248 struct set_mac_addr {
249 u8 u8MacAddress[ETH_ALEN];
250 };
251
252 struct get_mac_addr {
253 u8 *u8MacAddress;
254 };
255
256 struct ba_session_info {
257 u8 au8Bssid[ETH_ALEN];
258 u8 u8Ted;
259 u16 u16BufferSize;
260 u16 u16SessionTimeout;
261 };
262
263 struct remain_ch {
264 u16 u16Channel;
265 u32 u32duration;
266 wilc_remain_on_chan_expired pRemainOnChanExpired;
267 wilc_remain_on_chan_ready pRemainOnChanReady;
268 void *pVoid;
269 u32 u32ListenSessionID;
270 };
271
272 struct reg_frame {
273 bool bReg;
274 u16 u16FrameType;
275 u8 u8Regid;
276 };
277
278
279 #define ACTION 0xD0
280 #define PROBE_REQ 0x40
281 #define PROBE_RESP 0x50
282 #define ACTION_FRM_IDX 0
283 #define PROBE_REQ_IDX 1
284
285
286 enum p2p_listen_state {
287 P2P_IDLE,
288 P2P_LISTEN,
289 P2P_GRP_FORMATION
290 };
291
292 struct host_if_drv {
293 struct user_scan_req strWILC_UsrScanReq;
294 struct user_conn_req strWILC_UsrConnReq;
295
296 /*Remain on channel struvture*/
297 struct remain_ch strHostIfRemainOnChan;
298 u8 u8RemainOnChan_pendingreq;
299 u64 u64P2p_MgmtTimeout;
300 u8 u8P2PConnect;
301
302 enum host_if_state enuHostIFstate;
303
304 u8 au8AssociatedBSSID[ETH_ALEN];
305 struct cfg_param_val strCfgValues;
306 /* semaphores */
307 struct semaphore gtOsCfgValuesSem;
308 struct semaphore hSemTestKeyBlock;
309
310 struct semaphore hSemTestDisconnectBlock;
311 struct semaphore hSemGetRSSI;
312 struct semaphore hSemGetLINKSPEED;
313 struct semaphore hSemGetCHNL;
314 struct semaphore hSemInactiveTime;
315 /* timer handlers */
316 struct timer_list hScanTimer;
317 struct timer_list hConnectTimer;
318 struct timer_list hRemainOnChannel;
319
320 bool IFC_UP;
321 };
322
323 /*!
324 * @enum tenuWILC_StaFlag
325 * @brief Used to decode the station flag set and mask in tstrWILC_AddStaParam
326 * @details
327 * @todo
328 * @sa tstrWILC_AddStaParam, enum nl80211_sta_flags
329 * @author Enumeraion's creator
330 * @date 12 July 2012
331 * @version 1.0 Description
332 */
333
334 typedef enum {
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*/
341 } tenuWILC_StaFlag;
342
343 struct add_sta_param {
344 u8 au8BSSID[ETH_ALEN];
345 u16 u16AssocID;
346 u8 u8NumRates;
347 const u8 *pu8Rates;
348 bool bIsHTSupported;
349 u16 u16HTCapInfo;
350 u8 u8AmpduParams;
351 u8 au8SuppMCsSet[16];
352 u16 u16HTExtParams;
353 u32 u32TxBeamformingCap;
354 u8 u8ASELCap;
355 u16 u16FlagsMask; /*<! Determines which of u16FlagsSet were changed>*/
356 u16 u16FlagsSet; /*<! Decoded according to tenuWILC_StaFlag */
357 };
358
359 /*****************************************************************************/
360 /* */
361 /* Host Interface API */
362 /* */
363 /*****************************************************************************/
364
365 /**
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
372 * @note
373 * @author zsalah
374 * @date 8 March 2012
375 * @version 1.0
376 */
377 s32 host_int_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress);
378 /**
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
388 * @author zsalah
389 * @date 8 March 2012
390 * @version 1.0
391 */
392 int host_int_remove_wep_key(struct host_if_drv *wfi_drv, u8 index);
393 /**
394 * @brief sets WEP deafault key
395 * @details Sets the index of the WEP encryption key in use,
396 * in the key table
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
400 * @note
401 * @author zsalah
402 * @date 8 March 2012
403 * @version 1.0
404 */
405 s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hWFIDrv, u8 u8Index);
406
407 /**
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 ||---------------------------------------|
419 |
420 * @return Error code indicating success/failure
421 * @note
422 * @author zsalah
423 * @date 8 March 2012
424 * @version 1.0
425 */
426 s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx);
427 /**
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
433 *
434 *
435 * @return Error code indicating success/failure
436 * @note
437 * @author mdaftedar
438 * @date 28 Feb 2013
439 * @version 1.0
440 */
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);
442
443 /**
444 * @brief adds ptk Key
445 * @details
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
454 * @note
455 * @author zsalah
456 * @date 8 March 2012
457 * @version 1.0
458 */
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);
461
462 /**
463 * @brief host_int_get_inactive_time
464 * @details
465 * @param[in,out] handle to the wifi driver
466 * @param[in] message containing inactive time
467 *
468 * @return Error code indicating success/failure
469 * @note
470 * @author mdaftedar
471 * @date 15 April 2013
472 * @version 1.0
473 */
474 s32 host_int_get_inactive_time(struct host_if_drv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime);
475
476 /**
477 * @brief adds Rx GTk Key
478 * @details
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
487 * @note
488 * @author zsalah
489 * @date 8 March 2012
490 * @version 1.0
491 */
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);
495
496
497 /**
498 * @brief adds Tx GTk Key
499 * @details
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
508 * @note
509 * @author zsalah
510 * @date 8 March 2012
511 * @version 1.0
512 */
513 s32 host_int_add_tx_gtk(struct host_if_drv *hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx);
514
515 /**
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
521 * management frames
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
530 * @note
531 * @author zsalah
532 * @date 8 March 2012
533 * @version 1.0
534 */
535
536 s32 host_int_set_pmkid_info(struct host_if_drv *hWFIDrv, struct host_if_pmkid_attr *pu8PmkidInfoArray);
537 /**
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
543 * management frames
544 * @param[in,out] handle to the wifi driver,
545 *
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 ||-----------------------------------------------------------------|
552 * @param[in]
553 * @return Error code indicating success/failure
554 * @note
555 * @author zsalah
556 * @date 8 March 2012
557 * @version 1.0
558 */
559
560 s32 host_int_get_pmkid_info(struct host_if_drv *hWFIDrv, u8 *pu8PmkidInfoArray,
561 u32 u32PmkidInfoLen);
562
563 /**
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
572 * @note
573 * @author zsalah
574 * @date 8 March 2012
575 * @version 1.0
576 */
577 s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv, u8 *pu8PassPhrase,
578 u8 u8Psklength);
579 /**
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
588 * @note
589 * @author zsalah
590 * @date 8 March 2012
591 * @version 1.0
592 */
593 s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
594 u8 *pu8PassPhrase, u8 u8Psklength);
595
596 /**
597 * @brief gets mac address
598 * @details
599 * @param[in,out] handle to the wifi driver,
600 *
601 * @return Error code indicating success/failure
602 * @note
603 * @author mdaftedar
604 * @date 19 April 2012
605 * @version 1.0
606 */
607 s32 host_int_get_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
608
609 /**
610 * @brief sets mac address
611 * @details
612 * @param[in,out] handle to the wifi driver,
613 *
614 * @return Error code indicating success/failure
615 * @note
616 * @author mabubakr
617 * @date 16 July 2012
618 * @version 1.0
619 */
620 s32 host_int_set_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
621
622 /**
623 * @brief wait until msg q is empty
624 * @details
625 * @param[in,out]
626 *
627 * @return Error code indicating success/failure
628 * @note
629 * @author asobhy
630 * @date 19 march 2014
631 * @version 1.0
632 */
633 int host_int_wait_msg_queue_idle(void);
634
635 /**
636 * @brief sets a start scan request
637 * @details
638 * @param[in,out] handle to the wifi driver,
639 * @param[in] Scan Source one of the following values
640 * DEFAULT_SCAN 0
641 * USER_SCAN BIT0
642 * OBSS_PERIODIC_SCAN BIT1
643 * OBSS_ONETIME_SCAN BIT2
644 * @return Error code indicating success/failure
645 * @note
646 * @author zsalah
647 * @date 8 March 2012
648 * @version 1.0
649 */
650
651 s32 host_int_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
652 /**
653 * @brief gets scan source of the last scan
654 * @details
655 * @param[in,out] handle to the wifi driver,
656 * Scan Source one of the following values
657 * DEFAULT_SCAN 0
658 * USER_SCAN BIT0
659 * OBSS_PERIODIC_SCAN BIT1
660 * OBSS_ONETIME_SCAN BIT2
661 * @return Error code indicating success/failure
662 * @note
663 * @author zsalah
664 * @date 8 March 2012
665 * @version 1.0
666 */
667 s32 host_int_get_start_scan_req(struct host_if_drv *hWFIDrv, u8 *pu8ScanSource);
668
669 /**
670 * @brief sets a join request
671 * @details
672 * @param[in,out] handle to the wifi driver,
673 * @param[in] Index of the bss descriptor
674 * @return Error code indicating success/failure
675 * @note
676 * @author zsalah
677 * @date 8 March 2012
678 * @version 1.0
679 */
680
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,
686 u8 u8channel,
687 void *pJoinParams);
688
689 /**
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
695 * @note
696 * @author Amr Abdel-Moghny
697 * @date 19 DEC 2013
698 * @version 8.0
699 */
700
701 s32 host_int_flush_join_req(struct host_if_drv *hWFIDrv);
702
703
704 /**
705 * @brief disconnects from the currently associated network
706 * @details
707 * @param[in,out] handle to the wifi driver,
708 * @param[in] Reason Code of the Disconnection
709 * @return Error code indicating success/failure
710 * @note
711 * @author zsalah
712 * @date 8 March 2012
713 * @version 1.0
714 */
715 s32 host_int_disconnect(struct host_if_drv *hWFIDrv, u16 u16ReasonCode);
716
717 /**
718 * @brief disconnects a sta
719 * @details
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
723 * @note
724 * @author zsalah
725 * @date 8 March 2012
726 * @version 1.0
727 */
728 s32 host_int_disconnect_station(struct host_if_drv *hWFIDrv, u8 assoc_id);
729 /**
730 * @brief gets a Association request info
731 * @details
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 ||-------------------------------------------------------------------|
741 | |
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
749 * @note
750 * @author zsalah
751 * @date 8 March 2012
752 * @version 1.0
753 */
754
755 s32 host_int_get_assoc_req_info(struct host_if_drv *hWFIDrv, u8 *pu8AssocReqInfo,
756 u32 u32AssocReqInfoLen);
757 /**
758 * @brief gets a Association Response info
759 * @details
760 * @param[in,out] handle to the wifi driver,
761 * Message containg assoc. resp info
762 * @return Error code indicating success/failure
763 * @note
764 * @author zsalah
765 * @date 8 March 2012
766 * @version 1.0
767 */
768
769 s32 host_int_get_assoc_res_info(struct host_if_drv *hWFIDrv, u8 *pu8AssocRespInfo,
770 u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen);
771 /**
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
781 * @note
782 * @author zsalah
783 * @date 8 March 2012
784 * @version 1.0
785 */
786 s32 host_int_get_rx_power_level(struct host_if_drv *hWFIDrv, u8 *pu8RxPowerLevel,
787 u32 u32RxPowerLevelLen);
788
789 /**
790 * @brief sets a channel
791 * @details
792 * @param[in,out] handle to the wifi driver,
793 * @param[in] Index of the channel to be set
794 *|-------------------------------------------------------------------|
795 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
796 | Input: 1 2 14 |
797 ||-------------------------------------------------------------------|
798 * @return Error code indicating success/failure
799 * @note
800 * @author zsalah
801 * @date 8 March 2012
802 * @version 1.0
803 */
804 int host_int_set_mac_chnl_num(struct host_if_drv *wfi_drv, u8 channel);
805
806 /**
807 * @brief gets the current channel index
808 * @details
809 * @param[in,out] handle to the wifi driver,
810 * current channel index
811 *|-----------------------------------------------------------------------|
812 | CHANNEL1 CHANNEL2 .... CHANNEL14 |
813 | Input: 1 2 14 |
814 ||-----------------------------------------------------------------------|
815 * @return Error code indicating success/failure
816 * @note
817 * @author zsalah
818 * @date 8 March 2012
819 * @version 1.0
820 */
821 s32 host_int_get_host_chnl_num(struct host_if_drv *hWFIDrv, u8 *pu8ChNo);
822 /**
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,
828 * rssi value in dB
829 * @return Error code indicating success/failure
830 * @note
831 * @author zsalah
832 * @date 8 March 2012
833 * @version 1.0
834 */
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);
837 /**
838 * @brief scans a set of channels
839 * @details
840 * @param[in,out] handle to the wifi driver,
841 * @param[in] Scan source
842 * Scan Type PASSIVE_SCAN = 0,
843 * ACTIVE_SCAN = 1
844 * Channels Array
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
849 * @note
850 * @author zsalah
851 * @date 8 March 2012
852 * @version 1.0
853 */
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,
858 void *pvUserArg,
859 struct hidden_network *pstrHiddenNetwork);
860 /**
861 * @brief sets configuration wids values
862 * @details
863 * @param[in,out] handle to the wifi driver,
864 * @param[in] WID, WID value
865 * @return Error code indicating success/failure
866 * @note
867 * @author zsalah
868 * @date 8 March 2012
869 * @version 1.0
870 */
871 s32 hif_set_cfg(struct host_if_drv *hWFIDrv, struct cfg_param_val *pstrCfgParamVal);
872
873 /**
874 * @brief gets configuration wids values
875 * @details
876 * @param[in,out] handle to the wifi driver,
877 * WID value
878 * @param[in] WID,
879 * @return Error code indicating success/failure
880 * @note
881 * @author zsalah
882 * @date 8 March 2012
883 * @version 1.0
884 */
885 s32 hif_get_cfg(struct host_if_drv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
886 /*****************************************************************************/
887 /* Notification Functions */
888 /*****************************************************************************/
889 /**
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:
896 * Join = 1,
897 * Leave =0
898 * @return Error code indicating success/failure
899 * @note
900 * @author zsalah
901 * @date 8 March 2012
902 * @version 1.0
903 */
904 void host_int_send_join_leave_info_to_host
905 (u16 assocId, u8 *stationAddr, bool joining);
906
907 /**
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,
912 * Frame length,
913 * Rssi of the Station found
914 * @return Error code indicating success/failure
915 * @note
916 * @author zsalah
917 * @date 8 March 2012
918 * @version 1.0
919 */
920 void host_int_send_network_info_to_host
921 (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi);
922
923 /**
924 * @brief host interface initialization function
925 * @details
926 * @param[in,out] handle to the wifi driver,
927 * @note
928 * @author zsalah
929 * @date 8 March 2012
930 * @version 1.0
931 */
932 s32 host_int_init(struct host_if_drv **phWFIDrv);
933
934 /**
935 * @brief host interface initialization function
936 * @details
937 * @param[in,out] handle to the wifi driver,
938 * @note
939 * @author zsalah
940 * @date 8 March 2012
941 * @version 1.0
942 */
943 s32 host_int_deinit(struct host_if_drv *hWFIDrv);
944
945
946 /*!
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
949 * @details
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
961 * @todo
962 * @sa
963 * @author Adham Abozaeid
964 * @date 10 Julys 2012
965 * @version 1.0 Description
966 *
967 */
968 s32 host_int_add_beacon(struct host_if_drv *hWFIDrv, u32 u32Interval,
969 u32 u32DTIMPeriod,
970 u32 u32HeadLen, u8 *pu8Head,
971 u32 u32TailLen, u8 *pu8tail);
972
973
974 /*!
975 * @fn s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
976 * @brief Removes the beacon and stops trawilctting it over the air
977 * @details
978 * @param[in,out] hWFIDrv handle to the wifi driver
979 * @return 0 for Success, error otherwise
980 * @todo
981 * @sa
982 * @author Adham Abozaeid
983 * @date 10 Julys 2012
984 * @version 1.0 Description
985 */
986 s32 host_int_del_beacon(struct host_if_drv *hWFIDrv);
987
988 /*!
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
992 * @details
993 * @param[in,out] hWFIDrv handle to the wifi driver
994 * @param[in] pstrStaParams Station's parameters
995 * @return 0 for Success, error otherwise
996 * @todo
997 * @sa
998 * @author Adham Abozaeid
999 * @date 12 July 2012
1000 * @version 1.0 Description
1001 */
1002 s32 host_int_add_station(struct host_if_drv *hWFIDrv,
1003 struct add_sta_param *pstrStaParams);
1004
1005 /*!
1006 * @fn s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
1007 * @brief Deauthenticates clients when group is terminating
1008 * @details
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
1012 * @todo
1013 * @sa
1014 * @author Mai Daftedar
1015 * @date 09 April 2014
1016 * @version 1.0 Description
1017 */
1018 s32 host_int_del_allstation(struct host_if_drv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
1019
1020 /*!
1021 * @fn s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
1022 * @brief Notifies the firmware with a new deleted station
1023 * @details
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
1027 * @todo
1028 * @sa
1029 * @author Adham Abozaeid
1030 * @date 15 July 2012
1031 * @version 1.0 Description
1032 */
1033 s32 host_int_del_station(struct host_if_drv *hWFIDrv, const u8 *pu8MacAddr);
1034
1035 /*!
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
1039 * @details
1040 * @param[in,out] hWFIDrv handle to the wifi driver
1041 * @param[in] pstrStaParams Station's parameters
1042 * @return 0 for Success, error otherwise
1043 * @todo
1044 * @sa
1045 * @author Adham Abozaeid
1046 * @date 15 July 2012
1047 * @version 1.0 Description
1048 */
1049 s32 host_int_edit_station(struct host_if_drv *hWFIDrv,
1050 struct add_sta_param *pstrStaParams);
1051
1052 /*!
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
1055 * @details
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
1061 * @todo
1062 * @sa
1063 * @author Adham Abozaeid
1064 * @date 24 November 2012
1065 * @version 1.0 Description
1066 */
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
1071 *
1072 * @return 0 for Success, error otherwise
1073 * @todo
1074 * @sa
1075 * @author Adham Abozaeid
1076 * @date 24 November 2012
1077 * @version 1.0 Description
1078 */
1079 s32 host_int_setup_multicast_filter(struct host_if_drv *hWFIDrv, bool bIsEnabled, u32 u32count);
1080 /**
1081 * @brief host_int_setup_ipaddress
1082 * @details set IP address on firmware
1083 * @param[in]
1084 * @return Error code.
1085 * @author Abdelrahman Sobhy
1086 * @date
1087 * @version 1.0
1088 */
1089 s32 host_int_setup_ipaddress(struct host_if_drv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1090
1091
1092 /**
1093 * @brief host_int_delBASession
1094 * @details Delete single Rx BA session
1095 * @param[in]
1096 * @return Error code.
1097 * @author Abdelrahman Sobhy
1098 * @date
1099 * @version 1.0
1100 */
1101 s32 host_int_delBASession(struct host_if_drv *hWFIDrv, char *pBSSID, char TID);
1102
1103 /**
1104 * @brief host_int_delBASession
1105 * @details Delete all Rx BA session
1106 * @param[in]
1107 * @return Error code.
1108 * @author Abdelrahman Sobhy
1109 * @date
1110 * @version 1.0
1111 */
1112 s32 host_int_del_All_Rx_BASession(struct host_if_drv *hWFIDrv, char *pBSSID, char TID);
1113
1114
1115 /**
1116 * @brief host_int_get_ipaddress
1117 * @details get IP address on firmware
1118 * @param[in]
1119 * @return Error code.
1120 * @author Abdelrahman Sobhy
1121 * @date
1122 * @version 1.0
1123 */
1124 s32 host_int_get_ipaddress(struct host_if_drv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
1125
1126 /**
1127 * @brief host_int_remain_on_channel
1128 * @details
1129 * @param[in]
1130 * @return Error code.
1131 * @author
1132 * @date
1133 * @version 1.0
1134 */
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);
1136
1137 /**
1138 * @brief host_int_ListenStateExpired
1139 * @details
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
1145 * Priv
1146 * @return Error code.
1147 * @author
1148 * @date
1149 * @version 1.0
1150 */
1151 s32 host_int_ListenStateExpired(struct host_if_drv *hWFIDrv, u32 u32SessionID);
1152
1153 /**
1154 * @brief host_int_frame_register
1155 * @details
1156 * @param[in]
1157 * @return Error code.
1158 * @author
1159 * @date
1160 * @version 1.0
1161 */
1162 s32 host_int_frame_register(struct host_if_drv *hWFIDrv, u16 u16FrameType, bool bReg);
1163 /**
1164 * @brief host_int_set_wfi_drv_handler
1165 * @details
1166 * @param[in]
1167 * @return Error code.
1168 * @author
1169 * @date
1170 * @version 1.0
1171 */
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);
1174
1175 static s32 Handle_ScanDone(struct host_if_drv *drvHandler, tenuScanEvent enuEvent);
1176
1177 void host_int_freeJoinParams(void *pJoinParams);
1178
1179 s32 host_int_get_statistics(struct host_if_drv *hWFIDrv, tstrStatistics *pstrStatistics);
1180
1181 #endif
This page took 0.054763 seconds and 4 git commands to generate.