From 66d64068b461f99ecb440d9828b07726a529ca96 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 12 Jan 2009 17:03:39 +0000 Subject: [PATCH] set info.hsotype for ttyHS* devices 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 --- 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