summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-03-22 20:33:04 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-03-22 20:54:23 +0700
commit02abbe542087e761dd0d5cae6eebe32c785cefb3 (patch)
treef96667509350ffcbe7c9ca4d4bd951393d2dbb04 /src/host/trxcon
parent23914b9cf855de8e847d450c70494626da2216e6 (diff)
trxcon/sched_prim.c: fix: correct the first padding byte
According to TS 144.006, section 5.2, the first octet containing fill bits shall be set to the binary value "00101011" == 0x2b. Change-Id: I8f0304bf84613a2dc07cb78aff0cb8bb4c5adf6c
Diffstat (limited to 'src/host/trxcon')
-rw-r--r--src/host/trxcon/sched_prim.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c
index c17fb2a4..e1c87bbf 100644
--- a/src/host/trxcon/sched_prim.c
+++ b/src/host/trxcon/sched_prim.c
@@ -251,7 +251,7 @@ int sched_prim_dummy(struct trx_lchan_state *lchan)
* and with an information field of 0 octet length.
*/
static const uint8_t lapdm_fill_frame[] = {
- 0x01, 0x03, 0x01,
+ 0x01, 0x03, 0x01, 0x2b,
/* Pending part is to be randomized */
};
@@ -275,15 +275,16 @@ int sched_prim_dummy(struct trx_lchan_state *lchan)
/* FIXME: should we do anything for CSD? */
return 0;
} else {
+ /* Copy a fill frame payload */
+ memcpy(prim_buffer, lapdm_fill_frame, sizeof(lapdm_fill_frame));
+
/**
- * TS 144.006, section 8.1.2.3 "Fill frames"
- * A fill frame is a UI command frame for SAPI 0, P=0
- * and with an information field of 0 octet length.
+ * TS 144.006, section 5.2 "Frame delimitation and fill bits"
+ * Except for the first octet containing fill bits which shall
+ * be set to the binary value "00101011", each fill bit should
+ * be set to a random value when sent by the network.
*/
- memcpy(prim_buffer, lapdm_fill_frame, 3);
-
- /* Randomize pending unused bytes */
- for (i = 3; i < GSM_MACBLOCK_LEN; i++)
+ for (i = sizeof(lapdm_fill_frame); i < GSM_MACBLOCK_LEN; i++)
prim_buffer[i] = (uint8_t) rand();
/* Define a prim length */