All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Set MNC length to 2 if EFad doesn't specify it
@ 2012-09-13  8:44 Jonas Bonn
  2012-10-31 20:09 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Bonn @ 2012-09-13  8:44 UTC (permalink / raw)
  To: ofono

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

Byte 4 of the EFAD structure, which specifies the MNC length, is optional.
If this byte is not present, then there is no way to determine the length
of the MNC.  As the, by far, most common length is 2, we might as well
default to this value.

This patch changes the ofono_error to a warning as it's not really an
error that we're encountering, but the user should nonetheless be given
a heads-up that something might not work as expected.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
 src/sim.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sim.c b/src/sim.c
index 4384eb0..f6109c6 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1760,7 +1760,9 @@ static void sim_ad_read_cb(int ok, int length, int record,
 		return;
 
 	if (length < 4) {
-		ofono_error("EFad should contain@least four bytes");
+		ofono_warn("EFad does not specify (optional) MNC length"
+			   ", defaulting to 2");
+		sim->mnc_length = 2;
 		return;
 	}
 
-- 
1.7.9.5


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

* Re: [PATCH 1/1] Set MNC length to 2 if EFad doesn't specify it
  2012-09-13  8:44 [PATCH 1/1] Set MNC length to 2 if EFad doesn't specify it Jonas Bonn
@ 2012-10-31 20:09 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2012-10-31 20:09 UTC (permalink / raw)
  To: ofono

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

Hi Jonas,

On 09/13/2012 03:44 AM, Jonas Bonn wrote:
> Byte 4 of the EFAD structure, which specifies the MNC length, is optional.
> If this byte is not present, then there is no way to determine the length
> of the MNC.  As the, by far, most common length is 2, we might as well
> default to this value.

Depends on the continent.  On some it is not common at all.

>
> This patch changes the ofono_error to a warning as it's not really an
> error that we're encountering, but the user should nonetheless be given
> a heads-up that something might not work as expected.

What spec are you reading? 31.102 says it is mandatory ;)

>
> Signed-off-by: Jonas Bonn<jonas@southpole.se>

We do not use Signed-off-by here.

> ---
>   src/sim.c |    4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/sim.c b/src/sim.c
> index 4384eb0..f6109c6 100644
> --- a/src/sim.c
> +++ b/src/sim.c
> @@ -1760,7 +1760,9 @@ static void sim_ad_read_cb(int ok, int length, int record,
>   		return;
>
>   	if (length<  4) {
> -		ofono_error("EFad should contain at least four bytes");
> +		ofono_warn("EFad does not specify (optional) MNC length"
> +			   ", defaulting to 2");
> +		sim->mnc_length = 2;

And I'd rather not do this.  If mnc_length is unable to be determined, 
then oFono does not guess, but simply does not provide this information. 
  This hack might work for really old 2G devices which did not 
understand length 3 MNCs and always assumed length 2, but that is not 
really oFono's target.

>   		return;
>   	}
>

Regards,
-Denis

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

end of thread, other threads:[~2012-10-31 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13  8:44 [PATCH 1/1] Set MNC length to 2 if EFad doesn't specify it Jonas Bonn
2012-10-31 20:09 ` 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.