[MERGED] osmo-pcu[master]: cosmetic: tighten direct-phy related 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
Sat Sep 2 19:42:28 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: tighten direct-phy related code
......................................................................


cosmetic: tighten direct-phy related code

* move the code to related SAPI case
* get rid of 'unused variable' warning if direct-phy is not used

Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b
---
M src/pcu_l1_if.cpp
1 file changed, 11 insertions(+), 11 deletions(-)

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



diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 50e181e..97eee9b 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -163,9 +163,9 @@
 void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn,
 	uint32_t fn, uint8_t block_nr)
 {
+#ifdef ENABLE_DIRECT_PHY
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 
-#ifdef ENABLE_DIRECT_PHY
 	if (bts->trx[trx].fl1h) {
 		l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr,
 			msg->data, msg->len);
@@ -250,16 +250,7 @@
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 	int rc;
 	pcu_l1_meas meas;
-	meas.set_rssi(data_ind->rssi);
-#ifndef ENABLE_DIRECT_PHY
-	/* convert BER to % value */
-	meas.set_ber(data_ind->ber10k / 100);
-	meas.set_bto(data_ind->ta_offs_qbits);
-	meas.set_link_qual(data_ind->lqual_cb / 10);
-	LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements "
-	     "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k,
-	     data_ind->ta_offs_qbits, data_ind->lqual_cb);
-#endif
+
 	LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d "
 		"block=%d data=%s\n", data_ind->sapi,
 		data_ind->arfcn, data_ind->block_nr,
@@ -267,6 +258,15 @@
 
 	switch (data_ind->sapi) {
 	case PCU_IF_SAPI_PDTCH:
+		meas.set_rssi(data_ind->rssi);
+#ifndef ENABLE_DIRECT_PHY
+		/* convert BER to % value */
+		meas.set_ber(data_ind->ber10k / 100);
+		meas.set_bto(data_ind->ta_offs_qbits);
+		meas.set_link_qual(data_ind->lqual_cb / 10);
+		LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n",
+		     data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb);
+#endif
 		rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr,
 			data_ind->data, data_ind->len, data_ind->fn,
 			&meas);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
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