Re: connect to internet via android phone as usb-modem



Hello,

I've changed the hack to now check for a udev environment variable
'NM_PSEUDODRIVER'. If set, the lack of a driver is ignored.
The /etc/udev/rules.d/easytether.rules declares this if an easytether0
device is detected.

If need be I can revert it to check for 'easytether' in the code, but I
think the udev rule based approach is better.

Bye,
Torsten



diff -ruN NetworkManager/src/nm-udev-manager.c NetworkManager-easytether/src/nm-udev-manager.c
--- NetworkManager/src/nm-udev-manager.c	2011-03-10 23:38:01.298038845 +0100
+++ NetworkManager-easytether/src/nm-udev-manager.c	2011-03-18 19:27:06.893019906 +0100
@@ -385,8 +385,12 @@
 	}
 
 	if (!driver) {
-		nm_log_warn (LOGD_HW, "%s: couldn't determine device driver; ignoring...", path);
-		goto out;
+		if (g_udev_device_has_property (udev_device, "NM_PSEUDODRIVER"))
+			driver = g_udev_device_get_property(udev_device, "NM_PSEUDODRIVER");
+		else {
+			nm_log_warn (LOGD_HW, "%s: couldn't determine device driver; ignoring...", path);
+			goto out;
+		}
 	}
 
 	ifindex = g_udev_device_get_sysfs_attr_as_int (udev_device, "ifindex");
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="41da", RUN+="/usr/local/bin/easytether"
ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="easytether0", ENV{NM_PSEUDODRIVER}="easytether"


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