Message ID | 20240425115744.274891-1-martin@geanix.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d42aad3e9553cc11377b9b7cf8ac505382fd2204 |
Headers | show |
Series | atmodem: fix detection of ATD*99 for non-muxed serial ports | expand |
Hello: This patch was applied to ofono.git (master) by Denis Kenzior <denkenz@gmail.com>: On Thu, 25 Apr 2024 13:57:43 +0200 you wrote: > The gprs context probe function has logic to detect whether CGDATA is > supported by the modem, or if ATD*99 should be used instead. However, it > seems like this logic was wrongly placed after registering for CGEV > notification, which did an early return in case the passed chat did not > have a slave. > > Thus the ATD*99 detection was skipped for USB modems using separate > "virtual" serial ports for command and data channels (i.e. ttyUSB0 for > AT and ttyUSB1 for PPP). > > [...] Here is the summary with links: - atmodem: fix detection of ATD*99 for non-muxed serial ports https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=d42aad3e9553 You are awesome, thank you!
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c index d92b6392..bfe6ae56 100644 --- a/drivers/atmodem/gprs-context.c +++ b/drivers/atmodem/gprs-context.c @@ -458,10 +458,6 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc, ofono_gprs_context_set_data(gc, gcd); - chat = g_at_chat_get_slave(gcd->chat); - if (chat == NULL) - return 0; - switch (vendor) { case OFONO_VENDOR_SIMCOM_SIM900: gcd->use_atd99 = FALSE; @@ -471,7 +467,10 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc, at_cgdata_test_cb, gc, NULL); } - g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL); + chat = g_at_chat_get_slave(gcd->chat); + if (chat) + g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, + NULL); return 0; }