All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: Handle Refresh if also performed by modem.
@ 2011-02-19 10:00 Andrzej Zaborowski
  2011-02-19 10:00 ` [PATCH] Deduplicate AUTHORS Andrzej Zaborowski
  2011-03-03  5:30 ` [PATCH] stk: Handle Refresh if also performed by modem Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Andrzej Zaborowski @ 2011-02-19 10:00 UTC (permalink / raw)
  To: ofono

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

---
 src/stk.c |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index bc46b2f..c35f457 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1981,6 +1981,7 @@ static void free_idle_mode_text(struct ofono_stk *stk)
 	memset(&stk->idle_mode_icon, 0, sizeof(stk->idle_mode_icon));
 }
 
+/* Note: may be called from ofono_stk_proactive_command_handled_notify */
 static gboolean handle_command_refresh(const struct stk_command *cmd,
 					struct stk_response *rsp,
 					struct ofono_stk *stk)
@@ -2025,7 +2026,8 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
 
 	default:
 		ofono_info("Undefined Refresh qualifier: %d", cmd->qualifier);
-		rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
+		if (rsp != NULL)
+			rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
 		return TRUE;
 	}
 
@@ -2048,11 +2050,18 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
 		sim = __ofono_atom_get_data(sim_atom);
 
 	if (sim == NULL) {
-		rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
+		if (rsp != NULL)
+			rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
 		return TRUE;
 	}
 
-	if (cmd->qualifier < 4) {
+	/*
+	 * For now we can handle the Refresh types that don't require
+	 * a SIM reset except if that part of the task has been already
+	 * handled by modem firmware (indicated by rsp == NULL) in which
+	 * case we just restart our SIM initialisation.
+	 */
+	if (cmd->qualifier < 4 || rsp == NULL) {
 		int qualifier = stk->pending_cmd->qualifier;
 		GSList *file_list = stk->pending_cmd->refresh.file_list;
 
@@ -2062,10 +2071,15 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
 		/*
 		 * Queue the TERMINAL RESPONSE before triggering potential
 		 * file accesses.
+		 *
+		 * TODO: Find out if we need to send the "Refresh performed
+		 * with additional EFs read" response.
 		 */
-		err = stk_respond(stk, rsp, stk_command_cb);
-		if (err)
-			stk_command_cb(&failure, stk);
+		if (rsp != NULL) {
+			err = stk_respond(stk, rsp, stk_command_cb);
+			if (err)
+				stk_command_cb(&failure, stk);
+		}
 
 		/* TODO: use the alphaId / icon */
 		/* TODO: if AID is supplied, check its value */
@@ -2084,6 +2098,9 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
 			break;
 		case 2:
 		case 3:
+		case 4:
+		case 5:
+		case 6:
 			free_idle_mode_text(stk);
 			__ofono_sim_refresh(sim, file_list, FALSE, TRUE);
 			break;
@@ -2779,6 +2796,10 @@ void ofono_stk_proactive_command_handled_notify(struct ofono_stk *stk,
 				&cmd->send_dtmf.text_attr,
 				&cmd->send_dtmf.icon_id);
 		break;
+
+	case STK_COMMAND_TYPE_REFRESH:
+		handle_command_refresh(stk->pending_cmd, NULL, stk);
+		break;
 	}
 
 	stk_command_free(cmd);
-- 
1.7.1.86.g0e460.dirty


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

* [PATCH] Deduplicate AUTHORS.
  2011-02-19 10:00 [PATCH] stk: Handle Refresh if also performed by modem Andrzej Zaborowski
@ 2011-02-19 10:00 ` Andrzej Zaborowski
  2011-02-19 22:06   ` Denis Kenzior
  2011-03-03  5:30 ` [PATCH] stk: Handle Refresh if also performed by modem Denis Kenzior
  1 sibling, 1 reply; 4+ messages in thread
From: Andrzej Zaborowski @ 2011-02-19 10:00 UTC (permalink / raw)
  To: ofono

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

As noted on IRC.
---
 AUTHORS |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index d9f0434..046907a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -46,14 +46,12 @@ Rafael Ignacio Zurita <rafael.zurita@profusion.mobi>
 Helen Clemson <helen.clemson@stericsson.com>
 Jessica Nilsson <jessica.j.nilsson@stericsson.com>
 Oleg Zhurakivskyy <oleg.zhurakivskyy@nokia.com>
-Rafael Ignacio Zurita <rafael.zurita@profusion.mobi>
 Lasse Kunnasluoto <lasse.kunnasluoto@tieto.com>
 John Mathew <john.mathew@elektrobit.com>
 Benoît Monin <benoit.monin@gmx.fr>
 Dara Spieker-Doyle <dara.spieker-doyle@nokia.com>
 Neil Jerram <neil@ossau.uklinux.net>
 Lei Yu <lei.2.yu@nokia.com>
-Lasse Kunnasluoto <lasse.kunnasluoto@tieto.com>
 Oskari Timperi <oskari.timperi@iki.fi>
 Faiyaz Baxamusa <faiyaz.baxamusa@nokia.com>
 Jussi Kangas <jussi.kangas@tieto.com>
-- 
1.7.1.86.g0e460.dirty


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

* Re: [PATCH] Deduplicate AUTHORS.
  2011-02-19 10:00 ` [PATCH] Deduplicate AUTHORS Andrzej Zaborowski
@ 2011-02-19 22:06   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-02-19 22:06 UTC (permalink / raw)
  To: ofono

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

Hi Andrew,

On 02/19/2011 04:00 AM, Andrzej Zaborowski wrote:
> As noted on IRC.
> ---
>  AUTHORS |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

* Re: [PATCH] stk: Handle Refresh if also performed by modem.
  2011-02-19 10:00 [PATCH] stk: Handle Refresh if also performed by modem Andrzej Zaborowski
  2011-02-19 10:00 ` [PATCH] Deduplicate AUTHORS Andrzej Zaborowski
@ 2011-03-03  5:30 ` Denis Kenzior
  1 sibling, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-03-03  5:30 UTC (permalink / raw)
  To: ofono

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

Hi Andrew,

On 02/19/2011 04:00 AM, Andrzej Zaborowski wrote:
> ---
>  src/stk.c |   33 +++++++++++++++++++++++++++------
>  1 files changed, 27 insertions(+), 6 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-03-03  5:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 10:00 [PATCH] stk: Handle Refresh if also performed by modem Andrzej Zaborowski
2011-02-19 10:00 ` [PATCH] Deduplicate AUTHORS Andrzej Zaborowski
2011-02-19 22:06   ` Denis Kenzior
2011-03-03  5:30 ` [PATCH] stk: Handle Refresh if also performed by modem 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.