Change in osmo-pcu[master]: Split identity_lv param into mi+mi_len

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Jan 1 16:10:16 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/16673 )

Change subject: Split identity_lv param into mi+mi_len
......................................................................

Split identity_lv param into mi+mi_len

It's not really needed to have those together in some function calls,
and makes it more difficult to follow the code. Furthermore, new callers
not having content already aligned (len+value) will be using these
functions in forthcoming commits.

Change-Id: Ifb9d3997bfb74b35366c3d1bc51ce458f19abf16
---
M src/bts.cpp
M src/bts.h
M src/pcu_l1_if.cpp
M src/pdch.cpp
M src/pdch.h
5 files changed, 11 insertions(+), 9 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/bts.cpp b/src/bts.cpp
index c8b6375..71a2f06 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -38,6 +38,7 @@
 	#include <osmocom/core/stats.h>
 	#include <osmocom/gsm/protocol/gsm_04_08.h>
 	#include <osmocom/gsm/gsm_utils.h>
+	#include <osmocom/gsm/gsm48.h>
 	#include <osmocom/core/gsmtap_util.h>
 	#include <osmocom/core/application.h>
 	#include <osmocom/core/bitvec.h>
@@ -354,7 +355,7 @@
 	m_pollController.expireTimedout(fn, max_delay);
 }
 
-int BTS::add_paging(uint8_t chan_needed, uint8_t *identity_lv)
+int BTS::add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len)
 {
 	uint8_t l, trx, ts, any_tbf = 0;
 	struct gprs_rlcmac_tbf *tbf;
@@ -370,7 +371,7 @@
 
 
 	LOGP(DRLCMAC, LOGL_INFO, "Add RR paging: chan-needed=%d MI=%s\n",
-		chan_needed, osmo_hexdump(identity_lv + 1, identity_lv[0]));
+		chan_needed, osmo_mi_name(mi, mi_len));
 
 	/* collect slots to page
 	 * Mark slots for every TBF, but only mark one of it.
@@ -414,7 +415,7 @@
 		for (ts = 0; ts < 8; ts++) {
 			if ((slot_mask[trx] & (1 << ts))) {
 				/* schedule */
-				if (!m_bts.trx[trx].pdch[ts].add_paging(chan_needed, identity_lv))
+				if (!m_bts.trx[trx].pdch[ts].add_paging(chan_needed, mi, mi_len))
 					return -ENOMEM;
 
 				LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of TRX=%d TS=%d\n", trx, ts);
diff --git a/src/bts.h b/src/bts.h
index 7ef5a3f..0eaab85 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -290,7 +290,7 @@
 	int current_frame_number() const;
 
 	/** add paging to paging queue(s) */
-	int add_paging(uint8_t chan_needed, uint8_t *identity_lv);
+	int add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len);
 
 	gprs_rlcmac_dl_tbf *dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts);
 	gprs_rlcmac_ul_tbf *ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts);
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 98e697d..bac0e56 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -644,8 +644,8 @@
 		return -EINVAL;
 	}
 
-	return BTS::main_bts()->add_paging(pag_req->chan_needed,
-						pag_req->identity_lv);
+	return BTS::main_bts()->add_paging(pag_req->chan_needed, &pag_req->identity_lv[1],
+					   pag_req->identity_lv[0]);
 }
 
 static int pcu_rx_susp_req(struct gsm_pcu_if_susp_req *susp_req)
diff --git a/src/pdch.cpp b/src/pdch.cpp
index da221f4..e15af2c 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -251,14 +251,15 @@
 	return msg;
 }
 
-bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv)
+bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len)
 {
 	struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging);
 	if (!pag)
 		return false;
 
 	pag->chan_needed = chan_needed;
-	memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1);
+	pag->identity_lv[0] = mi_len;
+	memcpy(&pag->identity_lv[1], mi, mi_len);
 
 	llist_add(&pag->list, &paging_list);
 
diff --git a/src/pdch.h b/src/pdch.h
index d55f58e..821fb90 100644
--- a/src/pdch.h
+++ b/src/pdch.h
@@ -48,7 +48,7 @@
 	struct gprs_rlcmac_paging *dequeue_paging();
 	struct msgb *packet_paging_request();
 
-	bool add_paging(uint8_t chan_needed, uint8_t *identity_lv);
+	bool add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len);
 
 	void free_resources();
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/16673
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ifb9d3997bfb74b35366c3d1bc51ce458f19abf16
Gerrit-Change-Number: 16673
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200101/533ed074/attachment.htm>


More information about the gerrit-log mailing list