diff options
| author | Michael Biebl <biebl@debian.org> | 2015-01-22 00:29:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-01-22 00:29:39 +0100 |
| commit | 2c032d8f1c6292c1338a615e6ec40252889ba85c (patch) | |
| tree | 1f77182220b2b0264288ba4a476ab47e5bc48716 /src/platform/wifi/wifi-utils.c | |
| parent | 33491bc4279481db8ae47213e34a6d695a0e8830 (diff) | |
Imported Upstream version 1.0.0 upstream/1.0.0
Diffstat (limited to 'src/platform/wifi/wifi-utils.c')
| -rw-r--r-- | src/platform/wifi/wifi-utils.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/platform/wifi/wifi-utils.c b/src/platform/wifi/wifi-utils.c index ff480275..daef881b 100644 --- a/src/platform/wifi/wifi-utils.c +++ b/src/platform/wifi/wifi-utils.c @@ -19,7 +19,8 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include <config.h> +#include "config.h" + #include <sys/stat.h> #include <stdio.h> #include <string.h> @@ -120,12 +121,12 @@ wifi_utils_get_ssid (WifiData *data) } gboolean -wifi_utils_get_bssid (WifiData *data, struct ether_addr *out_bssid) +wifi_utils_get_bssid (WifiData *data, guint8 *out_bssid) { g_return_val_if_fail (data != NULL, FALSE); g_return_val_if_fail (out_bssid != NULL, FALSE); - memset (out_bssid, 0, sizeof (*out_bssid)); + memset (out_bssid, 0, ETH_ALEN); return data->get_bssid (data, out_bssid); } @@ -161,13 +162,20 @@ wifi_utils_deinit (WifiData *data) } gboolean -wifi_utils_is_wifi (const char *iface, const char *sysfs_path) +wifi_utils_is_wifi (const char *iface, const char *sysfs_path, const char *devtype) { char phy80211_path[255]; struct stat s; g_return_val_if_fail (iface != NULL, FALSE); + if (g_strcmp0 (devtype, "wlan") == 0) { + /* All Wi-Fi drivers should set DEVTYPE=wlan. Since the kernel's + * cfg80211/nl80211 stack does, this check should match any nl80211 + * capable driver (including mac82011-based ones). */ + return TRUE; + } + if (sysfs_path) { /* Check for nl80211 sysfs paths */ g_snprintf (phy80211_path, sizeof (phy80211_path), "%s/phy80211", sysfs_path); @@ -175,9 +183,6 @@ wifi_utils_is_wifi (const char *iface, const char *sysfs_path) return TRUE; } - if (wifi_nl80211_is_wifi (iface)) - return TRUE; - #if HAVE_WEXT if (wifi_wext_is_wifi (iface)) return TRUE; @@ -207,11 +212,11 @@ wifi_utils_set_mesh_channel (WifiData *data, guint32 channel) } gboolean -wifi_utils_set_mesh_ssid (WifiData *data, const GByteArray *ssid) +wifi_utils_set_mesh_ssid (WifiData *data, const guint8 *ssid, gsize len) { g_return_val_if_fail (data != NULL, FALSE); g_return_val_if_fail (data->set_mesh_ssid != NULL, FALSE); - return data->set_mesh_ssid (data, ssid); + return data->set_mesh_ssid (data, ssid, len); } gboolean |