Fix couple of forgotten wpa_hw_modes -> hostapd_hw_modes
[wpasupplicant] / hostapd / driver.h
index 36f5b2b..e369e84 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,36 +121,25 @@ 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);
-       int (*get_frag)(void *priv, int *frag);
        int (*set_retry)(void *priv, int short_retry, int long_retry);
-       int (*get_retry)(void *priv, int *short_retry, int *long_retry);
 
        int (*sta_set_flags)(void *priv, const u8 *addr,
                             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 +148,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
@@ -159,7 +156,6 @@ struct wpa_driver_ops {
         */
        int (*set_broadcast_ssid)(void *priv, int value);
        int (*set_cts_protect)(void *priv, int value);
-       int (*set_key_tx_rx_threshold)(void *priv, int value);
        int (*set_preamble)(void *priv, int value);
        int (*set_short_slot_time)(void *priv, int value);
        int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
@@ -209,9 +205,39 @@ 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,
+                      const u8 *buf, size_t len, int ack);
+void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd, const u8 *addr);
+int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
+                       const u8 *ie, size_t ielen);
+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);
+
+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);
+struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
+                                         const u8 *addr);
 
-#endif /* DRIVER_H */
+#endif /* HOSTAPD_DRIVER_H */