pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-gprs/+/33888 )
Change subject: rlcmac: ul_tbf: Move logic selecting proper queue to helper function
......................................................................
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, 25 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/88/33888/1
diff --git a/src/rlcmac/tbf_ul.c b/src/rlcmac/tbf_ul.c
index 0d78383..86ea8bd 100644
--- a/src/rlcmac/tbf_ul.c
+++ b/src/rlcmac/tbf_ul.c
@@ -328,6 +328,17 @@
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 +371,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
https://gerrit.osmocom.org/c/libosmo-gprs/+/33888
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Icceaf53048e9662176385b2976e2bc8e3387df71
Gerrit-Change-Number: 33888
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange