The log from my previous message clearly shows that the problem is that the modem stopped escaping control characters (<0x20) with 0x7d when phase 2 had begun. Apparently pppd is ok with this behaviour. Am going to compare the HLDC frame parsers in pppd and ofono. Is it a modem bug or an ofono missing feature? Any help will be appreciated.
I have found the problem. ofono does not apply ACCM, which is proposed by the DCE in a configuration request. The EC200 Quectel modem uses ACCM = 0x00000000 in the authentication phase and ofono ACK such configuration but does not apply configuration options. That is why ofono silently drops some frames from the DCE in phase 2 and does not answer to packets because the FCS (CRC) of packets does not match the value calculated by ofono. I have sent a patch, which solves the problem.
I am concerned about two things:
1. Did I choose the right place to insert the configuration options application code?
2. ACCM is for asynchronous links only. Does ofono support other links? If so we must check the link type before applying the ACCM configuration option as suggested in RFC 1812