[PATCH v2 4/6] nl80211: Add method to lookup drv by ifindex.

greearb at candelatech.com greearb
Thu Oct 20 13:21:22 PDT 2011


From: Ben Greear <greearb at candelatech.com>

Will be used by global netlink logic.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
:100644 100644 d8cbf45... f6556a2... M	src/drivers/driver_nl80211.c
 src/drivers/driver_nl80211.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d8cbf45..f6556a2 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -501,6 +501,21 @@ static int wpa_driver_nl80211_own_ifindex(struct wpa_driver_nl80211_data *drv,
 }
 
 
+struct wpa_driver_nl80211_data *nl80211_find_drv(struct nl80211_global *global, int idx,
+						 u8 *buf, size_t len)
+{
+	struct wpa_driver_nl80211_data *drvtmp;
+	dl_list_for_each(drvtmp, &global->interfaces,
+			 struct wpa_driver_nl80211_data, list) {
+		if (wpa_driver_nl80211_own_ifindex(drvtmp, idx, buf, len) ||
+		    have_ifidx(drvtmp, idx)) {
+			return drvtmp;
+		}
+	}
+	return NULL;
+}
+
+
 static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
 						 struct ifinfomsg *ifi,
 						 u8 *buf, size_t len)
-- 
1.7.3.4




More information about the Hostap mailing list