tbf: Move the updating of the data into the tbf class

This commit is contained in:
Holger Hans Peter Freyther 2013-10-26 17:49:36 +02:00
parent fcbc702112
commit aa9c326d7e
3 changed files with 11 additions and 11 deletions

View File

@ -838,7 +838,7 @@ int gprs_rlcmac_downlink_ack(
memset(&tbf->dir.dl, 0, sizeof(tbf->dir.dl)); /* reset RLC states */ memset(&tbf->dir.dl, 0, sizeof(tbf->dir.dl)); /* reset RLC states */
tbf->state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; /* keep TO flags */ tbf->state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; /* keep TO flags */
tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);
tbf_update(tbf); tbf->update();
gprs_rlcmac_trigger_downlink_assignment(tbf, tbf, NULL); gprs_rlcmac_trigger_downlink_assignment(tbf, tbf, NULL);
return 0; return 0;

View File

@ -78,7 +78,7 @@ static int tbf_append_data(struct gprs_rlcmac_tbf *tbf,
tbf->state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; tbf->state_flags &= GPRS_RLCMAC_FLAG_TO_MASK;
tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);
tbf_update_ms_class(tbf, ms_class); tbf_update_ms_class(tbf, ms_class);
tbf_update(tbf); tbf->update();
gprs_rlcmac_trigger_downlink_assignment(tbf, tbf, NULL); gprs_rlcmac_trigger_downlink_assignment(tbf, tbf, NULL);
} else { } else {
/* the TBF exists, so we must write it in the queue /* the TBF exists, so we must write it in the queue
@ -306,26 +306,26 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
talloc_free(tbf); talloc_free(tbf);
} }
int tbf_update(struct gprs_rlcmac_tbf *tbf) int gprs_rlcmac_tbf::update()
{ {
struct gprs_rlcmac_tbf *ul_tbf = NULL; struct gprs_rlcmac_tbf *ul_tbf = NULL;
gprs_rlcmac_bts *bts = tbf->bts->bts_data(); struct gprs_rlcmac_bts *bts_data = bts->bts_data();
int rc; int rc;
LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF update **********\n"); LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF update **********\n");
if (tbf->direction != GPRS_RLCMAC_DL_TBF) if (direction != GPRS_RLCMAC_DL_TBF)
return -EINVAL; return -EINVAL;
if (!tbf->ms_class) { if (!ms_class) {
LOGP(DRLCMAC, LOGL_DEBUG, "- Cannot update, no class\n"); LOGP(DRLCMAC, LOGL_DEBUG, "- Cannot update, no class\n");
return -EINVAL; return -EINVAL;
} }
ul_tbf = bts->bts->tbf_by_tlli(tbf->tlli, GPRS_RLCMAC_UL_TBF); ul_tbf = bts->tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
tbf_unlink_pdch(tbf); tbf_unlink_pdch(this);
rc = bts->alloc_algorithm(bts, ul_tbf, tbf, bts->alloc_algorithm_curst, 0); rc = bts_data->alloc_algorithm(bts_data, ul_tbf, this, bts_data->alloc_algorithm_curst, 0);
/* if no ressource */ /* if no ressource */
if (rc < 0) { if (rc < 0) {
LOGP(DRLCMAC, LOGL_ERROR, "No ressource after update???\n"); LOGP(DRLCMAC, LOGL_ERROR, "No ressource after update???\n");

View File

@ -101,6 +101,8 @@ struct gprs_rlcmac_tbf {
int rlcmac_diag(); int rlcmac_diag();
int update();
struct llist_head list; struct llist_head list;
uint32_t state_flags; uint32_t state_flags;
enum gprs_rlcmac_tbf_direction direction; enum gprs_rlcmac_tbf_direction direction;
@ -228,8 +230,6 @@ struct gprs_rlcmac_tbf *tbf_by_tfi(struct gprs_rlcmac_bts *bts,
void tbf_free(struct gprs_rlcmac_tbf *tbf); void tbf_free(struct gprs_rlcmac_tbf *tbf);
int tbf_update(struct gprs_rlcmac_tbf *tbf);
int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf);
void tbf_new_state(struct gprs_rlcmac_tbf *tbf, void tbf_new_state(struct gprs_rlcmac_tbf *tbf,