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.orgHarald Welte has submitted this change and it was merged.
Change subject: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func
......................................................................
bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func
The move includes a small logic change: If there's a mismatch between
the rsp and the cmd, now we bts_shutdown instead of blindly skipping
expected RSP and continuing with sending the next CMD in the queue. The
change is specially not a problem since next patches are improving the
logic furthermore to account for duplicates, different parameters, etc.
Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e
---
M src/osmo-bts-trx/trx_if.c
1 file changed, 7 insertions(+), 6 deletions(-)
Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 8123de0..74a2257 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -416,12 +416,8 @@
 				"transceiver (%s) rejected TRX command "
 				"with response: '%s'\n",
 				phy_instance_name(pinst), buf);
-rsp_error:
-			if (tcm->critical) {
-				bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL");
-				/* keep tcm list, so process is stopped */
-				return -EIO;
-			}
+			if (tcm->critical)
+				goto rsp_error;
 		}
 
 		/* remove command from list */
@@ -434,6 +430,11 @@
 			buf);
 
 	return 0;
+
+rsp_error:
+	bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL");
+	/* keep tcm list, so process is stopped */
+	return -EIO;
 }
 
 
-- 
To view, visit https://gerrit.osmocom.org/5854
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
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: Vadim Yanitskiy <axilirator at gmail.com>