Move ws_* fields from BTS to PCU

Change-Id: I997bc52f0d924c8f2a0b1d6cf23af98828ad4258
This commit is contained in:
Pau Espin 2021-01-14 14:30:03 +01:00
parent 47f15fb6fd
commit 519d071131
9 changed files with 19 additions and 23 deletions

View File

@ -201,10 +201,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
bts->n3105 = 8;
bts->si13_is_set = false;
/* TODO: increase them when CRBB decoding is implemented */
bts->ws_base = 64;
bts->ws_pdch = 0;
bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
bts->llc_idle_ack_csec = 10;

View File

@ -102,8 +102,6 @@ struct gprs_rlcmac_bts {
uint8_t si13[GSM_MACBLOCK_LEN];
bool si13_is_set;
uint16_t ws_base;
uint16_t ws_pdch; /* increase WS by this value per PDCH */
/* State for dynamic algorithm selection */
int multislot_disabled;

View File

@ -91,6 +91,9 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
pcu->vty.mcs_lqual_ranges[8].low = 23;
pcu->vty.mcs_lqual_ranges[8].high = 256;
pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
/* TODO: increase them when CRBB decoding is implemented */
pcu->vty.ws_base = 64;
pcu->vty.ws_pdch = 0;
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);

View File

@ -95,6 +95,8 @@ struct gprs_pcu {
struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS];
struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_EDGE_MCS];
enum gprs_ns2_dialect ns_dialect; /* Are we talking Gb with IP-SNS (true) or classic Gb? */
uint16_t ws_base;
uint16_t ws_pdch; /* increase WS by this value per PDCH */
} vty;
struct gsmtap_inst *gsmtap;

View File

@ -195,7 +195,7 @@ static int config_write_pcu(struct vty *vty)
the_pcu->vty.max_mcs_ul, VTY_NEWLINE);
}
vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch,
vty_out(vty, " window-size %d %d%s", the_pcu->vty.ws_base, the_pcu->vty.ws_pdch,
VTY_NEWLINE);
if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
@ -557,13 +557,12 @@ DEFUN_USRATTR(cfg_pcu_window_size,
"Base value (b)\n"
"Factor for number of PDCH (f)")
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t b = atoi(argv[0]);
bts->ws_base = b;
the_pcu->vty.ws_base = b;
if (argc > 1) {
uint16_t f = atoi(argv[1]);
bts->ws_pdch = f;
the_pcu->vty.ws_pdch = f;
}
return CMD_SUCCESS;

View File

@ -321,7 +321,7 @@ uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts_data, uint8_t slots
uint8_t num_pdch = pcu_bitcount(slots);
return OSMO_MIN((num_pdch != 1) ? (128 * num_pdch) : 192,
OSMO_MAX(64, (bts_data->ws_base + num_pdch * bts_data->ws_pdch) / 32 * 32));
OSMO_MAX(64, (the_pcu->vty.ws_base + num_pdch * the_pcu->vty.ws_pdch) / 32 * 32));
}
int gprs_rlcmac_tbf::update()

View File

@ -1494,7 +1494,7 @@ void gprs_rlcmac_dl_tbf::set_window_size()
uint16_t ws = egprs_window_size(b, dl_slots());
LOGPTBFDL(this, LOGL_INFO, "setting EGPRS DL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n",
ws, b->ws_base, pcu_bitcount(dl_slots()), b->ws_pdch);
ws, bts->pcu->vty.ws_base, pcu_bitcount(dl_slots()), bts->pcu->vty.ws_pdch);
m_window.set_ws(ws);
}

View File

@ -764,7 +764,7 @@ void gprs_rlcmac_ul_tbf::set_window_size()
const struct gprs_rlcmac_bts *b = bts->bts_data();
uint16_t ws = egprs_window_size(b, ul_slots());
LOGPTBFUL(this, LOGL_INFO, "setting EGPRS UL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n",
ws, b->ws_base, pcu_bitcount(ul_slots()), b->ws_pdch);
ws, bts->pcu->vty.ws_base, pcu_bitcount(ul_slots()), bts->pcu->vty.ws_pdch);
m_window.set_ws(ws);
}

View File

@ -1749,7 +1749,6 @@ static void test_tbf_egprs_two_phase_puan(void)
uint32_t tlli = 0xf1223344;
const char *imsi = "0011223344";
uint8_t ms_class = 1;
gprs_rlcmac_bts *bts;
uint8_t egprs_ms_class = 1;
gprs_rlcmac_ul_tbf *ul_tbf;
uint8_t test_data[256];
@ -1760,9 +1759,8 @@ static void test_tbf_egprs_two_phase_puan(void)
setup_bts(the_bts, ts_no, 4);
the_bts->bts_data()->initial_mcs_dl = 9;
bts = the_bts->bts_data();
bts->ws_base = 128;
bts->ws_pdch = 64;
the_pcu->vty.ws_base = 128;
the_pcu->vty.ws_pdch = 64;
ul_tbf = establish_ul_tbf(the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class);
/* Function to generate URBB with no length */
@ -1782,8 +1780,8 @@ static void test_tbf_egprs_two_phase_puan(void)
static_cast<gprs_rlc_ul_window *>(ul_tbf->window())->reset_state();
/* Function to generate CRBB */
bts->ws_base = 128;
bts->ws_pdch = 64;
the_pcu->vty.ws_base = 128;
the_pcu->vty.ws_pdch = 64;
ul_tbf = establish_ul_tbf_two_phase_puan_CRBB(the_bts, ts_no, tlli, &fn,
qta, ms_class, egprs_ms_class);
@ -2288,8 +2286,8 @@ static void test_tbf_ws()
setup_bts(the_bts, ts_no);
bts->ws_base = 128;
bts->ws_pdch = 64;
the_pcu->vty.ws_base = 128;
the_pcu->vty.ws_pdch = 64;
the_pcu->alloc_algorithm = alloc_algorithm_b;
bts->trx[0].pdch[2].enable();
bts->trx[0].pdch[3].enable();
@ -2336,8 +2334,8 @@ static void test_tbf_update_ws(void)
setup_bts(the_bts, ts_no);
bts->ws_base = 128;
bts->ws_pdch = 64;
the_pcu->vty.ws_base = 128;
the_pcu->vty.ws_pdch = 64;
the_pcu->alloc_algorithm = alloc_algorithm_b;
bts->trx[0].pdch[2].enable();
bts->trx[0].pdch[3].enable();