[PATCH] set info.hsotype for ttyHS* devices
Colin Watson
cjwatson at canonical.com
Mon Jan 12 09:03:39 PST 2009
Devices driven by the HSO (High Speed Option) driver have a number of
interfaces, including modem, diagnostic, control, etc. This patch grabs
the hsotype attribute out of sysfs and saves it in a HAL property so
that it can be matched by FDI files.
(The hso-udev package supplied by Option behaves somewhat similarly, but
requires a separate preprobe script. This implementation, suggested by
Scott James Remnant, is more compact.)
Signed-off-by: Colin Watson <cjwatson at canonical.com>
---
hald/linux/device.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/hald/linux/device.c b/hald/linux/device.c
index d16ac3a..20835e4 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3038,6 +3038,11 @@ serial_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent
} else {
hal_device_property_set_string (d, "info.product", "USB Serial Port");
}
+ } else if (sscanf (last_elem, "ttyHS%d", &portnum) == 1) {
+ hal_device_property_set_int (d, "serial.port", portnum);
+ hal_device_property_set_string (d, "serial.type", "usb");
+ hal_device_property_set_string (d, "info.product", "HSO Serial Port");
+ hal_util_set_string_from_file (d, "info.hsotype", sysfs_path, "hsotype");
} else {
int len;
int i;
--
1.6.0.4
--XSfi1pJWPNAvuBPy
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-set-capabilities-and-modem-command-sets-for-HSO-mode.patch"
More information about the hal
mailing list