xref: /freebsd/contrib/wpa/src/drivers/driver_wext.h (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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_scan(void *priv, struct wpa_driver_scan_params *params);
56 struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv);
57 
58 void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx);
59 
60 int wpa_driver_wext_alternative_ifindex(struct wpa_driver_wext_data *drv,
61 					const char *ifname);
62 
63 void * wpa_driver_wext_init(void *ctx, const char *ifname);
64 void wpa_driver_wext_deinit(void *priv);
65 
66 int wpa_driver_wext_set_operstate(void *priv, int state);
67 int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv);
68 
69 int wpa_driver_wext_associate(void *priv,
70 			      struct wpa_driver_associate_params *params);
71 int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa);
72 int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv,
73 				   int idx, u32 value);
74 int wpa_driver_wext_cipher2wext(int cipher);
75 int wpa_driver_wext_keymgmt2wext(int keymgmt);
76 
77 #endif /* DRIVER_WEXT_H */
78