aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-14 08:26:17 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-21 19:26:24 +0200
commit7a4bd9661bd5b5297132ea55c16cd8a5248cb693 (patch)
tree04398d273b3a6f8de843d54d192050c01b7f51ad
parent66ba0844be5058032cb31c6ee3e31428417b171f (diff)
alloc: Optionally enforce first common TS in find_multi_slots (TODO)jerlbeck/wip/pdch-alloc
TODO: - This isn't probably triggered at all currently, so this commit can possibly be dropped
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 0daeaf5..199eb41 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -505,7 +505,8 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts,
static int find_multi_slots(struct gprs_rlcmac_bts *bts,
struct gprs_rlcmac_trx *trx,
- const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots)
+ const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots,
+ int first_common_ts)
{
const struct gprs_ms_multislot_class *ms_class;
uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */
@@ -523,6 +524,8 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
unsigned num_tx;
enum {MASK_TT, MASK_TR};
unsigned mask_sel;
+ uint8_t common_mask = 0;
+ uint8_t common_req = 0;
if (ms->ms_class() >= 32) {
LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n",
@@ -599,6 +602,11 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
max_ul_slots = 0;
max_dl_slots = 0;
+ if (first_common_ts >= 0) {
+ common_req = 1 << first_common_ts;
+ common_mask = (common_req << 1) - 1;
+ }
+
/* Iterate through possible numbers of TX slots */
for (num_tx = 1; num_tx <= ms_class->tx; num_tx += 1) {
uint16_t tx_valid_win = (1 << num_tx) - 1;
@@ -735,6 +743,15 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
if (!rx_window)
continue;
+ /* Check required common slots */
+ if (((tx_window & rx_window) & common_mask) != common_req) {
+ LOGP(DRLCMAC, LOGL_INFO,
+ "Common slot pre-selection mismatch: "
+ "%02x %02x %02x %02x\n",
+ tx_window, rx_window, common_mask, common_req);
+ continue;
+ }
+
/* Check number of common slots according to TS 54.002, 6.4.2.2 */
common_slot_count = bitcount(tx_window & rx_window);
req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count);
@@ -873,7 +890,8 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
trx = &bts->trx[trx_no];
if (!dl_slots || !ul_slots) {
- rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots);
+ rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots,
+ first_common_ts);
if (rc < 0)
return rc;