• D
    tty: n_gsm: fix wrong signal octets encoding in MSC · 317f86af
    Daniel Starke 提交于
    n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
    See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
    The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to
    the newer 27.010 here. The value of the modem status command (MSC) frame
    contains an address field, control signal and optional break signal octet.
    The address field is encoded as described in chapter 5.2.1.2 with only one
    octet (may be extended to more in future versions of the standard). Whereas
    the control signal and break signal octet are always one byte each. This is
    strange at first glance as it makes the EA bit redundant. However, the same
    two octets are also encoded as header in convergence layer type 2 as
    described in chapter 5.5.2. No header length field is given and the only
    way to test if there is an optional break signal octet is via the EA flag
    which extends the control signal octet with a break signal octet. Now it
    becomes obvious how the EA bit for those two octets shall be encoded in the
    MSC frame. The current implementation treats the signal octet different for
    MSC frame and convergence layer type 2 header even though the standard
    describes it for both in the same way.
    Use the EA bit to encode the signal octets not only in the convergence
    layer type 2 header but also in the MSC frame in the same way with either
    1 or 2 bytes in case of an optional break signal. Adjust the receiving path
    accordingly in gsm_control_modem().
    
    Fixes: 3ac06b90 ("tty: n_gsm: Fix for modems with brk in modem status control")
    Cc: stable@vger.kernel.org
    Signed-off-by: NDaniel Starke <daniel.starke@siemens.com>
    Link: https://lore.kernel.org/r/20220414094225.4527-13-daniel.starke@siemens.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    317f86af
n_gsm.c 81.5 KB