All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric BOUXIROT <eric.bouxirot@azimut-monitoring.com>
To: ofono@ofono.org
Subject: Re: problem sim status
Date: Thu, 27 Mar 2014 23:14:33 +0100	[thread overview]
Message-ID: <lh27sl$bdg$1@ger.gmane.org> (raw)
In-Reply-To: <lh25hi$f72$1@ger.gmane.org>

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

> for thoses interested, i will send my patch in next minutes. (let me make it 
> clean)

this make an SL8083 Sierra modem to work with ofono. i mean that do not 
change anything for others modems.

diff -uprN a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
--- a/drivers/atmodem/sim.c	2013-11-08 08:37:52.000000000 +0100
+++ b/drivers/atmodem/sim.c	2014-03-27 22:28:58.000000000 +0100
@@ -1254,6 +1254,7 @@ static void at_pin_send_cb(gboolean ok,
 	case OFONO_VENDOR_ALCATEL:
 	case OFONO_VENDOR_HUAWEI:
 	case OFONO_VENDOR_SIMCOM:
+	case OFONO_VENDOR_SIERRA:
 		/*
 		 * On ZTE modems, after pin is entered, SIM state is checked
 		 * by polling CPIN as their modem doesn't provide unsolicited
diff -uprN a/plugins/sierra.c b/plugins/sierra.c
--- a/plugins/sierra.c	2013-11-08 08:37:52.000000000 +0100
+++ b/plugins/sierra.c	2014-03-27 23:00:59.872241558 +0100
@@ -48,6 +48,7 @@ static const char *none_prefix[] = { NUL

 struct sierra_data {
 	GAtChat *modem;
+	struct at_util_sim_state_query *sim_state_query;
 };

 static void sierra_debug(const char *str, void *user_data)
@@ -119,6 +120,17 @@ static GAtChat *open_device(struct ofono
 	return chat;
 }

+static void sim_state_cb(gboolean present, gpointer user_data)
+{
+	struct ofono_modem *modem = user_data;
+	struct sierra_data *data = ofono_modem_get_data(modem);
+
+	at_util_sim_state_query_free(data->sim_state_query);
+	data->sim_state_query = NULL;
+
+	ofono_modem_set_powered(modem, TRUE);
+}
+
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer 
user_data)
 {
 	struct ofono_modem *modem = user_data;
@@ -129,9 +141,13 @@ static void cfun_enable(gboolean ok, GAt
 	if (!ok) {
 		g_at_chat_unref(data->modem);
 		data->modem = NULL;
+
+		ofono_modem_set_powered(modem, FALSE);
 	}

-	ofono_modem_set_powered(modem, ok);
+	data->sim_state_query = at_util_sim_state_query_new(data->modem,
+						2, 20, sim_state_cb, modem,
+						NULL);
 }

 static int sierra_enable(struct ofono_modem *modem)


  reply	other threads:[~2014-03-27 22:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 18:55 problem sim status Eric BOUXIROT
2014-03-27 20:05 ` Denis Kenzior
2014-03-27 20:21   ` Eric BOUXIROT
2014-03-27 20:30     ` Denis Kenzior
2014-03-27 21:34       ` Eric BOUXIROT
2014-03-27 22:14         ` Eric BOUXIROT [this message]
2014-03-28 17:27       ` Eric BOUXIROT
2014-03-28 17:31         ` Eric BOUXIROT
2014-03-28 20:54         ` Denis Kenzior
2014-03-29 13:35           ` Eric BOUXIROT
2014-03-31 15:30             ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='lh27sl$bdg$1@ger.gmane.org' \
    --to=eric.bouxirot@azimut-monitoring.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.