#define DRIVER_I_H
#include "drivers/driver.h"
-#include "config.h"
+#include "ap/config.h"
static inline void *
hostapd_driver_init(struct hostapd_data *hapd, const u8 *bssid)
}
static inline int
-hostapd_set_key(const char *ifname, struct hostapd_data *hapd,
- 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_get_seqnum(const char *ifname, struct hostapd_data *hapd,
const u8 *addr, int idx, u8 *seq)
{
}
static inline int
-hostapd_read_sta_data(struct hostapd_data *hapd,
- struct hostap_sta_driver_data *data, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
- return -1;
- return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
-}
-
-static inline int
-hostapd_send_eapol(struct hostapd_data *hapd, const u8 *addr, const u8 *data,
- size_t data_len, int encrypt)
-{
- if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL)
- return 0;
- return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data,
- data_len, encrypt,
- hapd->own_addr);
-}
-
-static inline int
-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, hapd->own_addr, addr,
- reason);
-}
-
-static inline int
-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, hapd->own_addr, addr,
- reason);
-}
-
-static inline int
-hostapd_sta_remove(struct hostapd_data *hapd, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->sta_remove == NULL)
- return 0;
- return hapd->driver->sta_remove(hapd->drv_priv, addr);
-}
-
-static inline int
hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
{
if (hapd->driver == NULL || hapd->driver->hapd_get_ssid == NULL)
}
static inline int
-hostapd_send_mgmt_frame(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_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);
-}
-
-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_get_inact_sec(struct hostapd_data *hapd, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)
- return 0;
- return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
-}
-
-static inline int
hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int channel,
int ht_enabled, int sec_channel_offset)
{
}
static inline int
-hostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr)
-{
- if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
- return 0;
- return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
-}
-
-static inline int
-hostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,
- const u8 *head, size_t head_len,
- const u8 *tail, size_t tail_len, int dtim_period,
- int beacon_int)
-{
- if (hapd->driver == NULL || hapd->driver->set_beacon == NULL)
- return 0;
- return hapd->driver->set_beacon(ifname, hapd->drv_priv,
- head, head_len, tail, tail_len,
- dtim_period, beacon_int);
-}
-
-static inline int
hostapd_set_cts_protect(struct hostapd_data *hapd, int value)
{
if (hapd->driver == NULL || hapd->driver->set_cts_protect == NULL)
static inline int
hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
- const char *ifname, const u8 *addr)
+ const char *ifname, const u8 *addr, void *bss_ctx)
{
if (hapd->driver == NULL || hapd->driver->if_add == NULL)
return -1;
return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,
- ifname, addr);
+ ifname, addr, bss_ctx);
}
static inline int
}
static inline int
-hostapd_set_sta_vlan(const char *ifname, struct hostapd_data *hapd,
- const u8 *addr, int vlan_id)
-{
- if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)
- return 0;
- return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname, vlan_id);
-}
-
-static inline int
hostapd_driver_commit(struct hostapd_data *hapd)
{
if (hapd->driver == NULL || hapd->driver->commit == NULL)
}
static inline int
-hostapd_set_radius_acl_auth(struct hostapd_data *hapd, const u8 *mac,
- int accepted, u32 session_timeout)
-{
- if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)
- return 0;
- return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,
- session_timeout);
-}
-
-static inline int
-hostapd_set_radius_acl_expire(struct hostapd_data *hapd, const u8 *mac)
-{
- if (hapd->driver == NULL ||
- hapd->driver->set_radius_acl_expire == NULL)
- return 0;
- return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);
-}
-
-static inline int
hostapd_set_ht_params(const char *ifname, struct hostapd_data *hapd,
const u8 *ht_capab, size_t ht_capab_len,
const u8 *ht_oper, size_t ht_oper_len)
return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
}
-static inline int
-hostapd_set_wps_beacon_ie(struct hostapd_data *hapd, const u8 *ie, size_t len)
-{
- if (hapd->driver == NULL || hapd->driver->set_wps_beacon_ie == NULL)
- return 0;
- return hapd->driver->set_wps_beacon_ie(hapd->conf->iface,
- hapd->drv_priv, ie, len);
-}
-
-static inline int
-hostapd_set_wps_probe_resp_ie(struct hostapd_data *hapd, const u8 *ie,
- size_t len)
-{
- if (hapd->driver == NULL ||
- hapd->driver->set_wps_probe_resp_ie == NULL)
- return 0;
- return hapd->driver->set_wps_probe_resp_ie(hapd->conf->iface,
- hapd->drv_priv, ie, len);
-}
-
static inline int hostapd_driver_scan(struct hostapd_data *hapd,
struct wpa_driver_scan_params *params)
{