Gen2 EzX phones need to open a different set of dlci lines to make BP
finish its initialization. By using the union of the gen1 and gen2 dlci
lines sets, and ignoring errors about invalid lines for a given
generation, we can make init work on both with the same code.

Signed-off-by: Antonio Ospite <osp...@studenti.unina.it>
---
 .../ogsmd/modems/freescale_neptune/modem.py        |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/framework/subsystems/ogsmd/modems/freescale_neptune/modem.py 
b/framework/subsystems/ogsmd/modems/freescale_neptune/modem.py
index 3de8257..f0597ac 100644
--- a/framework/subsystems/ogsmd/modems/freescale_neptune/modem.py
+++ b/framework/subsystems/ogsmd/modems/freescale_neptune/modem.py
@@ -141,19 +141,20 @@ class FreescaleNeptune( AbstractModem ):
         subprocess.check_call(['modprobe', 'ts27010mux'])
 
         N_TS2710 = 19
-        dlci_lines = [0, 1, 2, 3, 4, 5, 6, 7, 8]
+        dlci_lines = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
         devpath  = "/dev/ttyIPC0"
         counter = 10
 
         # Loop when opening /dev/ttyIPC0 to have some tolerance
         ipc = None
         while True:
-            logger.debug("Trying to open %s..." % devpath)
+            logger.debug("Trying to open %s... (%d)" % (devpath, counter))
             counter -= 1
             try:
                 ipc = os.open(devpath, os.O_RDWR)
             except OSError as e:
-                if e.errno == errno.ENODEV:
+                if e.errno == errno.ENODEV and counter > 0:
+                    time.sleep(2)
                     continue
 
             if ipc or counter == 0:
@@ -176,7 +177,7 @@ class FreescaleNeptune( AbstractModem ):
                 fd = os.open(devpath, os.O_RDWR | os.O_NOCTTY)
             except OSError as e:
                 logger.error("%s: %s" % (devpath, e.strerror))
-                return False
+                #return False
 
             logger.debug("Opened %s" % devpath)
             muxfds.append(fd)
-- 
1.7.1


Reply via email to