From 02d7cd2ac204ef6f65a879afff101f5ec1999c44 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 15 Jan 2013 08:59:34 +0100 Subject: Get rid of allocating first timeslot at tfi_alloc This simpliefies the allocation process. tfi_alloc is responsible to allocate a TFI, not a time slot. The first time slot available depends on multislot class and on other ongoing TBF (concurrent TBFs), so it is part of the allocation algorithm to select it. --- src/gprs_bssgp_pcu.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gprs_bssgp_pcu.cpp') diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 414e96bb..6ea99203 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -192,7 +192,8 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp) tbf->ms_class = ms_class; } } else { - uint8_t trx, ts, use_trx, first_ts, ta, ss; + uint8_t trx, ta, ss; + int8_t use_trx; struct gprs_rlcmac_tbf *old_tbf; /* check for uplink data, so we copy our informations */ @@ -200,27 +201,25 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp) if (tbf && tbf->dir.ul.contention_resolution_done && !tbf->dir.ul.final_ack_sent) { use_trx = tbf->trx; - first_ts = tbf->first_ts; ta = tbf->ta; ss = 0; old_tbf = tbf; } else { use_trx = -1; - first_ts = -1; ta = 0; /* FIXME: initial TA */ ss = 1; /* PCH assignment only allows one timeslot */ old_tbf = NULL; } // Create new TBF (any TRX) - tfi = tfi_alloc(GPRS_RLCMAC_DL_TBF, &trx, &ts, use_trx, first_ts); + tfi = tfi_alloc(GPRS_RLCMAC_DL_TBF, &trx, use_trx); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ return -EBUSY; } /* set number of downlink slots according to multislot class */ - tbf = tbf_alloc(tbf, GPRS_RLCMAC_DL_TBF, tfi, trx, ts, ms_class, + tbf = tbf_alloc(tbf, GPRS_RLCMAC_DL_TBF, tfi, trx, ms_class, ss); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH ressource\n"); -- cgit v1.2.3