aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index ddc3b91..e83873a 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -263,18 +263,24 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
talloc_free(tbf);
}
-int gprs_rlcmac_tbf::update()
+int gprs_rlcmac_tbf::update(GprsMs *ms_)
{
struct gprs_rlcmac_bts *bts_data = bts->bts_data();
- int rc;
+ int rc = -EINVAL;
LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF update **********\n");
if (direction != GPRS_RLCMAC_DL_TBF)
return -EINVAL;
+ if (!ms_)
+ ms_ = ms();
+
+ if (!ms_)
+ return -EINVAL;
+
tbf_unlink_pdch(this);
- rc = bts_data->alloc_algorithm(bts_data, ms(), this, bts_data->alloc_algorithm_curst, 0);
+ rc = bts_data->alloc_algorithm(bts_data, ms_, this, bts_data->alloc_algorithm_curst, 0);
/* if no resource */
if (rc < 0) {
LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n");