udev: Add support for setting IFX multiplexer line discipline

The IFX modem plugin uses a kernel based multiplexer. And to support
different line discipline numbers on different target platforms, allow
them to be specified as option:

KERNEL=="ttyIFX[0-9]*", ENV{OFONO_DRIVER}="ifx", ENV{OFONO_IFX_LDISC}="23"

The extra OFONO_IFX_LDISC option specifies to use line discipline 23
for the multiplexer setup. The number is just an example here and the
correct one will be different.
This commit is contained in:
Marcel Holtmann 2010-09-25 13:12:36 +09:00
parent 2a62e28659
commit d0adc058c4
1 changed files with 14 additions and 0 deletions

View File

@ -213,6 +213,7 @@ static void add_hso(struct ofono_modem *modem,
static void add_ifx(struct ofono_modem *modem,
struct udev_device *udev_device)
{
struct udev_list_entry *entry;
const char *devnode;
DBG("modem %p", modem);
@ -220,6 +221,19 @@ static void add_ifx(struct ofono_modem *modem,
devnode = udev_device_get_devnode(udev_device);
ofono_modem_set_string(modem, "Device", devnode);
entry = udev_device_get_properties_list_entry(udev_device);
while (entry) {
const char *name = udev_list_entry_get_name(entry);
const char *value;
if (g_str_equal(name, "OFONO_IFX_LDISC") == TRUE) {
value = udev_list_entry_get_value(entry);
ofono_modem_set_string(modem, "LineDiscipline", value);
}
entry = udev_list_entry_get_next(entry);
}
ofono_modem_register(modem);
}