diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2023-06-13 13:44:32 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-07-21 11:15:27 +0000 |
commit | 353fa5a14d0a02ef383bfaa4f6a7273024f94d2f (patch) | |
tree | e2895e3b75637037946c370227d96d3af9d30550 /src | |
parent | d8a6a533a18933e9cc857ad2283e537332a295e4 (diff) |
ASCI: Add support for sending RSL UNIT-DATA towards BTS
This is required to send UPLINK FREE and UPLINK BUSY messages to the
BTS.
Change-Id: I25e80f079989a4c7dede58c327c22b958784f3ff
Related: OS#4852
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 25 | ||||
-rw-r--r-- | src/osmo-bsc/gsm_04_08_rr.c | 9 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index d7f5c3320..99c2822a8 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1157,6 +1157,31 @@ int rsl_data_request(struct msgb *msg, uint8_t link_id) return abis_rsl_sendmsg(msg); } +/* Send "UNIT DATA REQUEST" message with given L3 Info payload */ +/* Chapter 8.3.11 */ +int rsl_unit_data_request(struct msgb *msg, uint8_t link_id) +{ + int chan_nr; + + if (msg->lchan == NULL) { + LOGP(DRSL, LOGL_ERROR, "cannot send UNIT DATA REQUEST to unknown lchan\n"); + msgb_free(msg); + return -EINVAL; + } + + chan_nr = gsm_lchan2chan_nr(msg->lchan, true); + if (chan_nr < 0) { + msgb_free(msg); + return chan_nr; + } + + rsl_rll_push_l3(msg, RSL_MT_UNIT_DATA_REQ, chan_nr, link_id, 1); + + msg->dst = rsl_chan_link(msg->lchan); + + return abis_rsl_sendmsg(msg); +} + /* Send "ESTABLISH REQUEST" message with given L3 Info payload */ /* Chapter 8.3.1 */ int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index ae54cf504..5c2b0f88a 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -57,6 +57,15 @@ int gsm48_sendmsg(struct msgb *msg) return rsl_data_request(msg, 0); } +int gsm48_sendmsg_unit(struct msgb *msg) +{ + if (msg->lchan) + msg->dst = rsl_chan_link(msg->lchan); + + msg->l3h = msg->data; + return rsl_unit_data_request(msg, 0); +} + /* Section 9.1.8 / Table 9.9 */ struct chreq { uint8_t val; |