Home | History | Annotate | Download | only in drivers
      1 /*
      2  * WPA Supplicant - driver_wext exported functions
      3  * Copyright (c) 2003-2005, Jouni Malinen <j (at) 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 #ifdef ANDROID
     49 	int errors;
     50 	int driver_is_started;
     51 	int bgscan_enabled;
     52 #endif /* ANDROID */
     53 };
     54 
     55 int wpa_driver_wext_get_bssid(void *priv, u8 *bssid);
     56 int wpa_driver_wext_set_bssid(void *priv, const u8 *bssid);
     57 int wpa_driver_wext_get_ssid(void *priv, u8 *ssid);
     58 int wpa_driver_wext_set_ssid(void *priv, const u8 *ssid, size_t ssid_len);
     59 int wpa_driver_wext_set_freq(void *priv, int freq);
     60 int wpa_driver_wext_set_mode(void *priv, int mode);
     61 int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg,
     62 			    const u8 *addr, int key_idx,
     63 			    int set_tx, const u8 *seq, size_t seq_len,
     64 			    const u8 *key, size_t key_len);
     65 int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params);
     66 struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv);
     67 
     68 void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx);
     69 
     70 int wpa_driver_wext_alternative_ifindex(struct wpa_driver_wext_data *drv,
     71 					const char *ifname);
     72 
     73 void * wpa_driver_wext_init(void *ctx, const char *ifname);
     74 void wpa_driver_wext_deinit(void *priv);
     75 
     76 int wpa_driver_wext_set_operstate(void *priv, int state);
     77 int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv);
     78 
     79 int wpa_driver_wext_associate(void *priv,
     80 			      struct wpa_driver_associate_params *params);
     81 int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa);
     82 int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv,
     83 				   int idx, u32 value);
     84 int wpa_driver_wext_cipher2wext(int cipher);
     85 int wpa_driver_wext_keymgmt2wext(int keymgmt);
     86 
     87 #endif /* DRIVER_WEXT_H */
     88