aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-26 13:53:52 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-26 14:08:14 +0100
commite3cb8715f59cae342b6ecb96be4eb82c1ad00b4e (patch)
tree4e8027fda24949ff6f049d8fa6fa34c67eb42d1d /src/osmo-bts-trx
parent47c8f37c9f52ce66e0dabce2d5c2567d7a5d24da (diff)
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
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/l1_if.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index ccc13f42..da1b554f 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -764,7 +764,7 @@ int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts)
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)
{
int rc;
@@ -773,12 +773,10 @@ int bts_model_ts_connect(struct gsm_bts_trx_ts *ts,
rc = trx_set_ts_as_pchan(ts, as_pchan);
if (rc)
- return rc;
+ cb_ts_connected(ts, rc);
LOGP(DL1C, LOGL_NOTICE, "%s bts_model_ts_connect(as_pchan=%s) success,"
" calling cb_ts_connected()\n",
gsm_ts_name(ts), gsm_pchan_name(as_pchan));
-
- cb_ts_connected(ts);
- return 0;
+ cb_ts_connected(ts, 0);
}