Patchwork [12/18] driver_nl80211: use common eloop function

login
register
mail settings
Submitter Johannes Berg
Date Nov. 4, 2011, 10:38 a.m.
Message ID <20111104103811.511709601@sipsolutions.net>
Download mbox | patch
Permalink /patch/123597/
State Superseded
Headers show

Comments

Johannes Berg - Nov. 4, 2011, 10:38 a.m.
From: Johannes Berg <johannes.berg@intel.com>

We can pass the nl_cb as the context and use a common
eloop function instead of multiple.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 src/drivers/driver_nl80211.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index dbdec2a..6f6529c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1865,14 +1865,14 @@  static int process_drv_event(struct nl_msg *msg, void *arg)
 }
 
 
-static void wpa_driver_nl80211_drv_event_receive(int sock, void *eloop_ctx,
-						 void *handle)
+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);
 }
 
 
@@ -2255,7 +2255,7 @@  static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv)
 		  process_drv_event, drv);
 
 	eloop_register_read_sock(nl_socket_get_fd(drv->nl_event.handle),
-				 wpa_driver_nl80211_drv_event_receive, drv,
+				 wpa_driver_nl80211_event_receive, drv->nl_cb,
 				 drv->nl_event.handle);
 
 	return 0;
@@ -7216,7 +7216,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_drv_event_receive, drv,
+				 wpa_driver_nl80211_event_receive, drv->nl_cb,
 				 bss->nl_preq.handle);
 
 	return 0;