alloc_algorithm_b: Rearrange variable initialization

Untangle variable assignment at the start of the function. Changes end
up in same kind of assignment, but are far easier to understand based on
the variable use later on.
* reserved_{dl,ul}_slots contain mask of TS either "previously-reserved" or
  "intended to be reserved now" based on MS's ms_class.
* {dl,ul}_slots contain a derived mask from the one above, filtered
  further based on more factors like type of allocation requested (multi
  vs single), available USFs (UL), etc.

Change-Id: If3cfa82f8b793a87e97145ee8a6fc0fe1a61add6
This commit is contained in:
Pau Espin 2021-05-10 12:25:20 +02:00
parent 393484a5d0
commit 50272a4776
1 changed files with 6 additions and 9 deletions

View File

@ -883,10 +883,8 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf_,
/* Step 1: Get current state from the MS object */
OSMO_ASSERT(ms);
dl_slots = ms_reserved_dl_slots(ms);
ul_slots = ms_reserved_ul_slots(ms);
reserved_dl_slots = ms_reserved_dl_slots(ms);
reserved_ul_slots = ms_reserved_ul_slots(ms);
first_common_ts = ms_first_common_ts(ms);
trx = ms_current_trx(ms);
@ -901,14 +899,13 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf_,
if (!trx)
trx = &bts->trx[trx_no];
if (!dl_slots || !ul_slots) {
rc = find_multi_slots(trx, ms_ms_class(ms), &ul_slots, &dl_slots);
if (!reserved_dl_slots || !reserved_ul_slots) {
rc = find_multi_slots(trx, ms_ms_class(ms), &reserved_ul_slots, &reserved_dl_slots);
if (rc < 0)
return rc;
}
reserved_dl_slots = dl_slots;
reserved_ul_slots = ul_slots;
dl_slots = reserved_dl_slots;
ul_slots = reserved_ul_slots;
/* Step 3a: Derive the slot set for the current TBF */
rc = tbf_select_slot_set(tbf, trx, single, ul_slots, dl_slots, reserved_ul_slots, reserved_dl_slots,