]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Convert most commonly used drv ops to real function calls
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 24 Nov 2010 15:01:21 +0000 (17:01 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 24 Nov 2010 15:01:21 +0000 (17:01 +0200)
Getting rid of these inline functions seems to reduce the code size
quite a bit, so convert the most commonly used hostapd driver ops to
function calls.

src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h

index 2811b9d6c019e5fbbf4a0e45fb450ae5c6f650c3..7f9522a06d78b5e4c168e973cf9be7283279b56f 100644 (file)
@@ -582,3 +582,46 @@ int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
                                             duration);
        return -1;
 }
+
+
+int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
+                       enum 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)
+{
+       if (hapd->driver == NULL || hapd->driver->set_key == NULL)
+               return 0;
+       return hapd->driver->set_key(ifname, hapd->drv_priv, alg, addr,
+                                    key_idx, set_tx, seq, seq_len, key,
+                                    key_len);
+}
+
+
+int hostapd_drv_send_mlme(struct hostapd_data *hapd,
+                         const void *msg, size_t len)
+{
+       if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
+               return 0;
+       return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
+}
+
+
+int hostapd_drv_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, hapd->own_addr, addr,
+                                       reason);
+}
+
+
+int hostapd_drv_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, hapd->own_addr, addr,
+                                         reason);
+}
index 431e18aa74e2439b7bf31a875fa93753f3ebf17c..5bc9d013eb9f3089b147302e310abea4873b85db 100644 (file)
@@ -81,18 +81,22 @@ struct wpa_scan_results * hostapd_driver_get_scan_results(
        struct hostapd_data *hapd);
 int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
                           int duration);
+int hostapd_drv_set_key(const char *ifname,
+                       struct hostapd_data *hapd,
+                       enum 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 hostapd_drv_send_mlme(struct hostapd_data *hapd,
+                         const void *msg, size_t len);
+int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
+                          const u8 *addr, int reason);
+int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
+                            const u8 *addr, int reason);
 
 
 #include "drivers/driver.h"
 
-static inline int hostapd_drv_send_mlme(struct hostapd_data *hapd,
-                                       const void *msg, size_t len)
-{
-       if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
-               return 0;
-       return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
-}
-
 static inline int hostapd_drv_set_countermeasures(struct hostapd_data *hapd,
                                                  int enabled)
 {
@@ -120,24 +124,6 @@ static inline int hostapd_drv_get_inact_sec(struct hostapd_data *hapd,
        return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
 }
 
-static inline int hostapd_drv_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, hapd->own_addr, addr,
-                                       reason);
-}
-
-static inline int hostapd_drv_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, hapd->own_addr, addr,
-                                         reason);
-}
-
 static inline int hostapd_drv_sta_remove(struct hostapd_data *hapd,
                                         const u8 *addr)
 {
@@ -157,20 +143,6 @@ static inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd,
                                             hapd->own_addr);
 }
 
-static inline int hostapd_drv_set_key(const char *ifname,
-                                     struct hostapd_data *hapd,
-                                     enum 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)
-{
-       if (hapd->driver == NULL || hapd->driver->set_key == NULL)
-               return 0;
-       return hapd->driver->set_key(ifname, hapd->drv_priv, alg, addr,
-                                    key_idx, set_tx, seq, seq_len, key,
-                                    key_len);
-}
-
 static inline int hostapd_drv_read_sta_data(
        struct hostapd_data *hapd, struct hostap_sta_driver_data *data,
        const u8 *addr)