4 #include "coreconfigurator.h"
10 #define STATION_MODE 0x02
12 #define CLIENT_MODE 0x04
14 #define PROBE_REQ 0x40
15 #define PROBE_RESP 0x50
17 #define ACTION_FRM_IDX 0
18 #define PROBE_REQ_IDX 1
20 #define ACTIVE_SCAN_TIME 10
21 #define PASSIVE_SCAN_TIME 1200
22 #define MIN_SCAN_TIME 10
23 #define MAX_SCAN_TIME 1200
24 #define DEFAULT_SCAN 0
25 #define USER_SCAN BIT(0)
26 #define OBSS_PERIODIC_SCAN BIT(1)
27 #define OBSS_ONETIME_SCAN BIT(2)
28 #define GTK_RX_KEY_BUFF_LEN 24
31 #define DEFAULTKEY 0x4
33 #define MAX_NUM_SCANNED_NETWORKS 100
34 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
35 #define MAX_NUM_PROBED_SSID 10
36 #define CHANNEL_SCAN_TIME 250
38 #define TX_MIC_KEY_LEN 8
39 #define RX_MIC_KEY_LEN 8
40 #define PTK_KEY_LEN 16
42 #define TX_MIC_KEY_MSG_LEN 26
43 #define RX_MIC_KEY_MSG_LEN 48
44 #define PTK_KEY_MSG_LEN 39
46 #define PMKSA_KEY_LEN 22
49 #define WILC_MAX_NUM_PMKIDS 16
50 #define WILC_SUPP_MCS_SET_SIZE 16
51 #define WILC_ADD_STA_LENGTH 40
52 #define SCAN_EVENT_DONE_ABORTED
53 #define NUM_CONCURRENT_IFC 2
66 HOST_IF_CONNECTING = 2,
67 HOST_IF_WAITING_CONN_RESP = 3,
68 HOST_IF_CONNECTED = 4,
69 HOST_IF_P2P_LISTEN = 5,
70 HOST_IF_FORCE_32BIT = 0xFFFFFFFF
73 struct host_if_pmkid {
78 struct host_if_pmkid_attr {
80 struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
99 struct cfg_param_val {
106 u16 short_retry_limit;
107 u16 long_retry_limit;
111 u8 short_slot_allowed;
112 u8 txop_prot_disabled;
115 enum SITESURVEY site_survey_enabled;
116 u16 site_survey_scan_time;
118 u16 active_scan_time;
119 u16 passive_scan_time;
120 enum CURRENT_TXRATE curr_tx_rate;
125 RETRY_SHORT = BIT(0),
127 FRAG_THRESHOLD = BIT(2),
128 RTS_THRESHOLD = BIT(3),
131 AUTHEN_TIMEOUT = BIT(6),
132 POWER_MANAGEMENT = BIT(7),
134 SHORT_SLOT_ALLOWED = BIT(9),
135 TXOP_PROT_DISABLE = BIT(10),
136 BEACON_INTERVAL = BIT(11),
137 DTIM_PERIOD = BIT(12),
138 SITE_SURVEY = BIT(13),
139 SITE_SURVEY_SCAN_TIME = BIT(14),
140 ACTIVE_SCANTIME = BIT(15),
141 PASSIVE_SCANTIME = BIT(16),
142 CURRENT_TX_RATE = BIT(17),
146 struct found_net_info {
152 SCAN_EVENT_NETWORK_FOUND = 0,
154 SCAN_EVENT_ABORTED = 2,
155 SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF
159 CONN_DISCONN_EVENT_CONN_RESP = 0,
160 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
161 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
171 typedef void (*wilc_scan_result)(enum scan_event, tstrNetworkInfo *,
174 typedef void (*wilc_connect_result)(enum conn_event,
177 tstrDisconnectNotifInfo *,
180 typedef void (*wilc_remain_on_chan_expired)(void *, u32);
181 typedef void (*wilc_remain_on_chan_ready)(void *);
183 struct rcvd_net_info {
188 struct hidden_net_info {
193 struct hidden_network {
194 struct hidden_net_info *pstrHiddenNetworkInfo;
198 struct user_scan_req {
199 wilc_scan_result scan_result;
202 struct found_net_info net_info[MAX_NUM_SCANNED_NETWORKS];
205 struct user_conn_req {
209 enum AUTHTYPE auth_type;
213 wilc_connect_result conn_result;
226 struct set_mac_addr {
227 u8 mac_addr[ETH_ALEN];
230 struct get_mac_addr {
234 struct ba_session_info {
244 wilc_remain_on_chan_expired expired;
245 wilc_remain_on_chan_ready ready;
256 enum p2p_listen_state {
263 struct user_scan_req usr_scan_req;
264 struct user_conn_req usr_conn_req;
265 struct remain_ch remain_on_ch;
266 u8 remain_on_ch_pending;
270 enum host_if_state hif_state;
272 u8 assoc_bssid[ETH_ALEN];
273 struct cfg_param_val cfg_values;
275 struct semaphore sem_cfg_values;
276 struct semaphore sem_test_key_block;
277 struct semaphore sem_test_disconn_block;
278 struct semaphore sem_get_rssi;
279 struct semaphore sem_get_link_speed;
280 struct semaphore sem_get_chnl;
281 struct semaphore sem_inactive_time;
283 struct timer_list scan_timer;
284 struct timer_list connect_timer;
285 struct timer_list remain_on_ch_timer;
290 struct add_sta_param {
298 u8 ht_supp_mcs_set[16];
306 s32 host_int_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress);
307 int host_int_remove_wep_key(struct host_if_drv *wfi_drv, u8 index);
308 int host_int_set_wep_default_key(struct host_if_drv *hif_drv, u8 index);
309 int host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
310 const u8 *key, u8 len, u8 index);
311 int host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
312 const u8 *key, u8 len, u8 index, u8 mode,
313 enum AUTHTYPE auth_type);
314 int host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *ptk,
315 u8 ptk_key_len, const u8 *mac_addr,
316 const u8 *rx_mic, const u8 *tx_mic,
317 u8 mode, u8 cipher_mode, u8 index);
318 s32 host_int_get_inactive_time(struct host_if_drv *hWFIDrv, const u8 *mac,
319 u32 *pu32InactiveTime);
320 int host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *rx_gtk,
321 u8 gtk_key_len, u8 index,
322 u32 key_rsc_len, const u8 *key_rsc,
323 const u8 *rx_mic, const u8 *pu8TxMic,
324 u8 mode, u8 u8Ciphermode);
325 s32 host_int_add_tx_gtk(struct host_if_drv *hWFIDrv, u8 u8KeyLen,
326 u8 *pu8TxGtk, u8 u8KeyIdx);
327 s32 host_int_set_pmkid_info(struct host_if_drv *hWFIDrv,
328 struct host_if_pmkid_attr *pu8PmkidInfoArray);
329 s32 host_int_get_pmkid_info(struct host_if_drv *hWFIDrv, u8 *pu8PmkidInfoArray,
330 u32 u32PmkidInfoLen);
331 s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
334 s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
335 u8 *pu8PassPhrase, u8 u8Psklength);
336 s32 hif_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
337 s32 host_int_set_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
338 int host_int_wait_msg_queue_idle(void);
339 s32 host_int_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
340 s32 host_int_get_start_scan_req(struct host_if_drv *hWFIDrv, u8 *pu8ScanSource);
341 s32 host_int_set_join_req(struct host_if_drv *hWFIDrv, u8 *pu8bssid,
342 const u8 *pu8ssid, size_t ssidLen,
343 const u8 *pu8IEs, size_t IEsLen,
344 wilc_connect_result pfConnectResult, void *pvUserArg,
345 u8 u8security, enum AUTHTYPE tenuAuth_type,
346 u8 u8channel, void *pJoinParams);
347 s32 host_int_flush_join_req(struct host_if_drv *hWFIDrv);
348 s32 host_int_disconnect(struct host_if_drv *hWFIDrv, u16 u16ReasonCode);
349 s32 host_int_disconnect_station(struct host_if_drv *hWFIDrv, u8 assoc_id);
350 s32 host_int_get_assoc_req_info(struct host_if_drv *hWFIDrv,
352 u32 u32AssocReqInfoLen);
353 s32 host_int_get_assoc_res_info(struct host_if_drv *hWFIDrv,
354 u8 *pu8AssocRespInfo,
355 u32 u32MaxAssocRespInfoLen,
356 u32 *pu32RcvdAssocRespInfoLen);
357 s32 host_int_get_rx_power_level(struct host_if_drv *hWFIDrv,
359 u32 u32RxPowerLevelLen);
360 int host_int_set_mac_chnl_num(struct host_if_drv *wfi_drv, u8 channel);
361 s32 host_int_get_host_chnl_num(struct host_if_drv *hWFIDrv, u8 *pu8ChNo);
362 s32 host_int_get_rssi(struct host_if_drv *hWFIDrv, s8 *ps8Rssi);
363 s32 host_int_get_link_speed(struct host_if_drv *hWFIDrv, s8 *ps8lnkspd);
364 s32 host_int_scan(struct host_if_drv *hWFIDrv, u8 u8ScanSource,
365 u8 u8ScanType, u8 *pu8ChnlFreqList,
366 u8 u8ChnlListLen, const u8 *pu8IEs,
367 size_t IEsLen, wilc_scan_result ScanResult,
368 void *pvUserArg, struct hidden_network *pstrHiddenNetwork);
369 s32 hif_set_cfg(struct host_if_drv *hWFIDrv,
370 struct cfg_param_val *pstrCfgParamVal);
371 s32 hif_get_cfg(struct host_if_drv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value);
372 s32 host_int_init(struct net_device *dev, struct host_if_drv **phWFIDrv);
373 s32 host_int_deinit(struct host_if_drv *hWFIDrv);
374 s32 host_int_add_beacon(struct host_if_drv *hWFIDrv, u32 u32Interval,
380 int host_int_del_beacon(struct host_if_drv *hif_drv);
381 int host_int_add_station(struct host_if_drv *hif_drv,
382 struct add_sta_param *sta_param);
383 s32 host_int_del_allstation(struct host_if_drv *hWFIDrv,
384 u8 pu8MacAddr[][ETH_ALEN]);
385 int host_int_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr);
386 s32 host_int_edit_station(struct host_if_drv *hWFIDrv,
387 struct add_sta_param *pstrStaParams);
388 s32 host_int_set_power_mgmt(struct host_if_drv *hWFIDrv,
391 s32 host_int_setup_multicast_filter(struct host_if_drv *hWFIDrv,
394 s32 host_int_setup_ipaddress(struct host_if_drv *hWFIDrv,
397 s32 host_int_delBASession(struct host_if_drv *hWFIDrv, char *pBSSID, char TID);
398 s32 host_int_del_All_Rx_BASession(struct host_if_drv *hWFIDrv,
401 s32 host_int_get_ipaddress(struct host_if_drv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
402 s32 host_int_remain_on_channel(struct host_if_drv *hWFIDrv,
406 wilc_remain_on_chan_expired RemainOnChanExpired,
407 wilc_remain_on_chan_ready RemainOnChanReady,
409 s32 host_int_ListenStateExpired(struct host_if_drv *hWFIDrv, u32 u32SessionID);
410 s32 host_int_frame_register(struct host_if_drv *hWFIDrv,
413 int host_int_set_wfi_drv_handler(struct host_if_drv *address);
414 int host_int_set_operation_mode(struct host_if_drv *wfi_drv, u32 mode);
416 static s32 Handle_ScanDone(struct host_if_drv *drvHandler,
417 enum scan_event enuEvent);
419 void host_int_freeJoinParams(void *pJoinParams);
421 s32 host_int_get_statistics(struct host_if_drv *hWFIDrv,
422 struct rf_info *pstrStatistics);
423 void resolve_disconnect_aberration(struct host_if_drv *hif_drv);