aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/driver_i.h
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-04-11 16:23:09 (GMT)
committerJouni Malinen <j@w1.fi>2010-04-11 16:23:09 (GMT)
commitf3585c8a8507180830047894dddceb4b0159e299 (patch)
treed7ea7fc6c96f76d18963f9b9ff473ea4913afc5a /wpa_supplicant/driver_i.h
parent977b11747f9c354d4f9e17c82175822f16329317 (diff)
downloadhostap-f3585c8a8507180830047894dddceb4b0159e299.zip
hostap-f3585c8a8507180830047894dddceb4b0159e299.tar.gz
hostap-f3585c8a8507180830047894dddceb4b0159e299.tar.bz2
Simplify driver_ops for virtual interface add/remove
There is no absolute requirement for separating address allocation into separate functions, so simplify the driver wrapper interface to use just if_add and if_remove instead of adding the new alloc_interface_addr() and release_interface_addr() functions. if_add() can now indicate if the driver forced a different interface name or address on the virtual interface.
Diffstat (limited to 'wpa_supplicant/driver_i.h')
-rw-r--r--wpa_supplicant/driver_i.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 71240c3..fa2ae4f 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -394,20 +394,26 @@ static inline int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
return -1;
}
-static inline int wpa_drv_alloc_interface_addr(struct wpa_supplicant *wpa_s,
- u8 *addr, char *ifname)
+static inline int wpa_drv_if_add(struct wpa_supplicant *wpa_s,
+ enum wpa_driver_if_type type,
+ const char *ifname, const u8 *addr,
+ void *bss_ctx, char *force_ifname,
+ u8 *if_addr)
{
- if (wpa_s->driver->alloc_interface_addr)
- return wpa_s->driver->alloc_interface_addr(wpa_s->drv_priv,
- addr, ifname);
+ if (wpa_s->driver->if_add)
+ return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname,
+ addr, bss_ctx, NULL, force_ifname,
+ if_addr);
return -1;
}
-static inline void wpa_drv_release_interface_addr(struct wpa_supplicant *wpa_s,
- const u8 *addr)
+static inline int wpa_drv_if_remove(struct wpa_supplicant *wpa_s,
+ enum wpa_driver_if_type type,
+ const char *ifname)
{
- if (wpa_s->driver->release_interface_addr)
- wpa_s->driver->release_interface_addr(wpa_s->drv_priv, addr);
+ if (wpa_s->driver->if_remove)
+ return wpa_s->driver->if_remove(wpa_s->drv_priv, type, ifname);
+ return -1;
}
static inline int wpa_drv_remain_on_channel(struct wpa_supplicant *wpa_s,