Merge wireless_event_{,de}init() into {,de}init() driver op
[wpasupplicant] / hostapd / driver.h
index 55dace5..a7b371a 100644 (file)
  * See README and COPYING for more details.
  */
 
-#ifndef DRIVER_H
-#define DRIVER_H
+#ifndef HOSTAPD_DRIVER_H
+#define HOSTAPD_DRIVER_H
+
+#include "defs.h"
+#include "sta_flags.h"
 
 struct hostapd_data;
 
@@ -44,6 +47,7 @@ struct hostapd_sta_add_params {
 struct hostapd_freq_params {
        int mode;
        int freq;
+       int channel;
        int ht_enabled;
        int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
                                 * secondary channel below primary, 1 = HT40
@@ -54,16 +58,21 @@ enum hostapd_driver_if_type {
        HOSTAPD_IF_VLAN, HOSTAPD_IF_WDS
 };
 
-struct wpa_driver_ops {
+struct hostapd_neighbor_bss {
+       u8 bssid[ETH_ALEN];
+       int freq; /* MHz */
+       unsigned int ht:1;
+       int pri_chan;
+       int sec_chan; /* 0 for 20 MHz channels */
+};
+
+struct hapd_driver_ops {
        const char *name;               /* as appears in the config file */
 
        void * (*init)(struct hostapd_data *hapd);
        void * (*init_bssid)(struct hostapd_data *hapd, const u8 *bssid);
        void (*deinit)(void *priv);
 
-       int (*wireless_event_init)(void *priv);
-       void (*wireless_event_deinit)(void *priv);
-
        /**
         * set_8021x - enable/disable IEEE 802.1X support
         * @ifname: Interface name (for multi-SSID/VLAN support)
@@ -88,9 +97,9 @@ struct wpa_driver_ops {
         */
        int (*set_privacy)(const char *ifname, void *priv, int enabled);
 
-       int (*set_encryption)(const char *ifname, void *priv, const char *alg,
-                             const u8 *addr, int idx,
-                             const u8 *key, size_t key_len, int txkey);
+       int (*set_key)(const char *ifname, void *priv, wpa_alg alg,
+                      const u8 *addr, int key_idx, int set_tx, const u8 *seq,
+                      size_t seq_len, const u8 *key, size_t key_len);
        int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
                          int idx, u8 *seq);
        int (*get_seqnum_igtk)(const char *ifname, void *priv, const u8 *addr,
@@ -112,19 +121,12 @@ struct wpa_driver_ops {
        int (*set_countermeasures)(void *priv, int enabled);
        int (*send_mgmt_frame)(void *priv, const void *msg, size_t len,
                               int flags);
-       int (*set_assoc_ap)(void *priv, const u8 *addr);
-       /* note: sta_add() is deprecated; use sta_add2() instead */
-       int (*sta_add)(const char *ifname, void *priv, const u8 *addr, u16 aid,
-                      u16 capability, u8 *supp_rates, size_t supp_rates_len,
-                      int flags, u16 listen_interval);
-       int (*sta_add2)(const char *ifname, void *priv,
-                       struct hostapd_sta_add_params *params);
+       int (*sta_add)(const char *ifname, void *priv,
+                      struct hostapd_sta_add_params *params);
        int (*get_inact_sec)(void *priv, const u8 *addr);
        int (*sta_clear_stats)(void *priv, const u8 *addr);
 
-       /* note: set_freq() is deprecated; use set_freq2() instead */
-       int (*set_freq)(void *priv, int mode, int freq);
-       int (*set_freq2)(void *priv, struct hostapd_freq_params *freq);
+       int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
        int (*set_rts)(void *priv, int rts);
        int (*get_rts)(void *priv, int *rts);
        int (*set_frag)(void *priv, int frag);
@@ -136,12 +138,11 @@ struct wpa_driver_ops {
                             int total_flags, int flags_or, int flags_and);
        int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
                             int mode);
-       int (*set_regulatory_domain)(void *priv, unsigned int rd);
        int (*set_country)(void *priv, const char *country);
        int (*set_ieee80211d)(void *priv, int enabled);
        int (*set_beacon)(const char *ifname, void *priv,
-                         u8 *head, size_t head_len,
-                         u8 *tail, size_t tail_len);
+                         const u8 *head, size_t head_len,
+                         const u8 *tail, size_t tail_len, int dtim_period);
 
        /* Configure internal bridge:
         * 0 = disabled, i.e., client separation is enabled (no bridging of
@@ -150,7 +151,6 @@ struct wpa_driver_ops {
         */
        int (*set_internal_bridge)(void *priv, int value);
        int (*set_beacon_int)(void *priv, int value);
-       int (*set_dtim_period)(const char *ifname, void *priv, int value);
        /* Configure broadcast SSID mode:
         * 0 = include SSID in Beacon frames and reply to Probe Request frames
         *     that use broadcast SSID
@@ -209,8 +209,13 @@ struct wpa_driver_ops {
                                 const u8 *ie, size_t len);
        int (*set_wps_probe_resp_ie)(const char *ifname, void *priv,
                                     const u8 *ie, size_t len);
+
+       const struct hostapd_neighbor_bss *
+       (*get_neighbor_bss)(void *priv, size_t *num);
 };
 
+struct sta_info;
+
 void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
                           int reassoc);
 void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
@@ -222,4 +227,19 @@ void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
 void hostapd_eapol_receive(struct hostapd_data *hapd, const u8 *sa,
                           const u8 *buf, size_t len);
 
-#endif /* DRIVER_H */
+struct hostapd_frame_info {
+       u32 phytype;
+       u32 channel;
+       u32 datarate;
+       u32 ssi_signal;
+
+       unsigned int passive_scan:1;
+};
+
+void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
+                    u16 stype, struct hostapd_frame_info *fi);
+void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
+                       u16 stype, int ok);
+void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
+
+#endif /* HOSTAPD_DRIVER_H */