<p>fixeria <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/14593">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx/trx_if.c: introduce TRXD header version 0x01 support<br><br>The new version adds the following fields to the TRX2L1 message,<br>keeping the L12TRX message unchanged:<br><br>  +------+-----+-----+-----+--------------------+<br>  | RSSI | ToA | MTS | C/I | soft-bits (254..0) |<br>  +------+-----+-----+-----+--------------------+<br><br>  - MTS (1 octet)  - Modulation and Training Sequence info, and<br>  - C/I (2 octets) - Carrier-to-Interference ratio (big endian).<br><br>== Coding of MTS: Modulation and Training Sequence info<br><br>3GPP TS 45.002 version 15.1.0 defines several modulation types,<br>and a few sets of training sequences for each type. The most<br>common are GMSK and 8-PSK (which is used in EDGE).<br><br>  +-----------------+---------------------------------------+<br>  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |<br>  +-----------------+---------------------------------------+<br>  | . . . . . X X X | Training Sequence Code (0..7)         |<br>  +-----------------+---------------------------------------+<br>  | . X X X X . . . | Modulation, TS set number (see below) |<br>  +-----------------+---------------------------------------+<br>  | X . . . . . . . | IDLE / nope frame indication (0 or 1) |<br>  +-----------------+---------------------------------------+<br><br>The bit number 7 (MSB) is set to high when either nothing has been<br>detected, or during IDLE frames, so we can deliver noise levels,<br>and avoid clock gaps on the L1 side. Other bits are ignored,<br>and should be set to low (0) in this case.<br><br>== Coding of modulation and TS set number<br><br>GMSK has 4 sets of training sequences (see tables 5.2.3a-d),<br>while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets.<br>Access and Synchronization bursts also have several synch.<br>sequences.<br><br>  +-----------------+---------------------------------------+<br>  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |<br>  +-----------------+---------------------------------------+<br>  | . 0 0 X X . . . | GMSK, 4 TS sets (0..3)                |<br>  +-----------------+---------------------------------------+<br>  | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1)               |<br>  +-----------------+---------------------------------------+<br>  | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1)               |<br>  +-----------------+---------------------------------------+<br>  | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1)               |<br>  +-----------------+---------------------------------------+<br>  | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1)               |<br>  +-----------------+---------------------------------------+<br>  | . 1 1 1 X . . . | RESERVED (0)                          |<br>  +-----------------+---------------------------------------+<br><br>== C/I: Carrier-to-Interference ratio<br><br>The C/I value is computed from the training sequence of each burst,<br>where we can compare the "ideal" training sequence with the actual<br>training sequence, and then express that difference in centiBels.<br><br>== Limitations<br><br>  - The only supported modulation types are GMSK and 8-PSK.<br>    Messages with other modulation types will be rejected.<br><br>  - IDLE / NOPE indications are not (yet) handled.<br><br>  - The logical channel handlers do not (yet) handle optional<br>    fields, such as TSC and C/I. This will be implemented<br>    in the follow-up changes.<br><br>Change-Id: If61c71d20d590bf07bfd019afb33000a0b6135bd<br>Related: OS#4006<br>---<br>M include/osmo-bts/scheduler.h<br>M src/osmo-bts-trx/trx_if.c<br>2 files changed, 183 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h</span><br><span>index 9748d45..4f40636 100644</span><br><span>--- a/include/osmo-bts/scheduler.h</span><br><span>+++ b/include/osmo-bts/scheduler.h</span><br><span>@@ -227,14 +227,28 @@</span><br><span> bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink);</span><br><span> extern const struct trx_sched_multiframe trx_sched_multiframes[];</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#define TRX_BI_F_NOPE_IND      (1 << 0)</span><br><span style="color: hsl(120, 100%, 40%);">+#define TRX_BI_F_MOD_TYPE       (1 << 1)</span><br><span style="color: hsl(120, 100%, 40%);">+#define TRX_BI_F_TS_INFO        (1 << 2)</span><br><span style="color: hsl(120, 100%, 40%);">+#define TRX_BI_F_CI_CB          (1 << 3)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! UL burst indication with the corresponding meta info */</span><br><span> struct trx_ul_burst_ind {</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Field presence bitmask (see TRX_BI_F_*) */</span><br><span style="color: hsl(120, 100%, 40%);">+ uint8_t flags;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     /* Mandatory fields */</span><br><span>       uint32_t fn;            /*!< TDMA frame number */</span><br><span>         uint8_t tn;             /*!< TDMA time-slot number */</span><br><span>     int16_t toa256;         /*!< Timing of Arrival in units of 1/256 of symbol */</span><br><span>     int8_t rssi;            /*!< Received Signal Strength Indication */</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    /* Optional fields (defined by flags) */</span><br><span style="color: hsl(120, 100%, 40%);">+      enum trx_burst_type bt; /*!< Modulation type */</span><br><span style="color: hsl(120, 100%, 40%);">+    uint8_t tsc_set;        /*!< Training Sequence Set */</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t tsc;            /*!< Training Sequence Code */</span><br><span style="color: hsl(120, 100%, 40%);">+     int16_t ci_cb;          /*!< Carrier-to-Interference ratio (in centiBels) */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    /*! Burst soft-bits buffer */</span><br><span>        sbit_t burst[EGPRS_BURST_LEN];</span><br><span>       size_t burst_len;</span><br><span>diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c</span><br><span>index a164f17..f2e8b90 100644</span><br><span>--- a/src/osmo-bts-trx/trx_if.c</span><br><span>+++ b/src/osmo-bts-trx/trx_if.c</span><br><span>@@ -593,6 +593,8 @@</span><br><span> #define TRX_CHDR_LEN                (1 + 4)</span><br><span> /* Uplink v0 header length: 1 RSSI + 2 ToA256 */</span><br><span> #define TRX_UL_V0HDR_LEN (TRX_CHDR_LEN + 1 + 2)</span><br><span style="color: hsl(120, 100%, 40%);">+/* Uplink v1 header length: + 1 MTS + 2 C/I */</span><br><span style="color: hsl(120, 100%, 40%);">+#define TRX_UL_V1HDR_LEN        (TRX_UL_V0HDR_LEN + 1 + 2)</span><br><span> </span><br><span> /* TRXD header dissector for version 0 */</span><br><span> static int trx_data_handle_hdr_v0(struct trx_l1h *l1h,</span><br><span>@@ -621,6 +623,64 @@</span><br><span>         return TRX_UL_V0HDR_LEN;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* TRXD header dissector for version 0x01 */</span><br><span style="color: hsl(120, 100%, 40%);">+static int trx_data_handle_hdr_v1(struct trx_l1h *l1h,</span><br><span style="color: hsl(120, 100%, 40%);">+                                 struct trx_ul_burst_ind *bi,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  const uint8_t *buf, size_t buf_len)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t mts;</span><br><span style="color: hsl(120, 100%, 40%);">+  int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Make sure we have enough data */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (buf_len < TRX_UL_V1HDR_LEN) {</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                   "Short read on TRXD, missing version 1 header "</span><br><span style="color: hsl(120, 100%, 40%);">+                     "(len=%zu vs expected %d)\n", buf_len, TRX_UL_V1HDR_LEN);</span><br><span style="color: hsl(120, 100%, 40%);">+           return -EIO;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Parse v0 specific part */</span><br><span style="color: hsl(120, 100%, 40%);">+  rc = trx_data_handle_hdr_v0(l1h, bi, buf, buf_len);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (rc < 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                return rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Move closer to the v1 specific part */</span><br><span style="color: hsl(120, 100%, 40%);">+     buf_len -= rc;</span><br><span style="color: hsl(120, 100%, 40%);">+        buf += rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* IDLE / NOPE frame indication */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (buf[0] & (1 << 7)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            bi->flags |= TRX_BI_F_NOPE_IND;</span><br><span style="color: hsl(120, 100%, 40%);">+            return TRX_UL_V1HDR_LEN;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Modulation info and TSC set */</span><br><span style="color: hsl(120, 100%, 40%);">+     mts = (buf[0] >> 3) & 0b1111;</span><br><span style="color: hsl(120, 100%, 40%);">+       if ((mts & 0b1100) == 0x00) {</span><br><span style="color: hsl(120, 100%, 40%);">+             bi->bt = TRX_BURST_GMSK;</span><br><span style="color: hsl(120, 100%, 40%);">+           bi->tsc_set = mts & 0b11;</span><br><span style="color: hsl(120, 100%, 40%);">+              bi->flags |= TRX_BI_F_MOD_TYPE;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else if ((mts & 0b0100) == 0b0100) {</span><br><span style="color: hsl(120, 100%, 40%);">+            bi->bt = TRX_BURST_8PSK;</span><br><span style="color: hsl(120, 100%, 40%);">+           bi->tsc_set = mts & 0b1;</span><br><span style="color: hsl(120, 100%, 40%);">+               bi->flags |= TRX_BI_F_MOD_TYPE;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                   "Indicated modulation 0x%02x is not supported\n", mts & 0b1110);</span><br><span style="color: hsl(120, 100%, 40%);">+                return -ENOTSUP;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Training Sequence Code */</span><br><span style="color: hsl(120, 100%, 40%);">+  bi->tsc = buf[0] & 0b111;</span><br><span style="color: hsl(120, 100%, 40%);">+      bi->flags |= TRX_BI_F_TS_INFO;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* C/I: Carrier-to-Interference ratio (in centiBels) */</span><br><span style="color: hsl(120, 100%, 40%);">+       bi->ci_cb = (int16_t) osmo_load16be(buf + 1);</span><br><span style="color: hsl(120, 100%, 40%);">+      bi->flags |= TRX_BI_F_CI_CB;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     return TRX_UL_V1HDR_LEN;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* TRXD burst handler for header version 0 */</span><br><span> static int trx_data_handle_burst_v0(struct trx_l1h *l1h,</span><br><span>                               struct trx_ul_burst_ind *bi,</span><br><span>@@ -657,6 +717,30 @@</span><br><span>      return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* TRXD burst handler for header version 1 */</span><br><span style="color: hsl(120, 100%, 40%);">+static int trx_data_handle_burst_v1(struct trx_l1h *l1h,</span><br><span style="color: hsl(120, 100%, 40%);">+                               struct trx_ul_burst_ind *bi,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  const uint8_t *buf, size_t buf_len)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    /* Modulation types defined in 3GPP TS 45.002 */</span><br><span style="color: hsl(120, 100%, 40%);">+      static const size_t bl[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+          [TRX_BURST_GMSK] = 148, /* 1 bit per symbol */</span><br><span style="color: hsl(120, 100%, 40%);">+                [TRX_BURST_8PSK] = 444, /* 3 bits per symbol */</span><br><span style="color: hsl(120, 100%, 40%);">+       };</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Verify burst length */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (bl[bi->bt] != buf_len) {</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE,</span><br><span style="color: hsl(120, 100%, 40%);">+                  "Rx TRXD message with odd burst length %zu, "</span><br><span style="color: hsl(120, 100%, 40%);">+                       "expected %zu\n", buf_len, bl[bi->bt]);</span><br><span style="color: hsl(120, 100%, 40%);">+          return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* The burst format is the same as for version 0.</span><br><span style="color: hsl(120, 100%, 40%);">+      * NOTE: other modulation types to be handled separately. */</span><br><span style="color: hsl(120, 100%, 40%);">+  return trx_data_handle_burst_v0(l1h, bi, buf, buf_len);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Parse TRXD message from transceiver, compose an UL burst indication.</span><br><span>  *</span><br><span>  * This message contains a demodulated Uplink burst with fixed-size</span><br><span>@@ -697,12 +781,72 @@</span><br><span>  *   | RSSI | ToA | soft-bits (254..0) |</span><br><span>  *   +------+-----+--------------------+</span><br><span>  *</span><br><span style="color: hsl(120, 100%, 40%);">+ * == Version 0x01</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +------+-----+-----+-----+--------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | RSSI | ToA | MTS | C/I | soft-bits (254..0) |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +------+-----+-----+-----+--------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span>  * where:</span><br><span>  *</span><br><span>  *   - RSSI (1 octet) - Received Signal Strength Indication</span><br><span>  *     encoded without the negative sign.</span><br><span>  *   - ToA (2 octets) - Timing of Arrival in units of 1/256</span><br><span>  *     of symbol (big endian).</span><br><span style="color: hsl(120, 100%, 40%);">+ *   - MTS (1 octet)  - Modulation and Training Sequence info.</span><br><span style="color: hsl(120, 100%, 40%);">+ *   - C/I (2 octets) - Carrier-to-Interference ratio (big endian).</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * == Coding of MTS: Modulation and Training Sequence info</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * 3GPP TS 45.002 version 15.1.0 defines several modulation types,</span><br><span style="color: hsl(120, 100%, 40%);">+ * and a few sets of training sequences for each type. The most</span><br><span style="color: hsl(120, 100%, 40%);">+ * common are GMSK and 8-PSK (which is used in EDGE).</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . . . . . X X X | Training Sequence Code (0..7)         |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . X X X X . . . | Modulation, TS set number (see below) |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | X . . . . . . . | IDLE / nope frame indication (0 or 1) |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * The bit number 7 (MSB) is set to high when either nothing has been</span><br><span style="color: hsl(120, 100%, 40%);">+ * detected, or during IDLE frames, so we can deliver noise levels,</span><br><span style="color: hsl(120, 100%, 40%);">+ * and avoid clock gaps on the L1 side. Other bits are ignored,</span><br><span style="color: hsl(120, 100%, 40%);">+ * and should be set to low (0) in this case. L16 shall be set to 0x00.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * == Coding of modulation and TS set number</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * GMSK has 4 sets of training sequences (see tables 5.2.3a-d),</span><br><span style="color: hsl(120, 100%, 40%);">+ * while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets.</span><br><span style="color: hsl(120, 100%, 40%);">+ * Access and Synchronization bursts also have several synch.</span><br><span style="color: hsl(120, 100%, 40%);">+ * sequences.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 0 0 X X . . . | GMSK, 4 TS sets (0..3)                |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1)               |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1)               |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1)               |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1)               |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *   | . 1 1 1 X . . . | RESERVED (0)                          |</span><br><span style="color: hsl(120, 100%, 40%);">+ *   +-----------------+---------------------------------------+</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * NOTE: we only support GMSK and 8-PSK.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * == C/I: Carrier-to-Interference ratio</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * The C/I value can be computed from the training sequence of each</span><br><span style="color: hsl(120, 100%, 40%);">+ * burst, where we can compare the "ideal" training sequence with</span><br><span style="color: hsl(120, 100%, 40%);">+ * the actual training sequence and then express that in centiBels.</span><br><span>  *</span><br><span>  * == Coding of the burst bits</span><br><span>  *</span><br><span>@@ -731,6 +875,9 @@</span><br><span>            return buf_len;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Pre-clean (initialize) the flags */</span><br><span style="color: hsl(120, 100%, 40%);">+        bi.flags = 0x00;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   /* Parse the header depending on its version */</span><br><span>      hdr_ver = buf[0] >> 4;</span><br><span>         switch (hdr_ver) {</span><br><span>@@ -738,6 +885,9 @@</span><br><span>             /* Legacy protocol has no version indicator */</span><br><span>               hdr_len = trx_data_handle_hdr_v0(l1h, &bi, buf, buf_len);</span><br><span>                break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case 1:</span><br><span style="color: hsl(120, 100%, 40%);">+               hdr_len = trx_data_handle_hdr_v1(l1h, &bi, buf, buf_len);</span><br><span style="color: hsl(120, 100%, 40%);">+         break;</span><br><span>       default:</span><br><span>             LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,</span><br><span>                  "TRXD header version %u is not supported\n", hdr_ver);</span><br><span>@@ -748,21 +898,39 @@</span><br><span>     if (hdr_len < 0)</span><br><span>          return hdr_len;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   /* TODO: we can use NOPE indications to get noise levels on IDLE</span><br><span style="color: hsl(120, 100%, 40%);">+       * TDMA frames, and properly drive scheduler if nothing has been</span><br><span style="color: hsl(120, 100%, 40%);">+       * detected on non-IDLE channels. */</span><br><span style="color: hsl(120, 100%, 40%);">+  if (bi.flags & TRX_BI_F_NOPE_IND) {</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE,</span><br><span style="color: hsl(120, 100%, 40%);">+                  "IDLE / NOPE indications are not (yet) supported\n");</span><br><span style="color: hsl(120, 100%, 40%);">+               return -ENOTSUP;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* We're done with the header now */</span><br><span>     buf_len -= hdr_len;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       /* Handle burst bits */</span><br><span>      switch (hdr_ver) {</span><br><span>   case 0:</span><br><span>              rc = trx_data_handle_burst_v0(l1h, &bi, buf + hdr_len, buf_len);</span><br><span>                 break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case 1:</span><br><span style="color: hsl(120, 100%, 40%);">+               rc = trx_data_handle_burst_v1(l1h, &bi, buf + hdr_len, buf_len);</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              /* Shall not happen, just to make GCC happy */</span><br><span style="color: hsl(120, 100%, 40%);">+                OSMO_ASSERT(0);</span><br><span>      }</span><br><span> </span><br><span>        /* Burst parsing error */</span><br><span>    if (rc < 0)</span><br><span>               return rc;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        /* TODO: also print TSC and C/I */</span><br><span>   LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG,</span><br><span style="color: hsl(0, 100%, 40%);">-             "Rx UL burst (hdr_ver=%u) tn=%u fn=%u rssi=%d toa256=%d\n",</span><br><span style="color: hsl(120, 100%, 40%);">+         "Rx %s (hdr_ver=%u): tn=%u fn=%u rssi=%d toa256=%d\n",</span><br><span style="color: hsl(120, 100%, 40%);">+              (bi.flags & TRX_BI_F_NOPE_IND) ? "NOPE.ind" : "UL burst",</span><br><span>            hdr_ver, bi.tn, bi.fn, bi.rssi, bi.toa256);</span><br><span> </span><br><span> #ifdef TOA_RSSI_DEBUG</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/14593">change 14593</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/14593"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If61c71d20d590bf07bfd019afb33000a0b6135bd </div>
<div style="display:none"> Gerrit-Change-Number: 14593 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>