All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems
@ 2011-01-14 14:12 Lasse Kunnasluoto
  2011-01-14 14:20 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Lasse Kunnasluoto @ 2011-01-14 14:12 UTC (permalink / raw)
  To: ofono

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

Fixing issues in USSD quirk:
1) MT USSD are not handled correctly if modem uses IRA character set (change character set to GSM already in probe)
2) Responses from NW to MO USSD are not hadled as internal variable is not updated after cscs= command (Query right after setting)
3) Use the same quirk for STE modems

---
 drivers/atmodem/ussd.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 651b6af..411b1de 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -219,15 +219,6 @@ static void at_ussd_request(struct ofono_ussd *ussd, int dcs,
 				converted, dcs);
 	}
 
-	if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) {
-		/* Ensure that the modem is using GSM character set. It
-		 * seems it defaults to IRA and then umlauts are not
-		 * properly encoded. The modem returns some weird from
-		 * of Latin-1, but it is not really Latin-1 either. */
-		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
-							NULL, NULL, NULL);
-	}
-
 	if (g_at_chat_send(data->chat, buf, cusd_prefix,
 				cusd_request_cb, cbd, g_free) > 0)
 		return;
@@ -314,6 +305,18 @@ static int at_ussd_probe(struct ofono_ussd *ussd, unsigned int vendor,
 
 	ofono_ussd_set_data(ussd, data);
 
+	switch (data->vendor) {
+	case OFONO_VENDOR_QUALCOMM_MSM:
+	case OFONO_VENDOR_STE:
+		/*
+		* Ensure that the modem is using GSM character set. It
+		* seems it defaults to IRA and then umlauts are not
+		* properly encoded. The modem returns some weird from
+		* of Latin-1, but it is not really Latin-1 either.
+		*/
+		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
+							NULL, NULL, NULL);
+		break;
+	}
+
 	g_at_chat_send(chat, "AT+CSCS?", cscs_prefix, read_charset_cb, data,
 			NULL);
 
-- 
1.7.0.4


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

* Re: [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems
  2011-01-14 14:12 [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems Lasse Kunnasluoto
@ 2011-01-14 14:20 ` Marcel Holtmann
  2011-01-17  8:42   ` Lasse Kunnasluoto
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2011-01-14 14:20 UTC (permalink / raw)
  To: ofono

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

Hi Lasse,

> Fixing issues in USSD quirk:
> 1) MT USSD are not handled correctly if modem uses IRA character set (change character set to GSM already in probe)
> 2) Responses from NW to MO USSD are not hadled as internal variable is not updated after cscs= command (Query right after setting)
> 3) Use the same quirk for STE modems

Hi Lasse,

> ---
>  drivers/atmodem/ussd.c |   21 ++++++++++++---------
>  1 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
> index 651b6af..411b1de 100644
> --- a/drivers/atmodem/ussd.c
> +++ b/drivers/atmodem/ussd.c
> @@ -219,15 +219,6 @@ static void at_ussd_request(struct ofono_ussd *ussd, int dcs,
>  				converted, dcs);
>  	}
>  
> -	if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) {
> -		/* Ensure that the modem is using GSM character set. It
> -		 * seems it defaults to IRA and then umlauts are not
> -		 * properly encoded. The modem returns some weird from
> -		 * of Latin-1, but it is not really Latin-1 either. */
> -		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
> -							NULL, NULL, NULL);
> -	}
> -
>  	if (g_at_chat_send(data->chat, buf, cusd_prefix,
>  				cusd_request_cb, cbd, g_free) > 0)
>  		return;
> @@ -314,6 +305,18 @@ static int at_ussd_probe(struct ofono_ussd *ussd, unsigned int vendor,
>  
>  	ofono_ussd_set_data(ussd, data);
>  
> +	switch (data->vendor) {
> +	case OFONO_VENDOR_QUALCOMM_MSM:
> +	case OFONO_VENDOR_STE:
> +		/*
> +		* Ensure that the modem is using GSM character set. It
> +		* seems it defaults to IRA and then umlauts are not
> +		* properly encoded. The modem returns some weird from
> +		* of Latin-1, but it is not really Latin-1 either.
> +		*/
> +		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
> +							NULL, NULL, NULL);
> +		break;
> +	}
> +
>  	g_at_chat_send(chat, "AT+CSCS?", cscs_prefix, read_charset_cb, data,
>  			NULL);
>  

so we don't really wanna do it this way since other atoms like the
phonebook can switch the character sets as well.

The best is if the STE modem would provide access to the USSD in PDU
mode and we can then decode it properly. Using text mode for USSD is not
the best idea actually. Same as text mode for SMS is utterly broken ;)

Regards

Marcel



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

* Re: [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems
  2011-01-14 14:20 ` Marcel Holtmann
@ 2011-01-17  8:42   ` Lasse Kunnasluoto
  2011-01-17 15:58     ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: Lasse Kunnasluoto @ 2011-01-17  8:42 UTC (permalink / raw)
  To: ofono

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

Hi Marcel,

On Fri, 2011-01-14 at 16:20 +0200, Marcel Holtmann wrote:
> Hi Lasse,

> > @@ -314,6 +305,18 @@ static int at_ussd_probe(struct ofono_ussd *ussd, unsigned int vendor,
> >  
> >  	ofono_ussd_set_data(ussd, data);
> >  
> > +	switch (data->vendor) {
> > +	case OFONO_VENDOR_QUALCOMM_MSM:
> > +	case OFONO_VENDOR_STE:
> > +		/*
> > +		* Ensure that the modem is using GSM character set. It
> > +		* seems it defaults to IRA and then umlauts are not
> > +		* properly encoded. The modem returns some weird from
> > +		* of Latin-1, but it is not really Latin-1 either.
> > +		*/
> > +		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
> > +							NULL, NULL, NULL);
> > +		break;
> > +	}
> > +
> >  	g_at_chat_send(chat, "AT+CSCS?", cscs_prefix, read_charset_cb, data,
> >  			NULL);
> >  
> 
> so we don't really wanna do it this way since other atoms like the
> phonebook can switch the character sets as well.
> 
Yes, seems so. If phonebook switches the character set USSD won't get
notified and vice versa. So in general this should be somehow
centralized in ofono.
What about supporting the IRA character set in ofono? It would get us a
bit forward compared to current situation. Currently USSD functionality
is quite broken with AT modems having IRA character set, all strings
sent from NW are ignored in cusd_parse().

> The best is if the STE modem would provide access to the USSD in PDU
> mode and we can then decode it properly. Using text mode for USSD is not
> the best idea actually. Same as text mode for SMS is utterly broken ;)
Don't know if this is possible.

> Regards
> 
> Marcel
> 
> 
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono



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

* Re: [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems
  2011-01-17  8:42   ` Lasse Kunnasluoto
@ 2011-01-17 15:58     ` Denis Kenzior
  2011-01-18 13:17       ` Lasse Kunnasluoto
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2011-01-17 15:58 UTC (permalink / raw)
  To: ofono

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

Hi Lasse,

On 01/17/2011 02:42 AM, Lasse Kunnasluoto wrote:
> Hi Marcel,
> 
> On Fri, 2011-01-14 at 16:20 +0200, Marcel Holtmann wrote:
>> Hi Lasse,
> 
>>> @@ -314,6 +305,18 @@ static int at_ussd_probe(struct ofono_ussd *ussd, unsigned int vendor,
>>>  
>>>  	ofono_ussd_set_data(ussd, data);
>>>  
>>> +	switch (data->vendor) {
>>> +	case OFONO_VENDOR_QUALCOMM_MSM:
>>> +	case OFONO_VENDOR_STE:
>>> +		/*
>>> +		* Ensure that the modem is using GSM character set. It
>>> +		* seems it defaults to IRA and then umlauts are not
>>> +		* properly encoded. The modem returns some weird from
>>> +		* of Latin-1, but it is not really Latin-1 either.
>>> +		*/
>>> +		g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
>>> +							NULL, NULL, NULL);
>>> +		break;
>>> +	}
>>> +
>>>  	g_at_chat_send(chat, "AT+CSCS?", cscs_prefix, read_charset_cb, data,
>>>  			NULL);
>>>  
>>
>> so we don't really wanna do it this way since other atoms like the
>> phonebook can switch the character sets as well.
>>
> Yes, seems so. If phonebook switches the character set USSD won't get
> notified and vice versa. So in general this should be somehow
> centralized in ofono.
> What about supporting the IRA character set in ofono? It would get us a
> bit forward compared to current situation. Currently USSD functionality
> is quite broken with AT modems having IRA character set, all strings
> sent from NW are ignored in cusd_parse().

So in general it is a really bad idea for atoms to switch the character
set, we made the exception for USSD and Phonebook atoms because there's
no other way according to the spec.

Supporting IRA character set is not really an option since IRA and GSM
7bit have disjoint sets of characters.  The best you can really do is:

- If your modem supports UTF8, then set that for all multiplexer
channels in the modem driver.
- Otherwise set the character set to GSM and do your best to put ussd
and phonebook on separate multiplexer channels.  That is of course
assuming that the CSCS setting is handled per channel.

> 
>> The best is if the STE modem would provide access to the USSD in PDU
>> mode and we can then decode it properly. Using text mode for USSD is not
>> the best idea actually. Same as text mode for SMS is utterly broken ;)
> Don't know if this is possible.

USSD PDU mode is the ideal solution.  If this is not available, then you
will have to jump through all kinds of hoops to get this done properly.

Regards,
-Denis

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

* Re: [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems
  2011-01-17 15:58     ` Denis Kenzior
@ 2011-01-18 13:17       ` Lasse Kunnasluoto
  0 siblings, 0 replies; 5+ messages in thread
From: Lasse Kunnasluoto @ 2011-01-18 13:17 UTC (permalink / raw)
  To: ofono

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

Hi Denis,

On Mon, 2011-01-17 at 17:58 +0200, Denis Kenzior wrote:
> Hi Lasse,
> 
> On 01/17/2011 02:42 AM, Lasse Kunnasluoto wrote:
> > Hi Marcel,
> > 
> Supporting IRA character set is not really an option since IRA and GSM
> 7bit have disjoint sets of characters.  The best you can really do is:
> 
> - If your modem supports UTF8, then set that for all multiplexer
> channels in the modem driver.
Yes, it supports UTF8. I'll send a new patch for this. Thanks.

> - Otherwise set the character set to GSM and do your best to put ussd
> and phonebook on separate multiplexer channels.  That is of course
> assuming that the CSCS setting is handled per channel.
> 
> > 
> >> The best is if the STE modem would provide access to the USSD in PDU
> >> mode and we can then decode it properly. Using text mode for USSD is not
> >> the best idea actually. Same as text mode for SMS is utterly broken ;)
> > Don't know if this is possible.
> 
> USSD PDU mode is the ideal solution.  If this is not available, then you
> will have to jump through all kinds of hoops to get this done properly.
> 
> Regards,
> -Denis

-Lasse


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

end of thread, other threads:[~2011-01-18 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 14:12 [PATCH 1/2] atmodem: move USSD quirk to probe and use it also for STE modems Lasse Kunnasluoto
2011-01-14 14:20 ` Marcel Holtmann
2011-01-17  8:42   ` Lasse Kunnasluoto
2011-01-17 15:58     ` Denis Kenzior
2011-01-18 13:17       ` Lasse Kunnasluoto

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.