[PATCH] osmo-bts[master]: Simplify pcu_tx_data_ind()

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

Max gerrit-no-reply at lists.osmocom.org
Thu Jul 28 09:20:09 UTC 2016


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/611

to look at the new patch set (#2).

Simplify pcu_tx_data_ind()

This is preparation step to make extending BTS <-> PCU interface with
additional measurement information easier:

- remove unused parameters (always hardcoded to constant by caller)
- use struct argument directly instead of several parameters taken from
  the same struct

Change-Id: Ib196a36ae2bae36d37144337bed71f40414dbb64
Related: OS#1616
---
M include/osmo-bts/pcu_if.h
M src/common/l1sap.c
M src/common/pcu_sock.c
3 files changed, 17 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/611/2

diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index 3ce4d0b..c3a7eb7 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -8,9 +8,8 @@
 int pcu_tx_info_ind(void);
 int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
 	uint16_t arfcn, uint8_t block_nr);
-int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
-	uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
-	int8_t rssi);
+int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint8_t *data,
+		    uint8_t len, struct ph_data_param *ph);
 int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn);
 int pcu_tx_time_ind(uint32_t fn);
 int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed);
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 0bbdb9e..0a78c09 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -792,10 +792,8 @@
 	uint8_t chan_nr, link_id;
 	uint8_t tn;
 	uint32_t fn;
-	int8_t rssi;
 	enum osmo_ph_pres_info_type pr_info = data_ind->pdch_presence_info;
 
-	rssi = data_ind->rssi;
 	chan_nr = data_ind->chan_nr;
 	link_id = data_ind->link_id;
 	fn = data_ind->fn;
@@ -810,9 +808,7 @@
 		if (len == 0)
 			return -EINVAL;
 		if (L1SAP_IS_PTCCH(fn)) {
-			pcu_tx_data_ind(&trx->ts[tn], 1, fn,
-				0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn),
-				data, len, rssi);
+			pcu_tx_data_ind(&trx->ts[tn], 1, data, len, data_ind);
 
 			return 0;
 		}
@@ -820,8 +816,7 @@
 		if (pr_info != PRES_INFO_BOTH)
 			return 0;
 		/* PDTCH / PACCH frame handling */
-		pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */,
-			L1SAP_FN2MACBLOCK(fn), data, len, rssi);
+		pcu_tx_data_ind(&trx->ts[tn], 0, data, len, data_ind);
 
 		return 0;
 	}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index d40b19b..3678799 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -32,6 +32,7 @@
 
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/select.h>
+#include <osmocom/gsm/l1sap.h>
 #include <osmo-bts/logging.h>
 #include <osmo-bts/gsm_data.h>
 #include <osmo-bts/pcu_if.h>
@@ -336,9 +337,8 @@
 	return pcu_sock_send(&bts_gsmnet, msg);
 }
 
-int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
-	uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
-	int8_t rssi)
+int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint8_t *data,
+		    uint8_t len, struct ph_data_param *ph)
 {
 	struct msgb *msg;
 	struct gsm_pcu_if *pcu_prim;
@@ -346,8 +346,9 @@
 	struct gsm_bts *bts = ts->trx->bts;
 
 	LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d "
-		"block=%d data=%s\n", is_ptcch, arfcn, block_nr,
-		osmo_hexdump(data, len));
+	     "block=%d data=%s\n", is_ptcch, 0,
+	     is_ptcch ? L1SAP_FN2PTCCHBLOCK(ph->fn) : L1SAP_FN2MACBLOCK(ph->fn),
+	     osmo_hexdump(data, len));
 
 	msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_IND, bts->nr);
 	if (!msg)
@@ -356,13 +357,15 @@
 	data_ind = &pcu_prim->u.data_ind;
 
 	data_ind->sapi = (is_ptcch) ? PCU_IF_SAPI_PTCCH : PCU_IF_SAPI_PDTCH;
-	data_ind->rssi = rssi;
-	data_ind->fn = fn;
-	data_ind->arfcn = arfcn;
+	data_ind->rssi = ph->rssi;
+	data_ind->fn = ph->fn;
+	data_ind->arfcn = 0; /* FIXME: do we really need actual ARFCN value? */
 	data_ind->trx_nr = ts->trx->nr;
 	data_ind->ts_nr = ts->nr;
-	data_ind->block_nr = block_nr;
-	data_ind->rssi = rssi;
+	data_ind->block_nr = is_ptcch ?
+		L1SAP_FN2PTCCHBLOCK(ph->fn) : L1SAP_FN2MACBLOCK(ph->fn);
+	data_ind->rssi = ph->rssi;
+
 	memcpy(data_ind->data, data, len);
 	data_ind->len = len;
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib196a36ae2bae36d37144337bed71f40414dbb64
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list