aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-05-03 16:11:28 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-05-05 01:50:49 +0200
commitbf7099262adf0f27e71a08387747c5cb0d459360 (patch)
treebf3316423eff6219afabc1c715efdd1300a9fcee
parentf28f1ef9afa4edfcbdc32e4d820d23886e0e38b2 (diff)
dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACK
Sending PDCH activation upon RSL bootstrap is too early. Introduce OPSTART ACK handling to call dyn_ts_init() only when the dynamic timeslot is indeed ready to receive a PDCH activation. Related: OS#3205 Change-Id: Icf6e25ff068e8a2600562d52726ead65e864ec02
-rw-r--r--include/osmocom/bsc/signal.h1
-rw-r--r--src/libbsc/abis_nm.c11
-rw-r--r--src/libbsc/bsc_init.c1
-rw-r--r--src/libbsc/bts_ipaccess_nanobts.c43
4 files changed, 54 insertions, 2 deletions
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index 9c0d5a3de..1dde26772 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -71,6 +71,7 @@ enum signal_nm {
S_NM_STATECHG_OPER, /* Operational State changed*/
S_NM_STATECHG_ADM, /* Administrative State changed */
S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */
+ S_NM_OPSTART_ACK, /* Received OPSTART ACK, arg is struct abis_om_fom_hdr* */
};
/* SS_LCHAN signals */
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index e3c440813..b2cfa531d 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -678,6 +678,14 @@ static int abis_nm_rx_lmt_event(struct msgb *mb)
return 0;
}
+static int abis_nm_rx_opstart_ack(struct msgb *mb)
+{
+ struct abis_om_fom_hdr *foh = msgb_l3(mb);
+ DEBUGPFOH(DNM, foh, "Opstart ACK\n");
+ osmo_signal_dispatch(SS_NM, S_NM_OPSTART_ACK, foh);
+ return 0;
+}
+
bool all_trx_rsl_connected_unlocked(const struct gsm_bts *bts)
{
const struct gsm_bts_trx *trx;
@@ -802,7 +810,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
ret = abis_nm_rx_lmt_event(mb);
break;
case NM_MT_OPSTART_ACK:
- DEBUGPFOH(DNM, foh, "Opstart ACK\n");
+ abis_nm_rx_opstart_ack(mb);
break;
case NM_MT_SET_CHAN_ATTR_ACK:
DEBUGPFOH(DNM, foh, "Set Channel Attributes ACK\n");
@@ -1896,6 +1904,7 @@ int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb)
if (bts->type == GSM_BTS_TYPE_BS11)
msgb_tlv_put(msg, 0x59, 1, &zero);
+ DEBUGPFOH(DNM, foh, "%s(): sending %s\n", __func__, msgb_hexdump(msg));
return abis_nm_sendmsg(bts, msg);
}
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 429d3c7bf..92b8c27ff 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -354,7 +354,6 @@ static void bootstrap_rsl(struct gsm_bts_trx *trx)
for (i = 0; i < ARRAY_SIZE(trx->ts); i++) {
generate_ma_for_ts(&trx->ts[i]);
- dyn_ts_init(&trx->ts[i]);
}
}
diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c
index d94a87889..3eb7e0e4d 100644
--- a/src/libbsc/bts_ipaccess_nanobts.c
+++ b/src/libbsc/bts_ipaccess_nanobts.c
@@ -294,6 +294,46 @@ static int sw_activ_rep(struct msgb *mb)
return 0;
}
+static struct gsm_bts_trx_ts *gsm_bts_trx_ts(struct gsm_network *net,
+ int bts_nr, int trx_nr, int ts_nr)
+{
+ struct gsm_bts *bts;
+ struct gsm_bts_trx *trx;
+ bts = gsm_bts_num(net, bts_nr);
+ if (!bts)
+ return NULL;
+ trx = gsm_bts_trx_by_nr(bts, trx_nr);
+ if (!trx)
+ return NULL;
+ if (ts_nr < 0 || ts_nr > ARRAY_SIZE(trx->ts))
+ return NULL;
+ return &trx->ts[ts_nr];
+}
+
+static void nm_rx_opstart_ack_chan(struct abis_om_fom_hdr *foh)
+{
+ struct gsm_bts_trx_ts *ts;
+ ts = gsm_bts_trx_ts(bsc_gsmnet, foh->obj_inst.bts_nr, foh->obj_inst.trx_nr, foh->obj_inst.ts_nr);
+ if (!ts) {
+ LOGP(DNM, LOGL_ERROR, "%s Channel OPSTART ACK for non-existent TS\n",
+ abis_nm_dump_foh(foh));
+ return;
+ }
+
+ dyn_ts_init(ts);
+}
+
+static void nm_rx_opstart_ack(struct abis_om_fom_hdr *foh)
+{
+ switch (foh->obj_class) {
+ case NM_OC_CHANNEL:
+ nm_rx_opstart_ack_chan(foh);
+ break;
+ default:
+ break;
+ }
+}
+
/* Callback function to be called every time we receive a signal from NM */
static int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
@@ -307,6 +347,9 @@ static int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal,
case S_NM_STATECHG_OPER:
case S_NM_STATECHG_ADM:
return nm_statechg_event(signal, signal_data);
+ case S_NM_OPSTART_ACK:
+ nm_rx_opstart_ack(signal_data);
+ return 0;
default:
break;
}