laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21798 )

Change subject: osmo_e1f.c: Fix CRC4 insertion
......................................................................

osmo_e1f.c: Fix CRC4 insertion

When encoding the CRC bit for Frame number 0 and 8 in the multiframe,
we must first move the CRC4 into those of the last SMF.

Change-Id: I088741fc4528f33b3b989ada0e21957456deedb6
---
M software/obsolete/osmo_e1f.c
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/software/obsolete/osmo_e1f.c b/software/obsolete/osmo_e1f.c
index cbcd0db..a4cadb2 100644
--- a/software/obsolete/osmo_e1f.c
+++ b/software/obsolete/osmo_e1f.c
@@ -208,6 +208,12 @@
 {
        uint8_t ret = 0;
 
+       /* re-set CRC4 at start of sub-multiframe */
+       if (e1i->tx.frame_nr == 0 || e1i->tx.frame_nr == 8) {
+               e1i->tx.crc4_last_smf = e1i->tx.crc4;
+               e1i->tx.crc4 = 0;
+       }
+
        /* according to Table 5B/G.704 - CRC-4 multiframe structure */
        if ((e1i->tx.frame_nr % 2) == 0) {
                /* FAS */
@@ -236,12 +242,6 @@
                        ret |= 0x20;
        }

-       /* re-set CRC4 at start of sub-multiframe */
-       if (e1i->tx.frame_nr == 0 || e1i->tx.frame_nr == 8) {
-               e1i->tx.crc4_last_smf = e1i->tx.crc4;
-               e1i->tx.crc4 = 0;
-       }
-
        /* increment frame number modulo 16 */
        e1i->tx.frame_nr = (e1i->tx.frame_nr + 1) % 16;


--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21798
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I088741fc4528f33b3b989ada0e21957456deedb6
Gerrit-Change-Number: 21798
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to