From e3cb8715f59cae342b6ecb96be4eb82c1ad00b4e Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 26 Nov 2018 13:53:52 +0100 Subject: bts_model: Allow TS connect to be processed asynchronously This commit doesn't change internal logic of any model, only the API to be able to return result of connect TS asyncrhonously since some models (like osmo-bts-trx) require some time to process the result. This way PDCH ACT/DEACT (N)ACK can be sent once the result of this long process is known. For instance, nowadays in osmo-bts-trx we PDCH (DE)ACT ACK before getting the result from SETSLOT on the TRX iface. With this new API, bts_model_ts_connect doesn't return any value synchronously. Instead, it is expected to always end up calling cb_ts_connected with the return code from the TS activation process. 0 is considered a successs, while any other value is considered an error. Change-Id: Ie073a4397dd2f1a691968d12b15b8b42f1e1b0cf --- src/osmo-bts-litecell15/oml.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/osmo-bts-litecell15') diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index da6c60e8..f084f1bf 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1925,13 +1925,17 @@ static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "", ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : ""); - cb_ts_connected(ts); + cb_ts_connected(ts, 0); return 0; } -int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, +void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); + int rc; + + rc = ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); + if (rc) + cb_ts_connected(ts, rc); } -- cgit v1.2.3