Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] Udevng: Improve modem properties detection
Date: Mon, 02 May 2016 22:23:19 -0500	[thread overview]
Message-ID: <572819A7.5030407@gmail.com> (raw)
In-Reply-To: <1462206794-14322-2-git-send-email-m.chaplet@kerlink.fr>

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

Hi Martin,

On 05/02/2016 11:33 AM, Martin Chaplet wrote:
>   * Add driver's subsystem information (net, usb, tty, ...)
>   * Improve interface number extraction by scanning also device and
>   parent attributes
>
> Signed-off-by: Martin Chaplet <m.chaplet@kerlink.fr>

No signed-off-by please.  See HACKING, 'Submitting Patches' section.

> ---
>   plugins/udevng.c | 18 +++++++++++++++++-
>   1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index 9643b0a..8ca4471 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -55,6 +55,7 @@ struct device_info {
>   	char *number;
>   	char *label;
>   	char *sysattr;
> +	char *subsystem;
>   };
>
>   static gboolean setup_isi(struct modem_info *modem)
> @@ -939,6 +940,7 @@ static void destroy_modem(gpointer data)
>   		g_free(info->number);
>   		g_free(info->label);
>   		g_free(info->sysattr);
> +		g_free(info->subsystem);
>   		g_free(info);
>
>   		list->data = NULL;
> @@ -997,9 +999,10 @@ static void add_device(const char *syspath, const char *devname,
>   			const char *model, struct udev_device *device)
>   {
>   	struct udev_device *intf;
> -	const char *devpath, *devnode, *interface, *number, *label, *sysattr;
> +	const char *devpath, *devnode, *interface, *number, *label, *sysattr, *subsystem;
>   	struct modem_info *modem;
>   	struct device_info *info;
> +	struct udev_device *parent;
>
>   	devpath = udev_device_get_syspath(device);
>   	if (devpath == NULL)
> @@ -1037,7 +1040,19 @@ static void add_device(const char *syspath, const char *devname,
>   	interface = udev_device_get_property_value(intf, "INTERFACE");
>   	number = udev_device_get_property_value(device, "ID_USB_INTERFACE_NUM");
>
> +	/* If environment variable is not set, get value from attributes (or parent's ones) */
> +	if(number == NULL)
> +	{

Not our style.  oFono uses the Linux Kernel coding style, so the '{' 
should be on the same line as the if.

> +		number = udev_device_get_sysattr_value(device, "bInterfaceNumber");
> +		if(number == NULL)
> +		{

as above

> +			parent = udev_device_get_parent(device);
> +			number = udev_device_get_sysattr_value(parent, "bInterfaceNumber");
> +		}
> +	}
> +
>   	label = udev_device_get_property_value(device, "OFONO_LABEL");
> +	subsystem = udev_device_get_subsystem(device);
>
>   	if (modem->sysattr != NULL)
>   		sysattr = udev_device_get_sysattr_value(device, modem->sysattr);
> @@ -1059,6 +1074,7 @@ static void add_device(const char *syspath, const char *devname,
>   	info->number = g_strdup(number);
>   	info->label = g_strdup(label);
>   	info->sysattr = g_strdup(sysattr);
> +	info->subsystem = g_strdup(subsystem);
>
>   	modem->devices = g_slist_insert_sorted(modem->devices, info,
>   							compare_device);
>

Regards,
-Denis

  reply	other threads:[~2016-05-03  3:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 14:42 [PATCH 1/3] udevng: Add usbmisc scan for QMI devices Martin Chaplet
2016-05-02 14:42 ` [PATCH 2/3] Gobi: Enable SIM driver "manual" config Martin Chaplet
2016-05-02 15:13   ` Denis Kenzior
2016-05-02 15:27     ` Martin Chaplet
2016-05-02 14:42 ` [PATCH 3/3] Add support for Sierra MC73xx QMI modems Martin Chaplet
2016-05-02 15:20   ` Denis Kenzior
2016-05-02 15:37     ` Martin Chaplet
2016-05-02 16:33     ` [PATCH 1/3] Gobi: Enable SIM driver forcing Martin Chaplet
2016-05-02 16:33       ` [PATCH 2/3] Udevng: Improve modem properties detection Martin Chaplet
2016-05-03  3:23         ` Denis Kenzior [this message]
2016-05-03  8:40           ` Martin Chaplet
2016-05-02 16:33       ` [PATCH 3/3] Add support for Sierra MC73xx QMI modems Martin Chaplet
2016-05-03  3:21       ` [PATCH 1/3] Gobi: Enable SIM driver forcing Denis Kenzior
2016-05-02 20:24   ` [PATCH 3/3] Add support for Sierra MC73xx QMI modems =?unknown-8bit?q?Bj=C3=B8rn?= Mork
2016-05-03  8:27     ` Martin Chaplet
2016-05-03  8:55       ` =?unknown-8bit?q?Bj=C3=B8rn?= Mork
2016-05-02 15:12 ` [PATCH 1/3] udevng: Add usbmisc scan for QMI devices Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2016-05-03  8:44 [PATCH 1/3] Gobi: Enable SIM driver forcing Martin Chaplet
2016-05-03  8:44 ` [PATCH 2/3] Udevng: Improve modem properties detection Martin Chaplet

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=572819A7.5030407@gmail.com \
    --to=denkenz@gmail.com \
    --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