aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
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
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')
-rw-r--r--src/osmo-bts-octphy/l1_if.c8
-rw-r--r--src/osmo-bts-octphy/l1_if.h3
-rw-r--r--src/osmo-bts-octphy/l1_oml.c1
3 files changed, 12 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,
diff --git a/src/osmo-bts-octphy/l1_if.h b/src/osmo-bts-octphy/l1_if.h
index 54a5504c..ce956807 100644
--- a/src/osmo-bts-octphy/l1_if.h
+++ b/src/osmo-bts-octphy/l1_if.h
@@ -45,6 +45,9 @@ struct octphy_hdl {
struct osmo_timer_list alive_timer;
uint32_t alive_prim_cnt;
+
+ /* were we already (re)opened after OsmoBTS start */
+ int opened;
};
static inline struct octphy_hdl *trx_octphy_hdl(struct gsm_bts_trx *trx)
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 1e2bf44e..d682b841 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1141,6 +1141,7 @@ static int trx_open_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *d
octphy_hw_get_rf_ant_rx_config(fl1h, 0, 1);
octphy_hw_get_rf_ant_tx_config(fl1h, 0, 1);
octphy_hw_get_clock_sync_info(fl1h);
+ fl1h->opened = 1;
/* Temporary fix for enabling events after TRX Close + Reopen */
return l1if_enable_events(trx);