[PATCH] 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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Sat Apr 21 20:50:19 UTC 2018


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

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/7894/1

diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c
index 9081bf1..230016c 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: ");
@@ -2075,19 +2097,8 @@
 			"type %s (0x%02x)\n",
 			rsl_msg_name(rslh->c.msg_type), 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: newchange
Gerrit-Change-Id: I845fd3f0c6ff31f268f68a31e1d55981f7ec6129
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list