summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-08 21:53:28 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-08 20:35:11 +0000
commitd977f5fe08e23bbb5878b52fee09d97bcd996046 (patch)
treef2e14e88751ef2396661fa5aa2090149fd67d4c5 /src
parentafacc2be9ff2fccf6ff7c9c00849081627754ace (diff)
lapdm: cleanup: send_rslms_rll_l3_ui(): Use msgb_tv_push()
This is a purely cosmetic clean-up to use the msgb_tv_push() API to pre-pend a Tag-Value IE to a msgb, rather than the existing open-coding approach. Change-Id: I19bbfa1e327a617685ed11d4182e533df33215cb
Diffstat (limited to 'src')
-rw-r--r--src/gsm/lapdm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 1e81bff7..49c2a4bb 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -385,20 +385,16 @@ static int send_rslms_rll_l3(uint8_t msg_type, struct lapdm_msg_ctx *mctx,
static int send_rslms_rll_l3_ui(struct lapdm_msg_ctx *mctx, struct msgb *msg)
{
uint8_t l3_len = msg->tail - (uint8_t *)msgb_l3(msg);
- struct abis_rsl_rll_hdr *rllh;
/* Add the RSL + RLL header */
msgb_tv16_push(msg, RSL_IE_L3_INFO, l3_len);
- msgb_push(msg, 2 + 2);
- rsl_rll_push_hdr(msg, RSL_MT_UNIT_DATA_IND, mctx->chan_nr,
- mctx->link_id, 1);
- rllh = (struct abis_rsl_rll_hdr *)msgb_l2(msg);
- rllh->data[0] = RSL_IE_TIMING_ADVANCE;
- rllh->data[1] = mctx->ta_ind;
+ /* Add two IEs carrying MS power and TA values */
+ msgb_tv_push(msg, RSL_IE_MS_POWER, mctx->tx_power_ind);
+ msgb_tv_push(msg, RSL_IE_TIMING_ADVANCE, mctx->ta_ind);
- rllh->data[2] = RSL_IE_MS_POWER;
- rllh->data[3] = mctx->tx_power_ind;
+ rsl_rll_push_hdr(msg, RSL_MT_UNIT_DATA_IND, mctx->chan_nr,
+ mctx->link_id, 1);
return rslms_sendmsg(msg, mctx->dl->entity);
}