aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_ul.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-05-10 17:21:03 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-05-11 11:32:44 +0200
commit20271c421ca774e5e9dbafe366e7cdfd5cee8ad3 (patch)
tree6434667d8d44aab29d829f9759bf003efd678003 /src/tbf_ul.cpp
parentc6571b55814cf08f5df6ba5dc3423598845b0cb3 (diff)
Split ul_tbf alloc on CCCH into new function
This allows more easily finding when this specific scenario happens, and can easily be compared against the PACCH one. Change-Id: I609792a40fda2a798ca71a0e9f5639d0a0f011d7
Diffstat (limited to 'src/tbf_ul.cpp')
-rw-r--r--src/tbf_ul.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index cf8c75c5..686eea5e 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -160,6 +160,24 @@ gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms,
return tbf;
}
+/* Alloc a UL TBF to be assigned over CCCH */
+struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_ccch(struct gprs_rlcmac_bts *bts, struct GprsMs *ms)
+{
+ struct gprs_rlcmac_ul_tbf *tbf;
+
+ tbf = tbf_alloc_ul_tbf(bts, ms, -1, true);
+ if (!tbf) {
+ LOGP(DTBF, LOGL_NOTICE, "No PDCH resource for Uplink TBF\n");
+ /* Caller will most probably send a Imm Ass Reject after return */
+ return NULL;
+ }
+ TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW);
+ TBF_ASS_TYPE_SET(tbf, GPRS_RLCMAC_FLAG_CCCH);
+ OSMO_ASSERT(tbf->ms());
+
+ return tbf;
+}
+
/* Create a temporary dummy TBF to Tx a ImmAssReject if allocating a new one during
* packet resource Request failed. This is similar as tbf_alloc_ul() but without
* calling tbf->setup() (in charge of TFI/USF allocation), and reusing resources