[PATCH] get_radio_name driver wrapper added

Prameela Rani Garnepudi prameela.g at samsung.com
Tue Mar 18 08:05:22 EDT 2014


hi,

Please review the below patch:-

From 38629df763b59da9b021837e98c0d280941ad7b7 Mon Sep 17 00:00:00 2001
From: Prameela Rani Garnepudi <prameela.g at samsung.com>
Date: Tue, 18 Mar 2014 10:41:17 +0430
Subject: [PATCH] get_radio_name driver wrapper added


Signed-off-by: Prameela Rani Garnepudi <prameela.g at samsung.com>
---
 wpa_supplicant/driver_i.h       |    8 ++++++++
 wpa_supplicant/wpa_supplicant.c |    7 ++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 0691b6c..0488c57 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -206,6 +206,14 @@ static inline const char * wpa_drv_get_ifname(struct wpa_supplicant *wpa_s)
 	return NULL;
 }
 
+static inline const char * wpa_driver_get_radio_name(struct wpa_supplicant *wpa_s)
+{
+	if (wpa_s->driver->get_radio_name) {
+		return wpa_s->driver->get_radio_name(wpa_s->drv_priv);
+	}
+	return NULL;
+}
+
 static inline const u8 * wpa_drv_get_mac_addr(struct wpa_supplicant *wpa_s)
 {
 	if (wpa_s->driver->get_mac_addr) {
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 455b158..76fe3cd 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3250,10 +3250,7 @@ next_driver:
 		os_strlcpy(wpa_s->ifname, ifname, sizeof(wpa_s->ifname));
 	}
 
-	if (wpa_s->driver->get_radio_name)
-		rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
-	else
-		rn = NULL;
+	rn = wpa_driver_get_radio_name(wpa_s);
 	if (rn && rn[0] == '\0')
 		rn = NULL;
 
@@ -4412,7 +4409,7 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
 	}
 
 	/* If get_radio_name is not supported, use only the local freq */
-	if (!wpa_s->driver->get_radio_name) {
+	if (!wpa_driver_get_radio_name(wpa_s)) {
 		freq = wpa_drv_shared_freq(wpa_s);
 		if (freq > 0 && idx < len &&
 		    (idx == 0 || freq_array[0] != freq))
-- 
1.7.6.5



More information about the HostAP mailing list