}
+static int hostapd_sta_add(const char *ifname, struct hostapd_data *hapd,
+ const u8 *addr, u16 aid, u16 capability,
+ const u8 *supp_rates, size_t supp_rates_len,
+ u16 listen_interval,
+ const struct ieee80211_ht_capabilities *ht_capab)
+{
+ struct hostapd_sta_add_params params;
+
+ if (hapd->driver == NULL)
+ return 0;
+ if (hapd->driver->sta_add == NULL)
+ return 0;
+
+ os_memset(¶ms, 0, sizeof(params));
+ params.addr = addr;
+ params.aid = aid;
+ params.capability = capability;
+ params.supp_rates = supp_rates;
+ params.supp_rates_len = supp_rates_len;
+ params.listen_interval = listen_interval;
+ params.ht_capabilities = ht_capab;
+ return hapd->driver->sta_add(ifname, hapd->drv_priv, ¶ms);
+}
+
+
static int hostapd_sta_remove(struct hostapd_data *hapd, const u8 *addr)
{
if (hapd->driver == NULL || hapd->driver->sta_remove == NULL)
ops->get_inact_sec = hostapd_get_inact_sec;
ops->sta_deauth = hostapd_sta_deauth;
ops->sta_disassoc = hostapd_sta_disassoc;
+ ops->sta_add = hostapd_sta_add;
ops->sta_remove = hostapd_sta_remove;
}
}
static inline int
-hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr,
- u16 aid, u16 capability, const u8 *supp_rates,
- size_t supp_rates_len, u16 listen_interval,
- const struct ieee80211_ht_capabilities *ht_capabilities)
-{
- struct hostapd_sta_add_params params;
-
- if (hapd->driver == NULL)
- return 0;
- if (hapd->driver->sta_add == NULL)
- return 0;
-
- os_memset(¶ms, 0, sizeof(params));
- params.addr = addr;
- params.aid = aid;
- params.capability = capability;
- params.supp_rates = supp_rates;
- params.supp_rates_len = supp_rates_len;
- params.listen_interval = listen_interval;
- params.ht_capabilities = ht_capabilities;
- return hapd->driver->sta_add(ifname, hapd->drv_priv, ¶ms);
-}
-
-static inline int
hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int channel,
int ht_enabled, int sec_channel_offset)
{
struct hostapd_data;
struct sta_info;
struct hostap_sta_driver_data;
-
-#ifdef CONFIG_FULL_DYNAMIC_VLAN
+struct ieee80211_ht_capabilities;
struct full_dynamic_vlan;
-#endif /* CONFIG_FULL_DYNAMIC_VLAN */
struct hostapd_probereq_cb {
void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
int reason);
int (*sta_disassoc)(struct hostapd_data *hapd, const u8 *addr,
int reason);
+ int (*sta_add)(const char *ifname, struct hostapd_data *hapd,
+ const u8 *addr, u16 aid, u16 capability,
+ const u8 *supp_rates, size_t supp_rates_len,
+ u16 listen_interval,
+ const struct ieee80211_ht_capabilities *ht_capab);
int (*sta_remove)(struct hostapd_data *hapd, const u8 *addr);
};
#ifndef CONFIG_NATIVE_WINDOWS
-#include <net/if.h>
-
#include "common.h"
#include "eloop.h"
#include "crypto/crypto.h"
+#include "drivers/driver.h"
#include "common/wpa_ctrl.h"
#include "radius/radius.h"
#include "radius/radius_client.h"
#include "wme.h"
#include "ap_list.h"
#include "accounting.h"
-#include "driver_i.h"
+#include "config.h"
#include "mlme.h"
hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap);
#endif /* CONFIG_IEEE80211N */
- if (hostapd_sta_add(hapd->conf->iface, hapd, sta->addr, sta->aid,
- sta->capability, sta->supported_rates,
- sta->supported_rates_len, sta->listen_interval,
- sta->flags & WLAN_STA_HT ? &ht_cap : NULL))
- {
+ if (hapd->drv.sta_add(hapd->conf->iface, hapd, sta->addr, sta->aid,
+ sta->capability, sta->supported_rates,
+ sta->supported_rates_len, sta->listen_interval,
+ sta->flags & WLAN_STA_HT ? &ht_cap : NULL)) {
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE,
"Could not add STA to kernel driver");