From f8cf9cf154067aae9d3679d297033ba1487d2be6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 28 Sep 2015 20:38:17 -0500 Subject: [PATCH] wsc: Add wsc_init and wsc_exit --- src/wsc.c | 20 ++++++++++++++++++++ src/wsc.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/src/wsc.c b/src/wsc.c index 10dc3ff5..c883a698 100644 --- a/src/wsc.c +++ b/src/wsc.c @@ -34,6 +34,8 @@ #define WALK_TIME 120 +static struct l_genl_family *nl80211 = NULL; + struct wsc_sm { uint8_t *wsc_ies; size_t wsc_ies_size; @@ -98,3 +100,21 @@ void wsc_sm_free(struct wsc_sm *sm) { l_free(sm); } + +bool wsc_init(struct l_genl_family *in) +{ + nl80211 = in; + return true; +} + +bool wsc_exit() +{ + l_debug(""); + + if (!nl80211) + return false; + + nl80211 = 0; + + return true; +} diff --git a/src/wsc.h b/src/wsc.h index efec1eca..b3cff423 100644 --- a/src/wsc.h +++ b/src/wsc.h @@ -28,3 +28,6 @@ struct wsc_sm; struct wsc_sm *wsc_sm_new_pushbutton(uint32_t ifindex, const uint8_t *addr, uint32_t bands); void wsc_sm_free(struct wsc_sm *wsc_sm); + +bool wsc_init(struct l_genl_family *in); +bool wsc_exit();