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

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.