[MERGED] osmo-bsc[master]: abis_rsl.c: Clean ericsson specific imm assign code

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
Mon Apr 23 19:08:09 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: abis_rsl.c: Clean ericsson specific imm assign code
......................................................................


abis_rsl.c: Clean ericsson specific imm assign code

Move to its own function, store pointer to proper header format and use
the already defined IE define from libosmocore instead of using
hardcoded values.

Depends on: Change-Id I7cb65f3ff1cfdbe4eee97b7545bcd13a38c72e25

Change-Id: I845fd3f0c6ff31f268f68a31e1d55981f7ec6129
---
M src/libbsc/abis_rsl.c
1 file changed, 25 insertions(+), 14 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c
index 9c30c0f..10bef6e 100644
--- a/src/libbsc/abis_rsl.c
+++ b/src/libbsc/abis_rsl.c
@@ -2048,12 +2048,34 @@
 	return 0;
 }
 
+/* Ericsson specific: Immediate Assign Sent */
+static int rsl_rx_ericsson_imm_assign_sent(struct msgb *msg)
+{
+	struct e1inp_sign_link *sign_link = msg->dst;
+	struct abis_rsl_dchan_hdr *dh = msgb_l2(msg);
+	uint32_t tlli;
+
+	LOGP(DRSL, LOGL_INFO, "IMM.ass sent\n");
+	msgb_pull(msg, sizeof(*dh));
+
+	/* FIXME: Move to TLV once we support defining TV types with V having len != 1 byte */
+	if(msg->len < 5)
+		LOGP(DRSL, LOGL_ERROR, "short IMM.ass sent message!\n");
+	else if(msg->data[0] != RSL_IE_ERIC_MOBILE_ID)
+		LOGP(DRSL, LOGL_ERROR, "unsupported IMM.ass message format! (please fix)\n");
+	else {
+		msgb_pull(msg, 1); /* drop previous data to use msg_pull_u32 */
+		tlli = msgb_pull_u32(msg);
+		pcu_tx_imm_ass_sent(sign_link->trx->bts, tlli);
+	}
+	return 0;
+}
+
 static int abis_rsl_rx_cchan(struct msgb *msg)
 {
 	struct e1inp_sign_link *sign_link = msg->dst;
 	struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg);
 	int rc = 0;
-	uint32_t tlli;
 
 	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
 				  "Abis RSL rx CCHAN: ");
@@ -2074,19 +2096,8 @@
 		LOGP(DRSL, LOGL_NOTICE, "Unimplemented Abis RSL TRX message "
 			"type %s\n", rsl_msg_name(rslh->c.msg_type));
 		break;
-	case 0x10: /* Ericsson specific: Immediate Assign Sent */
-		/* FIXME: Replace the messy message parsing below
-		 * with proper TV parser */
-		LOGP(DRSL, LOGL_INFO, "IMM.ass sent\n");
-		if(msg->len < 9)
-			LOGP(DRSL, LOGL_ERROR, "short IMM.ass sent message!\n");
-		else if(msg->data[4] != 0xf1)
-			LOGP(DRSL, LOGL_ERROR, "unsupported IMM.ass message format! (please fix)\n");
-		else {
-			msgb_pull(msg, 5); /* drop previous data to use msg_pull_u32 */
-			tlli = msgb_pull_u32(msg);
-			pcu_tx_imm_ass_sent(sign_link->trx->bts, tlli);
-		}
+	case RSL_MT_ERICSSON_IMM_ASS_SENT:
+		rc = rsl_rx_ericsson_imm_assign_sent(msg);
 		break;
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "Unknown Abis RSL TRX message type "

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I845fd3f0c6ff31f268f68a31e1d55981f7ec6129
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list