diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-04-19 16:11:14 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-04-19 15:09:32 +0000 |
commit | 542301b0673f77c774c310ec7e2d568a7d515e25 (patch) | |
tree | 364d78c49f675cc9d1837b9a7b8c328f627ab57b /src/gsm | |
parent | 15753e93d2eec19e08168e6d049abaa94fbb8d19 (diff) |
RSL/LAPDm: Not all RLL message are "transparent"
3GPP TS 48.058 has a very clear definition of which messages are
"transparent" and hence have the T-bit == 1. This is *not* just
all RLL messages, but basically only RLL_DATA.{ind,req} and
RLL_UNITDATA.{ind,req}. All other messages are non-transparent.
Change-Id: I9f83654af189d818563d799bf623325b7fee8e70
Closes: OS#3188
Diffstat (limited to 'src/gsm')
-rw-r--r-- | src/gsm/lapdm.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 80c0d178..6a16012b 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -349,12 +349,29 @@ static int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le) return le->l1_prim_cb(&pp.oph, le->l1_ctx); } +/* Is a given msg_type "transparent" as per TS 48.058 Section 8.1 */ +static int rsl_is_transparent(uint8_t msg_type) +{ + switch (msg_type) { + case RSL_MT_DATA_IND: + case RSL_MT_UNIT_DATA_IND: + return 1; + case RSL_MT_DATA_REQ: + case RSL_MT_UNIT_DATA_REQ: + return 1; + default: + return 0; + } +} + /* Create RSLms various RSLms messages */ static int send_rslms_rll_l3(uint8_t msg_type, struct lapdm_msg_ctx *mctx, struct msgb *msg) { + int transparent = rsl_is_transparent(msg_type); + /* Add the RSL + RLL header */ - rsl_rll_push_l3(msg, msg_type, mctx->chan_nr, mctx->link_id, 1); + rsl_rll_push_l3(msg, msg_type, mctx->chan_nr, mctx->link_id, transparent); /* send off the RSLms message to L3 */ return rslms_sendmsg(msg, mctx->dl->entity); @@ -385,8 +402,9 @@ static int send_rslms_rll_l3_ui(struct lapdm_msg_ctx *mctx, struct msgb *msg) static int send_rll_simple(uint8_t msg_type, struct lapdm_msg_ctx *mctx) { struct msgb *msg; + int transparent = rsl_is_transparent(msg_type); - msg = rsl_rll_simple(msg_type, mctx->chan_nr, mctx->link_id, 1); + msg = rsl_rll_simple(msg_type, mctx->chan_nr, mctx->link_id, transparent); /* send off the RSLms message to L3 */ return rslms_sendmsg(msg, mctx->dl->entity); @@ -397,7 +415,7 @@ static int rsl_rll_error(uint8_t cause, struct lapdm_msg_ctx *mctx) struct msgb *msg; LOGP(DLLAPD, LOGL_NOTICE, "sending MDL-ERROR-IND %d\n", cause); - msg = rsl_rll_simple(RSL_MT_ERROR_IND, mctx->chan_nr, mctx->link_id, 1); + msg = rsl_rll_simple(RSL_MT_ERROR_IND, mctx->chan_nr, mctx->link_id, 0); msgb_tlv_put(msg, RSL_IE_RLM_CAUSE, 1, &cause); return rslms_sendmsg(msg, mctx->dl->entity); } |