driver.h
Go to the documentation of this file.
00001 /*
00002  * Driver interface definition
00003  * Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 2 as
00007  * published by the Free Software Foundation.
00008  *
00009  * Alternatively, this software may be distributed under the terms of BSD
00010  * license.
00011  *
00012  * See README and COPYING for more details.
00013  *
00014  * This file defines a driver interface used by both %wpa_supplicant and
00015  * hostapd. The first part of the file defines data structures used in various
00016  * driver operations. This is followed by the struct wpa_driver_ops that each
00017  * driver wrapper will beed to define with callback functions for requesting
00018  * driver operations. After this, there are definitions for driver event
00019  * reporting with wpa_supplicant_event() and some convenience helper functions
00020  * that can be used to report events.
00021  */
00022 
00023 #ifndef DRIVER_H
00024 #define DRIVER_H
00025 
00026 #define WPA_SUPPLICANT_DRIVER_VERSION 4
00027 
00028 #include "common/defs.h"
00029 
00030 #define HOSTAPD_CHAN_DISABLED 0x00000001
00031 #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
00032 #define HOSTAPD_CHAN_NO_IBSS 0x00000004
00033 #define HOSTAPD_CHAN_RADAR 0x00000008
00034 
00038 struct hostapd_channel_data {
00042         short chan;
00043 
00047         short freq;
00048 
00052         int flag;
00053 
00057         u8 max_tx_power;
00058 };
00059 
00063 struct hostapd_hw_modes {
00067         enum hostapd_hw_mode mode;
00068 
00072         int num_channels;
00073 
00077         struct hostapd_channel_data *channels;
00078 
00082         int num_rates;
00083 
00087         int *rates;
00088 
00092         u16 ht_capab;
00093 
00097         u8 mcs_set[16];
00098 
00102         u8 a_mpdu_params;
00103 };
00104 
00105 
00106 #define IEEE80211_MODE_INFRA    0
00107 #define IEEE80211_MODE_IBSS     1
00108 #define IEEE80211_MODE_AP       2
00109 
00110 #define IEEE80211_CAP_ESS       0x0001
00111 #define IEEE80211_CAP_IBSS      0x0002
00112 #define IEEE80211_CAP_PRIVACY   0x0010
00113 
00114 #define WPA_SCAN_QUAL_INVALID           BIT(0)
00115 #define WPA_SCAN_NOISE_INVALID          BIT(1)
00116 #define WPA_SCAN_LEVEL_INVALID          BIT(2)
00117 #define WPA_SCAN_LEVEL_DBM              BIT(3)
00118 #define WPA_SCAN_AUTHENTICATED          BIT(4)
00119 #define WPA_SCAN_ASSOCIATED             BIT(5)
00120 
00146 struct wpa_scan_res {
00147         unsigned int flags;
00148         u8 bssid[ETH_ALEN];
00149         int freq;
00150         u16 beacon_int;
00151         u16 caps;
00152         int qual;
00153         int noise;
00154         int level;
00155         u64 tsf;
00156         unsigned int age;
00157         size_t ie_len;
00158         size_t beacon_ie_len;
00159         /*
00160          * Followed by ie_len octets of IEs from Probe Response frame (or if
00161          * the driver does not indicate source of IEs, these may also be from
00162          * Beacon frame). After the first set of IEs, another set of IEs may
00163          * follow (with beacon_ie_len octets of data) if the driver provides
00164          * both IE sets.
00165          */
00166 };
00167 
00173 struct wpa_scan_results {
00174         struct wpa_scan_res **res;
00175         size_t num;
00176 };
00177 
00188 struct wpa_interface_info {
00189         struct wpa_interface_info *next;
00190         char *ifname;
00191         char *desc;
00192         const char *drv_name;
00193 };
00194 
00195 #define WPAS_MAX_SCAN_SSIDS 4
00196 
00201 struct wpa_driver_scan_params {
00205         struct wpa_driver_scan_ssid {
00211                 const u8 *ssid;
00215                 size_t ssid_len;
00216         } ssids[WPAS_MAX_SCAN_SSIDS];
00217 
00222         size_t num_ssids;
00223 
00227         const u8 *extra_ies;
00228 
00232         size_t extra_ies_len;
00233 
00239         int *freqs;
00240 
00255         struct wpa_driver_scan_filter {
00256                 u8 ssid[32];
00257                 size_t ssid_len;
00258         } *filter_ssids;
00259 
00263         size_t num_filter_ssids;
00264 };
00265 
00270 struct wpa_driver_auth_params {
00271         int freq;
00272         const u8 *bssid;
00273         const u8 *ssid;
00274         size_t ssid_len;
00275         int auth_alg;
00276         const u8 *ie;
00277         size_t ie_len;
00278         const u8 *wep_key[4];
00279         size_t wep_key_len[4];
00280         int wep_tx_keyidx;
00281         int local_state_change;
00282 };
00283 
00288 struct wpa_driver_associate_params {
00293         const u8 *bssid;
00294 
00298         const u8 *ssid;
00299 
00303         size_t ssid_len;
00304 
00310         int freq;
00311 
00330         const u8 *wpa_ie;
00331 
00335         size_t wpa_ie_len;
00336 
00342         enum wpa_cipher pairwise_suite;
00343 
00349         enum wpa_cipher group_suite;
00350 
00356         enum wpa_key_mgmt key_mgmt_suite;
00357 
00362         int auth_alg;
00363 
00367         int mode;
00368 
00372         const u8 *wep_key[4];
00373 
00377         size_t wep_key_len[4];
00378 
00382         int wep_tx_keyidx;
00383 
00387         enum mfp_options mgmt_frame_protection;
00388 
00410         const u8 *ft_ies;
00411 
00415         size_t ft_ies_len;
00416 
00424         const u8 *ft_md;
00425 
00435         const char *passphrase;
00436 
00445         const u8 *psk;
00446 
00454         int drop_unencrypted;
00455 
00462         const u8 *prev_bssid;
00463 };
00464 
00468 struct wpa_driver_capa {
00469 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA            0x00000001
00470 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2           0x00000002
00471 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK        0x00000004
00472 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK       0x00000008
00473 #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE       0x00000010
00474 #define WPA_DRIVER_CAPA_KEY_MGMT_FT             0x00000020
00475 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK         0x00000040
00476         unsigned int key_mgmt;
00477 
00478 #define WPA_DRIVER_CAPA_ENC_WEP40       0x00000001
00479 #define WPA_DRIVER_CAPA_ENC_WEP104      0x00000002
00480 #define WPA_DRIVER_CAPA_ENC_TKIP        0x00000004
00481 #define WPA_DRIVER_CAPA_ENC_CCMP        0x00000008
00482         unsigned int enc;
00483 
00484 #define WPA_DRIVER_AUTH_OPEN            0x00000001
00485 #define WPA_DRIVER_AUTH_SHARED          0x00000002
00486 #define WPA_DRIVER_AUTH_LEAP            0x00000004
00487         unsigned int auth;
00488 
00489 /* Driver generated WPA/RSN IE */
00490 #define WPA_DRIVER_FLAGS_DRIVER_IE      0x00000001
00491 /* Driver needs static WEP key setup after association command */
00492 #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
00493 #define WPA_DRIVER_FLAGS_USER_SPACE_MLME 0x00000004
00494 /* Driver takes care of RSN 4-way handshake internally; PMK is configured with
00495  * struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
00496 #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
00497 #define WPA_DRIVER_FLAGS_WIRED          0x00000010
00498 /* Driver provides separate commands for authentication and association (SME in
00499  * wpa_supplicant). */
00500 #define WPA_DRIVER_FLAGS_SME            0x00000020
00501 /* Driver supports AP mode */
00502 #define WPA_DRIVER_FLAGS_AP             0x00000040
00503 /* Driver needs static WEP key setup after association has been completed */
00504 #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE      0x00000080
00505         unsigned int flags;
00506 
00507         int max_scan_ssids;
00508 
00512         unsigned int max_remain_on_chan;
00513 };
00514 
00515 
00516 struct hostapd_data;
00517 
00518 struct hostap_sta_driver_data {
00519         unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
00520         unsigned long current_tx_rate;
00521         unsigned long inactive_msec;
00522         unsigned long flags;
00523         unsigned long num_ps_buf_frames;
00524         unsigned long tx_retry_failed;
00525         unsigned long tx_retry_count;
00526         int last_rssi;
00527         int last_ack_rssi;
00528 };
00529 
00530 struct hostapd_sta_add_params {
00531         const u8 *addr;
00532         u16 aid;
00533         u16 capability;
00534         const u8 *supp_rates;
00535         size_t supp_rates_len;
00536         u16 listen_interval;
00537         const struct ieee80211_ht_capabilities *ht_capabilities;
00538 };
00539 
00540 struct hostapd_freq_params {
00541         int mode;
00542         int freq;
00543         int channel;
00544         int ht_enabled;
00545         int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
00546                                  * secondary channel below primary, 1 = HT40
00547                                  * enabled, secondary channel above primary */
00548 };
00549 
00550 enum wpa_driver_if_type {
00554         WPA_IF_STATION,
00555 
00562         WPA_IF_AP_VLAN,
00563 
00569         WPA_IF_AP_BSS,
00570 };
00571 
00572 struct wpa_init_params {
00573         const u8 *bssid;
00574         const char *ifname;
00575         const u8 *ssid;
00576         size_t ssid_len;
00577         const char *test_socket;
00578         int use_pae_group_addr;
00579         char **bridge;
00580         size_t num_bridge;
00581 
00582         u8 *own_addr; /* buffer for writing own MAC address */
00583 };
00584 
00585 
00586 struct wpa_bss_params {
00588         const char *ifname;
00590         int enabled;
00591 
00592         int wpa;
00593         int ieee802_1x;
00594         int wpa_group;
00595         int wpa_pairwise;
00596         int wpa_key_mgmt;
00597         int rsn_preauth;
00598 };
00599 
00600 #define WPA_STA_AUTHORIZED BIT(0)
00601 #define WPA_STA_WMM BIT(1)
00602 #define WPA_STA_SHORT_PREAMBLE BIT(2)
00603 #define WPA_STA_MFP BIT(3)
00604 
00612 struct wpa_driver_ops {
00614         const char *name;
00616         const char *desc;
00617 
00629         int (*get_bssid)(void *priv, u8 *bssid);
00630 
00646         int (*get_ssid)(void *priv, u8 *ssid);
00647 
00692         int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg,
00693                        const u8 *addr, int key_idx, int set_tx,
00694                        const u8 *seq, size_t seq_len,
00695                        const u8 *key, size_t key_len);
00696 
00720         void * (*init)(void *ctx, const char *ifname);
00721 
00729         void (*deinit)(void *priv);
00730 
00741         int (*set_param)(void *priv, const char *param);
00742 
00753         int (*set_countermeasures)(void *priv, int enabled);
00754 
00764         int (*deauthenticate)(void *priv, const u8 *addr, int reason_code);
00765 
00775         int (*disassociate)(void *priv, const u8 *addr, int reason_code);
00776 
00784         int (*associate)(void *priv,
00785                          struct wpa_driver_associate_params *params);
00786 
00804         int (*add_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid);
00805 
00824         int (*remove_pmkid)(void *priv, const u8 *bssid, const u8 *pmkid);
00825 
00842         int (*flush_pmkid)(void *priv);
00843 
00852         int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
00853 
00866         void (*poll)(void *priv);
00867 
00879         const char * (*get_ifname)(void *priv);
00880 
00891         const u8 * (*get_mac_addr)(void *priv);
00892 
00911         int (*send_eapol)(void *priv, const u8 *dest, u16 proto,
00912                           const u8 *data, size_t data_len);
00913 
00926         int (*set_operstate)(void *priv, int state);
00927 
00944         int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
00945                                   int key_type);
00946 
00958         struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
00959                                                          u16 *num_modes,
00960                                                          u16 *flags);
00961 
00973         int (*set_channel)(void *priv, enum hostapd_hw_mode phymode, int chan,
00974                            int freq);
00975 
00986         int (*set_ssid)(void *priv, const u8 *ssid, size_t ssid_len);
00987 
00997         int (*set_bssid)(void *priv, const u8 *bssid);
00998 
01009         int (*send_mlme)(void *priv, const u8 *data, size_t data_len);
01010 
01026         int (*mlme_add_sta)(void *priv, const u8 *addr, const u8 *supp_rates,
01027                             size_t supp_rates_len);
01028 
01038         int (*mlme_remove_sta)(void *priv, const u8 *addr);
01039 
01055         int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
01056                              size_t ies_len);
01057 
01071         int (*send_ft_action)(void *priv, u8 action, const u8 *target_ap,
01072                               const u8 *ies, size_t ies_len);
01073 
01081          struct wpa_scan_results * (*get_scan_results2)(void *priv);
01082 
01092         int (*set_country)(void *priv, const char *alpha2);
01093 
01105         void * (*global_init)(void);
01106 
01114         void (*global_deinit)(void *priv);
01115 
01127         void * (*init2)(void *ctx, const char *ifname, void *global_priv);
01128 
01136         struct wpa_interface_info * (*get_interfaces)(void *global_priv);
01137 
01149         int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
01150 
01163         int (*authenticate)(void *priv,
01164                             struct wpa_driver_auth_params *params);
01165 
01182         int (*set_beacon)(void *priv, const u8 *head, size_t head_len,
01183                           const u8 *tail, size_t tail_len, int dtim_period,
01184                           int beacon_int);
01185 
01195         void * (*hapd_init)(struct hostapd_data *hapd,
01196                             struct wpa_init_params *params);
01197 
01202         void (*hapd_deinit)(void *priv);
01203 
01216         int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
01217 
01228         int (*set_privacy)(void *priv, int enabled);
01229 
01244         int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
01245                           int idx, u8 *seq);
01246 
01256         int (*flush)(void *priv);
01257 
01270         int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
01271 
01279         int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
01280                              const u8 *addr);
01281 
01293         int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
01294                                size_t data_len, int encrypt,
01295                                const u8 *own_addr);
01296 
01308         int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
01309                           int reason);
01310 
01322         int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
01323                             int reason);
01324 
01331         int (*sta_remove)(void *priv, const u8 *addr);
01332 
01344         int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
01345 
01353         int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
01354 
01364         int (*hapd_set_countermeasures)(void *priv, int enabled);
01365 
01376         int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
01377 
01384         int (*get_inact_sec)(void *priv, const u8 *addr);
01385 
01392         int (*sta_clear_stats)(void *priv, const u8 *addr);
01393 
01400         int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
01401 
01408         int (*set_rts)(void *priv, int rts);
01409 
01416         int (*set_frag)(void *priv, int frag);
01417 
01427         int (*sta_set_flags)(void *priv, const u8 *addr,
01428                              int total_flags, int flags_or, int flags_and);
01429 
01438         int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
01439                              int mode);
01440 
01447         int (*set_cts_protect)(void *priv, int value);
01448 
01455         int (*set_preamble)(void *priv, int value);
01456 
01463         int (*set_short_slot_time)(void *priv, int value);
01464 
01474         int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
01475                                    int cw_max, int burst_time);
01476 
01486         int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
01487 
01505         int (*if_add)(void *priv, enum wpa_driver_if_type type,
01506                       const char *ifname, const u8 *addr, void *bss_ctx,
01507                       void **drv_priv, char *force_ifname, u8 *if_addr);
01508 
01516         int (*if_remove)(void *priv, enum wpa_driver_if_type type,
01517                          const char *ifname);
01518 
01533         int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
01534                             int vlan_id);
01535 
01546         int (*commit)(void *priv);
01547 
01558         int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
01559                           const u8 *data, size_t data_len);
01560 
01569         int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted, 
01570                                    u32 session_timeout);
01571 
01578         int (*set_radius_acl_expire)(void *priv, const u8 *mac);
01579 
01589         int (*set_ht_params)(void *priv,
01590                              const u8 *ht_capab, size_t ht_capab_len,
01591                              const u8 *ht_oper, size_t ht_oper_len);
01592 
01606         int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
01607                              const struct wpabuf *proberesp);
01608 
01615         int (*set_supp_port)(void *priv, int authorized);
01616 
01625         int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val);
01626 
01645         int (*send_action)(void *priv, unsigned int freq,
01646                            const u8 *dst, const u8 *src, const u8 *bssid,
01647                            const u8 *data, size_t data_len);
01648 
01671         int (*remain_on_channel)(void *priv, unsigned int freq,
01672                                  unsigned int duration);
01673 
01685         int (*cancel_remain_on_channel)(void *priv);
01686 
01701         int (*probe_req_report)(void *priv, int report);
01702 
01714         int (*disable_11b_rates)(void *priv, int disabled);
01715 
01725         int (*deinit_ap)(void *priv);
01726 
01731         void (*suspend)(void *priv);
01732 
01737         void (*resume)(void *priv);
01738 
01753         int (*signal_monitor)(void *priv, int threshold, int hysteresis);
01754 
01766         int (*send_frame)(void *priv, const u8 *data, size_t data_len,
01767                           int encrypt);
01768 };
01769 
01770 
01774 enum wpa_event_type {
01787         EVENT_ASSOC,
01788 
01799         EVENT_DISASSOC,
01800 
01810         EVENT_MICHAEL_MIC_FAILURE,
01811 
01826         EVENT_SCAN_RESULTS,
01827 
01839         EVENT_ASSOCINFO,
01840 
01850         EVENT_INTERFACE_STATUS,
01851 
01876         EVENT_PMKID_CANDIDATE,
01877 
01887         EVENT_STKSTART,
01888 
01896         EVENT_FT_RESPONSE,
01897 
01906         EVENT_IBSS_RSN_START,
01907 
01917         EVENT_AUTH,
01918 
01927         EVENT_DEAUTH,
01928 
01936         EVENT_ASSOC_REJECT,
01937 
01941         EVENT_AUTH_TIMED_OUT,
01942 
01946         EVENT_ASSOC_TIMED_OUT,
01947 
01951         EVENT_FT_RRB_RX,
01952 
01956         EVENT_WPS_BUTTON_PUSHED,
01957 
01961         EVENT_TX_STATUS,
01962 
01966         EVENT_RX_FROM_UNKNOWN,
01967 
01971         EVENT_RX_MGMT,
01972 
01980         EVENT_RX_ACTION,
01981 
01989         EVENT_REMAIN_ON_CHANNEL,
01990 
01999         EVENT_CANCEL_REMAIN_ON_CHANNEL,
02000 
02006         EVENT_MLME_RX,
02007 
02019         EVENT_RX_PROBE_REQ,
02020 
02030         EVENT_NEW_STA,
02031 
02040         EVENT_EAPOL_RX,
02041 
02049         EVENT_SIGNAL_CHANGE
02050 };
02051 
02052 
02056 union wpa_event_data {
02065         struct assoc_info {
02077                 const u8 *req_ies;
02078 
02082                 size_t req_ies_len;
02083 
02095                 const u8 *resp_ies;
02096 
02100                 size_t resp_ies_len;
02101 
02118                 const u8 *beacon_ies;
02119 
02122                 size_t beacon_ies_len;
02123 
02127                 unsigned int freq;
02128 
02132                 const u8 *addr;
02133         } assoc_info;
02134 
02138         struct disassoc_info {
02142                 const u8 *addr;
02143 
02148                 u16 reason_code;
02149         } disassoc_info;
02150 
02154         struct deauth_info {
02158                 const u8 *addr;
02159 
02164                 u16 reason_code;
02165         } deauth_info;
02166 
02170         struct michael_mic_failure {
02171                 int unicast;
02172                 const u8 *src;
02173         } michael_mic_failure;
02174 
02178         struct interface_status {
02179                 char ifname[100];
02180                 enum {
02181                         EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
02182                 } ievent;
02183         } interface_status;
02184 
02188         struct pmkid_candidate {
02190                 u8 bssid[ETH_ALEN];
02192                 int index;
02194                 int preauth;
02195         } pmkid_candidate;
02196 
02200         struct stkstart {
02201                 u8 peer[ETH_ALEN];
02202         } stkstart;
02203 
02213         struct ft_ies {
02214                 const u8 *ies;
02215                 size_t ies_len;
02216                 int ft_action;
02217                 u8 target_ap[ETH_ALEN];
02219                 const u8 *ric_ies;
02221                 size_t ric_ies_len;
02222         } ft_ies;
02223 
02227         struct ibss_rsn_start {
02228                 u8 peer[ETH_ALEN];
02229         } ibss_rsn_start;
02230 
02234         struct auth_info {
02235                 u8 peer[ETH_ALEN];
02236                 u16 auth_type;
02237                 u16 status_code;
02238                 const u8 *ies;
02239                 size_t ies_len;
02240         } auth;
02241 
02245         struct assoc_reject {
02257                 u8 *resp_ies;
02258 
02262                 size_t resp_ies_len;
02263 
02267                 u16 status_code;
02268         } assoc_reject;
02269 
02270         struct timeout_event {
02271                 u8 addr[ETH_ALEN];
02272         } timeout_event;
02273 
02277         struct ft_rrb_rx {
02278                 const u8 *src;
02279                 const u8 *data;
02280                 size_t data_len;
02281         } ft_rrb_rx;
02282 
02286         struct tx_status {
02287                 u16 type;
02288                 u16 stype;
02289                 const u8 *dst;
02290                 const u8 *data;
02291                 size_t data_len;
02292                 int ack;
02293         } tx_status;
02294 
02298         struct rx_from_unknown {
02299                 const u8 *frame;
02300                 size_t len;
02301         } rx_from_unknown;
02302 
02306         struct rx_mgmt {
02307                 const u8 *frame;
02308                 size_t frame_len;
02309                 u32 datarate;
02310                 u32 ssi_signal;
02311         } rx_mgmt;
02312 
02316         struct rx_action {
02320                 const u8 *da;
02321 
02325                 const u8 *sa;
02326 
02330                 const u8 *bssid;
02331 
02335                 u8 category;
02336 
02340                 const u8 *data;
02341 
02345                 size_t len;
02346 
02350                 int freq;
02351         } rx_action;
02352 
02358         struct remain_on_channel {
02362                 unsigned int freq;
02363 
02367                 unsigned int duration;
02368         } remain_on_channel;
02369 
02379         struct scan_info {
02380                 int aborted;
02381                 const int *freqs;
02382                 size_t num_freqs;
02383                 struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
02384                 size_t num_ssids;
02385         } scan_info;
02386 
02390         struct mlme_rx {
02391                 const u8 *buf;
02392                 size_t len;
02393                 int freq;
02394                 int channel;
02395                 int ssi;
02396         } mlme_rx;
02397 
02401         struct rx_probe_req {
02405                 const u8 *sa;
02406 
02410                 const u8 *ie;
02411 
02415                 size_t ie_len;
02416         } rx_probe_req;
02417 
02421         struct new_sta {
02422                 const u8 *addr;
02423         } new_sta;
02424 
02428         struct eapol_rx {
02429                 const u8 *src;
02430                 const u8 *data;
02431                 size_t data_len;
02432         } eapol_rx;
02433 
02437         struct signal_change {
02438                 int above_threshold;
02439         } signal_change;
02440 };
02441 
02452 void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
02453                           union wpa_event_data *data);
02454 
02455 
02456 /*
02457  * The following inline functions are provided for convenience to simplify
02458  * event indication for some of the common events.
02459  */
02460 
02461 static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
02462                                    size_t ielen)
02463 {
02464         union wpa_event_data event;
02465         os_memset(&event, 0, sizeof(event));
02466         event.assoc_info.req_ies = ie;
02467         event.assoc_info.req_ies_len = ielen;
02468         event.assoc_info.addr = addr;
02469         wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
02470 }
02471 
02472 static inline void drv_event_disassoc(void *ctx, const u8 *addr)
02473 {
02474         union wpa_event_data event;
02475         os_memset(&event, 0, sizeof(event));
02476         event.disassoc_info.addr = addr;
02477         wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
02478 }
02479 
02480 static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
02481                                       size_t data_len)
02482 {
02483         union wpa_event_data event;
02484         os_memset(&event, 0, sizeof(event));
02485         event.eapol_rx.src = src;
02486         event.eapol_rx.data = data;
02487         event.eapol_rx.data_len = data_len;
02488         wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
02489 }
02490 
02491 #endif /* DRIVER_H */


wpa_supplicant
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:34:34