Re: Wireless silently disconnects?



* aj2r ya com  <aj2r ya com> [2006-03-01 18:29]:
> 
> This patch created by me solve the problem:
>

After de-mangling this patch seems to work.  I haven't done much
testing but this keeps me online for more than a couple of seconds.  I've
undone the line-wrapping, fixed the indentation, and included it below.

The games with *driver probably need some work.  There are choices besides
ndiswrapper and wext.  Probably just make that last line

+			"INTERFACE_ADD %s\t\t%s\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface, nm_device_get_driver(NM_DEVICE(self))

I'll reply with that patch if it works.

-Brian


--- src/nm-device-802-11-wireless.c	2006-02-21 11:39:33.000000000 +0100
+++ src/nm-device-802-11-wireless.c	2006-03-01 19:06:34.000000000 +0100
@@ -1808,8 +1808,10 @@
 			/* Must be in infrastructure mode during scan, otherwise we don't get a full
 			 * list of scan results.  Scanning doesn't work well in Ad-Hoc mode :( 
 			 */
-			nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
-			nm_device_802_11_wireless_set_frequency (self, 0);
+			if (nm_device_802_11_wireless_get_mode (self) == IW_MODE_ADHOC) {
+				nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA);
+				nm_device_802_11_wireless_set_frequency (self, 0);
+			}
 
 			wrq.u.data.pointer = NULL;
 			wrq.u.data.flags = 0;
@@ -2282,13 +2284,23 @@
 	const char *		iface = nm_device_get_iface (NM_DEVICE (self));
 	gboolean			success = FALSE;
 	int				tries = 0;
+	char *	driver;
 
 	if (!(ctrl = wpa_ctrl_open (WPA_SUPPLICANT_GLOBAL_SOCKET, NM_RUN_DIR)))
 		goto exit;
 
+	if (!strcmp (nm_device_get_driver (NM_DEVICE (self)), "ndiswrapper")) {
+		driver= g_malloc(sizeof(char)*(strlen("ndiswrapper")+1));
+		driver= strcpy(driver, "ndiswrapper");
+	}
+	else {
+		driver= g_malloc(sizeof(char)*(strlen("wext")+1));
+		driver= strcpy(driver, "wext");
+	}
+
 	/* wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext /var/run/wpa_supplicant */
 	if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
-			"INTERFACE_ADD %s\t\twext\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface))
+			"INTERFACE_ADD %s\t\t%s\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface, driver))
 		goto exit;
 	wpa_ctrl_close (ctrl);
 
@@ -2308,6 +2320,7 @@
 	success = TRUE;
 
 exit:
+	g_free (driver);
 	return success;
 }
 

 

_______________________________________________
NetworkManager-list mailing list
NetworkManager-list gnome org
http://mail.gnome.org/mailman/listinfo/networkmanager-list



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