[S] Change in libosmo-gprs[master]: rlcmac: ul_tbf: Move logic selecting proper queue to helper function
pespin has submitted this change. ( 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, 26 insertions(+), 4 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved 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 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: 2 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
pespin