Re: [PATCH 2/2] Mark 'Frequency Band Selection' task as done

2010-12-23 Thread Denis Kenzior
Hi Lucas,

On 12/23/2010 05:18 AM, Lucas De Marchi wrote:
> ---
>  TODO |   10 --
>  doc/features.txt |3 +++
>  2 files changed, 3 insertions(+), 10 deletions(-)
> 

Patch has been applied, thanks.

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


Re: [PATCH 1/2] huaweimodem: add frequency band selection support

2010-12-23 Thread Denis Kenzior
Hi Lucas,

On 12/23/2010 05:17 AM, Lucas De Marchi wrote:
> ---
>  drivers/huaweimodem/radio-settings.c |  206 
> +-
>  1 files changed, 200 insertions(+), 6 deletions(-)
> 

Patch has been applied.  I added a few minor style fixes afterward.

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


Re: [PATCH] TODO: add owner to 'Called Line Identification' task

2010-12-23 Thread Denis Kenzior
Hi Lucas,

On 12/23/2010 09:59 AM, Lucas De Marchi wrote:
> ---
>  TODO |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 

Thanks for taking up this task.  Patch has been applied.

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


Re: [PATCH] coding-style: mention preferred line wrap

2010-12-23 Thread Denis Kenzior
Hi Lucas,

On 12/23/2010 07:02 AM, Lucas De Marchi wrote:
> ---
>  doc/coding-style.txt |   43 +++
>  1 files changed, 39 insertions(+), 4 deletions(-)
> 

Thanks for doing this one.  Patch has been applied.

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


Re: [PATCH 2/2] doc: Describe DisplayActionInformation().

2010-12-23 Thread Denis Kenzior
Hi Andrew,

On 12/21/2010 03:34 AM, Andrzej Zaborowski wrote:
> ---
>  doc/stk-api.txt |   12 ++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 

Patch has been applied, thanks.

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


Re: [PATCH 1/2] stk: Send the AlphaId's to agent.

2010-12-23 Thread Denis Kenzior
Hi Andrew,

On 12/22/2010 10:39 PM, Andrzej Zaborowski wrote:
> v2: Method name changed according to irc talk.
> v3: Terminate session if return signature doesn't match but allow
> agent to return from the call if it does match.
> ---
>  src/stk.c  |9 +++--
>  src/stkagent.c |   49 +
>  src/stkagent.h |3 +++
>  3 files changed, 59 insertions(+), 2 deletions(-)
> 

Patch has been applied, thanks.

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


Re: [PATCH] gisi: fix use of unitialised variable.

2010-12-23 Thread Denis Kenzior
Hi Andrew,

On 12/22/2010 10:39 PM, Andrzej Zaborowski wrote:
> Set no msg.version if it's not available.
> ---
>  gisi/modem.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

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


Re: [PATCH] n900: remove unneeded g_isi_client_destroy call.

2010-12-23 Thread Denis Kenzior
Hi Andrew,

On 12/22/2010 10:39 PM, Andrzej Zaborowski wrote:
> "client" is either NULL or uninitialised in this place.
> ---
>  plugins/n900.c |1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

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


Re: [PATCH v3, Part2, 1/3] nokiacdma: Add plugin and CDMA MO Call Support

2010-12-23 Thread Dara Spieker-Doyle

Hi Denis

On 12/22/2010 06:31 PM, ext Denis Kenzior wrote:

Hi Dara,




+struct nokiacdma_data {
+   GAtChat *chat;
+   ofono_bool_t online;
+   ofono_bool_t registration_status;


What is the purpose of the above two variables?




+static void nokiacdma_disconnect(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct nokiacdma_data *data = ofono_modem_get_data(modem);
+
+   DBG("%p", modem);
+
+   g_at_chat_unref(data->chat);
+   data->chat = NULL;
+
+   data->chat = open_device(modem, "Device", "CDMA Device: ");
+   if (data->chat == NULL)
+   return;
+
+   g_at_chat_set_disconnect_function(data->chat,
+   nokiacdma_disconnect, modem);
+}


What are you trying to accomplish in this one?  on the huawei driver
this is used to re-open the tty because it is HUP-ed when the ppp
session ends (their way of signaling NO CARRIER).  However, I don't see
you doing PPP yet, so I'm not so sure of the purpose here?


+
+/* power up hardware */
+static int nokiacdma_enable(struct ofono_modem *modem)
+{
+   struct nokiacdma_data *data = ofono_modem_get_data(modem);
+
+   DBG("%p", modem);
+
+   ofono_modem_set_boolean(modem, "no_sim_required", TRUE);
+
+   data->chat = open_device(modem, "Device", "CDMA Device: ");
+   if (data->chat == NULL)
+   return -EINVAL;
+
+   g_at_chat_set_disconnect_function(data->chat,
+   nokiacdma_disconnect, modem);
+
+   if (getenv("OFONO_AT_DEBUG"))
+   g_at_chat_set_debug(data->chat, nokiacdma_debug,
+   "CDMA Generic: ");
+
+   return 0;
+}
+
+static int nokiacdma_disable(struct ofono_modem *modem)
+{
+   struct nokiacdma_data *data = ofono_modem_get_data(modem);
+
+   DBG("%p", modem);
+
+   if (data->chat) {
+   g_at_chat_cancel_all(data->chat);
+   g_at_chat_unregister_all(data->chat);
+   g_at_chat_unref(data->chat);
+   data->chat = NULL;
+   }
+
+   return 0;


So enable and disable just open up the ports?


+}
+
+static void nokiacdma_pre_sim(struct ofono_modem *modem)
+{
+   struct nokiacdma_data *data = ofono_modem_get_data(modem);
+
+   ofono_cdma_voicecall_create(modem, 0, "cdmamodem",
+   data->chat);
+}
+
+static void nokiacdma_post_sim(struct ofono_modem *modem)
+{
+}
+
+static gboolean nokiacdma_set_online_cb(gpointer cb_data)
+{
+   struct cb_data *cbd = cb_data;
+   ofono_modem_online_cb_t cb = cbd->cb;
+
+   CALLBACK_WITH_SUCCESS(cb, cbd->data);
+
+   g_free(cbd);
+
+   /* do not call again */
+   return FALSE;
+}
+
+static void nokiacdma_set_online(struct ofono_modem *modem, ofono_bool_t 
online,
+   ofono_modem_online_cb_t cb, void *user_data)
+{
+   struct nokiacdma_data *data = ofono_modem_get_data(modem);
+   struct cb_data *cbd = cb_data_new(cb, user_data);
+
+   DBG("modem %p %s", modem, online ? "online" : "offline");
+
+   if (cbd == NULL)
+   goto error;
+
+   data->online = online;
+
+   /* TODO: Fix this when network registration implemented */
+   if (online)
+   data->registration_status =
+   NETWORK_REGISTRATION_STATUS_REGISTERED;
+
+   nokiacdma_set_online_cb(cbd);
+   return;
+
+error:
+   g_free(cbd);
+
+   CALLBACK_WITH_FAILURE(cb, cbd->data);
+}


I'm lost here.  What are you trying to accomplish?



Regards,
-Denis


Apologies for the confusion, all these are relics of integration with 
other experimental work and are not relevant to the MO Call feature 
submission. I'll clean this up and send new versions.


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


Re: [PATCH v3, Part1, 5/5] test: Add CDMA MO Call Support

2010-12-23 Thread Dara Spieker-Doyle

Hi Denis

On 12/22/2010 05:31 PM, ext Denis Kenzior wrote:

Hi Dara,

On 12/20/2010 07:36 PM, Dara Spieker-Doyle wrote:

---
  Makefile.am   |5 -
  test/cdma-dial-number |   24 
  test/cdma-hangup  |   20 
  test/cdma-list-call   |   30 ++
  4 files changed, 78 insertions(+), 1 deletions(-)
  create mode 100755 test/cdma-dial-number
  create mode 100755 test/cdma-hangup
  create mode 100755 test/cdma-list-call



Patch looks fine but does not apply cleanly without patch 4.  Can you
also fix these:


diff --git a/Makefile.am b/Makefile.am
index 50e893f..32ded3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -431,7 +431,10 @@ test_scripts = test/backtrace \
test/test-push-notification \
test/test-smart-messaging \
test/send-vcard \
-   test/set-tty
+   test/set-tty \
+   test/cdma-list-call \
+   test/cdma-dial-number \
+   test/cdma-hangup

  if TEST
  testdir = $(pkglibdir)/test
diff --git a/test/cdma-dial-number b/test/cdma-dial-number
new file mode 100755
index 000..948d32d
--- /dev/null
+++ b/test/cdma-dial-number
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+if len(sys.argv)>  2:
+   path = sys.argv[1]
+   number = sys.argv[2]
+else:
+   modems = manager.GetModems()
+   path, properties = modems[0]
+   number = sys.argv[1]
+
+print "Using modem %s" % path
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+   
'org.ofono.cdma.VoiceCallManager')
+
+manager.Dial(number)
\ No newline at end of file


^


diff --git a/test/cdma-hangup b/test/cdma-hangup
new file mode 100755
index 000..f8e631e
--- /dev/null
+++ b/test/cdma-hangup
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+if len(sys.argv)>  2:
+   path = sys.argv[1]
+else:
+   modems = manager.GetModems()
+   path, properties = modems[0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+   
'org.ofono.cdma.VoiceCallManager')
+
+manager.Hangup()
diff --git a/test/cdma-list-call b/test/cdma-list-call
new file mode 100755
index 000..9f9fdbc
--- /dev/null
+++ b/test/cdma-list-call
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+   print "[ %s ]" % (path)
+
+   if "org.ofono.cdma.VoiceCallManager" not in properties["Interfaces"]:
+   continue
+
+   mgr = dbus.Interface(bus.get_object('org.ofono', path),
+   'org.ofono.cdma.VoiceCallManager')
+
+   properties = mgr.GetProperties()
+
+   for key in properties.keys():
+   if key in ["Interfaces", "Features"]:
+   val = ""
+   for i in properties[key]:
+   val += i + " "
+   else:
+   val = str(properties[key])
+   print "%s = %s" % (key, val)
\ No newline at end of file


and ^^

Regards,
-Denis


Yes I'll clean these up with the new version

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


Re: [PATCH v3, Part1, 4/5] cdmamodem: Add CDMA voicecall driver support for MO Call

2010-12-23 Thread Dara Spieker-Doyle

Hi Denis

Thank you for reviewing these.

On 12/22/2010 05:26 PM, ext Denis Kenzior wrote:

Hi Dara,




+
+struct voicecall_driver {
+   struct ofono_cdma_voicecall *vc;
+   unsigned int local_release;


What is the use of these two variables?


+   GAtChat *chat;
+   unsigned int vendor;
+};
+
+struct change_state_req {
+   struct ofono_cdma_voicecall *vc;
+   ofono_cdma_voicecall_cb_t cb;
+   void *data;
+};


is cb_data not good enough for some reason? :)


+
+static void at_dial_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct cb_data *cbd = user_data;
+   ofono_cdma_voicecall_cb_t cb = cbd->cb;
+   struct ofono_error error;
+
+   decode_at_error(&error, g_at_result_final_response(result));
+
+   if (!ok)
+   goto out;


This if statement serves no purpose


+
+out:


And neither does the label


+   cb(&error, cbd->data);
+}
+
+static void at_dial(struct ofono_cdma_voicecall *vc,
+   const struct ofono_cdma_phone_number *ph,
+   ofono_cdma_voicecall_cb_t cb, void *data)
+{
+   struct voicecall_driver *vd = ofono_cdma_voicecall_get_data(vc);
+   struct cb_data *cbd = cb_data_new(cb, data);
+   char buf[256];
+
+   if (cbd == NULL)
+   goto error;
+
+   cbd->user = vc;


Why are you assigning cbd->user and never making use of it?


For all of your above comments, yes they shouldn't be there - I will 
clean these up.



+
+   snprintf(buf, sizeof(buf), "AT+CDV=%s", ph->number);
+
+   if (g_at_chat_send(vd->chat, buf, none_prefix,
+   at_dial_cb, cbd, g_free)>  0)
+   return;
+
+error:
+   g_free(cbd);
+
+   CALLBACK_WITH_FAILURE(cb, data);
+}
+
+static void at_template(const char *cmd,
+   struct ofono_cdma_voicecall *vc,
+   GAtResultFunc result_cb,
+   ofono_cdma_voicecall_cb_t cb, void *data)
+{
+   struct voicecall_driver *vd = ofono_cdma_voicecall_get_data(vc);
+   struct change_state_req *req = g_try_new0(struct change_state_req, 1);
+
+   if (req == NULL)
+   goto error;
+
+   req->vc = vc;
+   req->cb = cb;
+   req->data = data;
+
+   if (g_at_chat_send(vd->chat, cmd, none_prefix,
+   result_cb, req, g_free)>  0)
+   return;
+
+error:
+   g_free(req);
+
+   CALLBACK_WITH_FAILURE(cb, data);
+}
+
+static void at_hangup_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct change_state_req *req = user_data;
+
+   if (!ok) {
+   ofono_error("hangup failed.");
+   return;


Please don't do this.  If the hangup fails you never return from the
operation and will cause the cdma-voicecall atom to stall forever.
decoding the error and calling the callback is good enough.


Thanks for spotting this, I will fix it.



+   }
+
+   ofono_cdma_voicecall_disconnected(req->vc,
+   OFONO_DISCONNECT_REASON_LOCAL_HANGUP, NULL);


Fair enough, but this should really come via a modem unsolicited
notification.


Agreed, I can either mark it with a TODO to make this clear or remove 
the disconnect reason support altogether.



+   CALLBACK_WITH_SUCCESS(req->cb, req->data);


This is not necessary if you call the callback up above.  And why the
different indentation?


+}
+
+static void at_hangup(struct ofono_cdma_voicecall *vc,
+   ofono_cdma_voicecall_cb_t cb, void *data)
+{
+   /* Hangup active call */
+   at_template("AT+CHV", vc, at_hangup_cb, cb, data);
+}
+
+static int at_voicecall_probe(struct ofono_cdma_voicecall *vc,
+   unsigned int vendor, void *data)
+{
+   GAtChat *chat = data;
+   struct voicecall_driver *vd;
+
+   vd = g_try_new0(struct voicecall_driver, 1);
+   if (vd == NULL)
+   return -ENOMEM;
+
+   vd->chat = g_at_chat_clone(chat);
+   vd->vendor = vendor;
+
+   ofono_cdma_voicecall_set_data(vc, vd);
+
+   ofono_cdma_voicecall_register(vc);
+
+   return 0;
+}
+
+static void at_voicecall_remove(struct ofono_cdma_voicecall *vc)
+{
+   struct voicecall_driver *vd = ofono_cdma_voicecall_get_data(vc);
+
+   ofono_cdma_voicecall_set_data(vc, NULL);
+
+   g_at_chat_unref(vd->chat);
+   g_free(vd);
+}
+
+static struct ofono_cdma_voicecall_driver driver = {
+   .name   = "cdmamodem",
+   .probe  = at_voicecall_probe,
+   .remove = at_voicecall_remove,
+   .dial   = at_dial,
+   .hangup = at_hangup,
+};
+
+void cdma_at_voicecall_init()
+{
+   ofono_cdma_voicecall_driver_register(&driver);
+}
+
+void cdma_at_voicecall_exit()
+{
+   ofono_cdma_voicecall_driver_unregister(&driver);
+}


Regards,
-Denis


Thanks
Dara
_

[PATCH v3] ifx: Adding modem selftest for Infineon modem

2010-12-23 Thread Robertino Benis
Hi all,

This is another attempt to submit a patch that triggers Infineon
modem selftest during ofono boot. Patch addresses issues raised
by Marcel from the previous submissions.

Thank you,
-- r.

---
 plugins/ifx.c |   76 +---
 1 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/plugins/ifx.c b/plugins/ifx.c
index c0a69c2..e0eb982 100644
--- a/plugins/ifx.c
+++ b/plugins/ifx.c
@@ -71,6 +71,8 @@
 #define GPRS3_DLC   4
 #define AUX_DLC 5
 
+#define IFX_SELF_TESTS_TIMEOUT 10
+
 static char *dlc_prefixes[NUM_DLC] = { "Voice: ", "Net: ", "GPRS1: ",
"GPRS2: ", "GPRS3: ", "Aux: " };
 
@@ -81,6 +83,16 @@ static const char *dlc_nodes[NUM_DLC] = { "/dev/ttyGSM1", 
"/dev/ttyGSM2",
 static const char *none_prefix[] = { NULL };
 static const char *xdrv_prefix[] = { "+XDRV:", NULL };
 
+static struct {
+   char *test_desc;
+   char *at_cmd;
+} const mst[] = {
+   { "AT Command Test", "ATE0 +CMEE=1" }, /* set echo & error reporting */
+   { "RTC GTI Test", "a...@rtc:rtc_gti_test_verify_32khz()" },
+   { "Device Version Test", "a...@vers:device_version_id()" },
+   { NULL, NULL }
+};
+
 struct ifx_data {
GIOChannel *device;
GAtMux *mux;
@@ -99,6 +111,7 @@ struct ifx_data {
int audio_loopback;
struct ofono_sim *sim;
gboolean have_sim;
+   int self_test_idx;
 };
 
 static void ifx_debug(const char *str, void *user_data)
@@ -545,6 +558,52 @@ static gboolean mux_timeout_cb(gpointer user_data)
return FALSE;
 }
 
+static void ifx_self_test_cb(gboolean ok, GAtResult *result,
+   gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct ifx_data *data = ofono_modem_get_data(modem);
+
+   if (data->mux_init_timeout > 0) {
+   g_source_remove(data->mux_init_timeout);
+   data->mux_init_timeout = 0;
+   }
+
+   if (!ok) {
+   ofono_error("Modem %s: FAIL",
+   mst[data->self_test_idx].test_desc);
+   g_at_chat_unref(data->dlcs[AUX_DLC]);
+   data->dlcs[AUX_DLC] = NULL;
+
+   g_io_channel_unref(data->device);
+   data->device = NULL;
+
+   ofono_modem_set_powered(modem, FALSE);
+
+   return;
+   }
+
+   data->self_test_idx++;
+
+   if (mst[data->self_test_idx].at_cmd != NULL) {
+   g_at_chat_send(data->dlcs[AUX_DLC],
+   mst[data->self_test_idx].at_cmd,
+   NULL, ifx_self_test_cb, modem, NULL);
+
+   data->mux_init_timeout = g_timeout_add_seconds(
+   IFX_SELF_TESTS_TIMEOUT, mux_timeout_cb, modem);
+
+   } else {/* Enable  MUX Channels */
+   data->frame_size = 1509;
+   g_at_chat_send(data->dlcs[AUX_DLC],
+   "AT+CMUX=0,0,,1509,10,3,30,,", NULL,
+   mux_setup_cb, modem, NULL);
+
+   data->mux_init_timeout = g_timeout_add_seconds(5,
+   mux_timeout_cb, modem);
+   }
+}
+
 static int ifx_enable(struct ofono_modem *modem)
 {
struct ifx_data *data = ofono_modem_get_data(modem);
@@ -595,18 +654,15 @@ static int ifx_enable(struct ofono_modem *modem)
if (getenv("OFONO_AT_DEBUG"))
g_at_chat_set_debug(chat, ifx_debug, "Master: ");
 
-   g_at_chat_send(chat, "ATE0 +CMEE=1", NULL,
-   NULL, NULL, NULL);
-
-   data->frame_size = 1509;
-
-   g_at_chat_send(chat, "AT+CMUX=0,0,,1509,10,3,30,,", NULL,
-   mux_setup_cb, modem, NULL);
+   /* Execute Modem Self tests */
+   data->dlcs[AUX_DLC] = chat;
+   data->self_test_idx = 0;
 
-   data->mux_init_timeout = g_timeout_add_seconds(5, mux_timeout_cb,
-   modem);
+   g_at_chat_send(data->dlcs[AUX_DLC], mst[data->self_test_idx].at_cmd,
+   NULL, ifx_self_test_cb, modem, NULL);
 
-   data->dlcs[AUX_DLC] = chat;
+   data->mux_init_timeout = g_timeout_add_seconds(
+   IFX_SELF_TESTS_TIMEOUT, mux_timeout_cb, modem);
 
return -EINPROGRESS;
 }
-- 
1.7.0.4

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


Re: [PATCH v3, Part1, 2/5] cdma-voicecall: Add CDMA MO Call Support

2010-12-23 Thread Dara Spieker-Doyle

Hi Denis

On 12/22/2010 05:36 PM, ext Denis Kenzior wrote:

Hi Dara,

On 12/20/2010 07:36 PM, Dara Spieker-Doyle wrote:

---
  Makefile.am  |3 +-
  src/cdma-voicecall.c |  430 ++
  src/common.c |   41 +
  src/common.h |6 +
  src/ofono.h  |3 +
  5 files changed, 482 insertions(+), 1 deletions(-)
  create mode 100644 src/cdma-voicecall.c



Patch has been applied, thanks.  I did perform some minor style tweaks
afterwards.

Regards,
-Denis


Thank you for going ahead and applying these patches, I'll review the 
diffs and make sure to doublecheck these style issues in future :)


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


[PATCH] TODO: add owner to 'Called Line Identification' task

2010-12-23 Thread Lucas De Marchi
---
 TODO |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index 463f74c..b752f2a 100644
--- a/TODO
+++ b/TODO
@@ -226,6 +226,7 @@ Supplementary Services
 
   Priority: Low
   Complexity: C4
+  Owner: Lucas De Marchi 
 
 - CPHS Support.  This includes ALS and CPHS specific elementary files.
 
-- 
1.7.3.4

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


[PATCH 1/2] stk: Send the AlphaId's to agent.

2010-12-23 Thread Andrzej Zaborowski
v2: Method name changed according to irc talk.
v3: Terminate session if return signature doesn't match but allow
agent to return from the call if it does match.
---
 src/stk.c  |9 +++--
 src/stkagent.c |   49 +
 src/stkagent.h |3 +++
 3 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index 87208d1..9dcbda6 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -472,12 +472,17 @@ static void stk_alpha_id_set(struct ofono_stk *stk,
const char *text, const struct stk_text_attribute *attr,
const struct stk_icon_id *icon)
 {
-   /* TODO */
+   char *alpha = dbus_apply_text_attributes(text, attr);
+
+   if (alpha || icon)
+   stk_agent_display_action_info(stk->current_agent, alpha, icon);
+
+   g_free(alpha);
 }
 
 static void stk_alpha_id_unset(struct ofono_stk *stk)
 {
-   /* TODO */
+   stk_agent_request_cancel(stk->current_agent);
 }
 
 static int duration_to_msecs(const struct stk_duration *duration)
diff --git a/src/stkagent.c b/src/stkagent.c
index e1a6f48..2cdc6e1 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -964,3 +964,52 @@ int stk_agent_loop_tone(struct stk_agent *agent, const 
char *text,
 
return 0;
 }
+
+static void action_info_cb(DBusPendingCall *call, void *data)
+{
+   struct stk_agent *agent = data;
+   DBusMessage *reply = dbus_pending_call_steal_reply(call);
+   enum stk_agent_result result;
+   gboolean remove_agent;
+
+   if (check_error(agent, reply, 0, &result) == -EINVAL) {
+   remove_agent = TRUE;
+   goto error;
+   }
+
+   if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
+   ofono_error("Can't parse the reply to DisplayActionInfo()");
+   remove_agent = TRUE;
+   goto error;
+   }
+
+   goto done;
+
+   CALLBACK_END();
+}
+
+int stk_agent_display_action_info(struct stk_agent *agent, const char *text,
+   const struct stk_icon_id *icon)
+{
+   DBusConnection *conn = ofono_dbus_get_connection();
+
+   agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+   OFONO_SIM_APP_INTERFACE,
+   "DisplayActionInformation");
+   if (agent->msg == NULL)
+   return -ENOMEM;
+
+   dbus_message_append_args(agent->msg,
+   DBUS_TYPE_STRING, &text,
+   DBUS_TYPE_BYTE, &icon->id,
+   DBUS_TYPE_INVALID);
+
+   if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
+   0) == FALSE ||
+   agent->call == NULL)
+   return -EIO;
+
+   dbus_pending_call_set_notify(agent->call, action_info_cb, agent, NULL);
+
+   return 0;
+}
diff --git a/src/stkagent.h b/src/stkagent.h
index 517bcfe..6477dbf 100644
--- a/src/stkagent.h
+++ b/src/stkagent.h
@@ -137,3 +137,6 @@ int stk_agent_loop_tone(struct stk_agent *agent, const char 
*text,
 
 void append_menu_items_variant(DBusMessageIter *iter,
const struct stk_menu_item *items);
+
+int stk_agent_display_action_info(struct stk_agent *agent, const char *text,
+   const struct stk_icon_id *icon);
-- 
1.7.1.86.g0e460.dirty

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


[PATCH] n900: remove unneeded g_isi_client_destroy call.

2010-12-23 Thread Andrzej Zaborowski
"client" is either NULL or uninitialised in this place.
---
 plugins/n900.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/plugins/n900.c b/plugins/n900.c
index 711f4ed..29daf05 100644
--- a/plugins/n900.c
+++ b/plugins/n900.c
@@ -382,7 +382,6 @@ static int n900_probe(struct ofono_modem *modem)
return 0;
 
 error:
-   g_isi_client_destroy(client);
g_isi_modem_destroy(isimodem);
gpio_remove(modem);
g_free(isi);
-- 
1.7.1.86.g0e460.dirty

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


[PATCH] gisi: fix use of unitialised variable.

2010-12-23 Thread Andrzej Zaborowski
Set no msg.version if it's not available.
---
 gisi/modem.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gisi/modem.c b/gisi/modem.c
index ff06cf2..9fb4d34 100644
--- a/gisi/modem.c
+++ b/gisi/modem.c
@@ -293,7 +293,6 @@ static gboolean isi_callback(GIOChannel *channel, 
GIOCondition cond,
msg.error = 0;
msg.data = buf;
msg.len = len;
-   msg.version = &mux->version;
 
if (modem->trace != NULL)
modem->trace(&msg, NULL);
@@ -311,6 +310,8 @@ static gboolean isi_callback(GIOChannel *channel, 
GIOCondition cond,
return TRUE;
}
 
+   msg.version = &mux->version;
+
if (g_isi_msg_id(&msg) == COMMON_MESSAGE)
common_message_decode(mux, &msg);
 
-- 
1.7.1.86.g0e460.dirty

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


RE: [RFC PATCH 2/5 v2] cell-info: Header file for cell-info atom

2010-12-23 Thread Marcel Holtmann
Hi Antti,

> > > ---
> > >  include/cell-info.h |  133 
> > > +++
> > >  1 files changed, 133 insertions(+), 0 deletions(-)  create mode 
> > > 100644 include/cell-info.h
> > > 
> > > diff --git a/include/cell-info.h b/include/cell-info.h new file mode 
> > > 100644 index 000..3941e69
> > > --- /dev/null
> > > +++ b/include/cell-info.h
> > > @@ -0,0 +1,133 @@
> > > +/*
> > >  ...
> > >  ...
> > >  ...
> > > +struct ofono_cell_info_driver {
> > > + const char *name;
> > > + int (*probe)(struct ofono_cell_info *ci,
> > > + unsigned int vendor,
> > > + void *data);
> > > + void (*remove)(struct ofono_cell_info *ci);
> > > + void (*query)(struct ofono_cell_info *ci,
> > > + ofono_cell_info_query_cb_t,
> > > + void *data);
> > > +};
> > > +
> > 
> > To be aligning with the other header files, do we need to add one 'cb' 
> > after 'ofono_cell_info_query_cb_t' here?
> 
> This seems to be a matter with no clear convention. In "sms.h" and
> "netreg.h" some callbacks have 'cb' and some not. I agree that if within
> a function's parameter list some parameters have name declared, so
> should all have.

we are trying to be consistent, but some of these slipped through in the
initial development phase of oFono.

Once we find them, we document them in doc/coding-style.txt and then
slowly start fixing these up. This is an ongoing process and pretty hard
if your codebase reaches over 100k lines of code.

Regards

Marcel


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


Re: oFono release plan?

2010-12-23 Thread Marcel Holtmann
Hi Aki,

> > - SIM authentication API (EAP-SIM, EAP-AKA, IMS and GBA)
> > Can you please add more light on what is supported. I could not find
> > this info in the todo list. 
> 
> In short, we need to expose certain security services offered by the SIM
> card that utilize the crypto algorithms on the card. This is used for
> instance in voice over LTE authentication procedures. Probably needs to
> be added to the TODO.

right now Andrew is looking into the SIM application discovery with AT
command modems. Once we have that, we can look into what is needed for
using the EAP methods and add details TODO items.

Just adding a simple TODO item entry that we split out later into more
detailed once would be fine with me.

In theory we want an interface that suits all SIM authentication needs.
Besides IMS, the second big user will be WISPr 2.0 for WiFi hotspots.

Regards

Marcel


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


[PATCH] coding-style: mention preferred line wrap

2010-12-23 Thread Lucas De Marchi
---
 doc/coding-style.txt |   43 +++
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index 9d7131d..c267b6b 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -75,10 +75,11 @@ Example:
 a + b;  // correct
 
 
-M4: Long condition
-==
-If your condition in if, while, for statement is too long to fit in one line,
-the new line needs to be indented not aligned with the body.
+M4: Wrap long lines
+===
+If your condition in if, while, for statement or a function declaration is too
+long to fit in one line, the new line needs to be indented not aligned with the
+body.
 
 Example:
 1)
@@ -91,6 +92,40 @@ if (call->status == CALL_STATUS_ACTIVE ||
call->status == CALL_STATUS_HELD) {  // correct
ofono_dbus_dict_append();
 
+3)
+gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
+   num sim_ust_service index) // wrong
+{
+   int a;
+   ...
+}
+
+4)
+gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
+   enum sim_ust_service index) // correct
+{
+   int a;
+   ...
+}
+
+If the line being wrapped is a function call or function declaration, the
+preferred style is to indent at least past the opening parenthesis. Indenting
+further is acceptable as well (as long as you don't hit the 80 character
+limit).
+
+If this is not possible due to hitting the 80 character limit, then indenting
+as far as possible to the right without hitting the limit is preferred.
+
+Example:
+
+1)
+gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
+   enum sim_ust_service index); // worse
+
+2)
+gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
+   enum sim_ust_service index); // 
better
+
 
 M5: Git commit message 50/72 formatting
 ===
-- 
1.7.3.4

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


Re: PATCH: Enable udev-based autodetection of calypso modem on Freerunner

2010-12-23 Thread Neil Jerram
Marcel Holtmann  writes:

> Hi Neil,
>
>> (I don't yet understand why it makes sense for calypso to be handled
>> differently from other cases in plugins/ofono.rules, but I'm happy to
>> trust that there is a good reason for this.)
>
> the other cases come from an unique vendor and product ID. The Calypso
> and also IFX modems are based on device nodes. These are not unique.
> They are platform specific. Not all platform will have a Calypso modem
> behind /dev/ttySAC0 for example.

Ah yes, that makes sense.  Thanks for explaining.

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


[PATCH 1/2] huaweimodem: add frequency band selection support

2010-12-23 Thread Lucas De Marchi
---
 drivers/huaweimodem/radio-settings.c |  206 +-
 1 files changed, 200 insertions(+), 6 deletions(-)

diff --git a/drivers/huaweimodem/radio-settings.c 
b/drivers/huaweimodem/radio-settings.c
index 30961da..10d46e9 100644
--- a/drivers/huaweimodem/radio-settings.c
+++ b/drivers/huaweimodem/radio-settings.c
@@ -43,11 +43,93 @@
 static const char *none_prefix[] = { NULL };
 static const char *syscfg_prefix[] = { "^SYSCFG:", NULL };
 
+#define HUAWEI_BAND_ANY 0x3FFF
+
 struct radio_settings_data {
GAtChat *chat;
 };
 
-static void syscfg_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
+static const struct huawei_band_gsm_table {
+   enum ofono_radio_band_gsm band_gsm;
+   unsigned int band_huawei;
+} huawei_band_gsm_table[] = {
+   { OFONO_RADIO_BAND_GSM_ANY, 0x8 | 0x200 | 0x100 | 0x80 | 0x20 },
+   { OFONO_RADIO_BAND_GSM_850, 0x8 },
+   { OFONO_RADIO_BAND_GSM_900P, 0x200 },
+   { OFONO_RADIO_BAND_GSM_900E, 0x100 },
+   { OFONO_RADIO_BAND_GSM_1800, 0x80 },
+   { OFONO_RADIO_BAND_GSM_1900, 0x20 },
+};
+
+static const struct huawei_band_umts_table {
+   enum ofono_radio_band_umts band_umts;
+   unsigned int band_huawei;
+} huawei_band_umts_table[] = {
+   { OFONO_RADIO_BAND_UMTS_ANY, 0x400 | 0x2 | 80 | 40 },
+   { OFONO_RADIO_BAND_UMTS_850, 0x400 },
+   { OFONO_RADIO_BAND_UMTS_900, 0x2 },
+   { OFONO_RADIO_BAND_UMTS_1900, 0x80 },
+   { OFONO_RADIO_BAND_UMTS_2100, 0x40 },
+};
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+static unsigned int band_gsm_to_huawei(enum ofono_radio_band_gsm band)
+{
+   size_t i;
+
+   for (i = 0; i < ARRAY_SIZE(huawei_band_gsm_table); i++) {
+   if (huawei_band_gsm_table[i].band_gsm == band)
+   return huawei_band_gsm_table[i].band_huawei;
+   }
+
+   return 0;
+}
+
+static unsigned int band_umts_to_huawei(enum ofono_radio_band_umts band)
+{
+   size_t i;
+
+   for (i = 0; i < ARRAY_SIZE(huawei_band_umts_table); i++) {
+   if (huawei_band_umts_table[i].band_umts == band)
+   return huawei_band_umts_table[i].band_huawei;
+   }
+
+   return 0;
+}
+
+static enum ofono_radio_band_gsm band_gsm_from_huawei(unsigned int band)
+{
+   size_t i;
+
+   if (band == HUAWEI_BAND_ANY)
+   return OFONO_RADIO_BAND_UMTS_ANY;
+
+   for (i = ARRAY_SIZE(huawei_band_gsm_table) - 1; i > 0; i--) {
+   if (huawei_band_gsm_table[i].band_huawei & band)
+   return huawei_band_gsm_table[i].band_gsm;
+   }
+
+   return OFONO_RADIO_BAND_GSM_ANY;
+}
+
+static enum ofono_radio_band_umts band_umts_from_huawei(unsigned int band)
+{
+   size_t i;
+
+   if (band == HUAWEI_BAND_ANY)
+   return OFONO_RADIO_BAND_UMTS_ANY;
+
+   for (i = ARRAY_SIZE(huawei_band_umts_table) - 1; i > 0; i--) {
+   if (huawei_band_umts_table[i].band_huawei & band)
+   return huawei_band_umts_table[i].band_umts;
+   }
+
+   return OFONO_RADIO_BAND_UMTS_ANY;
+}
+
+static void syscfg_query_mode_cb(gboolean ok, GAtResult *result,
+   gpointer user_data)
 {
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
@@ -101,13 +183,14 @@ static void huawei_query_rat_mode(struct 
ofono_radio_settings *rs,
struct cb_data *cbd = cb_data_new(cb, data);
 
if (g_at_chat_send(rsd->chat, "AT^SYSCFG?", syscfg_prefix,
-   syscfg_query_cb, cbd, g_free) == 0) {
+   syscfg_query_mode_cb, cbd, g_free) == 0) {
CALLBACK_WITH_FAILURE(cb, -1, data);
g_free(cbd);
}
 }
 
-static void syscfg_modify_cb(gboolean ok, GAtResult *result, gpointer 
user_data)
+static void syscfg_modify_mode_cb(gboolean ok, GAtResult *result,
+   gpointer user_data)
 {
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_set_cb_t cb = cbd->cb;
@@ -144,11 +227,11 @@ static void huawei_set_rat_mode(struct 
ofono_radio_settings *rs,
goto error;
}
 
-   snprintf(buf, sizeof(buf), "AT^SYSCFG=%u,%u,3FFF,2,4",
-   value, acq_order);
+   snprintf(buf, sizeof(buf), "AT^SYSCFG=%u,%u,4000,2,4",
+   value, acq_order);
 
if (g_at_chat_send(rsd->chat, buf, none_prefix,
-   syscfg_modify_cb, cbd, g_free) > 0)
+   syscfg_modify_mode_cb, cbd, g_free) > 0)
return;
 
 error:
@@ -156,6 +239,115 @@ error:
g_free(cbd);
 }
 
+static void syscfg_modify_band_cb(gboolean ok, GAtResult *result,
+ 

[PATCH 2/2] Mark 'Frequency Band Selection' task as done

2010-12-23 Thread Lucas De Marchi
---
 TODO |   10 --
 doc/features.txt |3 +++
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/TODO b/TODO
index 463f74c..db20513 100644
--- a/TODO
+++ b/TODO
@@ -384,16 +384,6 @@ Miscellaneous
   Complexity: C4
   Priority: Low
 
-- Frequency Band Selection.  Add frequency band selection capability to the
-  RadioSettings atom.
-  Owner: Lucas De Marchi 
-
-  This feature is not discussed in 27.007, thus manufacturer specific commands
-  are required.
-
-  Complexity: C2
-  Priority: Low
-
 - PolicyKit support.  Add support for PolicyKit checking of all oFono D-Bus
   interfaces.
 
diff --git a/doc/features.txt b/doc/features.txt
index 3f741b7..a1a3c25 100644
--- a/doc/features.txt
+++ b/doc/features.txt
@@ -246,6 +246,9 @@ Radio settings
   using the device but some networking applications are online using
   packet data.
 
+- Frequency Band Selection support. This feature allows the user to limit the
+  frequency bands in which the cellular modem can operate.
+
 Text Telephony
 ==
 
-- 
1.7.3.4

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


Re: oFono release plan?

2010-12-23 Thread Aki Niemi
Hi Sankar,

On Thu, 2010-12-23 at 15:16 +0530, ext Sankar wrote:

> Can you please add more light on what all is planned under the CDMA
> support.

See under doc the cdma-* files. However, these are proposals still, and
code is just being submitted for implementing these. That is not yet 1.0
material, IMHO.
 
> - the SMS (history) agent API
> - SIM authentication API (EAP-SIM, EAP-AKA, IMS and GBA)
> Can you please add more light on what is supported. I could not find
> this info in the todo list. 

In short, we need to expose certain security services offered by the SIM
card that utilize the crypto algorithms on the card. This is used for
instance in voice over LTE authentication procedures. Probably needs to
be added to the TODO.

Cheers,
Aki


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


Re: oFono release plan?

2010-12-23 Thread Sankar
Hi Aki,

On Tue, Dec 21, 2010 at 9:58 PM, Aki Niemi  wrote:

> Hi Marcel,
>
> 2010/12/21 Marcel Holtmann :
> > we don't know that yet for sure. They might be all internal, but there
> > might be also D-Bus visible changes. We will see once LTE support lands
> > in oFono.
>
> Well, from my point of view there are some key APIs we know for sure
> are missing. Off the top of my head:
>
> - LCS, neighbor cell info
> - CDMA support
>

Can you please add more light on what all is planned under the CDMA support.



> - the SMS (history) agent API
> - SIM authentication API (EAP-SIM, EAP-AKA, IMS and GBA)
>
Can you please add more light on what is supported. I could not find this
info in the todo list.

>
> Then again, I don't really see the point in a 1.0 beyond marketing.
> It's not like the current D-Bus API is allowed to change a lot as it
> stands currently.
>
> Cheers,
> Aki
>

Regards,
Sankar.

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