<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/14783">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fixup: trxd_hdr_v1_specific: fix MTS encoding<br><br>Somehow having the union causes overflows between the bit-fields<br>of the MTS (Modulation and Training Sequence). I could not figure<br>out why and how is that possible.<br><br>  gdb-peda$ p *v1<br>  $0 = {<br>    mts = 0x0,<br>    tsc = 0x0,<br>    modulation = 0x0,<br>    idle = 0x0,<br>    ci = 0x0<br>  }<br><br>  gdb-peda$ set v1->tsc = 7<br><br>  gdb-peda$ p *v1<br>  $0 = {<br>    mts = 0x7,<br>    tsc = 0x7,<br>    modulation = 0x7, // WTF?!?<br>    idle = 0x0,<br>    ci = 0x0<br>  }<br><br>Getting rid of that union fixes the problem.<br><br>Change-Id: I9c0b7eef1464524e93fe0945acbdbf3d557c5664<br>---<br>M Transceiver52M/proto_trxd.h<br>1 file changed, 6 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/83/14783/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Transceiver52M/proto_trxd.h b/Transceiver52M/proto_trxd.h</span><br><span>index a047be4..7eb5dac 100644</span><br><span>--- a/Transceiver52M/proto_trxd.h</span><br><span>+++ b/Transceiver52M/proto_trxd.h</span><br><span>@@ -74,18 +74,15 @@</span><br><span> #define TRXD_MODULATION_32QAM(ts_set) (0b1010 | (ts_set & 0b0001))</span><br><span> </span><br><span> struct trxd_hdr_v1_specific {</span><br><span style="color: hsl(0, 100%, 40%);">-   union {</span><br><span style="color: hsl(0, 100%, 40%);">-         uint8_t mts;</span><br><span> #if OSMO_IS_LITTLE_ENDIAN</span><br><span style="color: hsl(0, 100%, 40%);">-               uint8_t tsc:3,</span><br><span style="color: hsl(0, 100%, 40%);">-                  modulation:4,</span><br><span style="color: hsl(0, 100%, 40%);">-                   idle:1;</span><br><span style="color: hsl(120, 100%, 40%);">+       uint8_t tsc:3,</span><br><span style="color: hsl(120, 100%, 40%);">+                modulation:4,</span><br><span style="color: hsl(120, 100%, 40%);">+         idle:1;</span><br><span> #elif OSMO_IS_BIG_ENDIAN</span><br><span style="color: hsl(0, 100%, 40%);">-             uint8_t idle:1,</span><br><span style="color: hsl(0, 100%, 40%);">-                 modulation:4,</span><br><span style="color: hsl(0, 100%, 40%);">-                   tsc:3;</span><br><span style="color: hsl(120, 100%, 40%);">+        uint8_t idle:1,</span><br><span style="color: hsl(120, 100%, 40%);">+               modulation:4,</span><br><span style="color: hsl(120, 100%, 40%);">+         tsc:3;</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">-        };</span><br><span>   int16_t ci;  /* big endian, in centiBels */</span><br><span> } __attribute__ ((packed));</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/14783">change 14783</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-trx/+/14783"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9c0b7eef1464524e93fe0945acbdbf3d557c5664 </div>
<div style="display:none"> Gerrit-Change-Number: 14783 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>