All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xmm7modem: enabling simtoolkit in modem driver
@ 2019-05-15 11:10 Antara Borwankar
  2019-05-16 15:49 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Antara Borwankar @ 2019-05-15 11:10 UTC (permalink / raw)
  To: ofono

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

handled enabling of stk for xmm7modem vendor in atmodem
driver.
---
 drivers/atmodem/stk.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/atmodem/stk.c b/drivers/atmodem/stk.c
index f0dc5c0..43ae953 100644
--- a/drivers/atmodem/stk.c
+++ b/drivers/atmodem/stk.c
@@ -191,6 +191,19 @@ static gboolean at_stk_register(gpointer user)
 		g_at_chat_register(sd->chat, "*HCMD:", phonesim_hcmd_notify,
 						FALSE, stk, NULL);
 
+	if (sd->vendor == OFONO_VENDOR_XMM) {
+		/*	enabling stk	*/
+		g_at_chat_send(sd->chat, "AT+CFUN=6", none_prefix,
+						NULL, NULL, NULL);
+		/*	Here ofono has missed stk menu proactive command
+		 *	that comes after sim initialization only. Doing a
+		 *	sim reset will enable the stk driver to get the 
+		 *	missed +CUSATP notifications.
+		 */
+		g_at_chat_send(sd->chat, "AT+CFUN=27,1", none_prefix,
+						NULL, NULL, NULL);
+	}
+
 	ofono_stk_register(stk);
 
 	return FALSE;
-- 
1.9.1


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

* Re: [PATCH 1/2] xmm7modem: enabling simtoolkit in modem driver
  2019-05-15 11:10 [PATCH 1/2] xmm7modem: enabling simtoolkit in modem driver Antara Borwankar
@ 2019-05-16 15:49 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2019-05-16 15:49 UTC (permalink / raw)
  To: ofono

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

Hi Antara,

On 05/15/2019 06:10 AM, Antara Borwankar wrote:
> handled enabling of stk for xmm7modem vendor in atmodem
> driver.
> ---
>   drivers/atmodem/stk.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/atmodem/stk.c b/drivers/atmodem/stk.c
> index f0dc5c0..43ae953 100644
> --- a/drivers/atmodem/stk.c
> +++ b/drivers/atmodem/stk.c
> @@ -191,6 +191,19 @@ static gboolean at_stk_register(gpointer user)
>   		g_at_chat_register(sd->chat, "*HCMD:", phonesim_hcmd_notify,
>   						FALSE, stk, NULL);
>   
> +	if (sd->vendor == OFONO_VENDOR_XMM) {
> +		/*	enabling stk	*/
> +		g_at_chat_send(sd->chat, "AT+CFUN=6", none_prefix,
> +						NULL, NULL, NULL);
> +		/*	Here ofono has missed stk menu proactive command
> +		 *	that comes after sim initialization only. Doing a
> +		 *	sim reset will enable the stk driver to get the
> +		 *	missed +CUSATP notifications.
> +		 */

This seems really dangerous.  STK is created in post_sim, e.g. after the 
SIM has been detected and initialized.  What happens if you reset it and 
the PIN is locked, etc?  E.g. wouldn't the SIM PIN be needed again?

Would it make more sense to perform a SIM reset as part of the .enable() 
operation?

> +		g_at_chat_send(sd->chat, "AT+CFUN=27,1", none_prefix,
> +						NULL, NULL, NULL);
> +	}
> +
>   	ofono_stk_register(stk);
>   
>   	return FALSE;
> 

Regards,
-Denis

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

end of thread, other threads:[~2019-05-16 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 11:10 [PATCH 1/2] xmm7modem: enabling simtoolkit in modem driver Antara Borwankar
2019-05-16 15:49 ` 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.