diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-11-27 15:17:34 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-12-15 15:17:51 +0100 |
commit | 86b6f05d19c8559b99d548730e54c1a4bfb7beba (patch) | |
tree | f22e5bd988217e5f2b4164d0613381829b69a58b /src/tbf.cpp | |
parent | 5643f35fb4d09b160c4cd14c8e0ef6f2b7dce07e (diff) |
edge: Support EGPRS multislot class handling in tbf_alloc
Add an egprs_ms_class argument to the allocation functions and
set/pass it where necessary.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 0fc6edf..2d0aa9f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -271,7 +271,7 @@ void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction di } gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, - int8_t use_trx, uint8_t ms_class, + int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms) { struct gprs_rlcmac_ul_tbf *tbf; @@ -279,7 +279,7 @@ gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, #warning "Copy and paste with tbf_new_dl_assignment" /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -537,7 +537,7 @@ void gprs_rlcmac_tbf::poll_timeout() static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -594,14 +594,14 @@ static int ul_tbf_dtor(struct gprs_rlcmac_ul_tbf *tbf) struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF starts here **********\n"); - LOGP(DRLCMAC, LOGL_INFO, "Allocating %s TBF: MS_CLASS=%d\n", - "UL", ms_class); + LOGP(DRLCMAC, LOGL_INFO, "Allocating %s TBF: MS_CLASS=%d/%d\n", + "UL", ms_class, egprs_ms_class); tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); @@ -612,9 +612,9 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, new (tbf) gprs_rlcmac_ul_tbf(bts->bts); if (!ms) - ms = bts->bts->ms_alloc(ms_class); + ms = bts->bts->ms_alloc(ms_class, egprs_ms_class); - rc = setup_tbf(tbf, ms, use_trx, ms_class, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); /* if no resource */ if (rc < 0) { talloc_free(tbf); @@ -656,7 +656,7 @@ static int dl_tbf_dtor(struct gprs_rlcmac_dl_tbf *tbf) struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -674,9 +674,9 @@ struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, new (tbf) gprs_rlcmac_dl_tbf(bts->bts); if (!ms) - ms = bts->bts->ms_alloc(ms_class); + ms = bts->bts->ms_alloc(ms_class, egprs_ms_class); - rc = setup_tbf(tbf, ms, use_trx, ms_class, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, 0, single_slot); /* if no resource */ if (rc < 0) { talloc_free(tbf); @@ -971,7 +971,8 @@ int gprs_rlcmac_tbf::establish_dl_tbf_on_pacch() bts->tbf_reused(); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), 0); + this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, 0); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); |