Discussion:
PATCH: udev-synce-serial and udev rules
Karl Relton
2010-12-23 09:46:25 UTC
Permalink
Dear friends

I've done some digging, and worked out that the device querying code in
udev-synce-serial is only necessary for trying to handle two-port
devices. I think this can be better handled in the udev rules, from
which we can launch udev-synce-serial only when required (i.e. on the
2nd port of a two port device), and thus remove all that logic from
udev-synce-serial itself.

That means udev-synce-serial no longer has to call udevadm or use a
library to interrogate the udev database, cutting a chunk of code.

The patch below does just that.

Regards
Karl


diff -Naur scripts.orig/85-synce.rules.in scripts/85-synce.rules.in
--- scripts.orig/85-synce.rules.in 2010-07-19 18:24:17.000000000 +0100
+++ scripts/85-synce.rules.in 2010-12-23 09:24:35.267741000 +0000
@@ -8,4 +8,18 @@
SUBSYSTEM=="net", DRIVERS=="rndis_host", ATTRS{bInterfaceClass}=="ef", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{pocketpc}="env-synce", RUN+="@UDEVDIR@/synce-udev-rndis"

# capabilities = serial, parent driver = ipaq
-SUBSYSTEM=="tty", DRIVERS=="ipaq", ENV{pocketpc}="env-synce", RUN+="@UDEVDIR@/synce-udev-serial"
+# If the device has more than one port, then we need to only use the last
+# one.
+#
Mark Ellis
2010-12-24 10:15:04 UTC
Permalink
Post by Karl Relton
Dear friends
Hi Karl

Apologies, I should have replied earlier.

The ubuntu package is actually a bit out of date, so I've already added
some of the fixes you've been sending. I'll upload a new one as soon as
I can.

I'll also take a look at the below. I would rather do this at the udev
level, but I couldn't figure out how. If you've cracked it that will be
great.

The main problem that had stopped me releasing the udev stuff was with
pre WM 5 devices. It worked connecting once, but to connect again I had
to kill dccm. I've now managed to lose my WM2003 test device, can you
try connecting multiple times and confirm if it works or not ?

Thanks
Mark
Post by Karl Relton
I've done some digging, and worked out that the device querying code in
udev-synce-serial is only necessary for trying to handle two-port
devices. I think this can be better handled in the udev rules, from
which we can launch udev-synce-serial only when required (i.e. on the
2nd port of a two port device), and thus remove all that logic from
udev-synce-serial itself.
That means udev-synce-serial no longer has to call udevadm or use a
library to interrogate the udev database, cutting a chunk of code.
The patch below does just that.
Regards
Karl
diff -Naur scripts.orig/85-synce.rules.in scripts/85-synce.rules.in
--- scripts.orig/85-synce.rules.in 2010-07-19 18:24:17.000000000 +0100
+++ scripts/85-synce.rules.in 2010-12-23 09:24:35.267741000 +0000
@@ -8,4 +8,18 @@
# capabilities = serial, parent driver = ipaq
+# If the device has more than one port, then we need to only use the last
+# one.
Loading...