diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-01-16 18:45:46 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-01-19 15:41:19 +0100 |
commit | 1f80e9815f3bb98ddfabe5aaa9e69c0a47b84269 (patch) | |
tree | 4444a1ed1774a21446108c323945338d53e504a7 /src/osmo-bts-trx/trx_if.c | |
parent | 9a57c7bed4c096ccff4f9fc78b7ef789eeb18360 (diff) |
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
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r-- | src/osmo-bts-trx/trx_if.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8123de03..74a22574 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -416,12 +416,8 @@ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what) "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 @@ rsp_error: buf); return 0; + +rsp_error: + bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); + /* keep tcm list, so process is stopped */ + return -EIO; } |