jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33607 )
Change subject: ASCI: Add support for sending RSL UNIT-DATA towards BTS ......................................................................
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 --- M include/osmocom/bsc/abis_rsl.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/gsm_04_08_rr.c 3 files changed, 48 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/33607/1
diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index 83e8f7d..3da0d6c 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -62,6 +62,7 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_command);
int rsl_data_request(struct msgb *msg, uint8_t link_id); +int rsl_unit_data_request(struct msgb *msg, uint8_t link_id); int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id); int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index f3ab8d6..1b02450 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1157,6 +1157,31 @@ 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 ae54cf5..5c2b0f8 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -57,6 +57,15 @@ 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;