about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-05-29 12:28:20 +0200
committerMichael Biebl <biebl@debian.org>2012-05-29 12:28:20 +0200
commit41dfe5011b55b35f53f6ce2fe9bc2375f37039f1 (patch)
tree1e0044a44473f0dc1a035764c855774e01a4765f
parent20930f778c9e3851ad1de813a609920597c8e86d (diff)
wifi: attempt to use same kernel API wpa_supplicant does
  * debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch: Some
    drivers (ipw2x00) have an incomplete nl80211 implementation and only
    report capabilities which made NM chose the wrong API to talk to the
    device. Instead, match the logic that wpa_supplicant uses to determine
    whether to stick with nl80211 or fall back to WEXT. (Closes: #673705)
-rw-r--r--debian/changelog10
-rw-r--r--debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch75
-rw-r--r--debian/patches/series1
3 files changed, 86 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 0e484e55..09e19220 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+network-manager (0.9.4.0-5) UNRELEASED; urgency=low
+
+  * debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch: Some
+    drivers (ipw2x00) have an incomplete nl80211 implementation and only
+    report capabilities which made NM chose the wrong API to talk to the
+    device. Instead, match the logic that wpa_supplicant uses to determine
+    whether to stick with nl80211 or fall back to WEXT. (Closes: #673705)
+
+ -- Michael Biebl <biebl@debian.org>  Tue, 29 May 2012 12:20:24 +0200
+
 network-manager (0.9.4.0-4) unstable; urgency=low
 
   * debian/network-manager.dirs: Install /etc/NetworkManager/VPN/ directory.
diff --git a/debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch b/debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch
new file mode 100644
index 00000000..4ae4606f
--- /dev/null
+++ b/debian/patches/14-use-same-kernel-API-as-wpa_supplicant.patch
@@ -0,0 +1,75 @@
+commit 50435e1d5deff17233f1de73ee030a5982e9fd05 (origin/wifi-fallback)
+Author: Dan Williams <dcbw@redhat.com>
+Date:   Fri May 4 14:26:10 2012 -0500
+
+    wifi: attempt to use same kernel API wpa_supplicant does (bgo #675017)
+    
+    Some drivers (ipw2x00) support capabilities reporting via nl80211 but
+    absolutely nothing else.  NM was only checking for capabilities
+    when deciding whether or not to use nl80211 to communicate with the
+    driver for associated AP, signal strength, and channel info, and that
+    clearly fails with half-implementations of nl80211 in the kernel.
+    
+    Instead, match the logic that wpa_supplicant uses to determine whether
+    to stick with nl80211 or fall back to WEXT.  For these drivers
+    NM will now fall back to WEXT and should return to the behavior we
+    had with 0.9.2 for these devices.
+
+Index: network-manager/src/wifi/wifi-utils-nl80211.c
+===================================================================
+--- network-manager.orig/src/wifi/wifi-utils-nl80211.c	2012-05-15 02:00:59.049491794 +0200
++++ network-manager/src/wifi/wifi-utils-nl80211.c	2012-05-29 12:20:15.653087949 +0200
+@@ -535,7 +535,9 @@
+ 	guint32 *freqs;
+ 	int num_freqs;
+ 	guint32 caps;
+-	gboolean can_scan, can_scan_ssid;
++	gboolean can_scan;
++	gboolean can_scan_ssid;
++	gboolean supported;
+ 	gboolean success;
+ };
+ 
+@@ -579,11 +581,24 @@
+ 		struct nlattr *nl_cmd;
+ 		int i;
+ 
+-		nla_for_each_nested (nl_cmd,
+-				     tb[NL80211_ATTR_SUPPORTED_COMMANDS], i) {
+-			guint32 cmd = nla_get_u32 (nl_cmd);
+-			if (cmd == NL80211_CMD_TRIGGER_SCAN)
++		nla_for_each_nested (nl_cmd, tb[NL80211_ATTR_SUPPORTED_COMMANDS], i) {
++			switch (nla_get_u32 (nl_cmd)) {
++			case NL80211_CMD_TRIGGER_SCAN:
+ 				info->can_scan = TRUE;
++				break;
++			case NL80211_CMD_CONNECT:
++			case NL80211_CMD_AUTHENTICATE:
++				/* Only devices that support CONNECT or AUTH actually support
++				 * 802.11, unlike say ipw2x00 (up to at least kernel 3.4) which
++				 * has minimal info support, but no actual command support.
++				 * This check mirrors what wpa_supplicant does to determine
++				 * whether or not to use the nl80211 driver.
++				 */
++				info->supported = TRUE;
++				break;
++			default:
++				break;
++			}
+ 		}
+ 	}
+ 
+@@ -720,6 +735,13 @@
+ 				    nl80211->parent.iface);
+ 		goto error;
+ 	}
++
++	if (!device_info.supported) {
++		nm_log_dbg (LOGD_HW | LOGD_WIFI,
++				    "(%s): driver does not fully support nl80211, falling back to WEXT",
++				    nl80211->parent.iface);
++		goto error;
++	}
+ 
+ 	if (!device_info.can_scan_ssid) {
+ 		nm_log_err (LOGD_HW | LOGD_WIFI,
diff --git a/debian/patches/series b/debian/patches/series
index 0db45e84..134267a8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 11-initialize-nm-remote-settings.patch
 12-initialize-gerror.patch
 13-dont-replace-kernel-default-route-for-IPv6.patch
+14-use-same-kernel-API-as-wpa_supplicant.patch