Parcourir la source

Add get_radio_name() driver wrapper for wpa_supplicant

Signed-off-by: Prameela Rani Garnepudi <prameela.g@samsung.com>
Prameela Rani Garnepudi il y a 11 ans
Parent
commit
95bf699f76
2 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. 8 0
      wpa_supplicant/driver_i.h
  2. 2 5
      wpa_supplicant/wpa_supplicant.c

+ 8 - 0
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) {

+ 2 - 5
wpa_supplicant/wpa_supplicant.c

@@ -3361,10 +3361,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;
 
@@ -4534,7 +4531,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))