<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17718">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">RLC/MAC: implement decoding of [EGPRS] Packet Channel Request<br><br>According to 3GPP TS 44.004, section 7.4a, two alternative RACH<br>block formats are specified: 8 bit (1 octet) and 11 bit. This<br>change implements decoding of the following messages:<br><br> - Packet Channel Request, 11 bit block format (table 11.2.5.1),<br> - Packet Channel Request, 8 bit block format (table 11.2.5.2), and<br> - EGPRS Packet Channel Request, 11 bit block format (table 11.2.5a.2)<br><br>as specified in 3GPP TS 44.060.<br><br>Change-Id: I96df3352856933c9140177b2801a2c71f4134183<br>Related: OS#1548<br>---<br>M src/gsm_rlcmac.c<br>M src/gsm_rlcmac.h<br>M tests/rlcmac/RLCMACTest.cpp<br>M tests/rlcmac/RLCMACTest.err<br>M tests/rlcmac/RLCMACTest.ok<br>5 files changed, 475 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/18/17718/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm_rlcmac.c b/src/gsm_rlcmac.c</span><br><span>index 9b5ecfe..2caf4f0 100644</span><br><span>--- a/src/gsm_rlcmac.c</span><br><span>+++ b/src/gsm_rlcmac.c</span><br><span>@@ -5249,6 +5249,159 @@</span><br><span> CSN_DESCR_END (SI6_RestOctet_t)</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Common (unified) fields for [EGPRS] Packet Channel Request</span><br><span style="color: hsl(120, 100%, 40%);">+ * (see 3GPP TS 44.060, tables 11.2.5.1, 11.2.5.2, and 11.2.5a.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_MC5P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MC5P2RB3_t, MultislotClass, 5),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MC5P2RB3_t, Priority, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MC5P2RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_MC5P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_MC5RB2_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MC5RB2_t, MultislotClass, 5),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MC5RB2_t, RandomBits, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_MC5RB2_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_MCG3P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MCG3P2RB3_t, MultislotClassGroup, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MCG3P2RB3_t, Priority, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_MCG3P2RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_MCG3P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_NOB3P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_NOB3P2RB3_t, NumberOfBlocks, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_NOB3P2RB3_t, Priority, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_NOB3P2RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_NOB3P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_NOB3RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_NOB3RB3_t, NumberOfBlocks, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_NOB3RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_NOB3RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_P2RB3_t, Priority, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_P2RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_P2RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_RB5_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_RB5_t, RandomBits, 5),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_RB5_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_RB3_t, RandomBits, 3),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_RB3_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_BEGIN(PacketChannelRequest_RB2_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_UINT (PacketChannelRequest_RB2_t, RandomBits, 2),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_RB2_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Packet Channel Request (11 bit block, see table 11.2.5.1) */</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_ChoiceElement_t PacketChannelRequest_11b_Choice[] =</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ {1, 0x00, 0, M_TYPE(PacketChannelRequest_11b_t, u.OnePhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {3, 0x04, 0, M_TYPE(PacketChannelRequest_11b_t, u.Short,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x30, 0, M_TYPE(PacketChannelRequest_11b_t, u.TwoPhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x31, 0, M_TYPE(PacketChannelRequest_11b_t, u.PageResponse,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x32, 0, M_TYPE(PacketChannelRequest_11b_t, u.CellUpdate,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x33, 0, M_TYPE(PacketChannelRequest_11b_t, u.MMProcedure,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x34, 0, M_TYPE(PacketChannelRequest_11b_t, u.SingleBlockNoTBF,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x35, 0, M_TYPE(PacketChannelRequest_11b_t, u.OnePhaseUnack,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x36, 0, M_TYPE(PacketChannelRequest_11b_t, u.DedicatedChannel,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x37, 0, M_TYPE(PacketChannelRequest_11b_t, u.EmergencyCall,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x38, 0, M_TYPE(PacketChannelRequest_11b_t, u.SingleBlockMBMS,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</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%);">+CSN_DESCR_BEGIN (PacketChannelRequest_11b_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_CHOICE (PacketChannelRequest_11b_t, Type,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_11b_Choice, ElementsOf(PacketChannelRequest_11b_Choice)),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_11b_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Packet Channel Request (8 bit block, see table 11.2.5.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_ChoiceElement_t PacketChannelRequest_8b_Choice[] =</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ {1, 0x01, 0, M_TYPE(PacketChannelRequest_8b_t, u.OnePhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5RB2_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {2, 0x00, 0, M_TYPE(PacketChannelRequest_8b_t, u.Short,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x08, 0, M_TYPE(PacketChannelRequest_8b_t, u.TwoPhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x09, 0, M_TYPE(PacketChannelRequest_8b_t, u.PageResponse,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x0a, 0, M_TYPE(PacketChannelRequest_8b_t, u.CellUpdate,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x0b, 0, M_TYPE(PacketChannelRequest_8b_t, u.MMProcedure,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x0c, 0, M_TYPE(PacketChannelRequest_8b_t, u.SingleBlockNoTBF,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x1a, 0, M_TYPE(PacketChannelRequest_8b_t, u.OnePhaseUnack,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x1b, 0, M_TYPE(PacketChannelRequest_8b_t, u.DedicatedChannel,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x1c, 0, M_TYPE(PacketChannelRequest_8b_t, u.EmergencyCall,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {5, 0x0f, 0, M_TYPE(PacketChannelRequest_8b_t, u.SingleBlockMBMS,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t)},</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%);">+CSN_DESCR_BEGIN (PacketChannelRequest_8b_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_CHOICE (PacketChannelRequest_8b_t, Type,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_8b_Choice, ElementsOf(PacketChannelRequest_8b_Choice)),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (PacketChannelRequest_8b_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* EGPRS Packet Channel Request (11 bit block, see table 11.2.5a.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+static const</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_ChoiceElement_t EGPRS_PacketChannelRequest_Choice[] =</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ {1, 0x00, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.OnePhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {3, 0x04, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.Short,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {3, 0x05, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.OnePhaseRedLatency,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MCG3P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x30, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.TwoPhase,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x33, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.Signalling,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x35, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.OnePhaseUnack,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x36, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.DedicatedChannel,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x37, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.EmergencyCall,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x38, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.TwoPhaseIPA,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t)},</span><br><span style="color: hsl(120, 100%, 40%);">+ {6, 0x39, 0, M_TYPE(EGPRS_PacketChannelRequest_t, u.SignallingIPA,</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t)},</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%);">+CSN_DESCR_BEGIN (EGPRS_PacketChannelRequest_t)</span><br><span style="color: hsl(120, 100%, 40%);">+ M_CHOICE (EGPRS_PacketChannelRequest_t, Type,</span><br><span style="color: hsl(120, 100%, 40%);">+ EGPRS_PacketChannelRequest_Choice, ElementsOf(EGPRS_PacketChannelRequest_Choice)),</span><br><span style="color: hsl(120, 100%, 40%);">+CSN_DESCR_END (EGPRS_PacketChannelRequest_t)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> // ----------------------------------------------------------------------------</span><br><span> // osmo-pcu RLCMAC APIs</span><br><span> // ----------------------------------------------------------------------------</span><br><span>@@ -6153,3 +6306,54 @@</span><br><span> </span><br><span> return ret;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int decode_pkt_ch_req(guint16 ra, PacketChannelRequest_t *req)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ const CSN_DESCR *descr;</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned readIndex = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 bv_data[2];</span><br><span style="color: hsl(120, 100%, 40%);">+ csnStream_t ar;</span><br><span style="color: hsl(120, 100%, 40%);">+ int ret;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Allocate a bitvector on stack */</span><br><span style="color: hsl(120, 100%, 40%);">+ struct bitvec bv = {</span><br><span style="color: hsl(120, 100%, 40%);">+ .cur_bit = 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ .data_len = 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ .data = bv_data,</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%);">+ switch (req->type) {</span><br><span style="color: hsl(120, 100%, 40%);">+ case GSM_RLCMAC_PKT_CH_REQ_GPRS_11B:</span><br><span style="color: hsl(120, 100%, 40%);">+ case GSM_RLCMAC_PKT_CH_REQ_EGPRS:</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Unpack the bits: xxxxxxxx xxx..... */</span><br><span style="color: hsl(120, 100%, 40%);">+ bv_data[0] = (guint8) (ra >> 3);</span><br><span style="color: hsl(120, 100%, 40%);">+ bv_data[1] = (guint8) ((ra & 0x07) << 5);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (req->type == GSM_RLCMAC_PKT_CH_REQ_EGPRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ descr = CSNDESCR(EGPRS_PacketChannelRequest_t);</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ descr = CSNDESCR(PacketChannelRequest_11b_t);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ csnStreamInit(&ar, 0, 11);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ case GSM_RLCMAC_PKT_CH_REQ_GPRS_8B:</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Unpack the bits: xxxxxxxx ........ */</span><br><span style="color: hsl(120, 100%, 40%);">+ bv_data[0] = (guint8) (ra & 0xff);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ descr = CSNDESCR(PacketChannelRequest_8b_t);</span><br><span style="color: hsl(120, 100%, 40%);">+ csnStreamInit(&ar, 0, 8);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ default:</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Type must be set by the caller */</span><br><span style="color: hsl(120, 100%, 40%);">+ OSMO_ASSERT(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%);">+ /* Recursive csnStreamDecoder call uses LOGPC everywhere, so we need to start the log somewhere... */</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGP(DCSN1, LOGL_INFO, "csnStreamDecoder (%sPacket Channel Request): ",</span><br><span style="color: hsl(120, 100%, 40%);">+ req->type == GSM_RLCMAC_PKT_CH_REQ_EGPRS ? "EGPRS " : "");</span><br><span style="color: hsl(120, 100%, 40%);">+ ret = csnStreamDecoder(&ar, descr, &bv, &readIndex, (void *) &req->u);</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGPC(DCSN1, LOGL_INFO, "\n");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return ret;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/gsm_rlcmac.h b/src/gsm_rlcmac.h</span><br><span>index e9ae20a..d2fac1f 100644</span><br><span>--- a/src/gsm_rlcmac.h</span><br><span>+++ b/src/gsm_rlcmac.h</span><br><span>@@ -5330,6 +5330,125 @@</span><br><span> </span><br><span> } EnhancedMeasurementReport_t;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Common (unified) fields for [EGPRS] Packet Channel Request</span><br><span style="color: hsl(120, 100%, 40%);">+ * (see 3GPP TS 44.060, tables 11.2.5.1, 11.2.5.2, and 11.2.5a.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 MultislotClass;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Priority;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_MC5P2RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 MultislotClass;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_MC5RB2_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 MultislotClassGroup;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Priority;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_MCG3P2RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 NumberOfBlocks;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Priority;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_NOB3P2RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 NumberOfBlocks;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_NOB3RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Priority;</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_P2RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct PacketChannelRequest_RB235_t {</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 RandomBits;</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%);">+typedef struct PacketChannelRequest_RB235_t PacketChannelRequest_RB5_t;</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct PacketChannelRequest_RB235_t PacketChannelRequest_RB3_t;</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct PacketChannelRequest_RB235_t PacketChannelRequest_RB2_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Packet Channel Request (11 bit block, see table 11.2.5.1) */</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Type;</span><br><span style="color: hsl(120, 100%, 40%);">+ union</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5P2RB3_t OnePhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3P2RB3_t Short;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t TwoPhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t PageResponse;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t CellUpdate;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t MMProcedure;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t SingleBlockNoTBF;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t OnePhaseUnack;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t DedicatedChannel;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t EmergencyCall;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t SingleBlockMBMS;</span><br><span style="color: hsl(120, 100%, 40%);">+ } u;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_11b_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Packet Channel Request (8 bit block, see table 11.2.5.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Type;</span><br><span style="color: hsl(120, 100%, 40%);">+ union</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5RB2_t OnePhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3RB3_t Short;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t TwoPhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t PageResponse;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t CellUpdate;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t MMProcedure;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t SingleBlockNoTBF;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t OnePhaseUnack;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t DedicatedChannel;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB2_t EmergencyCall;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB3_t SingleBlockMBMS;</span><br><span style="color: hsl(120, 100%, 40%);">+ } u;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_8b_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* EGPRS Packet Channel Request (11 bit block, see table 11.2.5a.2) */</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ guint8 Type;</span><br><span style="color: hsl(120, 100%, 40%);">+ union</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MC5P2RB3_t OnePhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_NOB3P2RB3_t Short;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_MCG3P2RB3_t OnePhaseRedLatency;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t TwoPhase;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t Signalling;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t OnePhaseUnack;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t DedicatedChannel;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t EmergencyCall;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_P2RB3_t TwoPhaseIPA;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_RB5_t SignallingIPA;</span><br><span style="color: hsl(120, 100%, 40%);">+ } u;</span><br><span style="color: hsl(120, 100%, 40%);">+} EGPRS_PacketChannelRequest_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Union of all possible Packet Channel Request types */</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ enum {</span><br><span style="color: hsl(120, 100%, 40%);">+ GSM_RLCMAC_PKT_CH_REQ_UNKNOWN = 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ GSM_RLCMAC_PKT_CH_REQ_GPRS_11B,</span><br><span style="color: hsl(120, 100%, 40%);">+ GSM_RLCMAC_PKT_CH_REQ_GPRS_8B,</span><br><span style="color: hsl(120, 100%, 40%);">+ GSM_RLCMAC_PKT_CH_REQ_EGPRS,</span><br><span style="color: hsl(120, 100%, 40%);">+ } type;</span><br><span style="color: hsl(120, 100%, 40%);">+ union</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_11b_t gprs_11b;</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_8b_t gprs_8b;</span><br><span style="color: hsl(120, 100%, 40%);">+ EGPRS_PacketChannelRequest_t egprs;</span><br><span style="color: hsl(120, 100%, 40%);">+ } u;</span><br><span style="color: hsl(120, 100%, 40%);">+} PacketChannelRequest_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> int decode_gsm_rlcmac_uplink(struct bitvec *vector, RlcMacUplink_t *data);</span><br><span> int decode_gsm_rlcmac_downlink(struct bitvec *vector, RlcMacDownlink_t *data);</span><br><span> int encode_gsm_rlcmac_downlink(struct bitvec *vector, RlcMacDownlink_t *data);</span><br><span>@@ -5337,4 +5456,6 @@</span><br><span> void decode_gsm_rlcmac_uplink_data(struct bitvec *vector, RlcMacUplinkDataBlock_t * data);</span><br><span> void encode_gsm_rlcmac_downlink_data(struct bitvec *vector, RlcMacDownlinkDataBlock_t * data);</span><br><span> int decode_gsm_ra_cap(struct bitvec *vector, MS_Radio_Access_capability_t * data);</span><br><span style="color: hsl(120, 100%, 40%);">+ int decode_pkt_ch_req(guint16 ra, PacketChannelRequest_t *data);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #endif /* __PACKET_GSM_RLCMAC_H__ */</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp</span><br><span>index 0215cc8..fb5dbb5 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.cpp</span><br><span>+++ b/tests/rlcmac/RLCMACTest.cpp</span><br><span>@@ -471,6 +471,118 @@</span><br><span> bitvec_free(bv_dec);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+void testPktChReqGPRS(void *test_ctx)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_t req;</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%);">+ printf("*** %s ***\n", __func__);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ static const uint16_t GPRSPktCh11bReqs[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < One Phase Access Request : '0'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < MultislotClass : '01010'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '10'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '101'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x155,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Short Access Request : '100'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < NumberOfBlocks : '101'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '10'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '010'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x4b2,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Two Phase Access Request : '110000'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '11'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '000'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x618,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < MM Procedure : '110011'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '11001'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x679,</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%);">+ /* Indicate block type to decode_pkt_ch_req() */</span><br><span style="color: hsl(120, 100%, 40%);">+ req.type = PacketChannelRequest_t::GSM_RLCMAC_PKT_CH_REQ_GPRS_11B;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ for (size_t i = 0; i < ARRAY_SIZE(GPRSPktCh11bReqs); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = decode_pkt_ch_req(GPRSPktCh11bReqs[i], &req);</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("decode_pkt_ch_req(0x%03x) returns %d\n", GPRSPktCh11bReqs[i], rc);</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%);">+ static const uint16_t GPRSPktCh8bReqs[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < One Phase Access Request : '1'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < MultislotClass : '01010'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '10'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0xaa,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Short Access Request : '00'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < NumberOfBlocks : '101'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '010'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x2a,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Two Phase Access Request : '01000'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '010'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x42,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Emergency call : '011100'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '11'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x73,</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%);">+ /* Indicate block type to decode_pkt_ch_req() */</span><br><span style="color: hsl(120, 100%, 40%);">+ req.type = PacketChannelRequest_t::GSM_RLCMAC_PKT_CH_REQ_GPRS_8B;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ for (size_t i = 0; i < ARRAY_SIZE(GPRSPktCh8bReqs); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = decode_pkt_ch_req(GPRSPktCh8bReqs[i], &req);</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("decode_pkt_ch_req(0x%02x) returns %d\n", GPRSPktCh8bReqs[i], rc);</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void testPktChReqEGPRS(void *test_ctx)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ PacketChannelRequest_t req;</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%);">+ printf("*** %s ***\n", __func__);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ static const uint16_t EGPRSPktChReqs[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < One Phase Access Request : '0'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < MultislotClass : '10101'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '10'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '101'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x2b5,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < One Phase Access Request : '0'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < MultislotClass : '01010'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '01'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '010'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x14a,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Short Access Request : '100'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < NumberOfBlocks : '001'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '01'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '000'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x428,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Two Phase Access Request : '110000'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '00'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '000'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x600,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Two Phase Access Request : '110000'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < Priority : '11'B ></span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '111'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x61f,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Signalling : '110011'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '10101'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x675,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Signalling : '110011'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '10001'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x671,</span><br><span style="color: hsl(120, 100%, 40%);">+ /* < Emergency call : '110111'B</span><br><span style="color: hsl(120, 100%, 40%);">+ < RandomBits : '11001'B > > */</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x6f9,</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%);">+ /* Indicate block type to decode_pkt_ch_req() */</span><br><span style="color: hsl(120, 100%, 40%);">+ req.type = PacketChannelRequest_t::GSM_RLCMAC_PKT_CH_REQ_EGPRS;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ for (size_t i = 0; i < ARRAY_SIZE(EGPRSPktChReqs); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = decode_pkt_ch_req(EGPRSPktChReqs[i], &req);</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("decode_pkt_ch_req(0x%03x) returns %d\n", EGPRSPktChReqs[i], rc);</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%);">+</span><br><span> int main(int argc, char *argv[])</span><br><span> {</span><br><span> void *ctx = talloc_named_const(NULL, 1, "RLCMACTest");</span><br><span>@@ -490,5 +602,9 @@</span><br><span> testRAcap(ctx);</span><br><span> testMalformedRAcap(ctx);</span><br><span> testRAcap2(ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ testPktChReqGPRS(ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+ testPktChReqEGPRS(ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> talloc_free(ctx);</span><br><span> }</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.err b/tests/rlcmac/RLCMACTest.err</span><br><span>index c271e5c..469ec9e 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.err</span><br><span>+++ b/tests/rlcmac/RLCMACTest.err</span><br><span>@@ -37,3 +37,19 @@</span><br><span> DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 21 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 | : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | DCSN1 ERROR csnStreamDecoder: error NEED_MORE BITS TO UNPACK (-5) at EGPRS_multislot_class (idx 31): End Multislot_capability | </span><br><span> DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 29 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 0 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 | : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 3 | GPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_SM = 0 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 0 | EGPRS_Extended_Dynamic_Allocation_Capability = 0 | Exist_DTM_GPRS_multislot_class = 0 | : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 0 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = NULL | UMTS_FDD_Radio_Access_Technology_Capability = NULL | UMTS_384_TDD_Radio_Access_Technology_Capability = NULL | CDMA2000_Radio_Access_Technology_Capability = NULL | UMTS_128_TDD_Radio_Access_Technology_Capability = NULL | GERAN_Feature_Package_1 = NULL | Modulation_based_multislot_class_support = NULL | GMSK_MultislotPowerProfile = NULL | EightPSK_MultislotProfile = NULL | MultipleTBF_Capability = NULL | DownlinkAdvancedReceiverPerformance = NULL | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = NULL | DTM_EnhancementsCapability = NULL | PS_HandoverCapability = NULL | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | Padding = 0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|</span><br><span> DCSN1 INFO csnStreamDecoder (RAcap): MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 1 | u.Content length = 73 | offset = 4 | RF_Power_Capability = 4 | Exist_A5_bits = 1 | A5_bits = 80 | ES_IND = 1 | PS = 1 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 1 | : Multislot_capability | Exist_HSCSD_multislot_class = 0 | Exist_GPRS_multislot_class = 1 | GPRS_multislot_class = 12 | GPRS_Extended_Dynamic_Allocation_Capability = 1 | Exist_SM = 1 | SMS_VALUE = 7 | SM_VALUE = 1 | Exist_ECSD_multislot_class = 0 | Exist_EGPRS_multislot_class = 1 | EGPRS_multislot_class = 12 | EGPRS_Extended_Dynamic_Allocation_Capability = 1 | Exist_DTM_GPRS_multislot_class = 1 | DTM_GPRS_multislot_class = 3 | Single_Slot_DTM = 0 | : DTM_EGPRS_Params | Exist_DTM_EGPRS_multislot_class = 1 | DTM_EGPRS_multislot_class = 3 | : End DTM_EGPRS_Params | : End Multislot_capability | Exist_Eight_PSK_Power_Capability = 1 | Eight_PSK_Power_Capability = 2 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = 1 | UMTS_FDD_Radio_Access_Technology_Capability = 0 | UMTS_384_TDD_Radio_Access_Technology_Capability = 0 | CDMA2000_Radio_Access_Technology_Capability = 0 | UMTS_128_TDD_Radio_Access_Technology_Capability = 0 | GERAN_Feature_Package_1 = 1 | Exist_Extended_DTM_multislot_class = 0 | Modulation_based_multislot_class_support = 0 | Exist_HighMultislotCapability = 0 | Exist_GERAN_lu_ModeCapability = 0 | GMSK_MultislotPowerProfile = 3 | EightPSK_MultislotProfile = 3 | MultipleTBF_Capability = 0 | DownlinkAdvancedReceiverPerformance = 1 | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = 1 | DTM_EnhancementsCapability = 1 | Exist_DTM_GPRS_HighMultislotClass = 0 | PS_HandoverCapability = 0 | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 7 | u.Content length = 34 | offset = 4 | RF_Power_Capability = 4 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 1 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 0 | Exist_Eight_PSK_Power_Capability = 1 | Eight_PSK_Power_Capability = 2 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = 1 | UMTS_FDD_Radio_Access_Technology_Capability = 0 | UMTS_384_TDD_Radio_Access_Technology_Capability = 0 | CDMA2000_Radio_Access_Technology_Capability = 0 | UMTS_128_TDD_Radio_Access_Technology_Capability = 0 | GERAN_Feature_Package_1 = 1 | Exist_Extended_DTM_multislot_class = 0 | Modulation_based_multislot_class_support = 0 | Exist_HighMultislotCapability = 0 | Exist_GERAN_lu_ModeCapability = 0 | GMSK_MultislotPowerProfile = 3 | EightPSK_MultislotProfile = 3 | MultipleTBF_Capability = 0 | DownlinkAdvancedReceiverPerformance = 1 | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = 1 | DTM_EnhancementsCapability = 1 | Exist_DTM_GPRS_HighMultislotClass = 0 | PS_HandoverCapability = 0 | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | MS_RA_capability_value { | Choice MS_RA_capability_value_Choice = 3 | u.Content length = 34 | offset = 4 | RF_Power_Capability = 1 | Exist_A5_bits = 0 | ES_IND = 1 | PS = 1 | VGCS = 0 | VBS = 0 | Exist_Multislot_capability = 0 | Exist_Eight_PSK_Power_Capability = 1 | Eight_PSK_Power_Capability = 2 | COMPACT_Interference_Measurement_Capability = 0 | Revision_Level_Indicator = 1 | UMTS_FDD_Radio_Access_Technology_Capability = 0 | UMTS_384_TDD_Radio_Access_Technology_Capability = 0 | CDMA2000_Radio_Access_Technology_Capability = 0 | UMTS_128_TDD_Radio_Access_Technology_Capability = 0 | GERAN_Feature_Package_1 = 1 | Exist_Extended_DTM_multislot_class = 0 | Modulation_based_multislot_class_support = 0 | Exist_HighMultislotCapability = 0 | Exist_GERAN_lu_ModeCapability = 0 | GMSK_MultislotPowerProfile = 3 | EightPSK_MultislotProfile = 3 | MultipleTBF_Capability = 0 | DownlinkAdvancedReceiverPerformance = 1 | ExtendedRLC_MAC_ControlMessageSegmentionsCapability = 1 | DTM_EnhancementsCapability = 1 | Exist_DTM_GPRS_HighMultislotClass = 0 | PS_HandoverCapability = 0 | DTM_Handover_Capability = NULL | FlexibleTimeslotAssignment = NULL | GAN_PS_HandoverCapability = NULL | RLC_Non_persistentMode = NULL | ReducedLatencyCapability = NULL | UplinkEGPRS2 = NULL | DownlinkEGPRS2 = NULL | EUTRA_FDD_Support = NULL | EUTRA_TDD_Support = NULL | GERAN_To_EUTRAN_supportInGERAN_PTM = NULL | PriorityBasedReselectionSupport = NULL | MS_RA_capability_value } | Padding = 0|</span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_11b_Choice = 0 | : u.OnePhase | MultislotClass = 10 | Priority = 2 | RandomBits = 5 | : End u.OnePhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_11b_Choice = 4 | : u.Short | NumberOfBlocks = 5 | Priority = 2 | RandomBits = 2 | : End u.Short | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_11b_Choice = 48 | : u.TwoPhase | Priority = 3 | RandomBits = 0 | : End u.TwoPhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_11b_Choice = 51 | : u.MMProcedure | RandomBits = 25 | : End u.MMProcedure | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_8b_Choice = 1 | : u.OnePhase | MultislotClass = 10 | RandomBits = 2 | : End u.OnePhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_8b_Choice = 0 | : u.Short | NumberOfBlocks = 5 | RandomBits = 2 | : End u.Short | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_8b_Choice = 8 | : u.TwoPhase | RandomBits = 2 | : End u.TwoPhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (Packet Channel Request): Choice PacketChannelRequest_8b_Choice = 28 | : u.EmergencyCall | RandomBits = 3 | : End u.EmergencyCall | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 0 | : u.OnePhase | MultislotClass = 21 | Priority = 2 | RandomBits = 5 | : End u.OnePhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 0 | : u.OnePhase | MultislotClass = 10 | Priority = 1 | RandomBits = 2 | : End u.OnePhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 4 | : u.Short | NumberOfBlocks = 1 | Priority = 1 | RandomBits = 0 | : End u.Short | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 48 | : u.TwoPhase | Priority = 0 | RandomBits = 0 | : End u.TwoPhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 48 | : u.TwoPhase | Priority = 3 | RandomBits = 7 | : End u.TwoPhase | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 51 | : u.Signalling | RandomBits = 21 | : End u.Signalling | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 51 | : u.Signalling | RandomBits = 17 | : End u.Signalling | </span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (EGPRS Packet Channel Request): Choice EGPRS_PacketChannelRequest_Choice = 55 | : u.EmergencyCall | RandomBits = 25 | : End u.EmergencyCall | </span><br><span>diff --git a/tests/rlcmac/RLCMACTest.ok b/tests/rlcmac/RLCMACTest.ok</span><br><span>index 4e4967b..52db8f7 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.ok</span><br><span>+++ b/tests/rlcmac/RLCMACTest.ok</span><br><span>@@ -149,3 +149,21 @@</span><br><span> decode_gsm_ra_cap() returns 0</span><br><span> GPRS multislot class = 12</span><br><span> EGPRS multislot class = 12</span><br><span style="color: hsl(120, 100%, 40%);">+*** testPktChReqGPRS ***</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x155) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x4b2) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x618) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x679) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0xaa) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x2a) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x42) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x73) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+*** testPktChReqEGPRS ***</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x2b5) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x14a) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x428) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x600) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x61f) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x675) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x671) returns 0</span><br><span style="color: hsl(120, 100%, 40%);">+decode_pkt_ch_req(0x6f9) returns 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17718">change 17718</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-pcu/+/17718"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I96df3352856933c9140177b2801a2c71f4134183 </div>
<div style="display:none"> Gerrit-Change-Number: 17718 </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>