Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH v2 3/3] udev: add Telit UC864-G and update udev rules
Date: Wed, 25 May 2011 12:10:30 -0700	[thread overview]
Message-ID: <1306350630.2681.41.camel@aeonflux> (raw)
In-Reply-To: <1306329265-12066-3-git-send-email-Bernhard.Guillon@hale.at>

[-- Attachment #1: Type: text/plain, Size: 3308 bytes --]

Hi Bernard,

> *for now only check for Modem, add GPS later
> 
> Co-authored-by: Christopher Vogl <Christopher.Vogl@hale.at>
> ---
>  plugins/ofono.rules |    8 ++++++++
>  plugins/udev.c      |   31 +++++++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/plugins/ofono.rules b/plugins/ofono.rules
> index 5a36380..87ef065 100644
> --- a/plugins/ofono.rules
> +++ b/plugins/ofono.rules
> @@ -344,6 +344,14 @@ ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1485", ENV{OFONO_IFACE_NUM}=="02", E
>  ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1486", ENV{OFONO_IFACE_NUM}=="00", ENV{OFONO_HUAWEI_TYPE}="Modem"
>  ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1486", ENV{OFONO_IFACE_NUM}=="02", ENV{OFONO_HUAWEI_TYPE}="Pcui"
>  
> +#Telit UC864-G
> +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{OFONO_IFACE_NUM}=="00", ENV{OFONO_TELIT_TYPE}="Modem"
> +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{OFONO_IFACE_NUM}=="01", ENV{OFONO_TELIT_TYPE}="Aux"
> +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{OFONO_IFACE_NUM}=="02", ENV{OFONO_TELIT_TYPE}="GPS"
> +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{OFONO_IFACE_NUM}=="03", ENV{OFONO_TELIT_TYPE}="UART"
> +

I can actually look this up, but which ones are you planning to use. I
can see the Modem, Aux and GPS, but what is the UART for?

> +ATTRS{idVendor}=="1bc7", ENV{OFONO_DRIVER}="telit"
> +
>  LABEL="ofono_tty_end"
>  
>  # ISI/Phonet drivers
> diff --git a/plugins/udev.c b/plugins/udev.c
> index cbb596d..28fff72 100644
> --- a/plugins/udev.c
> +++ b/plugins/udev.c
> @@ -588,6 +588,35 @@ static void add_linktop(struct ofono_modem *modem,
>  	}
>  }
>  
> +static void add_telit(struct ofono_modem *modem,
> +					struct udev_device *udev_device)
> +{
> +	struct udev_list_entry *entry;
> +	const char *devnode;
> +	gboolean found = FALSE;
> +
> +	DBG("modem %p", modem);
> +
> +	entry = udev_device_get_properties_list_entry(udev_device);
> +	while (entry) {
> +		const char *name = udev_list_entry_get_name(entry);
> +		const char *value = udev_list_entry_get_value(entry);
> +
> +		if (g_str_equal(name, "OFONO_TELIT_TYPE") == TRUE &&
> +					g_str_equal(value, "Modem") == TRUE) {
> +			found = TRUE;
> +		}
> +		entry = udev_list_entry_get_next(entry);
> +	}
> +
> +	if (found == FALSE)
> +		return;
> +
> +	devnode = udev_device_get_devnode(udev_device);
> +	ofono_modem_set_string(modem, "Modem", devnode);
> +	ofono_modem_register(modem);
> +}
> +

You can not really do it like this. You have to wait to register the
modem until all mandatory TTYs are present. Especially in case you
require two or more TTYs, which it seems you will.

Check the other ones like Novatel for examples.

>  static void add_modem(struct udev_device *udev_device)
>  {
>  	struct ofono_modem *modem;
> @@ -682,6 +711,8 @@ done:
>  		add_calypso(modem, udev_device);
>  	else if (g_strcmp0(driver, "tc65") == 0)
>  		add_tc65(modem, udev_device);
> +	else if (g_strcmp0(driver, "telit") == 0)
> +		add_telit(modem, udev_device);
>  	else if (g_strcmp0(driver, "nokiacdma") == 0)
>  		add_nokiacdma(modem, udev_device);
>          else if (g_strcmp0(driver, "linktop") == 0)

Regards

Marcel



  reply	other threads:[~2011-05-25 19:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 13:14 [PATCH v2 1/3] Add basic Telit UC864-G support: Bernhard.Guillon
2011-05-25 13:14 ` [PATCH v2 2/3] network-registration.c: implement CIND forTelit UC864-G Bernhard.Guillon
2011-05-25 19:08   ` Marcel Holtmann
2011-05-24  7:18     ` Denis Kenzior
2011-06-07 12:01       ` [PATCH v2 2/3] network-registration.c: implement CIND forTelitUC864-G Bernhard Guillon
2011-06-07 12:04       ` [PATCH] network-registration.c: enhance CIND=? support Bernhard.Guillon
2011-06-06  5:24         ` Denis Kenzior
2011-06-07 12:12         ` Bernhard Guillon
2011-05-25 13:14 ` [PATCH v2 3/3] udev: add Telit UC864-G and update udev rules Bernhard.Guillon
2011-05-25 19:10   ` Marcel Holtmann [this message]
2011-05-25 19:04 ` [PATCH v2 1/3] Add basic Telit UC864-G support: Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306350630.2681.41.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox