diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-30 09:44:05 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-03 15:37:16 +0200 |
commit | 83426b20a30832cbacd8165f5b757910e98f5417 (patch) | |
tree | 1bdbb0dda9c20c2a45f27758616c660e4de3c898 /src/gprs_rlcmac_ts_alloc.cpp | |
parent | 617c7127f434fc866ca370e8812f1ad01ad90d27 (diff) |
alloc: Ignore slots with differing TSC if multiple slots are requested
According to TS 45.002, 6.4.2 the training sequence (TSC) must be the
same for all slots in a multi-slot set.
This commit updates find_possible_pdchs() to only consider slots with
the same TSC if more that 1 slot shall be assigned.
Note that the first PDCH's TSC will be used as reference, so if two
or more groups with a common TSC are configured, only the first will
be used. This restriction does not apply to algorithm A, since it
will not assign more than one slot and therefore sets the max_slots
parameter to 1.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_rlcmac_ts_alloc.cpp')
-rw-r--r-- | src/gprs_rlcmac_ts_alloc.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2ba920ab..116cabe0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -101,10 +101,12 @@ static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) } static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, + size_t max_slots, uint8_t mask, const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; + int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { struct gprs_rlcmac_pdch *pdch; @@ -124,6 +126,21 @@ static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, continue; } + if (max_slots > 1) { + /* check if TSC changes, see TS 45.002, 6.4.2 */ + if (last_tsc < 0) + last_tsc = pdch->tsc; + else if (last_tsc != pdch->tsc) { + LOGP(DRLCMAC, LOGL_ERROR, + "Skipping TS %d of TRX=%d, because it " + "has different TSC than lower TS of TRX. " + "In order to allow multislot, all " + "slots must be configured with the same " + "TSC!\n", ts, trx->trx_no); + continue; + } + } + valid_ts_set |= 1 << ts; } @@ -244,7 +261,7 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, if (ts >= 0) mask = 1 << ts; - mask = find_possible_pdchs(tbf->trx, mask, mask_reason); + mask = find_possible_pdchs(tbf->trx, 1, mask, mask_reason); if (!mask) return -EINVAL; |