aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-03-06 14:22:51 +0100
committerHarald Welte <laforge@gnumonks.org>2017-05-08 07:46:25 +0000
commit91685096f8eae4a0be2b3bd2a773259c516897de (patch)
tree511213bf43601f21a14ca6091e297ca297ad113d /src/common/bts.c
parent40dca8f991465aaa8e3c95c23d00f155106f584d (diff)
bts: revert trx shutdown order
When a new TRX is allocated using gsm_bts_trx_alloc() (see gsm_data_shared.c in openbsc.git), than it is added to the list in order. When octphy is shutting down the BTS, it uses llist_for_each_entry() to iterate the tansceiver list to shut all transceivers down. This means it starts the shut down process with the primary TRX and then continues with the secondary transceivers in order. However, octphy does not allow to close primary TRX if the secondary TRX is open. The shutdown sequence must begin with the secondary transceivers and finish with the primiary transceiver as last item. The problem can be easily fixed by iterating the transceiver list in reverse order using llist_for_each_entry_reverse() instead of llist_for_each_entry() Since this is a change in the common code, all BTS models (not only octphy) are affected, but from the logical perspective, this change makes sense for all other BTS models too. Change-Id: I18485de586b402610f9e98053d69e92bc9b18dc2
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 540caaa1..cb5284dd 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -207,7 +207,7 @@ void bts_shutdown(struct gsm_bts *bts, const char *reason)
LOGP(DOML, LOGL_NOTICE, "Shutting down BTS %u, Reason %s\n",
bts->nr, reason);
- llist_for_each_entry(trx, &bts->trx_list, list) {
+ llist_for_each_entry_reverse(trx, &bts->trx_list, list) {
bts_model_trx_deact_rf(trx);
bts_model_trx_close(trx);
}