From d977f5fe08e23bbb5878b52fee09d97bcd996046 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 8 May 2018 21:53:28 +0200 Subject: 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 --- src/gsm/lapdm.c | 14 +++++--------- 1 file 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); } -- cgit v1.2.3