[PATCH 2/2] udev: changed linktop device strings

2011-06-15 Thread Amit Mendapara
---
 plugins/udev.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index 0234fc0..4f4e6d8 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -577,10 +577,10 @@ static void add_linktop(struct ofono_modem *modem,
 
if (g_strcmp0(intfnum, 01) == 0) {
devnode = udev_device_get_devnode(udev_device);
-   ofono_modem_set_string(modem, Modem, devnode);
+   ofono_modem_set_string(modem, ModemDevice, 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_string(modem, DataDevice, devnode);
 
ofono_modem_set_integer(modem, Registered, 1);
ofono_modem_register(modem);
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] linktop: reimplemented linktop plugin based on mbm with minimum features

2011-06-15 Thread Amit Mendapara
The AT commands listed with AT+CLAC matches with MBM supported devices.
However, the mbm plugin doesn't work for this devices and the specification is
also quite different.

I have also adopted some fixes from huawei plugin to fix MeeGo bug #14784

The device supports voice call but I am unable to hear any sound after
making calls even though the soundcard is detected by the kernel.

The device also supports sim toolkit commands but I am unable to test
this feature.

All these untested features will be added later.
---
 plugins/linktop.c |  299 +++--
 1 files changed, 199 insertions(+), 100 deletions(-)

diff --git a/plugins/linktop.c b/plugins/linktop.c
index 953f634..4083f17 100644
--- a/plugins/linktop.c
+++ b/plugins/linktop.c
@@ -26,6 +26,7 @@
 #include stdio.h
 #include errno.h
 #include stdlib.h
+#include string.h
 
 #include glib.h
 #include gatchat.h
@@ -34,10 +35,6 @@
 #define OFONO_API_SUBJECT_TO_CHANGE
 #include ofono/plugin.h
 #include ofono/modem.h
-#include ofono/call-barring.h
-#include ofono/call-forwarding.h
-#include ofono/call-meter.h
-#include ofono/call-settings.h
 #include ofono/devinfo.h
 #include ofono/message-waiting.h
 #include ofono/netreg.h
@@ -45,24 +42,27 @@
 #include ofono/cbs.h
 #include ofono/sms.h
 #include ofono/ussd.h
-#include ofono/call-volume.h
-#include ofono/voicecall.h
 #include ofono/gprs.h
 #include ofono/gprs-context.h
 #include ofono/phonebook.h
 #include ofono/radio-settings.h
 #include ofono/log.h
 
-#include drivers/atmodem/vendor.h
 #include drivers/atmodem/atutil.h
+#include drivers/atmodem/vendor.h
 
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 static const char *none_prefix[] = { NULL };
 
 struct linktop_data {
-   GAtChat *modem;
-   GAtChat *control;
+   GAtChat *modem_port;
+   GAtChat *data_port;
+   guint cpin_poll_source;
+   guint cpin_poll_count;
+   gboolean have_sim;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
+   guint reopen_source;
 };
 
 static int linktop_probe(struct ofono_modem *modem)
@@ -86,35 +86,86 @@ static void linktop_remove(struct ofono_modem *modem)
 
DBG(%p, modem);
 
+   if (data-reopen_source  0) {
+   g_source_remove(data-reopen_source);
+   data-reopen_source = 0;
+   }
+
ofono_modem_set_data(modem, NULL);
 
-   g_at_chat_unref(data-modem);
-   g_at_chat_unref(data-control);
+   g_at_chat_unref(data-data_port);
+   g_at_chat_unref(data-modem_port);
+
+   if (data-cpin_poll_source  0)
+   g_source_remove(data-cpin_poll_source);
 
g_free(data);
 }
 
 static void linktop_debug(const char *str, void *user_data)
 {
-const char *prefix = user_data;
+   const char *prefix = user_data;
+
+   ofono_info(%s%s, prefix, str);
+}
+
+static gboolean init_simpin_check(gpointer user_data);
+
+static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct linktop_data *data = ofono_modem_get_data(modem);
+
+   DBG();
+
+   /* Modem returns an error if SIM is not ready. */
+   if (!ok  data-cpin_poll_count++  5) {
+   data-cpin_poll_source =
+   g_timeout_add_seconds(1, init_simpin_check, modem);
+   return;
+   }
+
+   data-cpin_poll_count = 0;
+
+   /* There is probably no SIM if SIM is not ready after 5 seconds. */
+   data-have_sim = ok;
+
+   ofono_modem_set_powered(modem, TRUE);
+}
+
+static gboolean init_simpin_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct linktop_data *data = ofono_modem_get_data(modem);
+
+   data-cpin_poll_source = 0;
 
-ofono_info(%s%s, prefix, str);
+   g_at_chat_send(data-modem_port, AT+CPIN?, cpin_prefix,
+   simpin_check, modem, NULL);
+
+   return FALSE;
 }
 
-static GAtChat *open_device(struct ofono_modem *modem,
-   const char *key, char *debug)
+static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+
+   DBG();
+
+   if (!ok) {
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   init_simpin_check(modem);
+}
+
+static GAtChat *create_port(const char *device)
 {
-   const char *device;
GAtSyntax *syntax;
GIOChannel *channel;
GAtChat *chat;
 
-   device = ofono_modem_get_string(modem, key);
-   if (device == NULL)
-   return NULL;
-
-   DBG(%s %s, key, device);
-
channel = g_at_tty_open(device, NULL);
if (channel == NULL)
return NULL;
@@ -127,93 +178,130 @@ static GAtChat *open_device(struct ofono_modem *modem,
if (chat == NULL)
return NULL;
 
-   if (getenv(OFONO_AT_DEBUG))
- 

[PATCH v6] udev: add initial Telit support

2011-06-15 Thread Bernhard . Guillon
From: Bernhard Guillon bernhard.guil...@hale.at

---
 plugins/ofono.rules |8 
 plugins/udev.c  |   49 +
 2 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 268b327..7124143 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -344,6 +344,11 @@ 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}==02, 
ENV{OFONO_TELIT_TYPE}=GPS
+ATTRS{idVendor}==1bc7, ATTRS{idProduct}==1004, ENV{OFONO_IFACE_NUM}==03, 
ENV{OFONO_TELIT_TYPE}=Data
+
 LABEL=ofono_tty_end
 
 # ISI/Phonet drivers
@@ -459,4 +464,7 @@ ATTRS{idVendor}==0421, ATTRS{idProduct}==00b6, 
ENV{OFONO_DRIVER}=nokiacdma
 # Teracom (Linktop/LW27x) 3G Data Card
 ATTRS{idVendor}==230d, ATTRS{idProduct}==0001, ENV{OFONO_DRIVER}=linktop
 
+# Telit
+ATTRS{idVendor}==1bc7, ENV{OFONO_DRIVER}=telit
+
 LABEL=ofono_end
diff --git a/plugins/udev.c b/plugins/udev.c
index 0234fc0..026eb70 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -587,6 +587,53 @@ 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, *type;
+   int registered;
+
+   DBG(modem %p, modem);
+
+   registered = ofono_modem_get_integer(modem, Registered);
+
+   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_TELIT_TYPE) != TRUE) {
+   entry = udev_list_entry_get_next(entry);
+   continue;
+   }
+
+   if ((registered == 0)  (g_str_equal(type, Modem) == TRUE)) {
+   devnode = udev_device_get_devnode(udev_device);
+   ofono_modem_set_string(modem, Modem, devnode);
+   } else if (g_str_equal(type, GPS) == TRUE) {
+   devnode = udev_device_get_devnode(udev_device);
+   ofono_modem_set_string(modem, GPS, devnode);
+   } else if ((registered == 0) 
+   (g_str_equal(type, Data) == TRUE)) {
+   devnode = udev_device_get_devnode(udev_device);
+   ofono_modem_set_string(modem, Data, devnode);
+   }
+
+   break;
+   }
+
+   if (registered == 1)
+   return;
+
+   if ((ofono_modem_get_string(modem, Modem) != NULL) 
+   (ofono_modem_get_string(modem, Data) != NULL)) {
+   ofono_modem_set_integer(modem, Registered, 1);
+   ofono_modem_register(modem);
+   }
+
+}
+
 static void add_modem(struct udev_device *udev_device)
 {
struct ofono_modem *modem;
@@ -681,6 +728,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)
-- 
1.7.0.4



--
Scanned by MailScanner.

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: Re: Problems ofono 0.45 and Nokia 6760

2011-06-15 Thread Claudio Degioanni
Il 08/06/2011 17.17, Jeevaka Prabu Badrappan ha scritto:
 Hi Claudio,

 On Wed, Jun 8, 2011 at 5:22 PM, Claudio Degioanni
 claudio.degioa...@zirak.it wrote:
 Hi all,

 I have attacched a nokia 6760 to ofono for using it as gprs modem.

 I have started the daemon with

 OFONO_ISI_TRACE=1 OFONO_ISI_DEBUG=1 ofonod -nd


 After enabling the modem and activate the profile using

 dbus-send --system --print-reply --reply-timeout=12
 --type=method_call --dest='org.ofono' /isiusb0
 org.ofono.Modem.SetProperty string:Powered variant:boolean:true

 dbus-send --system --print-reply --reply-timeout=12
 --type=method_call --dest='org.ofono' /isiusb0
 org.ofono.Modem.SetProperty string:Online variant:boolean:true

 dbus-send --system --print-reply --reply-timeout=12
 --type=method_call --dest='org.ofono' /isiusb0/context1
 org.ofono.ConnectionContext.SetProperty string:AccessPointName
 variant:string:ibox.tim.it

 dbus-send --system --print-reply --reply-timeout=12
 --type=method_call --dest='org.ofono' /isiusb0/context1
 org.ofono.ConnectionContext.SetProperty string:Active variant:boolean:true

 We obtain on last method calls the follow error:

 Error org.ofono.Error.NotAttached: GPRS is not attached

 You can help me ?

 PS: I have attacced the log on ofono.
 As per the log, there is some issue with the network registration
 status query. Log statement:

 src/network.c:init_registration_status() Error during registration
 status query

 isimodem people can help you on this issue.

Any news ?

regs
Claufio
 Regards,
 Jeevaka
 ___
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v4 4/4] udev: add Telit UC864-G and update udev rules

2011-06-15 Thread Bernhard Guillon



On Mon, 13 Jun 2011, Denis Kenzior wrote:


Patch has been reviewed, however we might have to examine whether we
need to tweak the udev rules for this serial number / modem path stuff
to work properly.  Marcel will have to take a look as I'm lost in that
part of the udev plugin.


Thanks,
I do not have access to the modem for two weeks from now but 
afterwards I will work on it again :)


Best regards,
Bernhard


--
Scanned by MailScanner.

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: Problems ofono 0.45 and Nokia 6760

2011-06-15 Thread Aki Niemi
Hi Claudio,

On Wed, 2011-06-08 at 16:22 +0200, ext Claudio Degioanni wrote:
 Error org.ofono.Error.NotAttached: GPRS is not attached

Has this been working before?

It looks like the network registration status query fails with a
SERVICE_NOT_IDENTIFIED service type. My suspicion is that the phone
actually blocks this query, for reasons unknown. Either that, or the API
has changed since 10.001 in a backwards incompatible way unknown to me.

Because of this, the GPRS atom doesn't think the device is registered
and no attach happens.

There's not much that can be done if the query is indeed intentionally
blocked. I didn't find any documented change in the API, so it's not
possible to try to use a different type of query based on version here.

So my advice is to simply use DUN via USB ACM interface. So I think the
nokia driver might work better than the isiusb one in this case.

Cheers,
Aki

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


PDP Context Activation

2011-06-15 Thread Yuvaraj Ragupathi
Hi All,


Now i have taken version 0.45. Modem enabled successfully.

When i am trying activate pdp context., It is failing with unknown errors.

*Please refer log messages below*

nod[8803]: src/network.c:__ofono_netreg_add_status_watch() 0xa0295c0
ofonod[8803]: src/network.c:__ofono_netreg_add_status_watch() 0xa0295c0
ofonod[8803]: src/message-waiting.c:mw_cphs_mwis_read_cb() No CPHS MWIS on
SIM
ofonod[8803]: src/network.c:current_operator_callback() 0xa0295c0, (nil)
ofonod[8803]: src/gprs.c:netreg_status_changed() 4
ofonod[8803]: src/simfs.c:sim_fs_op_read_block() bufoff: 0, seekoff: 38,
toread: 17
ofonod[8803]: src/network.c:current_operator_callback() 0xa0295c0, (nil)
ofonod[8803]: src/gprs.c:netreg_status_changed() 4
ofonod[8803]: src/gprs.c:ofono_gprs_status_notify() /ste0 status 0
ofonod[8803]: src/gprs.c:netreg_status_changed() 1
ofonod[8803]: drivers/atmodem/network-registration.c:cops_numeric_cb() Cops
numeric got mcc: 405, mnc: 034
ofonod[8803]: src/gprs.c:gprs_attach_callback() /ste0 error = 0
ofonod[8803]: src/gprs.c:ofono_gprs_status_notify() /ste0 status 1
ofonod[8803]: drivers/atmodem/network-registration.c:cops_cb() cops_cb: ,
405 034 0
ofonod[8803]: src/network.c:current_operator_callback() 0xa0295c0, (nil)
ofonod[8803]: src/gprs.c:netreg_status_changed() 1
ofonod[8803]: src/gprs.c:registration_status_cb() /ste0 error 0 status 1
ofonod[8803]: src/gprs.c:ofono_gprs_status_notify() /ste0 status 1
Control @ ste_gprs_activate_primary
 Command is AT+CGDCONT=1,IP,
Control @ ste_cgdcont_cb
Control 1 @ ste_cgdcont_cb
ofonod[8803]: src/gprs.c:pri_activate_callback() 0xa02f868 (null)
ofonod[8803]: src/gprs.c:pri_activate_callback() Activating context failed
with error: Unknown error type



I am trying with ste modem

Note: tried to active through  active_context script file at test folder

Thanks

Yuvaraj R
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v6] udev: add initial Telit support

2011-06-15 Thread Denis Kenzior
Hi Bernhard,

On 06/15/2011 02:17 AM, bernhard.guil...@hale.at wrote:
 From: Bernhard Guillon bernhard.guil...@hale.at
 
 ---
  plugins/ofono.rules |8 
  plugins/udev.c  |   49 +
  2 files changed, 57 insertions(+), 0 deletions(-)

I amended your patch with some minor style nitpicks (you don't need
parens around boolean expressions) and applied your patch.  Thanks for that.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: PDP Context Activation

2011-06-15 Thread Denis Kenzior
Hi Yuvaraj,

 Control @ ste_gprs_activate_primary
  Command is AT+CGDCONT=1,IP,
 Control @ ste_cgdcont_cb
 Control 1 @ ste_cgdcont_cb
 ofonod[8803]: src/gprs.c:pri_activate_callback() 0xa02f868 (null)
 ofonod[8803]: src/gprs.c:pri_activate_callback() Activating context
 failed with error: Unknown error type

You might try provisioning the context first since you're trying to
activate an empty APN.

See doc/connman-api.txt for more details.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v6] udev: add initial Telit support

2011-06-15 Thread Denis Kenzior
Hi Bernhard,

On 06/15/2011 02:17 AM, bernhard.guil...@hale.at wrote:
 From: Bernhard Guillon bernhard.guil...@hale.at
 
 ---
  plugins/ofono.rules |8 
  plugins/udev.c  |   49 +
  2 files changed, 57 insertions(+), 0 deletions(-)

I amended your patch with some minor style nitpicks (you don't need
parens around boolean expressions) and applied your patch.  Thanks for that.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: PDP Context Activation

2011-06-15 Thread Yuvaraj Ragupathi
Hi,

I set access point name and tried. Same result.

Here i am providing more info about this issue

Ofono logs at http://pastebin.com/xFrEjRYA

*# list of contexts*

~/Downloads/ofono-0.40/test$ ./list-contexts
[ /ste0 ]
[ /ste0/context6 ]
Username =
Protocol = ip
Name = Internet
Settings = { }
Active = 0
AccessPointName = Testing
Password =
Type = internet

~/Downloads/ofono-0.40/test$ ./activate-context
Error activating /ste0/context6: org.ofono.Error.Failed: Operation failed


Thanks

Yuvaraj R



On Tue, Jun 14, 2011 at 3:05 PM, Denis Kenzior denk...@gmail.com wrote:

 Hi Yuvaraj,

  Control @ ste_gprs_activate_primary
   Command is AT+CGDCONT=1,IP,
  Control @ ste_cgdcont_cb
  Control 1 @ ste_cgdcont_cb
  ofonod[8803]: src/gprs.c:pri_activate_callback() 0xa02f868 (null)
  ofonod[8803]: src/gprs.c:pri_activate_callback() Activating context
  failed with error: Unknown error type

 You might try provisioning the context first since you're trying to
 activate an empty APN.

 See doc/connman-api.txt for more details.

 Regards,
 -Denis

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: PDP Context Activation

2011-06-15 Thread Yuvaraj Ragupathi
Hi

Sorry , I am trying with invalid APN

Thanks

Yuvaraj R

On Thu, Jun 16, 2011 at 9:57 AM, Yuvaraj Ragupathi
yuvaraj.a...@gmail.comwrote:

 Hi,

 I set access point name and tried. Same result.

 Here i am providing more info about this issue

 Ofono logs at http://pastebin.com/xFrEjRYA

 *# list of contexts*

 ~/Downloads/ofono-0.40/test$ ./list-contexts
 [ /ste0 ]
 [ /ste0/context6 ]
 Username =
 Protocol = ip
 Name = Internet
 Settings = { }
 Active = 0
 AccessPointName = Testing
 Password =
 Type = internet

 ~/Downloads/ofono-0.40/test$ ./activate-context
 Error activating /ste0/context6: org.ofono.Error.Failed: Operation failed


 Thanks

 Yuvaraj R




 On Tue, Jun 14, 2011 at 3:05 PM, Denis Kenzior denk...@gmail.com wrote:

 Hi Yuvaraj,

  Control @ ste_gprs_activate_primary
   Command is AT+CGDCONT=1,IP,
  Control @ ste_cgdcont_cb
  Control 1 @ ste_cgdcont_cb
  ofonod[8803]: src/gprs.c:pri_activate_callback() 0xa02f868 (null)
  ofonod[8803]: src/gprs.c:pri_activate_callback() Activating context
  failed with error: Unknown error type

 You might try provisioning the context first since you're trying to
 activate an empty APN.

 See doc/connman-api.txt for more details.

 Regards,
 -Denis



___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono