From: Bertrand Aygon <bertrand.aygon@intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/2] Add udev rules for SpeedUp modem
Date: Wed, 06 Jul 2011 19:25:59 +0200 [thread overview]
Message-ID: <1309973159-4446-2-git-send-email-bertrand.aygon@intel.com> (raw)
In-Reply-To: <1309973159-4446-1-git-send-email-bertrand.aygon@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3959 bytes --]
---
plugins/ofono.rules | 9 ++++++++
plugins/udev.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 2829ea2..1fcdddb 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -358,6 +358,10 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{OFONO_IFACE_NUM}=="00", E
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}="Data"
+# SpeedUp 9800
+ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9800", ENV{OFONO_IFACE_NUM}=="01", ENV{OFONO_SPEEDUP_TYPE}="modem"
+ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9800", ENV{OFONO_IFACE_NUM}=="02", ENV{OFONO_SPEEDUP_TYPE}="aux"
+
LABEL="ofono_tty_end"
# ISI/Phonet drivers
@@ -398,6 +402,11 @@ ATTRS{idVendor}=="19d2", ENV{OFONO_DRIVER}="zte"
ATTRS{idVendor}=="19d2", ATTRS{serial}=="1234567890ABCDEF", ENV{ID_SERIAL_SHORT}=""
+# SpeedUp
+ATTRS{idVendor}=="1c9e", ENV{OFONO_DRIVER}="speedup"
+
+ATTRS{idVendor}=="1c9e", ATTRS{serial}=="1234567890ABCDEF", ENV{ID_SERIAL_SHORT}=""
+
# Option Globetrotter
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6911", ENV{OFONO_DRIVER}="hso"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6971", ENV{OFONO_DRIVER}="hso"
diff --git a/plugins/udev.c b/plugins/udev.c
index 4faf63e..a28bea7 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -639,6 +639,58 @@ static void add_telit(struct ofono_modem *modem,
}
}
+static void add_speedup(struct ofono_modem *modem,
+ struct udev_device *udev_device)
+{
+ struct udev_list_entry *entry;
+ const char *devnode, *type;
+
+ int ppp, aux;
+
+ DBG("modem %p", modem);
+
+ ppp = ofono_modem_get_integer(modem, "ModemRegistered");
+ aux = ofono_modem_get_integer(modem, "AuxRegistered");
+
+ if (ppp && aux)
+ return;
+
+ entry = udev_device_get_properties_list_entry(udev_device);
+ while (entry) {
+ const char *name = udev_list_entry_get_name(entry);
+ type = udev_list_entry_get_value(entry);
+
+ if (g_str_equal(name, "OFONO_SPEEDUP_TYPE") != TRUE) {
+ entry = udev_list_entry_get_next(entry);
+ continue;
+ }
+
+ if (g_str_equal(type, "modem") == TRUE) {
+ if (ppp != 0)
+ return;
+
+ devnode = udev_device_get_devnode(udev_device);
+ ofono_modem_set_string(modem, "Modem", devnode);
+ ppp = 1;
+ ofono_modem_set_integer(modem, "ModemRegistered", ppp);
+ } else if (g_str_equal(type, "aux") == TRUE) {
+ if (aux != 0)
+ return;
+
+ devnode = udev_device_get_devnode(udev_device);
+ ofono_modem_set_string(modem, "Aux", devnode);
+
+ aux = 1;
+ ofono_modem_set_integer(modem, "AuxRegistered", aux);
+ }
+
+ break;
+ }
+
+ if (ppp && aux)
+ ofono_modem_register(modem);
+}
+
static void add_modem(struct udev_device *udev_device)
{
struct ofono_modem *modem;
@@ -739,6 +791,8 @@ done:
add_nokiacdma(modem, udev_device);
else if (g_strcmp0(driver, "linktop") == 0)
add_linktop(modem, udev_device);
+ else if (g_strcmp0(driver, "speedup") == 0)
+ add_speedup(modem, udev_device);
}
static gboolean devpath_remove(gpointer key, gpointer value, gpointer user_data)
--
1.7.4.1
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next prev parent reply other threads:[~2011-07-06 17:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 17:25 [PATCH 1/2] Add SpeedUp plugin Bertrand Aygon
2011-07-06 7:02 ` Denis Kenzior
2011-07-06 17:25 ` Bertrand Aygon [this message]
2011-07-06 7:03 ` [PATCH 2/2] Add udev rules for SpeedUp modem Denis Kenzior
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=1309973159-4446-2-git-send-email-bertrand.aygon@intel.com \
--to=bertrand.aygon@intel.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