diff options
author | Max <msuraev@sysmocom.de> | 2018-01-02 14:17:04 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-01-12 14:17:52 +0000 |
commit | 8dce1de6d2669023b715945cc58813380ac7f322 (patch) | |
tree | ad32dcb8b1b16689fc09b4990541372a749f9b3f /src/tbf.cpp | |
parent | 5081806f4d41ceccf5b5421c9644113ac41e2524 (diff) |
TBF: cleanup state flag handling
* introduce generic function to check whether particular flag was set
for'a TBF and clear it if necessary. Use this instead of
clear_poll_timeout_flag()
* add function to explicitly set assignment and appropriate state flags
Overall this makes the code easier to read and debug.
Related: OS#1759
Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 9e3a8efc..6847e181 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,8 +402,7 @@ gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -1511,8 +1510,7 @@ struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); - ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); |