From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] udev: Handle Linktop data card
Date: Mon, 14 Feb 2011 13:55:50 -0600 [thread overview]
Message-ID: <4D5988C6.6060701@gmail.com> (raw)
In-Reply-To: <1297314940-4315-2-git-send-email-mendapara.amit@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]
Hi Amit,
On 02/09/2011 11:15 PM, Amit Mendapara wrote:
> Signed-off-by: Amit Mendapara <mendapara.amit@gmail.com>
> ---
> plugins/udev.c | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
>
Patch has been applied, thanks.
Some comments on further improvements:
> +static void add_linktop(struct ofono_modem *modem,
> + struct udev_device *udev_device)
> +{
> + const char *devnode, *intfnum;
> + struct udev_device *parent;
> + int registered;
> +
> + DBG("modem %p", modem);
> +
> + registered = ofono_modem_get_integer(modem, "Registered");
> + if (registered != 0)
> + return;
> +
> + parent = udev_device_get_parent(udev_device);
> + intfnum = udev_device_get_sysattr_value(parent, "bInterfaceNumber");
> +
> + DBG("intfnum %s", intfnum);
> +
> + if (g_strcmp0(intfnum, "01") == 0) {
> + devnode = udev_device_get_devnode(udev_device);
> + ofono_modem_set_string(modem, "Modem", devnode);
> + } else if (g_strcmp0(intfnum, "03") == 0) {
> + devnode = udev_device_get_devnode(udev_device);
> + ofono_modem_set_string(modem, "Control", devnode);
> +
> + ofono_modem_set_integer(modem, "Registered", 1);
> + ofono_modem_register(modem);
> + }
Instead of hardcoding this info, you might want to use an approach
similar to how the Huawei udev rules are structured. However, this
really depends on how many variations of this Linktop card there are.
Since there's only 1 right now, this is fine.
Regards,
-Denis
next prev parent reply other threads:[~2011-02-14 19:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-10 5:15 [PATCH 1/3] plugin: Add plugin for Linktop LW27x data cards Amit Mendapara
2011-02-10 5:15 ` [PATCH 2/3] udev: Handle Linktop data card Amit Mendapara
2011-02-14 19:55 ` Denis Kenzior [this message]
2011-02-10 5:15 ` [PATCH 3/3] udev: Add Teracom (Linktop/LW27x) device detection Amit Mendapara
2011-02-14 19:56 ` Denis Kenzior
2011-02-14 19:54 ` [PATCH 1/3] plugin: Add plugin for Linktop LW27x data cards Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2011-02-07 3:22 Amit Mendapara
2011-02-07 3:22 ` [PATCH 2/3] udev: Handle Linktop data card Amit Mendapara
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=4D5988C6.6060701@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.