aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-03-06 20:22:56 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-06 20:22:56 (GMT)
commita2e40bb6508dc8d5443144c8c4976a742470b6bb (patch)
treefde282e1c796332d8f58b339d25522a5f14b7517 /src/ap
parent39f42d1193bc55cba6cf28f9bf8d16fc9cd24a76 (diff)
downloadhostap-a2e40bb6508dc8d5443144c8c4976a742470b6bb.zip
hostap-a2e40bb6508dc8d5443144c8c4976a742470b6bb.tar.gz
hostap-a2e40bb6508dc8d5443144c8c4976a742470b6bb.tar.bz2
hostapd: Fix interface selection for the nl80211 driver
This patch allows the nl80211 driver to create its own per-bss context and pass it to the drv_priv pointer of the hostapd bss state. With this and the following patch, stations can associate to and switch between multiple BSS interfaces of a single wiphy. This obsoletes a few instances of passing ifname to a callback, those can be removed in a separate patch. It might also be useful to move more fields from the driver data to the per-bss data structure in the future.
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/ap_drv_ops.c7
-rw-r--r--src/ap/ap_drv_ops.h3
-rw-r--r--src/ap/hostapd.c3
3 files changed, 8 insertions, 5 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 956b546..07c0e69 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -242,7 +242,7 @@ static int hostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,
static int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname)
{
- return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, NULL, NULL);
+ return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, NULL, NULL, NULL);
}
static int hostapd_vlan_if_remove(struct hostapd_data *hapd,
@@ -407,12 +407,13 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
- const char *ifname, const u8 *addr, void *bss_ctx)
+ const char *ifname, const u8 *addr, void *bss_ctx,
+ void **drv_priv)
{
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, bss_ctx);
+ ifname, addr, bss_ctx, drv_priv);
}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index 0efde28..0085ea2 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -26,7 +26,8 @@ int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len);
int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
- const char *ifname, const u8 *addr, void *bss_ctx);
+ const char *ifname, const u8 *addr, void *bss_ctx,
+ void **drv_priv);
int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname);
int hostapd_set_ieee8021x(struct hostapd_data *hapd,
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 317baf6..8bf92b8 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -484,7 +484,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
hapd->interface_added = 1;
if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
- hapd->conf->iface, hapd->own_addr, hapd)) {
+ hapd->conf->iface, hapd->own_addr, hapd,
+ &hapd->drv_priv)) {
wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID="
MACSTR ")", MAC2STR(hapd->own_addr));
return -1;