aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-07-21 18:54:48 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-07-24 13:46:46 +0200
commit8c935ca0a76da92a7b2eb60112d0c6bef94200c6 (patch)
tree48af5f526991617052f5bee557e880e6ec36cb2d
parent29dc2b13fb029aa69d9905f5ec9ba7436d2ef7ca (diff)
rlcmac: ul_tbf: Move logic selecting proper queue to helper function
This clarifies the logic behind selecting the proper queue, and it will be used further in the future, for instance when recalculating CV once already in Countdown procedure. Change-Id: Icceaf53048e9662176385b2976e2bc8e3387df71
-rw-r--r--src/rlcmac/tbf_ul.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/rlcmac/tbf_ul.c b/src/rlcmac/tbf_ul.c
index 0d78383..baa5ec0 100644
--- a/src/rlcmac/tbf_ul.c
+++ b/src/rlcmac/tbf_ul.c
@@ -328,6 +328,18 @@ free_ret:
return NULL;
}
+/* Returns the MS/GRE queue unless the UL TBF has entered Countdown Procedure.
+ * In that case, it returns the specific frozen queue. */
+static struct gprs_rlcmac_llc_queue *gprs_rlcmac_ul_tbf_llc_queue(const struct gprs_rlcmac_ul_tbf *ul_tbf)
+{
+ struct gprs_rlcmac_llc_queue *llc_queue;
+ if (ul_tbf->countdown_proc.active)
+ llc_queue = ul_tbf->countdown_proc.llc_queue;
+ else
+ llc_queue = ul_tbf->tbf.gre->llc_queue;
+ return llc_queue;
+}
+
bool gprs_rlcmac_ul_tbf_have_data(const struct gprs_rlcmac_ul_tbf *ul_tbf)
{
if (ul_tbf->llc_tx_msg && msgb_length(ul_tbf->llc_tx_msg) > 0)
@@ -360,10 +372,7 @@ void gprs_rlcmac_ul_tbf_schedule_next_llc_frame(struct gprs_rlcmac_ul_tbf *ul_tb
msgb_free(ul_tbf->llc_tx_msg);
- if (ul_tbf->countdown_proc.active)
- llc_queue = ul_tbf->countdown_proc.llc_queue;
- else
- llc_queue = ul_tbf->tbf.gre->llc_queue;
+ llc_queue = gprs_rlcmac_ul_tbf_llc_queue(ul_tbf);
/* dequeue next LLC frame, if any */
ul_tbf->llc_tx_msg = gprs_rlcmac_llc_queue_dequeue(llc_queue);