]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd_driver_ops reduction: set_countermeasures
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 24 Nov 2010 13:26:44 +0000 (15:26 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 24 Nov 2010 13:26:44 +0000 (15:26 +0200)
src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
src/ap/hostapd.h
src/ap/tkip_countermeasures.c

index c65af9215db70c473a4b7991f31c1c655f4b126b..d62829ffbeaa3adf171ccd1c0d7d89e3d3812b0b 100644 (file)
@@ -455,15 +455,6 @@ static int hostapd_sta_remove(struct hostapd_data *hapd, const u8 *addr)
 }
 
 
-static int hostapd_set_countermeasures(struct hostapd_data *hapd, int enabled)
-{
-       if (hapd->driver == NULL ||
-           hapd->driver->hapd_set_countermeasures == NULL)
-               return 0;
-       return hapd->driver->hapd_set_countermeasures(hapd->drv_priv, enabled);
-}
-
-
 void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
 {
        ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
@@ -487,7 +478,6 @@ void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
        ops->sta_disassoc = hostapd_sta_disassoc;
        ops->sta_add = hostapd_sta_add;
        ops->sta_remove = hostapd_sta_remove;
-       ops->set_countermeasures = hostapd_set_countermeasures;
 }
 
 
index 68869a0d941ac7c03970b3edbfadbef6e5fd3608..e2059e8cf748fcb6d8c8c4f782a712fc0512a39d 100644 (file)
@@ -77,4 +77,13 @@ static inline int hostapd_drv_send_mlme(struct hostapd_data *hapd,
        return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
 }
 
+static inline int hostapd_drv_set_countermeasures(struct hostapd_data *hapd,
+                                                 int enabled)
+{
+       if (hapd->driver == NULL ||
+           hapd->driver->hapd_set_countermeasures == NULL)
+               return 0;
+       return hapd->driver->hapd_set_countermeasures(hapd->drv_priv, enabled);
+}
+
 #endif /* AP_DRV_OPS */
index e0450d9272f6586412307ecaebfdc3cf0936df5b..c0d3491cbb4c757d0339acd9ff067b6299bd30ff 100644 (file)
@@ -93,7 +93,6 @@ struct hostapd_driver_ops {
                       u16 listen_interval,
                       const struct ieee80211_ht_capabilities *ht_capab);
        int (*sta_remove)(struct hostapd_data *hapd, const u8 *addr);
-       int (*set_countermeasures)(struct hostapd_data *hapd, int enabled);
 };
 
 /**
index 9690348e9ccfaa59ec66858aca074f3cad5631bb..9e4a5d96b86d85b809fdd4297a740f52e5441b8c 100644 (file)
@@ -21,6 +21,7 @@
 #include "sta_info.h"
 #include "ap_mlme.h"
 #include "wpa_auth.h"
+#include "ap_drv_ops.h"
 #include "tkip_countermeasures.h"
 
 
@@ -29,7 +30,7 @@ static void ieee80211_tkip_countermeasures_stop(void *eloop_ctx,
 {
        struct hostapd_data *hapd = eloop_ctx;
        hapd->tkip_countermeasures = 0;
-       hapd->drv.set_countermeasures(hapd, 0);
+       hostapd_drv_set_countermeasures(hapd, 0);
        hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
                       HOSTAPD_LEVEL_INFO, "TKIP countermeasures ended");
 }
@@ -44,7 +45,7 @@ static void ieee80211_tkip_countermeasures_start(struct hostapd_data *hapd)
 
        wpa_auth_countermeasures_start(hapd->wpa_auth);
        hapd->tkip_countermeasures = 1;
-       hapd->drv.set_countermeasures(hapd, 1);
+       hostapd_drv_set_countermeasures(hapd, 1);
        wpa_gtk_rekey(hapd->wpa_auth);
        eloop_cancel_timeout(ieee80211_tkip_countermeasures_stop, hapd, NULL);
        eloop_register_timeout(60, 0, ieee80211_tkip_countermeasures_stop,