All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] isimodem/gprs: fix attached_status response
@ 2010-08-26 13:08 Pekka.Pessi
  2010-08-26 15:39 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka.Pessi @ 2010-08-26 13:08 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

From: Pekka Pessi <Pekka.Pessi@nokia.com>

---
 drivers/isimodem/gprs.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/isimodem/gprs.c b/drivers/isimodem/gprs.c
index 3f79972..7c6a806 100644
--- a/drivers/isimodem/gprs.c
+++ b/drivers/isimodem/gprs.c
@@ -41,6 +41,16 @@
 #include "gpds.h"
 #include "debug.h"
 
+/* 27.007 Section 10.1.20 <stat> */
+enum network_registration_status {
+	GPRS_STAT_NOT_REGISTERED = 0,
+	GPRS_STAT_REGISTERED = 1,
+	GPRS_STAT_SEARCHING = 2,
+	GPRS_STAT_DENIED = 3,
+	GPRS_STAT_UNKNOWN = 4,
+	GPRS_STAT_ROAMING = 5
+};
+
 struct gprs_data {
 	GIsiClient *client;
 };
@@ -252,6 +262,7 @@ static gboolean status_resp_cb(GIsiClient *client,
 	const unsigned char *msg = data;
 	struct isi_cb_data *cbd = opaque;
 	ofono_gprs_status_cb_t cb = cbd->cb;
+	int status;
 
 	if (!msg) {
 		DBG("ISI client error: %d", g_isi_client_error(client));
@@ -263,9 +274,18 @@ static gboolean status_resp_cb(GIsiClient *client,
 
 	/* FIXME: the core still expects reg status, and not a boolean
 	 * attached status here.*/
+	switch (msg[1]) {
+	case GPDS_ATTACHED:
+		status = GPRS_STAT_REGISTERED;
+		break;
+	case GPDS_DETACHED:
+		status = GPRS_STAT_NOT_REGISTERED;
+		break;
+	default:
+		status = GPRS_STAT_UNKNOWN;
+	}
 
-	/* CALLBACK_WITH_SUCCESS(cb, msg[1] == GPDS_ATTACHED, cbd->data); */
-	CALLBACK_WITH_SUCCESS(cb, 1, cbd->data);
+	CALLBACK_WITH_SUCCESS(cb, status, cbd->data);
 
 	goto out;
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] isimodem/gprs: fix attached_status response
  2010-08-26 13:08 [PATCH] isimodem/gprs: fix attached_status response Pekka.Pessi
@ 2010-08-26 15:39 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-08-26 15:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

Hi Pekka,

On 08/26/2010 08:08 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> ---

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-26 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-26 13:08 [PATCH] isimodem/gprs: fix attached_status response Pekka.Pessi
2010-08-26 15:39 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.