Re: Trouble using Huwei E160G

2011-04-06 Thread Claudio Degioanni
HI Caiwen,

Il 06/04/2011 10.36, Zhang, Caiwen ha scritto:
> Hi Claudio,
>
>> I have made the test proposed, I still recive the same error :)
> ofonod[2329]: drivers/atmodem/gprs-context.c:at_gprs_context_probe() 
> ofonod[2329]: Missing support for TUN/TAP devices
>
> It seems you device doesn't support TUN/TAP. at_gprs_context_probe return 
> -ENODEV,
> So it cause the gprs context driver is not set (ofono_gprs_context->driver is 
> NULL).
>> Any suggestion ?
> Remove TUN checking code, in 
> drivers/atmodem/gprs-context.c:at_gprs_context_probe()
>
> Hope it help.

Thank you very much for feedback, I have checked the target kernel and
support for TUN (CONFIG_TUN) it disabled.

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

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


[PATCH v4 4/4] TODO: Mark Network/Modem EN update task as done

2011-04-06 Thread Jeevaka Badrappan
---
 TODO |   11 ---
 doc/features.txt |   18 ++
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/TODO b/TODO
index 85c5ad1..3491436 100644
--- a/TODO
+++ b/TODO
@@ -289,17 +289,6 @@ Sim Toolkit
   Complexity: C2
   Owner: Philippe Nunes 
 
-Emergency Calls
-===
-
-- Network / Modem updating of the emergency number list. Support the list of
-  emergency numbers dynamically updated by the network or by the modem (e.g.
-  additional numbers burned into modem ROM).
-
-  Priority: High
-  Complexity: C2
-
-
 Miscellaneous
 =
 
diff --git a/doc/features.txt b/doc/features.txt
index eb945c3..68d0676 100644
--- a/doc/features.txt
+++ b/doc/features.txt
@@ -583,14 +583,16 @@ Text Telephony
 Emergency Calls
 ===
 
-- EFecc support.  During SIM initialization phase oFono reads EFecc in order
-  to bootstrap the emergency calling codes provides by the SIM.  If the SIM is
-  not present or EFecc has not been read yet, the default set of emergency
-  calling codes is used.
-
-- Emergency number reporting.  The current known list of emergency calling
-  codes is reported by oFono in the EmergencyNumbers property on the
-  VoicecallManager interface.  When a voicecall is made to a number present
+- Emergency number reporting.  During SIM initialization phase oFono reads
+  EFecc in order to bootstrap the emergency calling codes provided by the SIM.
+  Emergency number list is exposed via the EmergencyNumbers property on the
+  VoicecallManager interface.  If SIM is present, list is the union of default
+  emergency numbers(112, 911), numbers in EFecc and Network / Modem reported
+  emergency numbers.  If SIM is not present or EFecc has not been read yet,
+  list is the union of default emergency numbers(112, 911) and emergency
+  numbers without SIM(119, 118, 999, 110, 08 and 000).
+
+- Emergency call reporting.  When a voicecall is made to a number present
   on the EmergencyNumbers list it is automatically flagged as an emergency
   call.  This is done by setting the Emergency property on the Voicecall
   interface to TRUE.
-- 
1.7.0.4

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


[PATCH v4 3/4] voicecall: network emergency number list support

2011-04-06 Thread Jeevaka Badrappan
---
 src/voicecall.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index b0f15fd..19ef479 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -49,6 +49,7 @@ struct ofono_voicecall {
GHashTable *en_list; /* emergency number list */
GSList *sim_en_list; /* Emergency numbers being read from SIM */
ofono_bool_t sim_en_list_ready;
+   char **nw_en_list; /* Emergency numbers from modem/network */
DBusMessage *pending;
struct ofono_sim *sim;
struct ofono_sim_context *sim_context;
@@ -2093,6 +2094,10 @@ static void set_new_ecc(struct ofono_voicecall *vc)
vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, NULL);
 
+   /* Emergency numbers from modem/network */
+   if (vc->nw_en_list)
+   add_to_en_list(vc, vc->nw_en_list);
+
/* Emergency numbers read from SIM */
if (vc->sim_en_list_ready == TRUE && vc->sim_en_list) {
for (l = vc->sim_en_list; l; l = l->next)
@@ -2175,6 +2180,15 @@ check:
set_new_ecc(vc);
 }
 
+void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
+   char **nw_en_list)
+{
+   g_strfreev(vc->nw_en_list);
+
+   vc->nw_en_list = g_strdupv(nw_en_list);
+   set_new_ecc(vc);
+}
+
 int ofono_voicecall_driver_register(const struct ofono_voicecall_driver *d)
 {
DBG("driver: %p, name: %s", d, d->name);
@@ -2220,6 +2234,11 @@ static void voicecall_unregister(struct ofono_atom *atom)
vc->sim_en_list = NULL;
}
 
+   if (vc->nw_en_list) {
+   g_strfreev(vc->nw_en_list);
+   vc->nw_en_list = NULL;
+   }
+
g_hash_table_destroy(vc->en_list);
vc->en_list = NULL;
 
-- 
1.7.0.4

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


[PATCH v4 0/4] Support of Network / Modem updated emergency numbers

2011-04-06 Thread Jeevaka Badrappan
Hi,

 Following set of patch adds the support for emergency number list update
from the network/modem in the oFono core.

Regards,
Jeevaka

Jeevaka Badrappan (4):
  include: Add ofono_voicecall_en_list_notify api
  voicecall: refactor emergency number list handling
  voicecall: network emergency number list support
  TODO: Mark Network/Modem EN update task as done

 TODO|   11 
 doc/features.txt|   18 +++---
 include/voicecall.h |3 +
 src/voicecall.c |  160 --
 4 files changed, 103 insertions(+), 89 deletions(-)

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


[PATCH v4 2/4] voicecall: refactor emergency number list handling

2011-04-06 Thread Jeevaka Badrappan
---
 src/voicecall.c |  143 ---
 1 files changed, 72 insertions(+), 71 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 469b939..b0f15fd 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -46,8 +46,9 @@ struct ofono_voicecall {
GSList *call_list;
GSList *release_list;
GSList *multiparty_list;
-   GSList *en_list;  /* emergency number list */
-   GSList *new_en_list; /* Emergency numbers being read from SIM */
+   GHashTable *en_list; /* emergency number list */
+   GSList *sim_en_list; /* Emergency numbers being read from SIM */
+   ofono_bool_t sim_en_list_ready;
DBusMessage *pending;
struct ofono_sim *sim;
struct ofono_sim_context *sim_context;
@@ -130,11 +131,12 @@ static gint call_compare(gconstpointer a, gconstpointer b)
return 0;
 }
 
-static void add_to_en_list(GSList **l, const char **list)
+static void add_to_en_list(struct ofono_voicecall *vc, char **list)
 {
int i = 0;
+
while (list[i])
-   *l = g_slist_prepend(*l, g_strdup(list[i++]));
+   g_hash_table_insert(vc->en_list, g_strdup(list[i++]), NULL);
 }
 
 static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r)
@@ -331,17 +333,10 @@ static void tone_request_finish(struct ofono_voicecall 
*vc,
g_free(entry);
 }
 
-static gint number_compare(gconstpointer a, gconstpointer b)
-{
-   const char *s1 = a, *s2 = b;
-   return strcmp(s1, s2);
-}
-
 static gboolean is_emergency_number(struct ofono_voicecall *vc,
const char *number)
 {
-   return g_slist_find_custom(vc->en_list, number,
-   number_compare) ? TRUE : FALSE;
+   return g_hash_table_lookup_extended(vc->en_list, number, NULL, NULL);
 }
 
 static void append_voicecall_properties(struct voicecall *v,
@@ -1120,9 +1115,10 @@ static DBusMessage 
*manager_get_properties(DBusConnection *conn,
DBusMessage *reply;
DBusMessageIter iter;
DBusMessageIter dict;
-   int i;
-   GSList *l;
+   int i = 0;
char **list;
+   GHashTableIter ht_iter;
+   gpointer key, value;
 
reply = dbus_message_new_method_return(msg);
if (reply == NULL)
@@ -1135,14 +1131,16 @@ static DBusMessage 
*manager_get_properties(DBusConnection *conn,
&dict);
 
/* property EmergencyNumbers */
-   list = g_new0(char *, g_slist_length(vc->en_list) + 1);
+   list = g_new0(char *, g_hash_table_size(vc->en_list) + 1);
+
+   g_hash_table_iter_init(&ht_iter, vc->en_list);
 
-   for (i = 0, l = vc->en_list; l; l = l->next, i++)
-   list[i] = g_strdup(l->data);
+   while (g_hash_table_iter_next(&ht_iter, &key, &value))
+   list[i++] = key;
 
ofono_dbus_dict_append_array(&dict, "EmergencyNumbers",
DBUS_TYPE_STRING, &list);
-   g_strfreev(list);
+   g_free(list);
 
dbus_message_iter_close_container(&iter, &dict);
 
@@ -2068,46 +2066,43 @@ static void emit_en_list_changed(struct ofono_voicecall 
*vc)
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(vc->atom);
char **list;
-   GSList *l;
-   int i;
+   int i = 0;
+   GHashTableIter iter;
+   gpointer key, value;
 
-   list = g_new0(char *, g_slist_length(vc->en_list) + 1);
-   for (i = 0, l = vc->en_list; l; l = l->next, i++)
-   list[i] = g_strdup(l->data);
+   list = g_new0(char *, g_hash_table_size(vc->en_list) + 1);
+
+   g_hash_table_iter_init(&iter, vc->en_list);
+
+   while (g_hash_table_iter_next(&iter, &key, &value))
+   list[i++] = key;
 
ofono_dbus_signal_array_property_changed(conn, path,
OFONO_VOICECALL_MANAGER_INTERFACE,
"EmergencyNumbers", DBUS_TYPE_STRING, &list);
 
-   g_strfreev(list);
+   g_free(list);
 }
 
 static void set_new_ecc(struct ofono_voicecall *vc)
 {
-   int i = 0;
-
-   g_slist_foreach(vc->en_list, (GFunc) g_free, NULL);
-   g_slist_free(vc->en_list);
-   vc->en_list = NULL;
-
-   vc->en_list = vc->new_en_list;
-   vc->new_en_list = NULL;
+   GSList *l;
 
-   while (default_en_list[i]) {
-   GSList *l;
+   g_hash_table_destroy(vc->en_list);
 
-   for (l = vc->en_list; l; l = l->next)
-   if (!strcmp(l->data, default_en_list[i]))
-   break;
+   vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal,
+   g_free, NULL);
 
-   if (l == NULL)
-   vc->en_list = g_slist_prepend(vc->en_list,
-   

[PATCH v4 1/4] include: Add ofono_voicecall_en_list_notify api

2011-04-06 Thread Jeevaka Badrappan
---
 include/voicecall.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/voicecall.h b/include/voicecall.h
index 6ae06a9..a373c64 100644
--- a/include/voicecall.h
+++ b/include/voicecall.h
@@ -135,6 +135,9 @@ struct ofono_voicecall_driver {
ofono_voicecall_cb_t cb, void *data);
 };
 
+void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
+   char **nw_en_list);
+
 void ofono_voicecall_notify(struct ofono_voicecall *vc,
const struct ofono_call *call);
 void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id,
-- 
1.7.0.4

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


Re: [RFC PATCH v3] gprs: add function to handle activated context

2011-04-06 Thread Arun Ravindran

Hi Pessi,


Hi Arun,

2011/4/6 Arun Ravindran:

According to this, the cid of user initiated context and network initiated
context doesn't overlap.

The problem is, the initial EPS context is initiated by mobile, not by
the network. The mobile sends a piggybacked
PDN CONNECTIVITY REQUEST with the initial attach request in order to
initiate the initial EPS context.



How does this happen from oFono (or in the TE-MT Interface).

Does it mean that in for EPS context the TE will have to do the same 
steps what it does for GPRS?


The PDN CONNECTIVITY REQUEST has the APN name, and for TE, CGDCONT to 
set the APN is called with a context id, in that case what is the need 
for the cid handling done in this patch?


Regards
Arun

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


Re: [RFC PATCH v3] gprs: add function to handle activated context

2011-04-06 Thread Pekka Pessi
Hi Arun,

2011/4/6 Arun Ravindran :
> According to this, the cid of user initiated context and network initiated
> context doesn't overlap.

The problem is, the initial EPS context is initiated by mobile, not by
the network. The mobile sends a piggybacked
PDN CONNECTIVITY REQUEST with the initial attach request in order to
initiate the initial EPS context.

-- 
Pekka.Pessi mail at nokia.com
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [RFC PATCH v3] gprs: add function to handle activated context

2011-04-06 Thread Arun Ravindran

Hi Redouane,

The purpose of the patch is to handle Network Initiated Context 
Activation and PDN connection request as part of EPS Attach procedure 
(LTE) in oFono core.


In order to avoid issue regarding CID allocation :
- driver should call the core using ofono_gprs_set_cid_range function 
to specify CID range for UE initiated PDN connection
- driver could use a new function to check if the CID is already used 
or not : ofono_gprs_is_cid_used, usefull in case the modem is not 
using a specific range for UE initiated PDN connection.
- driver will use a new function to notify the gprs atom of a new PDN 
connection with all the ip parameters from AT+CGCONTRDP (I can provide 
an update later to handle PCSCF and IMS Signaling Flag as well) 
commmand : ofono_gprs_context_activated



27.007 section 10.1.1 says

Defined values
: a numeric parameter which specifies a particular PDP context 
definition. The parameter is local to the TE-
MT interface and is used in other PDP context-related commands. The 
range of permitted values (minimum

value = 1) is returned by the test form of the command.
NOTE 1: The s for network-initiated PDP contexts will have values 
outside the ranges indicated for the

 in the test form of the commands +CGDCONT and +CGDSCONT.

According to this, the cid of user initiated context and network 
initiated context doesn't overlap.


Also

+CGEV: ME PDN ACT [,[,]]
The mobile termination has activated a context. The context represents a 
PDN connection in LTE or a Primary
PDP context in GSM/UMTS. The  for this context is provided to the 
TE. This event is sent either in result
of explicit context activation request (+CGACT), or in result of 
implicit context activation request associated to
attach request (+CGATT=1). The format of the parameters , 
 are found in command

+CGDCONT.

We should also be able to get the cid of the default context, from CGEV 
indications.


ofono_gprs_context_activated is similar to 
ofono_gprs_context_deactivated.

This function must be call by any gprs driver when :
 - a context has been activated without explicit request as part of 
attach procedure in LTE (PDN ACT X and X is a unused CID)

 - a context has been activated by the Network (NW PDN ACT X, NW ACT X,Y)

Behavior of the function :

List all the context and try to find correct APN with empty username 
and empty password.
If such context is not found then create a new one with "Internet" 
type only if we are in LTE with no Active context.

Otherwise deactivate the connection.

For the context (found or created):
Update the settings
Set to active

The function will also assign the context to a context driver.


Please correct me if i miss some information.

Regards
Arun

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


RE: Trouble using Huwei E160G

2011-04-06 Thread Zhang, Caiwen

Hi Claudio,

> I have made the test proposed, I still recive the same error :)

ofonod[2329]: drivers/atmodem/gprs-context.c:at_gprs_context_probe() 
ofonod[2329]: Missing support for TUN/TAP devices

It seems you device doesn't support TUN/TAP. at_gprs_context_probe return 
-ENODEV,
So it cause the gprs context driver is not set (ofono_gprs_context->driver is 
NULL).

> Any suggestion ?

Remove TUN checking code, in 
drivers/atmodem/gprs-context.c:at_gprs_context_probe()

Hope it help.

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


Re: Trouble using Huwei E160G

2011-04-06 Thread Claudio Degioanni
Hi all,

Il 05/04/2011 12.34, Claudio Degioanni ha scritto:
> Il 05/04/2011 12.09, Aygon, Bertrand ha scritto:
>> Hi,
>>
 From what I can see when you do the 'list-modem', your modem is already 
 enabled and online, so you do not have to do the >>./enable_modem and 
 ./online-modem.

 The PS context is also created (looking at ./list-contexts answer).

 So just the ./activate-context should be fine.

 But there is an error ... From what I can see in the source code, it 
 should be enable 'post sim'. And still according to source code, >>the 
 Huawei modem seems to skip some SIM status during warm start.

 So, can you please unplug replug the USB key, wait a few, just execute 
 ./list-modems and ./list-contexts (nothing else).
 You should see the modem enabled and online, and your context created. 
 If so, just execute ./activate-context
>>> I have made the test proposed, I still recive the same error :)
>>>
>>> I have attacched the new log of test. Ofono create the connection context, 
>>> but on activation it repond with not implemented.
>> Sorry, I have no idea, I have try all I have in mind, but now, we need the 
>> help of someone else.
>>
>> Huawei modem should support data call. The AT log looks correct. Why there 
>> is a not implemented error, I don't know...
> Thanks very much for help, I have made some search on target and on
> ubuntu 11.04. There is a difference in product id of device, after usb
> modem swicth.
>
> Target:
>
> Bus 001 Device 001: ID 1d6b:0002 
> Bus 002 Device 001: ID 1d6b:0002 
> Bus 002 Device 002: ID 05e3:0608 
> Bus 002 Device 003: ID 0951:1653 
> Bus 002 Device 004: ID 2001:3c05 
> *Bus 002 Device 005: ID 12d1:1436  *
> Bus 003 Device 001: ID 1d6b:0002
>
> Ubuntu:
>
> Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 003 Device 003: ID 0a5c:2110 Broadcom Corp. Bluetooth Controller
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 002 Device 004: ID 050d:5055 Belkin Components F5D5055 Gigabit
> Network Adapter [AX88xxx]
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> *Bus 001 Device 007: ID 12d1:140c Huawei Technologies Co., Ltd. *
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have made some test on target, and now I'm able to swicth the modem to
correct device type

*Bus 001 Device 007: ID 12d1:140c Huawei Technologies Co., Ltd. *

But I still have the problem to activate the 3G connection, i have
attacched the new log of my test.

Any suggestion ?

regs claudio

/tmp # ./list-modems 
[ /huawei0 ]
Features = gprs cbs net ussd sms rat sim 
Powered = 1
Lockdown = 0
Interfaces = org.ofono.ConnectionManager org.ofono.CellBroadcast 
org.ofono.NetworkRegistration org.ofono.SupplementaryServices 
org.ofono.CallBarring org.ofono.CallSettings org.ofono.CallForwarding 
org.ofono.MessageWaiting org.ofono.SmartMessaging org.ofono.PushNotification 
org.ofono.MessageManager org.ofono.RadioSettings org.ofono.AudioSettings 
org.ofono.VoiceCallManager org.ofono.SimManager 
Online = 1
Model = E1692
Manufacturer = huawei
Serial = 353108032160081
Revision = 11.126.08.00.192
[ org.ofono.ConnectionManager ]
Powered = 1
Attached = 1
Bearer = none
Suspended = 0
RoamingAllowed = 0
[ org.ofono.CellBroadcast ]
Topics = 
Powered = 1
[ org.ofono.NetworkRegistration ]
Status = registered
Strength = 35
Name = Telecom Italia M
LocationAreaCode = 61108
Mode = auto
MobileCountryCode = 222
CellId = 72657880
MobileNetworkCode = 01
[ org.ofono.SupplementaryServices ]
State = idle
[ org.ofono.CallBarring ]
VoiceOutgoing = disabled
VoiceIncoming = disabled
[ org.ofono.CallSettings ]
HideCallerId = default
CallingLinePresentation = enabled
VoiceCallWaiting = disabled
CalledLinePresentation = disabled
ConnectedLineRestriction = unknown
ConnectedLinePresentation = disabled
CallingLineRestriction = off
CallingNamePresentation = unknown
[ org.ofono.CallForwarding ]
ForwardingFlagOnSim = 0
VoiceNoReplyTimeout = 20
VoiceNotReachable = +39363338585692
VoiceBusy = +39363338585692
VoiceNoReply = +39363338585692
VoiceUnconditional = 
[ org.ofono.MessageWaiting ]
VoicemailMessageCount = 0
VoicemailMailboxNumber = 
VoicemailWaiting = 0
[ org.ofono.SmartMessaging ]
[ org.ofono.PushNotification ]
[ org.ofono.MessageManager ]
Alphabet = default
UseDeliveryReports = 0
Bearer = cs-preferred
ServiceCenterAddress