pespin submitted this change.
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
---
M src/rlcmac/tbf_ul.c
1 file changed, 26 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 @@
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 @@
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);
To view, visit change 33888. To unsubscribe, or for help writing mail filters, visit settings.