2008-02-27 20:34:43 -05:00
|
|
|
/*
|
|
|
|
* WPA Supplicant - driver_wext exported functions
|
|
|
|
* Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
2012-02-11 09:46:35 -05:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-27 20:34:43 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DRIVER_WEXT_H
|
|
|
|
#define DRIVER_WEXT_H
|
|
|
|
|
2008-03-13 13:00:37 -04:00
|
|
|
#include <net/if.h>
|
|
|
|
|
|
|
|
struct wpa_driver_wext_data {
|
|
|
|
void *ctx;
|
2009-12-18 10:11:54 -05:00
|
|
|
struct netlink_data *netlink;
|
2008-03-13 13:00:37 -04:00
|
|
|
int ioctl_sock;
|
|
|
|
int mlme_sock;
|
|
|
|
char ifname[IFNAMSIZ + 1];
|
2010-11-26 14:46:30 -05:00
|
|
|
char phyname[32];
|
2008-03-13 13:00:37 -04:00
|
|
|
int ifindex;
|
|
|
|
int ifindex2;
|
2008-07-24 18:30:53 -04:00
|
|
|
int if_removed;
|
2010-05-31 11:00:27 -04:00
|
|
|
int if_disabled;
|
2010-05-23 03:27:32 -04:00
|
|
|
struct rfkill_data *rfkill;
|
2008-03-13 13:00:37 -04:00
|
|
|
u8 *assoc_req_ies;
|
|
|
|
size_t assoc_req_ies_len;
|
|
|
|
u8 *assoc_resp_ies;
|
|
|
|
size_t assoc_resp_ies_len;
|
|
|
|
struct wpa_driver_capa capa;
|
|
|
|
int has_capability;
|
|
|
|
int we_version_compiled;
|
|
|
|
|
|
|
|
/* for set_auth_alg fallback */
|
|
|
|
int use_crypt;
|
|
|
|
int auth_alg_fallback;
|
|
|
|
|
|
|
|
int operstate;
|
|
|
|
|
|
|
|
char mlmedev[IFNAMSIZ + 1];
|
|
|
|
|
|
|
|
int scan_complete_events;
|
2010-01-12 13:01:09 -05:00
|
|
|
|
|
|
|
int cfg80211; /* whether driver is using cfg80211 */
|
wext: Fix scan result signal levels when driver reports in dBm
wpa_supplicant showed signal levels incorrectly with some drivers:
Jun 6 16:29:36 rupert wpa_supplicant[18945]: Current BSS: 00:0d:97:11:40:d6
level=190
Jun 6 16:29:36 rupert wpa_supplicant[18945]: Selected BSS: 00:0d:97:11:50:09
level=192
Judging from output from other tools (iwlist) and the min_diff block
at the end of wpa_supplicant_need_to_roam, it seems these values
should actually be negative. Specifically, if one treats that number
as a signed char instead of unsigned, everything matches up.
To be honest, I've little to no understanding of wireless, but looking
at the source code for wireless-tools (iw_print_stats in iwlib.c), it
seems that the fields of the iw_quality struct need to be decoded
differently depending on various flags. I guess
src/drivers/driver_wext.c should have similar logic in
wext_get_scan_qual.
I wrote a patch that attempts to replicate some of that logic,
although it may be more complicated than is necessary; I think some of
the complexity is for backwards-compatibility, which might not be
necessary depending on wpa_supplicant's dependencies? In any case, it
is attached. Again, I don't know how any of this works, so it's likely
the patch is a bit off. But I think at least the logic to determine
min_diff in wpa_supplicant_need_to_roam would be more accurate if
level were determined correctly.
2010-09-05 12:04:10 -04:00
|
|
|
|
|
|
|
u8 max_level;
|
2011-11-25 14:49:03 -05:00
|
|
|
|
|
|
|
#ifdef ANDROID
|
|
|
|
int errors;
|
|
|
|
int driver_is_started;
|
|
|
|
int bgscan_enabled;
|
|
|
|
#endif /* ANDROID */
|
2008-03-13 13:00:37 -04:00
|
|
|
};
|
2008-02-27 20:34:43 -05:00
|
|
|
|
|
|
|
int wpa_driver_wext_get_bssid(void *priv, u8 *bssid);
|
|
|
|
int wpa_driver_wext_set_bssid(void *priv, const u8 *bssid);
|
|
|
|
int wpa_driver_wext_get_ssid(void *priv, u8 *ssid);
|
|
|
|
int wpa_driver_wext_set_ssid(void *priv, const u8 *ssid, size_t ssid_len);
|
|
|
|
int wpa_driver_wext_set_freq(void *priv, int freq);
|
|
|
|
int wpa_driver_wext_set_mode(void *priv, int mode);
|
2009-12-26 03:35:08 -05:00
|
|
|
int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg,
|
2008-02-27 20:34:43 -05:00
|
|
|
const u8 *addr, int key_idx,
|
|
|
|
int set_tx, const u8 *seq, size_t seq_len,
|
|
|
|
const u8 *key, size_t key_len);
|
2009-11-23 14:13:46 -05:00
|
|
|
int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params);
|
2008-02-27 20:34:43 -05:00
|
|
|
struct wpa_scan_results * wpa_driver_wext_get_scan_results(void *priv);
|
|
|
|
|
|
|
|
void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx);
|
|
|
|
|
|
|
|
int wpa_driver_wext_alternative_ifindex(struct wpa_driver_wext_data *drv,
|
|
|
|
const char *ifname);
|
|
|
|
|
|
|
|
void * wpa_driver_wext_init(void *ctx, const char *ifname);
|
|
|
|
void wpa_driver_wext_deinit(void *priv);
|
|
|
|
|
|
|
|
int wpa_driver_wext_set_operstate(void *priv, int state);
|
|
|
|
int wpa_driver_wext_get_version(struct wpa_driver_wext_data *drv);
|
|
|
|
|
2008-03-13 13:00:37 -04:00
|
|
|
int wpa_driver_wext_associate(void *priv,
|
|
|
|
struct wpa_driver_associate_params *params);
|
|
|
|
int wpa_driver_wext_get_capa(void *priv, struct wpa_driver_capa *capa);
|
|
|
|
int wpa_driver_wext_set_auth_param(struct wpa_driver_wext_data *drv,
|
|
|
|
int idx, u32 value);
|
|
|
|
int wpa_driver_wext_cipher2wext(int cipher);
|
|
|
|
int wpa_driver_wext_keymgmt2wext(int keymgmt);
|
|
|
|
|
2008-02-27 20:34:43 -05:00
|
|
|
#endif /* DRIVER_WEXT_H */
|