platform: rework link type detection for better fallback (bgo #743209)

See "Revert "wireless: Support of IFLA_INFO_KIND rtnl attribute""
http://www.spinics.net/lists/linux-wireless/msg132219.html

The reverted kernel patch caused rtnl_link_get_type() to return "wlan"
for WiFi devices.  Since NM depends on this function returning
NULL for WiFi devices so that it goes on to check the sysfs DEVTYPE
attribute, the kernel patch caused WiFi devices to show up as Generic
ones instead.  That's wrong, and NM should be able to more easily
handle changes in the kernel drivers from NULL to a more descriptive
rtnl_link_get_type() return, since that's the kernel trend.

What NM should be doing here is to fall back to other detection
schemes if the type is NULL or unrecognized. Make that happen and
clean things up to use a table instead of a giant if(strcmp()) block.

https://bugzilla.gnome.org/show_bug.cgi?id=743209
This commit is contained in:
Dan Williams
2015-04-14 17:18:34 -05:00
parent b484b03acf
commit 2d527b30ff
3 changed files with 59 additions and 80 deletions

View File

@@ -29,7 +29,7 @@
typedef struct WifiData WifiData;
gboolean wifi_utils_is_wifi (const char *iface, const char *sysfs_path, const char *devtype);
gboolean wifi_utils_is_wifi (const char *iface, const char *sysfs_path);
WifiData *wifi_utils_init (const char *iface, int ifindex, gboolean check_scan);