[PATCH 2/2] sim: Read EFust and EFest

2010-08-19 Thread Yang Gu
---
 src/sim.c |   75 +++-
 src/simutil.c |   18 ++
 src/simutil.h |  105 +
 3 files changed, 196 insertions(+), 2 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index d2ed780..235f457 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -95,6 +95,10 @@ struct ofono_sim {
void *driver_data;
struct ofono_atom *atom;
DBusMessage *pending;
+   unsigned char *efust;
+   unsigned char efust_length;
+   unsigned char *efest;
+   unsigned char efest_length;
 };
 
 struct msisdn_set_request {
@@ -1076,6 +1080,61 @@ static void sim_retrieve_imsi(struct ofono_sim *sim)
sim-driver-read_imsi(sim, sim_imsi_cb, sim);
 }
 
+static void sim_efest_read_cb(int ok, int length, int record,
+   const unsigned char *data,
+   int record_length, void *userdata)
+{
+   struct ofono_sim *sim = userdata;
+
+   if (!ok)
+   goto out;
+
+   if (length  1) {
+   ofono_error(EFest shall contain at least one byte);
+   goto out;
+   }
+
+   sim-efest = g_memdup(data, length);
+   sim-efest_length = length;
+
+out:
+   sim_retrieve_imsi(sim);
+}
+
+static void sim_efust_read_cb(int ok, int length, int record,
+   const unsigned char *data,
+   int record_length, void *userdata)
+{
+   struct ofono_sim *sim = userdata;
+
+   if (!ok)
+   goto out;
+
+   if (length  1) {
+   ofono_error(EFust shall contain at least one byte);
+   goto out;
+   }
+
+   sim-efust = g_memdup(data, length);
+   sim-efust_length = length;
+
+   ofono_sim_read(sim, SIM_EFEST_FILEID,
+   OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+   sim_efest_read_cb, sim);
+
+   return;
+
+out:
+   sim_retrieve_imsi(sim);
+}
+
+static inline void sim_retrieve_efust(struct ofono_sim *sim)
+{
+   ofono_sim_read(sim, SIM_EFUST_FILEID,
+   OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+   sim_efust_read_cb, sim);
+}
+
 static void sim_pin_query_cb(const struct ofono_error *error,
enum ofono_sim_password_type pin_type,
void *data)
@@ -1110,13 +1169,13 @@ static void sim_pin_query_cb(const struct ofono_error 
*error,
 
 checkdone:
if (pin_type == OFONO_SIM_PASSWORD_NONE)
-   sim_retrieve_imsi(sim);
+   sim_retrieve_efust(sim);
 }
 
 static void sim_pin_check(struct ofono_sim *sim)
 {
if (!sim-driver-query_passwd_state) {
-   sim_retrieve_imsi(sim);
+   sim_retrieve_efust(sim);
return;
}
 
@@ -1934,6 +1993,18 @@ static void sim_free_state(struct ofono_sim *sim)
g_strfreev(sim-language_prefs);
sim-language_prefs = NULL;
}
+
+   if (sim-efust) {
+   g_free(sim-efust);
+   sim-efust = NULL;
+   sim-efust_length = 0;
+   }
+
+   if (sim-efest) {
+   g_free(sim-efest);
+   sim-efest = NULL;
+   sim-efest_length = 0;
+   }
 }
 
 void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
diff --git a/src/simutil.c b/src/simutil.c
index 4b49b00..2d0764c 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -1416,3 +1416,21 @@ gboolean sim_parse_2g_get_response(const unsigned char 
*response, int len,
 
return TRUE;
 }
+
+gboolean sim_ust_is_available(unsigned char *efust, unsigned char len,
+   enum sim_ust_service index)
+{
+   if (index = len * 8)
+   return FALSE;
+
+   return (efust[index / 8]  (index % 8))  1;
+}
+
+gboolean sim_est_is_active(unsigned char *efest, unsigned char len,
+   enum sim_est_service index)
+{
+   if (index = len * 8)
+   return FALSE;
+
+   return (efest[index / 8]  (index % 8))  1;
+}
diff --git a/src/simutil.h b/src/simutil.h
index 29194ca..4db950b 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -26,9 +26,11 @@ enum sim_fileid {
SIM_EF_CPHS_MWIS_FILEID = 0x6f11,
SIM_EF_CPHS_INFORMATION_FILEID = 0x6f16,
SIM_EF_CPHS_MBDN_FILEID = 0x6f17,
+   SIM_EFUST_FILEID = 0x6f38,
SIM_EFMSISDN_FILEID = 0x6f40,
SIM_EFSPN_FILEID = 0x6f46,
SIM_EFSDN_FILEID = 0x6f49,
+   SIM_EFEST_FILEID = 0x6f56,
SIM_EFAD_FILEID = 0x6fad,
SIM_EFPHASE_FILEID = 0x6fae,
SIM_EFPNN_FILEID = 0x6fc5,
@@ -53,6 +55,104 @@ enum sim_file_access {
SIM_FILE_ACCESS_NEVER = 15,
 };
 
+/* 131.102 Section 4.2.8 */
+enum sim_ust_service {
+   SIM_UST_SERVICE_LOCAL_PHONE_BOOK= 0,
+   SIM_UST_SERVICE_FDN = 1,
+  

[PATCH 1/2] Make function reset_available() return void

2010-08-19 Thread Yang Gu
This change is to dispel compiler's complaint.
---
 src/network.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/network.c b/src/network.c
index f5b9a5e..190eba9 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1175,7 +1175,7 @@ static void notify_status_watches(struct ofono_netreg 
*netreg)
}
 }
 
-static gboolean reset_available(struct network_operator_data *old,
+static void reset_available(struct network_operator_data *old,
const struct ofono_network_operator *new)
 {
if (old == NULL)
-- 
1.7.0.4

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


Re: UIM manager atom APIs review request

2010-08-19 Thread Kalle Valo
Zhang, Caiwen caiwen.zh...@windriver.com writes:

 I am going to implement an UIM manager atom for CDMA extension. Its APIs will 
 be almost the same as 
 current SIM manger atom's APIs.  But I suggest maybe will can do some changes:

   1. Add PIN remain retry count support

Doesn't GSM also support this? If yes, any pointers/tips how to access
the retry count from the modem/SIM? I need this in my UI and I would
like to give a shot implementing this in ofono, but I don't know where
to start.

(Actually I doubt that my Huawei E1552 even supports this, but miracles
do happen some times...)

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


Re: UIM manager atom APIs review request

2010-08-19 Thread Marcel Holtmann
Hi Kalle,

  I am going to implement an UIM manager atom for CDMA extension. Its APIs 
  will be almost the same as 
  current SIM manger atom's APIs.  But I suggest maybe will can do some 
  changes:
 
  1. Add PIN remain retry count support
 
 Doesn't GSM also support this? If yes, any pointers/tips how to access
 the retry count from the modem/SIM? I need this in my UI and I would
 like to give a shot implementing this in ofono, but I don't know where
 to start.

yes, GSM modems support this as well. It is just vendor specific.

 (Actually I doubt that my Huawei E1552 even supports this, but miracles
 do happen some times...)

Yes, the Huawei supports this as well. Check $QCPINSTAT or ^CPIN
commands.

Regards

Marcel


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


Re: [PATCH 1/2] Make function reset_available() return void

2010-08-19 Thread Marcel Holtmann
Hi Yang,

 This change is to dispel compiler's complaint.
 ---
  src/network.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


I fixed this before I read your email. Thanks for the patch anyway.

Regards

Marcel


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


[PATCH 2/3] mbm: retry modem init

2010-08-19 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

If the first initialization command results are catastrophic. Retry it 10
times, refuse to enable modem if it fails.
---
 plugins/mbm.c |   71 +
 1 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/plugins/mbm.c b/plugins/mbm.c
index bebf5aa..a06c444 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -55,8 +55,8 @@ static const char *none_prefix[] = { NULL };
 struct mbm_data {
GAtChat *modem_port;
GAtChat *data_port;
-   guint cpin_poll_source;
-   guint cpin_poll_count;
+   guint poll_source;
+   guint poll_count;
gboolean have_sim;
 };
 
@@ -86,8 +86,8 @@ static void mbm_remove(struct ofono_modem *modem)
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);
+   if (data-poll_source  0)
+   g_source_remove(data-poll_source);
 
g_free(data);
 }
@@ -109,13 +109,13 @@ static void simpin_check(gboolean ok, GAtResult *result, 
gpointer user_data)
DBG();
 
/* Modem returns an error if SIM is not ready. */
-   if (!ok  data-cpin_poll_count++  5) {
-   data-cpin_poll_source =
+   if (!ok  data-poll_count++  5) {
+   data-poll_source =
g_timeout_add_seconds(1, init_simpin_check, modem);
return;
}
 
-   data-cpin_poll_count = 0;
+   data-poll_count = 0;
 
/* There is probably no SIM if SIM is not ready after 5 seconds. */
data-have_sim = ok;
@@ -128,7 +128,7 @@ static gboolean init_simpin_check(gpointer user_data)
struct ofono_modem *modem = user_data;
struct mbm_data *data = ofono_modem_get_data(modem);
 
-   data-cpin_poll_source = 0;
+   data-poll_source = 0;
 
g_at_chat_send(data-modem_port, AT+CPIN?, cpin_prefix,
simpin_check, modem, NULL);
@@ -220,6 +220,53 @@ static void emrdy_query(gboolean ok, GAtResult *result, 
gpointer user_data)
cfun_query, modem, NULL);
 };
 
+static gboolean init_check(gpointer user_data);
+
+static void init_result(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct mbm_data *data = ofono_modem_get_data(modem);
+
+   DBG();
+
+   if (!ok  data-poll_count++  10) {
+   data-poll_source = g_timeout_add_seconds(1, init_check, modem);
+   return;
+   }
+
+   data-poll_count = 0;
+
+   if (!ok) {
+   g_at_chat_unref(data-modem_port);
+   data-modem_port = NULL;
+
+   g_at_chat_unref(data-data_port);
+   data-data_port = NULL;
+
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   g_at_chat_register(data-modem_port, *EMRDY:, emrdy_notifier,
+   FALSE, modem, NULL);
+
+   g_at_chat_send(data-modem_port, AT*EMRDY?, none_prefix,
+   emrdy_query, modem, NULL);
+}
+
+static gboolean init_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct mbm_data *data = ofono_modem_get_data(modem);
+
+   data-poll_source = 0;
+
+   g_at_chat_send(data-modem_port, ATF E0 V1 X4 C1 +CMEE=1, NULL,
+   init_result, modem, NULL);
+
+   return FALSE;
+}
+
 static GAtChat *create_port(const char *device)
 {
GAtSyntax *syntax;
@@ -277,13 +324,7 @@ static int mbm_enable(struct ofono_modem *modem)
if (getenv(OFONO_AT_DEBUG))
g_at_chat_set_debug(data-data_port, mbm_debug, Data:);
 
-   g_at_chat_register(data-modem_port, *EMRDY:, emrdy_notifier,
-   FALSE, modem, NULL);
-
-   g_at_chat_send(data-modem_port, ATF E0 V1 X4 C1 +CMEE=1, NULL,
-   NULL, NULL, NULL);
-   g_at_chat_send(data-modem_port, AT*EMRDY?, none_prefix,
-   emrdy_query, modem, NULL);
+   init_check(modem);
 
return -EINPROGRESS;
 }
-- 
1.7.0.4

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


[PATCH 3/3] mbm: register gprs as STE to utilize STE quirks

2010-08-19 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

No AT+CGEREP=2,1 on mbm either.
---
 plugins/mbm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/plugins/mbm.c b/plugins/mbm.c
index a06c444..e77e61c 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -395,7 +395,8 @@ static void mbm_post_sim(struct ofono_modem *modem)
ofono_cbs_create(modem, 0, atmodem, data-modem_port);
ofono_ussd_create(modem, 0, atmodem, data-modem_port);
 
-   gprs = ofono_gprs_create(modem, 0, atmodem, data-modem_port);
+   gprs = ofono_gprs_create(modem, OFONO_VENDOR_STE, atmodem,
+   data-modem_port);
gc = ofono_gprs_context_create(modem, 0, mbm, data-modem_port);
 
if (gprs  gc)
-- 
1.7.0.4

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


[PATCH 1/3] mbm: fix initial polling for sim

2010-08-19 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

There seems to be no specific error codes returned when SIM is missing. Poll
at least 5 times upon an error and give up after that.
---
 plugins/mbm.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/plugins/mbm.c b/plugins/mbm.c
index 6f71553..bebf5aa 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -108,10 +108,8 @@ static void simpin_check(gboolean ok, GAtResult *result, 
gpointer user_data)
 
DBG();
 
-   /* Modem returns +CME ERROR: 10 if SIM is not ready. */
-   if (!ok  result-final_or_pdu 
-   !strcmp(result-final_or_pdu, +CME ERROR: 10) 
-   data-cpin_poll_count++  5) {
+   /* 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;
@@ -119,7 +117,7 @@ static void simpin_check(gboolean ok, GAtResult *result, 
gpointer user_data)
 
data-cpin_poll_count = 0;
 
-   /* Modem returns ERROR if there is no SIM in slot. */
+   /* There is probably no SIM if SIM is not ready after 5 seconds. */
data-have_sim = ok;
 
ofono_modem_set_powered(modem, TRUE);
-- 
1.7.0.4

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


Re: [PATCH 1/3] mbm: fix initial polling for sim

2010-08-19 Thread Marcel Holtmann
Hi Pekka,

 There seems to be no specific error codes returned when SIM is missing. Poll
 at least 5 times upon an error and give up after that.
 ---
  plugins/mbm.c |8 +++-
  1 files changed, 3 insertions(+), 5 deletions(-)
 
 diff --git a/plugins/mbm.c b/plugins/mbm.c
 index 6f71553..bebf5aa 100644
 --- a/plugins/mbm.c
 +++ b/plugins/mbm.c
 @@ -108,10 +108,8 @@ static void simpin_check(gboolean ok, GAtResult *result, 
 gpointer user_data)
  
   DBG();
  
 - /* Modem returns +CME ERROR: 10 if SIM is not ready. */
 - if (!ok  result-final_or_pdu 
 - !strcmp(result-final_or_pdu, +CME ERROR: 10) 
 - data-cpin_poll_count++  5) {
 + /* 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);

maybe the STE modem is a bit more specific here than the MBM one. Which
MBM modem did you test this with?

Regards

Marcel


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


Re: [PATCH 2/3] mbm: retry modem init

2010-08-19 Thread Marcel Holtmann
Hi Pekka,

 If the first initialization command results are catastrophic. Retry it 10
 times, refuse to enable modem if it fails.
 ---
  plugins/mbm.c |   71 
 +
  1 files changed, 56 insertions(+), 15 deletions(-)
 
 diff --git a/plugins/mbm.c b/plugins/mbm.c
 index bebf5aa..a06c444 100644
 --- a/plugins/mbm.c
 +++ b/plugins/mbm.c
 @@ -55,8 +55,8 @@ static const char *none_prefix[] = { NULL };
  struct mbm_data {
   GAtChat *modem_port;
   GAtChat *data_port;
 - guint cpin_poll_source;
 - guint cpin_poll_count;
 + guint poll_source;
 + guint poll_count;
   gboolean have_sim;
  };
  
 @@ -86,8 +86,8 @@ static void mbm_remove(struct ofono_modem *modem)
   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);
 + if (data-poll_source  0)
 + g_source_remove(data-poll_source);
  
   g_free(data);
  }
 @@ -109,13 +109,13 @@ static void simpin_check(gboolean ok, GAtResult 
 *result, gpointer user_data)
   DBG();
  
   /* Modem returns an error if SIM is not ready. */
 - if (!ok  data-cpin_poll_count++  5) {
 - data-cpin_poll_source =
 + if (!ok  data-poll_count++  5) {
 + data-poll_source =
   g_timeout_add_seconds(1, init_simpin_check, modem);
   return;
   }
  
 - data-cpin_poll_count = 0;
 + data-poll_count = 0;
  
   /* There is probably no SIM if SIM is not ready after 5 seconds. */
   data-have_sim = ok;
 @@ -128,7 +128,7 @@ static gboolean init_simpin_check(gpointer user_data)
   struct ofono_modem *modem = user_data;
   struct mbm_data *data = ofono_modem_get_data(modem);
  
 - data-cpin_poll_source = 0;
 + data-poll_source = 0;
  
   g_at_chat_send(data-modem_port, AT+CPIN?, cpin_prefix,
   simpin_check, modem, NULL);
 @@ -220,6 +220,53 @@ static void emrdy_query(gboolean ok, GAtResult *result, 
 gpointer user_data)
   cfun_query, modem, NULL);
  };
  
 +static gboolean init_check(gpointer user_data);
 +
 +static void init_result(gboolean ok, GAtResult *result, gpointer user_data)
 +{
 + struct ofono_modem *modem = user_data;
 + struct mbm_data *data = ofono_modem_get_data(modem);
 +
 + DBG();
 +
 + if (!ok  data-poll_count++  10) {
 + data-poll_source = g_timeout_add_seconds(1, init_check, modem);
 + return;
 + }
 +
 + data-poll_count = 0;
 +
 + if (!ok) {
 + g_at_chat_unref(data-modem_port);
 + data-modem_port = NULL;
 +
 + g_at_chat_unref(data-data_port);
 + data-data_port = NULL;
 +
 + ofono_modem_set_powered(modem, FALSE);
 + return;
 + }
 +
 + g_at_chat_register(data-modem_port, *EMRDY:, emrdy_notifier,
 + FALSE, modem, NULL);
 +
 + g_at_chat_send(data-modem_port, AT*EMRDY?, none_prefix,
 + emrdy_query, modem, NULL);
 +}
 +
 +static gboolean init_check(gpointer user_data)
 +{
 + struct ofono_modem *modem = user_data;
 + struct mbm_data *data = ofono_modem_get_data(modem);
 +
 + data-poll_source = 0;
 +
 + g_at_chat_send(data-modem_port, ATF E0 V1 X4 C1 +CMEE=1, NULL,
 + init_result, modem, NULL);
 +
 + return FALSE;
 +}
 +
  static GAtChat *create_port(const char *device)
  {
   GAtSyntax *syntax;
 @@ -277,13 +324,7 @@ static int mbm_enable(struct ofono_modem *modem)
   if (getenv(OFONO_AT_DEBUG))
   g_at_chat_set_debug(data-data_port, mbm_debug, Data:);
  
 - g_at_chat_register(data-modem_port, *EMRDY:, emrdy_notifier,
 - FALSE, modem, NULL);
 -
 - g_at_chat_send(data-modem_port, ATF E0 V1 X4 C1 +CMEE=1, NULL,
 - NULL, NULL, NULL);
 - g_at_chat_send(data-modem_port, AT*EMRDY?, none_prefix,
 - emrdy_query, modem, NULL);
 + init_check(modem);

you do know that the F35xx series and before only support *EMRDY
notifications and not the query command. Also the notification only
comes ones after reset of the modem on these old cards.

Regards

Marcel


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


Re: [PATCH 3/3] mbm: register gprs as STE to utilize STE quirks

2010-08-19 Thread Marcel Holtmann
Hi Pekka,

 No AT+CGEREP=2,1 on mbm either.
 ---
  plugins/mbm.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/plugins/mbm.c b/plugins/mbm.c
 index a06c444..e77e61c 100644
 --- a/plugins/mbm.c
 +++ b/plugins/mbm.c
 @@ -395,7 +395,8 @@ static void mbm_post_sim(struct ofono_modem *modem)
   ofono_cbs_create(modem, 0, atmodem, data-modem_port);
   ofono_ussd_create(modem, 0, atmodem, data-modem_port);
  
 - gprs = ofono_gprs_create(modem, 0, atmodem, data-modem_port);
 + gprs = ofono_gprs_create(modem, OFONO_VENDOR_STE, atmodem,
 + data-modem_port);
   gc = ofono_gprs_context_create(modem, 0, mbm, data-modem_port);

looks good, but I actually prefer if we turn this around. Make the quirk
in drivers/atmodem/gprs.c an OFONO_VENDOR_MBM quirk with a proper
comment that this applies to STE and MBM modems. And then have the MBM
and STE plugin use that quirk.

Regards

Marcel


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


Gatmux doubt and suggestion

2010-08-19 Thread Arun.Ravindran

Hi All,

In mux_query_cb(), the frame size is taken as default (31 or 64). We
have a case where the default values are not accepted by the modem.

Gatmux is a generic component, and so makes all modem to use the default
values, one needs to modify the gatmux to enable for example, a larger
frame size.

Why not let the modem plug-in parse the CMUX query and decide on a
suitable configuration for enabling MUX? 

What is your opinion?



-

Regards
Arun Ravindran
Specialist, Elektrobit OYJ
Keilasatama 5, Espoo
M: +358403445507




Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.




Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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


About Connection between PPP and linux Sockets

2010-08-19 Thread Steven

Hi

I have a little question just as the title said?
In Ofono how to connect PPP to Linux socket, when we receive packet from 
network, how the packet go through the kernel to application?


modem --PPP--? -- linux kernel(network part)-- socket -- application?

steven
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---

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


RE: UIM manager atom APIs review request

2010-08-19 Thread Zhang, Caiwen
Hi Marcel,

Thanks for your review. I don't know what is wrong with our company's 
Mail server. I miss your reply mail. Fortunately,I see it on the ofono
website. 
I create a similar mail. Hope it looks the same. 

 -Original Message-
 From: Zhang, Caiwen
 Sent: Thursday, August 19, 2010 5:05 PM
 To: Zhang, Caiwen
 Subject: RE: UIM manager atom APIs review request
 
 
 
 Hi Caiwen,
 
  I am going to implement an UIM manager atom for CDMA extension. Its
 APIs will be almost the same as
  current SIM manger atom's APIs.  But I suggest maybe will can do
some
 changes:
 
  1. Add PIN remain retry count support
  2. replace properties 'Present' 'PinRequired' and 'LockedPins'
 with a new add property 'Status'
 
  Properties  string Status [readonly]
 
  Contains the string type of the status of the
SIM.
  The possible values are:
  ready - Not waiting for a password
  pin - SIM PIN is required
  phone - Phone-to-SIM PIN is required  [GSM
only]
  firstphone - Phone-to-very-first SIM
  PIN is required  [GSM
only]
  pin2 - SIM PIN2 is required
  network - Network Personalization password is
  required  [GSM only]
  netsub - Network subset personalization
  password is required
[GSM only]
  service - Service Provider personalization
  password is required
[GSM only]
  corp - Corporate personalization password
  is required  [GSM only]
  puk - SIM PUK is required
  firstphonepuk - Phone-to-very-first SIM PUK is
  required  [GSM only]
  puk2 - SIM PUK2 is required
  networkpuk - Network personalization
unblocking
  password is required
[GSM only]
  netsubpuk - Network subset personalization
  unblocking password is
required
 [GSM only]
  servicepuk - Service provider personalization
  unblocking password is
required
 [GSM only]
  corppuk - Corporate personalization unblocking
  password is required
[GSM only]
  absent - No SIM inserted
 
 why? What is wrong with the current properties? I like to see this
from
 the UI point of view (and ConnMan as one user) why we should change
it.
 
Current properties are OK. I think maybe we can improve it. Generally,
user
Only care the SIM status, e.g. whether SIM is insert or need input
password.
In fact, He/she doesn't care which Pins are locked. So we can simplify
it. 
replace 'Present' 'PinRequired' with Status and remove 'LockedPins'.

In fact, there is no way to get all the Locked Pins, 'LockedPins'
property
Value maybe incorrect.


  array{uint8} PinRetryCount [readonly]
 
   Contains the remain retry count of PIN,PIN2,PUK
and
 PUK2
 
 Only uint8 is needed here. The UI doesn't care about the retries other
 PINs. I only care about the current one it needs to enter.
 
There are some cases that need show PIN remain retry count  but the SIM
status 
is ready (Not waiting for a password). 
such as, activates/ deactivate PIN lock. 


 Regards
 
 Marcel

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


Re: [PATCH 1/3] mbm: fix initial polling for sim

2010-08-19 Thread Sjur Brændeland
Marcel Holtmann mar...@holtmann.org wrote:

 maybe the STE modem is a bit more specific here than the MBM one. Which
 MBM modem did you test this with?

I have been using MBM as template for my sim ready changes, so I don't think
there is any point at looking at STE driver at this point in time.

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


Re: Gatmux doubt and suggestion

2010-08-19 Thread Marcel Holtmann
Hi Arun,

 In mux_query_cb(), the frame size is taken as default (31 or 64). We
 have a case where the default values are not accepted by the modem.
 
 Gatmux is a generic component, and so makes all modem to use the
 default values, one needs to modify the gatmux to enable for example,
 a larger frame size.
 
 Why not let the modem plug-in parse the CMUX query and decide on a
 suitable configuration for enabling MUX? 
 
 What is your opinion?

patches are welcome.

However you do know that the GAtMux has setup functions for basic and
advanced mode. So you could parse AT+CMUX all by yourself in the modem
plugin.

GAtMux *g_at_mux_new_gsm0710_basic(GIOChannel *channel, int framesize);
GAtMux *g_at_mux_new_gsm0710_advanced(GIOChannel *channel, int framesize);

There is no requirement to actually use g_at_mux_setup_gsm0710(), but it
is a lot more convenient.

Regards

Marcel


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


Re: About Connection between PPP and linux Sockets

2010-08-19 Thread Marcel Holtmann
Hi Steven,

 I have a little question just as the title said?
 In Ofono how to connect PPP to Linux socket, when we receive packet from 
 network, how the packet go through the kernel to application?
 
 modem --PPP--? -- linux kernel(network part)-- socket -- application?

it is more like this:

modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket - application.

With the TTY being in kernel, the PPP being in userspace, and TUN/TAP
etc. begin in the kernel again.

A future enhancement is to use the kernel PPP layer, but we haven't
gotten there yet.

Regards

Marcel


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


RE: UIM manager atom APIs review request

2010-08-19 Thread Marcel Holtmann
Hi Caiwen,

   I am going to implement an UIM manager atom for CDMA extension. Its
  APIs will be almost the same as
   current SIM manger atom's APIs.  But I suggest maybe will can do
 some
  changes:
  
 1. Add PIN remain retry count support
 2. replace properties 'Present' 'PinRequired' and 'LockedPins'
  with a new add property 'Status'
  
   Propertiesstring Status [readonly]
  
 Contains the string type of the status of the
 SIM.
 The possible values are:
 ready - Not waiting for a password
 pin - SIM PIN is required
 phone - Phone-to-SIM PIN is required  [GSM
 only]
 firstphone - Phone-to-very-first SIM
 PIN is required  [GSM
 only]
 pin2 - SIM PIN2 is required
 network - Network Personalization password is
 required  [GSM only]
 netsub - Network subset personalization
 password is required
 [GSM only]
 service - Service Provider personalization
 password is required
 [GSM only]
 corp - Corporate personalization password
 is required  [GSM only]
 puk - SIM PUK is required
 firstphonepuk - Phone-to-very-first SIM PUK is
 required  [GSM only]
 puk2 - SIM PUK2 is required
 networkpuk - Network personalization
 unblocking
 password is required
 [GSM only]
 netsubpuk - Network subset personalization
 unblocking password is
 required
  [GSM only]
 servicepuk - Service provider personalization
 unblocking password is
 required
  [GSM only]
 corppuk - Corporate personalization unblocking
 password is required
 [GSM only]
 absent - No SIM inserted
  
  why? What is wrong with the current properties? I like to see this
 from
  the UI point of view (and ConnMan as one user) why we should change
 it.
  
 Current properties are OK. I think maybe we can improve it. Generally,
 user
 Only care the SIM status, e.g. whether SIM is insert or need input
 password.
 In fact, He/she doesn't care which Pins are locked. So we can simplify
 it. 
 replace 'Present' 'PinRequired' with Status and remove 'LockedPins'.
 
 In fact, there is no way to get all the Locked Pins, 'LockedPins'
 property
 Value maybe incorrect.

actually the user and the UI cares about which PIN is locked. It has to
tell the user which PIN to enter and how long it is. So that is
important.

 array{uint8} PinRetryCount [readonly]
  
  Contains the remain retry count of PIN,PIN2,PUK
 and
  PUK2
  
  Only uint8 is needed here. The UI doesn't care about the retries other
  PINs. I only care about the current one it needs to enter.
  
 There are some cases that need show PIN remain retry count  but the SIM
 status 
 is ready (Not waiting for a password). 
 such as, activates/ deactivate PIN lock. 

And when is that. I don't see that use case. Why would you show the
remaining entries if your SIM card is active and unlocked?

Please provide clear examples where this would be needed.

Regards

Marcel


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


RE: Gatmux doubt and suggestion

2010-08-19 Thread Arun.Ravindran
 
Hi Marcel,

 Hi Arun,

 In mux_query_cb(), the frame size is taken as default (31 or 64). We 
 have a case where the default values are not accepted by the modem.
 
 Gatmux is a generic component, and so makes all modem to use the 
 default values, one needs to modify the gatmux to enable for example, 
 a larger frame size.
 
 Why not let the modem plug-in parse the CMUX query and decide on a 
 suitable configuration for enabling MUX?
 
 What is your opinion?

 patches are welcome.
 However you do know that the GAtMux has setup functions for basic and
advanced mode. So you could parse AT+CMUX all by yourself in the modem
plugin.
 GAtMux *g_at_mux_new_gsm0710_basic(GIOChannel *channel, int
framesize); GAtMux *g_at_mux_new_gsm0710_advanced(GIOChannel *channel,
int framesize);
 There is no requirement to actually use g_at_mux_setup_gsm0710(), but
it is a lot more convenient.

I am thinking of a solution, where the modem plugin passes a call back
function pointer to g_at_mux_setup_gsm0710(). mux_query_cb() can call
this call back function during processing of CMUX=? Response. This call
back function will be a member of struct mux_setup_data. This way the
modem plugins can have the freedom to set the CMUX parameters if they
wish to do so. If the call back is NULL the default values are applied
as now.

But this involves patches in the existing plugins (calypso etc) and
Gatmux, but gives options to plugins (their of values or default
values).

What is your opinion about this?

Regards
Arun


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



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.




Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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


RE: Gatmux doubt and suggestion

2010-08-19 Thread Marcel Holtmann
Hi Arun,

  In mux_query_cb(), the frame size is taken as default (31 or 64). We 
  have a case where the default values are not accepted by the modem.
  
  Gatmux is a generic component, and so makes all modem to use the 
  default values, one needs to modify the gatmux to enable for example, 
  a larger frame size.
  
  Why not let the modem plug-in parse the CMUX query and decide on a 
  suitable configuration for enabling MUX?
  
  What is your opinion?
 
  patches are welcome.
  However you do know that the GAtMux has setup functions for basic and
 advanced mode. So you could parse AT+CMUX all by yourself in the modem
 plugin.
  GAtMux *g_at_mux_new_gsm0710_basic(GIOChannel *channel, int
 framesize); GAtMux *g_at_mux_new_gsm0710_advanced(GIOChannel *channel,
 int framesize);
  There is no requirement to actually use g_at_mux_setup_gsm0710(), but
 it is a lot more convenient.
 
 I am thinking of a solution, where the modem plugin passes a call back
 function pointer to g_at_mux_setup_gsm0710(). mux_query_cb() can call
 this call back function during processing of CMUX=? Response. This call
 back function will be a member of struct mux_setup_data. This way the
 modem plugins can have the freedom to set the CMUX parameters if they
 wish to do so. If the call back is NULL the default values are applied
 as now.
 
 But this involves patches in the existing plugins (calypso etc) and
 Gatmux, but gives options to plugins (their of values or default
 values).

changing modem plugins is not a problem at.

However if you make an extra callback to parse the AT+CMUX=? result and
then send force it to send the AT+CMUX command by itself, then this
makes no sense. It is as complicated as doing it manually in the first
place.

If you wanna modify setup_gsm0710() to always pick the largest available
framesize instead of default, then yes, that sounds reasonable. For your
proposed solution I prefer you just use the manual setup. If you try it
you will see that there is no difference. You just replace one function
call to setup_gsm0710() with a call to g_at_chat_send().

Regards

Marcel


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


RE: Gatmux doubt and suggestion

2010-08-19 Thread Arun.Ravindran
 
Hi Marcel,

  In mux_query_cb(), the frame size is taken as default (31 or 64). We

  have a case where the default values are not accepted by the modem.
  
  Gatmux is a generic component, and so makes all modem to use the 
  default values, one needs to modify the gatmux to enable for 
  example, a larger frame size.
  
  Why not let the modem plug-in parse the CMUX query and decide on a 
  suitable configuration for enabling MUX?
  
  What is your opinion?
 
  patches are welcome.
  However you do know that the GAtMux has setup functions for basic 
  and
 advanced mode. So you could parse AT+CMUX all by yourself in the modem

 plugin.
  GAtMux *g_at_mux_new_gsm0710_basic(GIOChannel *channel, int
 framesize); GAtMux *g_at_mux_new_gsm0710_advanced(GIOChannel *channel,

 int framesize);
  There is no requirement to actually use g_at_mux_setup_gsm0710(), 
  but
 it is a lot more convenient.
 
 I am thinking of a solution, where the modem plugin passes a call back

 function pointer to g_at_mux_setup_gsm0710(). mux_query_cb() can call 
 this call back function during processing of CMUX=? Response. This 
 call back function will be a member of struct mux_setup_data. This way

 the modem plugins can have the freedom to set the CMUX parameters if 
 they wish to do so. If the call back is NULL the default values are 
 applied as now.
 
 But this involves patches in the existing plugins (calypso etc) and 
 Gatmux, but gives options to plugins (their of values or default 
 values).

 changing modem plugins is not a problem at.

 However if you make an extra callback to parse the AT+CMUX=? result
and then send force it to send the AT+CMUX command by itself, then this
makes no sense. It is as  complicated as doing it manually in the first
place.

 If you wanna modify setup_gsm0710() to always pick the largest
available framesize instead of default, then yes, that sounds
reasonable. For your proposed solution I prefer  you just use the
manual setup. If you try it you will see that there is no difference.
You just replace one function call to setup_gsm0710() with a call to 
g_at_chat_send().

It is not only framesize, it can also be for other parameters, where the
default values seem insufficient. I can see that the existing plugins
are not using those, but need not be true for other modems. Ok now I
understand, writing a plugin specific mux initialization
(xxmodem_mux_setup_gsm0710(...) ) is more clean, and use
g_at_mux_new_gsm0710_basic () g_at_mux_new_gsm0710_advanced()from there.
right? 

Thanks Marcel.

Regards
Arun

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



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.




Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

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


Re: Gatmux doubt and suggestion

2010-08-19 Thread Denis Kenzior
Hi Arun,

On 08/19/2010 04:27 AM, arun.ravind...@elektrobit.com wrote:
 
 Hi All,
 
 In mux_query_cb(), the frame size is taken as default (31 or 64). We
 have a case where the default values are not accepted by the modem.
 
 Gatmux is a generic component, and so makes all modem to use the default
 values, one needs to modify the gatmux to enable for example, a larger
 frame size.
 
 Why not let the modem plug-in parse the CMUX query and decide on a
 suitable configuration for enabling MUX?
 
 What is your opinion?

g_at_mux_setup_gsm0710 is really meant for the default cases.  If you
have some particular hardware in mind that requires specific parameters,
then sending the AT+CMUX command directly is a much better idea.

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


Re: [PATCH 1/3] mbm: fix initial polling for sim

2010-08-19 Thread Pekka Pessi
Hi Marcel and Sjur,

  There seems to be no specific error codes returned when SIM is missing. Poll
  at least 5 times upon an error and give up after that.
  ---
   plugins/mbm.c |8 +++-
   1 files changed, 3 insertions(+), 5 deletions(-)
 
  diff --git a/plugins/mbm.c b/plugins/mbm.c
  index 6f71553..bebf5aa 100644
  --- a/plugins/mbm.c
  +++ b/plugins/mbm.c
  @@ -108,10 +108,8 @@ static void simpin_check(gboolean ok, GAtResult 
  *result, gpointer user_data)
 
  DBG();
 
  -   /* Modem returns +CME ERROR: 10 if SIM is not ready. */
  -   if (!ok  result-final_or_pdu 
  -   !strcmp(result-final_or_pdu, +CME ERROR: 10) 
  -   data-cpin_poll_count++  5) {
  +   /* 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);

 maybe the STE modem is a bit more specific here than the MBM one. Which
 MBM modem did you test this with?

I've been testing with F3507g, branded as Dell 5530.

The existing mbm sim detection logic is based on my earlier tests
without connman. It worked when I manually called test/enable-modem.

When using ofono with connman, the modem gets powered immediately after
it gets configured by kernel. Sometimes mbm seems to be still in the middle of
its initialization when ofono tries to enable it.

--Pekka

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


[PATCH] Fix: remove extra comma from NotAvailable error

2010-08-19 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

---
 src/dbus.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/dbus.c b/src/dbus.c
index 09114c3..c51f2a9 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -300,7 +300,7 @@ DBusMessage *__ofono_error_not_supported(DBusMessage *msg)
 
 DBusMessage *__ofono_error_not_available(DBusMessage *msg)
 {
-   return g_dbus_create_error(msg, DBUS_GSM_ERROR_INTERFACE,
+   return g_dbus_create_error(msg, DBUS_GSM_ERROR_INTERFACE
.NotAvailable,
Operation currently not available);
 }
-- 
1.7.0.4

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


Re: [PATCH] Fix: remove extra comma from NotAvailable error

2010-08-19 Thread Marcel Holtmann
Hi Pekka,

 ---
  src/dbus.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 
 diff --git a/src/dbus.c b/src/dbus.c
 index 09114c3..c51f2a9 100644
 --- a/src/dbus.c
 +++ b/src/dbus.c
 @@ -300,7 +300,7 @@ DBusMessage *__ofono_error_not_supported(DBusMessage *msg)
  
  DBusMessage *__ofono_error_not_available(DBusMessage *msg)
  {
 - return g_dbus_create_error(msg, DBUS_GSM_ERROR_INTERFACE,
 + return g_dbus_create_error(msg, DBUS_GSM_ERROR_INTERFACE
   .NotAvailable,
   Operation currently not available);
  }

good catch. Patch has been applied.

And the compiler should have complained, but of course it only does that
if you annotate this properly in gdbus :(

Regards

Marcel


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


[RFC PATCH v2 2/4] smsutil: storing/loading sms status report over reboot

2010-08-19 Thread Petteri Tikander
---
 src/smsutil.c |  192 +++--
 src/smsutil.h |2 +-
 2 files changed, 188 insertions(+), 6 deletions(-)

diff --git a/src/smsutil.c b/src/smsutil.c
index c60b8ec..b001a1d 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -45,6 +45,10 @@
 #define SMS_BACKUP_PATH_DIR SMS_BACKUP_PATH /%s-%i-%i
 #define SMS_BACKUP_PATH_FILE SMS_BACKUP_PATH_DIR /%03i
 
+#define SMS_SR_BACKUP_PATH STORAGEDIR /%s/sms_sr
+#define SMS_SR_BACKUP_PATH_DIR SMS_SR_BACKUP_PATH /%s
+#define SMS_SR_BACKUP_PATH_FILE SMS_SR_BACKUP_PATH_DIR /%i
+
 #define SMS_ADDR_FMT %24[0-9A-F]
 
 static GSList *sms_assembly_add_fragment_backup(struct sms_assembly *assembly,
@@ -2413,7 +2417,7 @@ static void sms_assembly_backup_free(struct sms_assembly 
*assembly,
 {
char *path;
int seq;
-   char straddr[25];
+   DECLARE_SMS_ADDR_STR(straddr);
 
if (!assembly-imsi)
return;
@@ -2642,20 +2646,182 @@ void sms_assembly_expire(struct sms_assembly 
*assembly, time_t before)
}
 }
 
+static void sr_assembly_load_backup(GHashTable *assembly_table,
+   const char *imsi,
+   const struct dirent *addr_dir)
+{
+   char *path;
+   struct dirent **ids;
+   struct sms_address addr;
+   DECLARE_SMS_ADDR_STR(straddr);
+   struct id_table_node *node;
+   GHashTable *id_table;
+   int len;
+   int r;
+   char *assembly_table_key;
+   unsigned int *id_table_key;
+   struct stat segment_stat;
+
+   if (addr_dir-d_type != DT_DIR)
+   return;
+
+   /* Max of SMS address size is 12 bytes, hex encoded */
+   if (sscanf(addr_dir-d_name, SMS_ADDR_FMT, straddr)  1)
+   return;
+
+   if (sms_assembly_extract_address(straddr, addr) == FALSE)
+   return;
+
+   /* Go through different msg_ids. */
+   path = g_strdup_printf(SMS_SR_BACKUP_PATH /%s, imsi,
+   addr_dir-d_name);
+   len = scandir(path, ids, NULL, versionsort);
+
+   g_free(path);
+
+   if (len  0)
+   return;
+
+   id_table = g_hash_table_new_full(g_int_hash, g_int_equal,
+   g_free, g_free);
+
+   assembly_table_key = g_try_malloc(sizeof(addr.address));
+
+   if (assembly_table_key == NULL)
+   return;
+
+   assembly_table_key = g_strdup(sms_address_to_string(addr));
+   g_hash_table_insert(assembly_table, assembly_table_key, id_table);
+
+   while (len--) {
+   path = g_strdup_printf(SMS_SR_BACKUP_PATH /%s/%s,
+   imsi, addr_dir-d_name, ids[len]-d_name);
+
+   node = g_new0(struct id_table_node, 1);
+
+   r = read_file((unsigned char *) node,
+   sizeof(struct id_table_node),
+   SMS_SR_BACKUP_PATH /%s/%s,
+   imsi, addr_dir-d_name, ids[len]-d_name);
+
+   if (r  0) {
+   g_free(path);
+   g_free(ids[len]);
+   g_free(node);
+   continue;
+   }
+
+   r = stat(path, segment_stat);
+
+   if (r != 0) {
+   g_free(path);
+   g_free(ids[len]);
+   g_free(node);
+   continue;
+   }
+
+   /* Node ready, create key and add them to the table */
+   id_table_key = g_new0(unsigned int, 1);
+   *id_table_key = atoi(ids[len]-d_name);
+
+   g_hash_table_insert(id_table, id_table_key, node);
+
+   g_free(path);
+   g_free(ids[len]);
+   }
+   g_free(ids);
+}
+
 struct status_report_assembly *status_report_assembly_new(const char *imsi)
 {
+   char *path;
+   int len;
+   struct dirent **addresses;
struct status_report_assembly *ret =
g_new0(struct status_report_assembly, 1);
 
ret-assembly_table = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, (GDestroyNotify)g_hash_table_destroy);
 
-   if (imsi)
+   if (imsi) {
ret-imsi = imsi;
 
+   /* Restore state from backup */
+   path = g_strdup_printf(SMS_SR_BACKUP_PATH, imsi);
+   len = scandir(path, addresses, NULL, alphasort);
+
+   g_free(path);
+
+   if (len  0)
+   return ret;
+
+   /* Go through different addresses. Each address can relate to
+* 1-n msg_ids.
+*/
+
+   while (len--) {
+   sr_assembly_load_backup(ret-assembly_table, imsi,
+   addresses[len]);
+   

RE: About Connection between PPP and linux Sockets

2010-08-19 Thread Zhang, Zhenhua
Hi Marcel,

Marcel Holtmann wrote:
 Hi Steven,
 
 I have a little question just as the title said?
 In Ofono how to connect PPP to Linux socket, when we receive packet
 from network, how the packet go through the kernel to application?
 
 modem --PPP--? -- linux kernel(network part)-- socket --
 application? 
 
 it is more like this:
 
 modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
 application. 
 
 With the TTY being in kernel, the PPP being in userspace, and TUN/TAP
 etc. begin in the kernel again.
 
 A future enhancement is to use the kernel PPP layer, but we haven't
 gotten there yet.

I am interested to know how could we use kernel PPP layer instead of gatppp. 
Shall we add this item into our TODO?
 
 Regards
 
 Marcel
 
 
 ___
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono

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


Re: About Connection between PPP and linux Sockets

2010-08-19 Thread Steven

Hi Marcel,


I have a little question just as the title said?
In Ofono how to connect PPP to Linux socket, when we receive packet from 
network, how the packet go through the kernel to application?


modem --PPP--? -- linux kernel(network part)-- socket -- application?


it is more like this:

modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket - application.

With the TTY being in kernel, the PPP being in userspace, and TUN/TAP
etc. begin in the kernel again.

A future enhancement is to use the kernel PPP layer, but we haven't
gotten there yet.


I got it, thanks

B.R

Steven
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---

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


RE: About Connection between PPP and linux Sockets

2010-08-19 Thread Marcel Holtmann
Hi Zhenhua,

  I have a little question just as the title said?
  In Ofono how to connect PPP to Linux socket, when we receive packet
  from network, how the packet go through the kernel to application?
  
  modem --PPP--? -- linux kernel(network part)-- socket --
  application? 
  
  it is more like this:
  
  modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
  application. 
  
  With the TTY being in kernel, the PPP being in userspace, and TUN/TAP
  etc. begin in the kernel again.
  
  A future enhancement is to use the kernel PPP layer, but we haven't
  gotten there yet.
 
 I am interested to know how could we use kernel PPP layer instead of gatppp. 
 Shall we add this item into our TODO?

the kernel PPP line discipline can be used and then LCP and IPCP will be
spoken via a side channel to the kernel. And all the packet handling is
done by the kernel itself via the TTY line discipline. It is a bit more
work than just using a TUN/TAP device. And of course it only works in
real TTYs. Not on the GIOChannel that you get from GAtMux.

Regards

Marcel


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


Re: About Connection between PPP and linux Sockets

2010-08-19 Thread Steven

Hi Zhang
Zhang, Zhenhua wrote:

Hi Marcel,

Marcel Holtmann wrote:

Hi Steven,


I have a little question just as the title said?
In Ofono how to connect PPP to Linux socket, when we receive packet
from network, how the packet go through the kernel to application?

modem --PPP--? -- linux kernel(network part)-- socket --
application? 

it is more like this:

modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
application. 


With the TTY being in kernel, the PPP being in userspace, and TUN/TAP
etc. begin in the kernel again.

A future enhancement is to use the kernel PPP layer, but we haven't
gotten there yet.


I am interested to know how could we use kernel PPP layer instead of gatppp. 
Shall we add this item into our TODO?
 


Maybe you can reference to RILD in Android, it used kernel PPP.

B.R

Steven

---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---

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


RE: About Connection between PPP and linux Sockets

2010-08-19 Thread Zhang, Zhenhua
Hi Steven,

Steven wrote:
 Hi Zhang
 Zhang, Zhenhua wrote:
 Hi Marcel,
 
 Marcel Holtmann wrote:
 Hi Steven,
 
 I have a little question just as the title said?
 In Ofono how to connect PPP to Linux socket, when we receive packet
 from network, how the packet go through the kernel to application?
 
 modem --PPP--? -- linux kernel(network part)-- socket --
 application?
 it is more like this:
 
 modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
 application. 
 
 With the TTY being in kernel, the PPP being in userspace, and
 TUN/TAP etc. begin in the kernel again.
 
 A future enhancement is to use the kernel PPP layer, but we haven't
 gotten there yet.
 
 I am interested to know how could we use kernel PPP layer instead of
 gatppp. Shall we add this item into our TODO? 
 
 
 Maybe you can reference to RILD in Android, it used kernel PPP.

Thanks. Will take a look then.
 
 B.R
 
 Steven
 
 ---
 Confidentiality Notice: The information contained in this e-mail and
 any accompanying attachment(s) is intended only for the use of the
 intended recipient and may be confidential and/or privileged of
 Neusoft Corporation, its subsidiaries and/or its affiliates. If any
 reader of this communication is not the intended recipient,
 unauthorized use, forwarding, printing,  storing, disclosure or
 copying is strictly prohibited, and may be unlawful.If you have
 received this communication in error,please immediately notify the
 sender by return e-mail, and delete the original message and all
 copies from your system. Thank you.
 ---
 ___   
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono



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


Re: About Connection between PPP and linux Sockets

2010-08-19 Thread Steven

Hi Zhang,

Zhang, Zhenhua wrote:

Hi Steven,

Steven wrote:

Hi Zhang
Zhang, Zhenhua wrote:

Hi Marcel,

Marcel Holtmann wrote:

Hi Steven,


I have a little question just as the title said?
In Ofono how to connect PPP to Linux socket, when we receive packet
from network, how the packet go through the kernel to application?

modem --PPP--? -- linux kernel(network part)-- socket --
application?

it is more like this:

modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
application. 


With the TTY being in kernel, the PPP being in userspace, and
TUN/TAP etc. begin in the kernel again.

A future enhancement is to use the kernel PPP layer, but we haven't
gotten there yet.

I am interested to know how could we use kernel PPP layer instead of
gatppp. Shall we add this item into our TODO? 


Maybe you can reference to RILD in Android, it used kernel PPP.


Thanks. Will take a look then.


This information is a good start point.
http://www.devdiv.net/viewthread-26543

But only for Chinese people:(

B.R

Steven

---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---

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


RE: About Connection between PPP and linux Sockets

2010-08-19 Thread Zhang, Zhenhua
Hi Steven,

Steven wrote:
 Hi Zhang,
 
 Zhang, Zhenhua wrote:
 Hi Steven,
 
 Steven wrote:
 Hi Zhang
 Zhang, Zhenhua wrote:
 Hi Marcel,
 
 Marcel Holtmann wrote:
 Hi Steven,
 
 I have a little question just as the title said?
 In Ofono how to connect PPP to Linux socket, when we receive
 packet from network, how the packet go through the kernel to
 application? 
 
 modem --PPP--? -- linux kernel(network part)-- socket --
 application?
 it is more like this:
 
 modem - TTY - PPP - TUN/TAP - Kernel Net-Stack - socket -
 application. 
 
 With the TTY being in kernel, the PPP being in userspace, and
 TUN/TAP etc. begin in the kernel again.
 
 A future enhancement is to use the kernel PPP layer, but we
 haven't gotten there yet.
 I am interested to know how could we use kernel PPP layer instead
 of gatppp. Shall we add this item into our TODO?
 
 Maybe you can reference to RILD in Android, it used kernel PPP.
 
 Thanks. Will take a look then.
 
 This information is a good start point.
 http://www.devdiv.net/viewthread-26543
 
 But only for Chinese people:(

Thanks. I have read this before. ;-). The original article is from maxleng's 
blog:

http://blog.csdn.net/maxleng/archive/2010/05/10/5576509.aspx

However, it's just a big picture about phone stack in Android. It said nothing 
about how Android works with kernel PPP layer.

 B.R
 
 Steven
 
 ---
 Confidentiality Notice: The information contained in this e-mail and
 any accompanying attachment(s) is intended only for the use of the
 intended recipient and may be confidential and/or privileged of
 Neusoft Corporation, its subsidiaries and/or its affiliates. If any
 reader of this communication is not the intended recipient,
 unauthorized use, forwarding, printing,  storing, disclosure or
 copying is strictly prohibited, and may be unlawful.If you have
 received this communication in error,please immediately notify the
 sender by return e-mail, and delete the original message and all
 copies from your system. Thank you.
 ---
 ___   
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono

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


[PATCH] udev: Add check for serial before string operation

2010-08-19 Thread Zhenhua Zhang
'serial' could be NULL in some case. So it need to add check before
doing string operation.
---
 plugins/udev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index 84399de..6720a0c 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -86,7 +86,7 @@ static const char *get_serial(struct udev_device *udev_device)
entry = udev_list_entry_get_next(entry);
}
 
-   if (strpbrk(serial, .-_?*) != NULL)
+   if (serial  strpbrk(serial, .-_?*) != NULL)
return NULL;
 
return serial;
-- 
1.7.0.4

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


RE: UIM manager atom APIs review request

2010-08-19 Thread Zhang, Caiwen
Hi Marcel,

 -Original Message-
 From: ofono-boun...@ofono.org [mailto:ofono-boun...@ofono.org] On
 Behalf Of Marcel Holtmann
 Sent: Thursday, August 19, 2010 6:58 PM
 To: ofono@ofono.org
 Subject: RE: UIM manager atom APIs review request
 
 Hi Caiwen,
 
I am going to implement an UIM manager atom for CDMA extension.
 Its
   APIs will be almost the same as
current SIM manger atom's APIs.  But I suggest maybe will can do
  some
   changes:
   
1. Add PIN remain retry count support
2. replace properties 'Present' 'PinRequired' and
 'LockedPins'
   with a new add property 'Status'
   
Properties  string Status [readonly]
   
Contains the string type of the status
of the
  SIM.
The possible values are:
ready - Not waiting for a password
pin - SIM PIN is required
phone - Phone-to-SIM PIN is required
[GSM
  only]
firstphone - Phone-to-very-first SIM
PIN is required
[GSM
  only]
pin2 - SIM PIN2 is required
network - Network Personalization
password is
required  [GSM
only]
netsub - Network subset
personalization
password is
required
  [GSM only]
service - Service Provider
personalization
password is
required
  [GSM only]
corp - Corporate personalization
password
is required
[GSM only]
puk - SIM PUK is required
firstphonepuk - Phone-to-very-first
SIM PUK
 is
required  [GSM
only]
puk2 - SIM PUK2 is required
networkpuk - Network personalization
  unblocking
password is
required
  [GSM only]
netsubpuk - Network subset
personalization
unblocking
password is
  required
   [GSM only]
servicepuk - Service provider
personalization
unblocking
password is
  required
   [GSM only]
corppuk - Corporate personalization
 unblocking
password is
required
  [GSM only]
absent - No SIM inserted
  
   why? What is wrong with the current properties? I like to see this
  from
   the UI point of view (and ConnMan as one user) why we should
change
  it.
  
  Current properties are OK. I think maybe we can improve it.
Generally,
  user
  Only care the SIM status, e.g. whether SIM is insert or need input
  password.
  In fact, He/she doesn't care which Pins are locked. So we can
 simplify
  it.
  replace 'Present' 'PinRequired' with Status and remove
'LockedPins'.
 
  In fact, there is no way to get all the Locked Pins, 'LockedPins'
  property
  Value maybe incorrect.
 
 actually the user and the UI cares about which PIN is locked. It has
to
 tell the user which PIN to enter and how long it is. So that is
 important.
 

Generally, SIM status (I mean +CPIN? Result) will be PIN required at two
cases: 
1. when the modem is power on 
a)PIN lock is enabled. or
b) case 2 has occur Before power off last time and the
password is not reset.

2. When user input wrong password time reach the max count,
required input relatives PUK, 
to reset the password.

In other status, the SIM status is always be 'READY'.

e.g. enable PIN lock

To achieve this, use AT command: +CLCK= SC, 1, PIN 
At this time the SIM status is still be 'READY' 
Even after input PIN error twice. 

Once input PIN incorrect three times the Status changes to PUK required
(case 2 of above case).

That's to say, once the modem is power on. SIM status 
Will always be ready. Except above case 2 occurs. 
When case 1 or 2 occurs, user have to input password, otherwise,
Modem enter function limited mode.

For other cases that user must input password, they are independent on
The SIM status, it is always required. Such as when enable/disable PIN
lock (above example), 
Always require PIN; When Enable/disable FDN (fixed dialing number)
always required input PIN2.

That's to say, when enter password wrong, it doesn't mean it is locked,
it just subtract the retry count 1. When must input password, it not
always due to SIM status
changes to password required case.

array{uint8} PinRetryCount [readonly]
   
 Contains the