[PATCH] olpc-mesh: force use of WEXT

The libertas driver now uses nl80211 for mesh, and wifi-utils chooses to
use wifi-utils-nl80211.

The wifi-utils-nl80211 code does not have implementations for
mesh_get_channel/mesh_set_channel and this breaks mesh networking.
Adding these methods under nl80211 is a little painful.

For now, force use of wifi-utils-wext to restore mesh networking.
 src/nm-device-olpc-mesh.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

I have written a set_mesh_channel implementation for nl80211 which
I think should work.

However, get_mesh_channel is harder: reading of the active channel in
nl80211 is done by reading scan results and looking for the network that
is marked as connected. The mesh device doesn't return scan results.

I think we could improve libertas to return always return a fake scan
result on the mesh device (with the expected SSID and channel details),
and also make it report itself as always connected.

Until I find a moment to try that approach, is this patch acceptable?

diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c
index f6390c1..8e3cb95 100644
--- a/src/nm-device-olpc-mesh.c
+++ b/src/nm-device-olpc-mesh.c
@@ -55,6 +55,9 @@
 #include "nm-manager.h"
 #include "nm-enum-types.h"
 #include "wifi-utils.h"
+#include "wifi-utils-wext.h"
 /* This is a bug; but we can't really change API now... */
 #include "NetworkManagerVPN.h"
@@ -153,9 +156,16 @@ constructor (GType type,
 	            nm_device_get_iface (NM_DEVICE (self)),
 	            nm_device_get_ifindex (NM_DEVICE (self)));
-	priv->wifi_data = wifi_utils_init (nm_device_get_iface (NM_DEVICE (self)),
-	                                   nm_device_get_ifindex (NM_DEVICE (self)),
-	                                   FALSE);
+	/*
+	 * The kernel driver now uses nl80211, but we force use of WEXT because
+	 * the cfg80211 interactions are not quite ready to support access to
+	 * mesh control through nl80211 just yet.
+	 */
+	priv->wifi_data = wifi_wext_init (nm_device_get_iface (NM_DEVICE (self)),
+	                                  nm_device_get_ifindex (NM_DEVICE (self)),
+	                                  FALSE);
 	if (priv->wifi_data == NULL) {
 		nm_log_warn (LOGD_HW | LOGD_OLPC_MESH, "(%s): failed to initialize WiFi driver",
 		             nm_device_get_iface (NM_DEVICE (self)));

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]