aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy/l1_if.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-15 18:24:03 +0100
committerHarald Welte <laforge@gnumonks.org>2016-01-16 17:26:22 +0100
commit0c017618cd335f88712174154575ce9569a4634c (patch)
tree016473c126677836c2561dc31bb293d8109b8595 /src/osmo-bts-octphy/l1_if.c
parent8d198f3598f7e0928f7b4001088dfbf007873791 (diff)
OCTPHY: Block PHY indications until it is confirmed open
When re-starting OsmoBTS after unclean shutdown, the PHY is already sending notifications (PH-DATA.ind, PH-TIME.ind, etc.) for the previous physical channel / timeslot configuration. At the point those messages are received, OsmoBTS might not even have A-bis OML up yet, and thus has no clue how to process such messages (and subsequently likely crashes). Let's block such primitives from passing further up the code until we have received the TRX-OPEN response.
Diffstat (limited to 'src/osmo-bts-octphy/l1_if.c')
-rw-r--r--src/osmo-bts-octphy/l1_if.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index f259661f..9c523fb5 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1086,8 +1086,16 @@ static int rx_gsm_trx_rach_ind(struct msgb *msg)
static int rx_octvc1_notif(struct msgb *msg, uint32_t msg_id)
{
const char *evt_name = get_value_string(octphy_eid_vals, msg_id);
+ struct octphy_hdl *fl1h = msg->dst;
int rc = 0;
+ if (!fl1h->opened) {
+ LOGP(DL1P, LOGL_NOTICE, "Rx NOTIF %s: Ignoring as PHY TRX "
+ "hasn't been re-opened yet\n", evt_name);
+ msgb_free(msg);
+ return 0;
+ }
+
LOGP(DL1P, LOGL_DEBUG, "Rx NOTIF %s\n", evt_name);
/* called functions MUST NOT take ownership of the msgb,