Patchwork [v3,07/15] driver_nl80211: pass cb to eloop function

login
register
mail settings
Submitter Johannes Berg
Date Nov. 19, 2011, 12:39 p.m.
Message ID <20111119123951.516507439@sipsolutions.net>
Download mbox | patch
Permalink /patch/126573/
State Accepted
Commit a4ae123c3f0e0559e35ab26a7d1182aea9cbc907
Headers show

Comments

Johannes Berg - Nov. 19, 2011, 12:39 p.m.
From: Johannes Berg <johannes.berg@intel.com>

By passing the nl_cb as the context to the eloop function
we can (in the next patch) use the same eloop function for
BSS events.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 src/drivers/driver_nl80211.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Jouni Malinen - Dec. 3, 2011, 6:08 p.m.
On Sat, Nov 19, 2011 at 01:39:17PM +0100, Johannes Berg wrote:
> By passing the nl_cb as the context to the eloop function
> we can (in the next patch) use the same eloop function for
> BSS events.

Thanks, applied.

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index ca33f3a..507511f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1849,11 +1849,11 @@  static int process_event(struct nl_msg *msg, void *arg)
 static void wpa_driver_nl80211_event_receive(int sock, void *eloop_ctx,
 					     void *handle)
 {
-	struct wpa_driver_nl80211_data *drv = eloop_ctx;
+	struct nl_cb *cb = eloop_ctx;
 
 	wpa_printf(MSG_DEBUG, "nl80211: Event message available");
 
-	nl_recvmsgs(handle, drv->nl_cb);
+	nl_recvmsgs(handle, cb);
 }
 
 
@@ -2233,7 +2233,7 @@  static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv)
 		  process_event, drv);
 
 	eloop_register_read_sock(nl_socket_get_fd(drv->nl_event.handle),
-				 wpa_driver_nl80211_event_receive, drv,
+				 wpa_driver_nl80211_event_receive, drv->nl_cb,
 				 drv->nl_event.handle);
 
 	return 0;
@@ -7204,7 +7204,7 @@  static int wpa_driver_nl80211_probe_req_report(void *priv, int report)
 		goto out_err;
 
 	eloop_register_read_sock(nl_socket_get_fd(bss->nl_preq.handle),
-				 wpa_driver_nl80211_event_receive, drv,
+				 wpa_driver_nl80211_event_receive, drv->nl_cb,
 				 bss->nl_preq.handle);
 
 	return 0;