Remove unused set_retry() driver op
[wpasupplicant] / hostapd / driver_i.h
index cc087e6..20ac9a1 100644 (file)
 #include "config.h"
 
 static inline void *
-hostapd_driver_init(struct hostapd_data *hapd)
+hostapd_driver_init(struct hostapd_data *hapd, const u8 *bssid)
 {
+       struct wpa_init_params params;
+       void *ret;
+       size_t i;
+
        if (hapd->driver == NULL || hapd->driver->hapd_init == NULL)
                return NULL;
-       return hapd->driver->hapd_init(hapd);
-}
 
-static inline void *
-hostapd_driver_init_bssid(struct hostapd_data *hapd, const u8 *bssid)
-{
-       if (hapd->driver == NULL || hapd->driver->init_bssid == NULL)
+       os_memset(&params, 0, sizeof(params));
+       params.bssid = bssid;
+       params.ifname = hapd->conf->iface;
+       params.ssid = (const u8 *) hapd->conf->ssid.ssid;
+       params.ssid_len = hapd->conf->ssid.ssid_len;
+       params.test_socket = hapd->conf->test_socket;
+       params.use_pae_group_addr = hapd->conf->use_pae_group_addr;
+
+       params.num_bridge = hapd->iface->num_bss;
+       params.bridge = os_zalloc(hapd->iface->num_bss * sizeof(char *));
+       if (params.bridge == NULL)
                return NULL;
-       return hapd->driver->init_bssid(hapd, bssid);
+       for (i = 0; i < hapd->iface->num_bss; i++) {
+               struct hostapd_data *bss = hapd->iface->bss[i];
+               if (bss->conf->bridge[0])
+                       params.bridge[i] = bss->conf->bridge;
+       }
+
+       params.own_addr = hapd->own_addr;
+
+       ret = hapd->driver->hapd_init(hapd, &params);
+       os_free(params.bridge);
+
+       return ret;
 }
 
 static inline void
@@ -137,7 +157,8 @@ hostapd_sta_deauth(struct hostapd_data *hapd, const u8 *addr, int reason)
 {
        if (hapd->driver == NULL || hapd->driver->sta_deauth == NULL)
                return 0;
-       return hapd->driver->sta_deauth(hapd->drv_priv, addr, reason);
+       return hapd->driver->sta_deauth(hapd->drv_priv, hapd->own_addr, addr,
+                                       reason);
 }
 
 static inline int
@@ -145,7 +166,8 @@ hostapd_sta_disassoc(struct hostapd_data *hapd, const u8 *addr, int reason)
 {
        if (hapd->driver == NULL || hapd->driver->sta_disassoc == NULL)
                return 0;
-       return hapd->driver->sta_disassoc(hapd->drv_priv, addr, reason);
+       return hapd->driver->sta_disassoc(hapd->drv_priv, hapd->own_addr, addr,
+                                         reason);
 }
 
 static inline int
@@ -175,12 +197,11 @@ hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
 }
 
 static inline int
-hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len,
-                       int flags)
+hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len)
 {
-       if (hapd->driver == NULL || hapd->driver->send_mgmt_frame == NULL)
+       if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
                return 0;
-       return hapd->driver->send_mgmt_frame(hapd->drv_priv, msg, len, flags);
+       return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
 }
 
 static inline int
@@ -260,15 +281,6 @@ hostapd_set_frag(struct hostapd_data *hapd, int frag)
 }
 
 static inline int
-hostapd_set_retry(struct hostapd_data *hapd, int short_retry, int long_retry)
-{
-       if (hapd->driver == NULL || hapd->driver->set_retry == NULL)
-               return 0;
-       return hapd->driver->set_retry(hapd->drv_priv, short_retry,
-                                      long_retry);
-}
-
-static inline int
 hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
                      int total_flags, int flags_or, int flags_and)
 {
@@ -292,9 +304,9 @@ static inline int
 hostapd_set_country(struct hostapd_data *hapd, const char *country)
 {
        if (hapd->driver == NULL ||
-           hapd->driver->hapd_set_country == NULL)
+           hapd->driver->set_country == NULL)
                return 0;
-       return hapd->driver->hapd_set_country(hapd->drv_priv, country);
+       return hapd->driver->set_country(hapd->drv_priv, country);
 }
 
 static inline int
@@ -337,9 +349,9 @@ hostapd_set_internal_bridge(struct hostapd_data *hapd, int value)
 static inline int
 hostapd_set_beacon_int(struct hostapd_data *hapd, int value)
 {
-       if (hapd->driver == NULL || hapd->driver->hapd_set_beacon_int == NULL)
+       if (hapd->driver == NULL || hapd->driver->set_beacon_int == NULL)
                return 0;
-       return hapd->driver->hapd_set_beacon_int(hapd->drv_priv, value);
+       return hapd->driver->set_beacon_int(hapd->drv_priv, value);
 }
 
 static inline int
@@ -437,27 +449,15 @@ hostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
        return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);
 }
 
-static inline int
-hostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,
-                    int interval, int _listen, int *channel,
-                    int *last_rx)
-{
-       if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)
-               return -1;
-       return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,
-                                         interval, _listen, channel, last_rx);
-}
-
 static inline struct hostapd_hw_modes *
 hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
                            u16 *flags)
 {
        if (hapd->driver == NULL ||
-           hapd->driver->hapd_get_hw_feature_data == NULL)
+           hapd->driver->get_hw_feature_data == NULL)
                return NULL;
-       return hapd->driver->hapd_get_hw_feature_data(hapd->drv_priv,
-                                                     num_modes,
-                                                     flags);
+       return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
+                                                flags);
 }
 
 static inline int
@@ -537,12 +537,27 @@ hostapd_set_wps_probe_resp_ie(struct hostapd_data *hapd, const u8 *ie,
                                                   hapd->drv_priv, ie, len);
 }
 
-static inline const struct hostapd_neighbor_bss *
-hostapd_driver_get_neighbor_bss(struct hostapd_data *hapd, size_t *num)
+static inline int hostapd_driver_set_mode(struct hostapd_data *hapd, int mode)
 {
-       if (hapd->driver == NULL || hapd->driver->get_neighbor_bss == NULL)
-               return NULL;
-       return hapd->driver->get_neighbor_bss(hapd->drv_priv, num);
+       if (hapd->driver == NULL || hapd->driver->set_mode == NULL)
+               return 0;
+       return hapd->driver->set_mode(hapd->drv_priv, mode);
+}
+
+static inline int hostapd_driver_scan(struct hostapd_data *hapd,
+                                     struct wpa_driver_scan_params *params)
+{
+       if (hapd->driver && hapd->driver->scan2)
+               return hapd->driver->scan2(hapd->drv_priv, params);
+       return -1;
+}
+
+static inline struct wpa_scan_results * hostapd_driver_get_scan_results(
+       struct hostapd_data *hapd)
+{
+       if (hapd->driver && hapd->driver->get_scan_results2)
+               return hapd->driver->get_scan_results2(hapd->drv_priv);
+       return NULL;
 }
 
 #endif /* DRIVER_I_H */