1 /*
2  * WPA Supplicant - driver_wext exported functions
3  * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef DRIVER_WEXT_H
10 #define DRIVER_WEXT_H
11 
12 #include <net/if.h>
13 
14 struct wpa_driver_wext_data {
15 	void *ctx;
16 	struct netlink_data *netlink;
17 	int ioctl_sock;
18 	int mlme_sock;
19 	char ifname[IFNAMSIZ + 1];
20 	char phyname[32];
21 	int ifindex;
22 	int ifindex2;
23 	int if_removed;
24 	int if_disabled;
25 	struct rfkill_data *rfkill;
26 	u8 *assoc_req_ies;
27 	size_t assoc_req_ies_len;
28 	u8 *assoc_resp_ies;
29 	size_t assoc_resp_ies_len;
30 	struct wpa_driver_capa capa;
31 	int has_capability;
32 	int we_version_compiled;
33 
34 	/* for set_auth_alg fallback */
35 	int use_crypt;
36 	int auth_alg_fallback;
37 
38 	int operstate;
39 
40 	char mlmedev[IFNAMSIZ + 1];
41 
42 	int scan_complete_events;
43 
44 	int cfg80211; /* whether driver is using cfg80211 */
45 
46 	u8 max_level;
47 };
48 
49 int wpa_driver_wext_get_bssid(void *priv, u8 *bssid);
50 int wpa_driver_wext_set_bssid(void *priv, const u8 *bssid);
51 int wpa_driver_wext_get_ssid(void *priv, u8 *ssid);
52 int wpa_driver_wext_set_ssid(void *priv, const u8 *ssid, size_t ssid_len);
53 int wpa_driver_wext_set_freq(void *priv, int freq);
54 int wpa_driver_wext_set_mode(void *priv, int mode);
55 int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg,
56 			    const u8 *addr, int key_idx,
57 			    int set_tx, const u8 *seq, size_t seq_len,
58 			    const u8 *key, size_t key_len);
59 int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params);
60 struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv);
61 
62 void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx);
63 
64 int wpa_driver_wext_alternative_ifindex(struct wpa_driver_wext_data *drv,
65 					const char *ifname);
66 
67 void * wpa_driver_wext_init(void *ctx, const char *ifname);
68 void wpa_driver_wext_deinit(void *priv);
69 
70 int wpa_driver_wext_set_operstate(void *priv, int state);
71 int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv);
72 
73 int wpa_driver_wext_associate(void *priv,
74 			      struct wpa_driver_associate_params *params);
75 int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa);
76 int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv,
77 				   int idx, u32 value);
78 int wpa_driver_wext_cipher2wext(int cipher);
79 int wpa_driver_wext_keymgmt2wext(int keymgmt);
80 
81 #endif /* DRIVER_WEXT_H */
82