From cabf53179eb0c660ff3bdfb765645a3d0f88530d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Apr 2013 14:44:57 -0500 Subject: [PATCH] sierra: handle probing ERROR response better The USB305 (Icera-based) apparently has a port that replies to everything with ERROR, and that port is unusable. Make sure it's ignored, otherwise MM may claim it as the primary AT port since it technically speaks AT. --- plugins/sierra/mm-plugin-sierra.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/sierra/mm-plugin-sierra.c b/plugins/sierra/mm-plugin-sierra.c index fc39b76e..76ae323e 100644 --- a/plugins/sierra/mm-plugin-sierra.c +++ b/plugins/sierra/mm-plugin-sierra.c @@ -96,6 +96,13 @@ gcap_ready (MMAtSerialPort *port, mm_port_probe_set_result_at (ctx->probe, FALSE); ctx->retries = 0; } + /* Some Icera-based devices (eg, USB305) have an AT-style port that + * replies to everything with ERROR, so tag as unsupported; sometimes + * the real AT ports do this too, so let a retry tag the port as + * supported if it responds correctly later. */ + else if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN)) { + mm_port_probe_set_result_at (ctx->probe, FALSE); + } /* Just retry... */ sierra_custom_init_step (ctx);