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 skip_disconnect; 52 int bgscan_enabled; 53 #endif /* ANDROID */ 54 }; 55 56 int wpa_driver_wext_get_bssid(void *priv, u8 *bssid); 57 int wpa_driver_wext_set_bssid(void *priv, const u8 *bssid); 58 int wpa_driver_wext_get_ssid(void *priv, u8 *ssid); 59 int wpa_driver_wext_set_ssid(void *priv, const u8 *ssid, size_t ssid_len); 60 int wpa_driver_wext_set_freq(void *priv, int freq); 61 int wpa_driver_wext_set_mode(void *priv, int mode); 62 int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg, 63 const u8 *addr, int key_idx, 64 int set_tx, const u8 *seq, size_t seq_len, 65 const u8 *key, size_t key_len); 66 int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params); 67 struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv); 68 69 void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx); 70 71 int wpa_driver_wext_alternative_ifindex(struct wpa_driver_wext_data *drv, 72 const char *ifname); 73 74 void * wpa_driver_wext_init(void *ctx, const char *ifname); 75 void wpa_driver_wext_deinit(void *priv); 76 77 int wpa_driver_wext_set_operstate(void *priv, int state); 78 int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv); 79 80 int wpa_driver_wext_associate(void *priv, 81 struct wpa_driver_associate_params *params); 82 int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa); 83 int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv, 84 int idx, u32 value); 85 int wpa_driver_wext_cipher2wext(int cipher); 86 int wpa_driver_wext_keymgmt2wext(int keymgmt); 87 88 #endif /* DRIVER_WEXT_H */ 89