[PATCH] libosmocore[master]: lapdm: cleanup: send_rslms_rll_l3_ui(): Use msgb_tv_push()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue May 8 20:05:56 UTC 2018


Review at  https://gerrit.osmocom.org/8075

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
---
M src/gsm/lapdm.c
1 file changed, 5 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/8075/1

diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 1e81bff..49c2a4b 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -385,20 +385,16 @@
 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);
+
+	/* 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);
+
 	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;
-
-	rllh->data[2] = RSL_IE_MS_POWER;
-	rllh->data[3] = mctx->tx_power_ind;
 
 	return rslms_sendmsg(msg, mctx->dl->entity);
 }

-- 
To view, visit https://gerrit.osmocom.org/8075
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19bbfa1e327a617685ed11d4182e533df33215cb
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list