aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-24 04:32:29 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-24 04:35:49 +0100
commit19da7fdea8912831b19d9aeed51cd2226f342283 (patch)
tree944fb5e6ae231924e5cb5a707182f6259e84e207 /src/common/rsl.c
parent6e92255cc7694ad02094036a87aba46c6d8ec950 (diff)
RSL: Implement DELETE INDICATION on AGCH overflow
This patch adds generation of a DELETE INDICATION when the BTS AGCH queue overflows due to too many IMMEDIATE ASSIGN CMDs, as required by the specs. The AGCH queue length in OsmoBTS so far is at 1000 entries, which I consider way too high. But that is for another patch. Change-Id: Ied3306e85cbdc6f3476b10dc4bb0463cd728b274 Related: OS#2990
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 8448925e..2638ad2f 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -404,6 +404,21 @@ int rsl_tx_ccch_load_ind_rach(struct gsm_bts *bts, uint16_t total,
return abis_bts_rsl_sendmsg(msg);
}
+/* 8.5.4 DELETE INDICATION */
+static int rsl_tx_delete_ind(struct gsm_bts *bts, const uint8_t *ia, uint8_t ia_len)
+{
+ struct msgb *msg;
+
+ msg = rsl_msgb_alloc(sizeof(struct abis_rsl_cchan_hdr));
+ if (!msg)
+ return -ENOMEM;
+ rsl_cch_push_hdr(msg, RSL_MT_DELETE_IND, RSL_CHAN_PCH_AGCH);
+ msgb_tlv_put(msg, RSL_IE_FULL_IMM_ASS_INFO, ia_len, ia);
+ msg->trx = bts->c0;
+
+ return abis_bts_rsl_sendmsg(msg);
+}
+
/* 8.5.5 PAGING COMMAND */
static int rsl_rx_paging_cmd(struct gsm_bts_trx *trx, struct msgb *msg)
{
@@ -546,6 +561,8 @@ static int rsl_rx_imm_ass(struct gsm_bts_trx *trx, struct msgb *msg)
/* put into the AGCH queue of the BTS */
if (bts_agch_enqueue(trx->bts, msg) < 0) {
/* if there is no space in the queue: send DELETE IND */
+ rsl_tx_delete_ind(trx->bts, TLVP_VAL(&tp, RSL_IE_FULL_IMM_ASS_INFO),
+ TLVP_LEN(&tp, RSL_IE_FULL_IMM_ASS_INFO));
msgb_free(msg);
}