Repository navigation
ModemManager: read 5G SA registration reported with two-digit AcT - #12
Merged
Merged
Conversation
After a replug on a 5G SA network the FM350-GL registered on NR, but ModemManager stayed at 'searching' until the registration was polled by hand. The module reports 5GS registration through +CREG/+CGREG/+CEREG with AcT 11, and every one of ModemManager's patterns that captures an AcT field accepts one digit only. The searching answers (AcT 0) parse, the registered ones match nothing, the URCs are dropped, and no periodic registration check runs while unsolicited reports are enabled. Patch 0004 accepts one or more digits there and adds replay tests that fail without it. The same change applies to upstream main, where it is not filed yet. The docs record it as a fork carry next to the FM350-GL series, and the static patch contract keeps it in the series.
Accepting any number of AcT digits let a padded cell id or an unquoted RAC pass for an AcT. "+CGREG: 2,05,000B,0011,3" as a URC and "+CGREG: 1,0005,2816,3,11" as a response then changed state and access technology, depending on which pattern the AT port tried first. Patch 0004 now accepts only the unpadded values 10 to 13, and pattern 7 takes a two-digit AcT only after an unpadded <stat>. The tests run each line in forward order and in the reverse order the AT port tries URC handlers, and cover both layouts. The +CREG/+CGREG <lac> is read as a TAC on NR, so the three reports agree on the location. The patch header uses a plain "Forwarded: no". POLICY records the release-line waiver in both sections, and the ADR says which parts of the field diagnosis are inferred.
A padded <stat> still let a two-digit field pass for an AcT: "+CGREG: 2,05,000B,11,3" as a URC read the cell id as AcT 11, and "+CEREG: 2,01,"1F00",...,11" read the padded <stat> as a TAC. In patterns 5, 9 and 10 the field after <stat> must now not be a (padded) digit, and in pattern 7 the <ci> must not be a value 0 to 13; pattern 7 accepts a padded <stat> again. Both lines are in the collision test. Over the existing test strings and a generated set of about 52,000 +CREG/+CGREG/+CEREG lines, parsed as response and as URC in both orders, no line that parsed before changes its result. The ADR now says the registration is re-read only by event-driven checks, of which a registration attempt and the location check are two.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes ModemManager read a 5G standalone registration that the FM350-GL reports in
+CREG,+CGREGand+CEREG. Today, when the module registers on NR after ModemManager's first registration check (for example after a replug), ModemManager keeps showingsearchingand never connects until someone runsmmcli -m <n> --3gpp-register-homeby hand.What it adds:
0004for ModemManager 1.24.2: the six+CREG/+CGREG/+CEREGpatterns that capture an AcT field accept the 27.007 values 10 to 13 (5G core and NR), unpadded, where the line has no competing reading, and nothing else new. The+CREG/+CGREG<lac>is read as a TAC on NR.src/tests/test-modem-helpers.cwith the module's line layouts, two replayed sequences (searching then registered by polling, and by URCs only), and five layouts a looser pattern misreads. Each runs in forward order and in the reverse order the AT port tries URC handlers.ci/test-fm350-patch-contract.shthat keeps the patch in the series, and doc updates (ADR section 2.4, a release-line waiver in POLICY, packaging README, suite adaptations).How: the module answers
+CEREG: 2,2,"FFFF","0FFFFFFF",0while searching and+CEREG: 2,1,"<tac>","<nr cell id>",11once registered. ModemManager's patterns only take one AcT digit, so the searching lines parse and the registered ones match nothing, URCs included. Only 10 to 13 are added, and only where the line can't also be read in another layout. The AT port tries URC patterns in reverse order and responses in forward order, so otherwise a padded<stat>, a two-digit cell id or an unquoted RAC can pass for an AcT. In patterns 5, 9 and 10 the field after<stat>must not be a padded digit, and in pattern 7 the cell id must not be 0 to 13. Periodic registration checks only run when unsolicited reports can't be enabled, so nothing polls again and the state stays atsearching. The solicited+CGREGwith its trailing RAC happens to fall through to a six-field pattern that takes any AcT, which is why one manual register request fixes it. The fix is in the generic parser rather than the plugin because any modem that reports AcT 10 to 13 there hits the same thing, and upstream main has the same one-digit patterns.Validation and limits
patch -p1to the pinned orig tarball (sha256 matchesupstream-pins.yaml): build,meson test30 of 30 suites pass,test-modem-helpers214 of 214.[0-9]+AcT (the first version of this PR) the collision test fails; with this version all pass.+CREG/+CGREG/+CEREGlines (padded and unpadded fields, 4 to 6 fields), each parsed as response and as URC in both orders (206,552 parses): no line that parsed before changes its result, the order-dependent lines are the same set as before, and every newly parsed line carries an unpadded 10 to 13.packaging/ci/contract.shindebian:trixie: passes. The contract check fails when the series line is dropped or a pattern loses the 10 to 13 capture or takes an open-ended number.81600.0000.00.29.18.01; TAC and cell id values in the tests are synthetic. No URC from this module was captured, so the URC sequence is built from the recorded answers in their 27.007 unsolicited form; the parser defect is confirmed, the field timeline is inferred.+C5GREGstays unused for this module: 1.24.2 enables only+CREG/+CGREG/+CEREGreports, and the module lists no 5G mode inAT+WS46=?. The firmware mirrors 5GS registration into the legacy reports, so that's not needed for this fix.+osbrebuild comes after review.