aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-09-08 11:36:03 +0200
committerpespin <pespin@sysmocom.de>2021-09-21 10:28:52 +0000
commitfce67bc7fa93ac5728df3634c632c40e45488ef9 (patch)
tree9d990b8e6dfdf05903f03c1e908006d2a79dc367
parenteeae77634560de084767dfc651a0a14f5d7d95a8 (diff)
pdch: has_gprs_only_tb_attached: use m_num_tbfs
Make use of the separate GPRS counters added in previous patch I0c0a1121b4ae5f031782e7e63a0c28eb0b6c8b42 to shorten has_gprs_only_tb_attached. Related: SYS#4878 Change-Id: I1dd7df2c740ea604f07c65bebcb7c0051aebf9ae
-rw-r--r--src/pdch.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/pdch.cpp b/src/pdch.cpp
index d10ee4a7..19d57a23 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -1114,18 +1114,8 @@ void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf)
bool gprs_rlcmac_pdch::has_gprs_only_tbf_attached() const
{
- unsigned int i;
- unsigned int j;
- for (i = 0; i < sizeof(m_assigned_tfi[0]); i++) {
- for (j = 0; j < 2; j++) {
- if (m_assigned_tfi[j] & (1UL << i)) {
- gprs_rlcmac_tbf *tbf = m_tbfs[j][i];
- if (!tbf->is_egprs_enabled())
- return true;
- }
- }
- }
- return false;
+ return (m_num_tbfs_gprs[GPRS_RLCMAC_UL_TBF] +
+ m_num_tbfs_gprs[GPRS_RLCMAC_DL_TBF]) > 0;
}
void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir)