aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bts.cpp4
-rw-r--r--src/bts.h2
-rw-r--r--src/gprs_pcu.c3
-rw-r--r--src/gprs_pcu.h2
-rw-r--r--src/pcu_vty.c7
-rw-r--r--src/tbf.cpp2
-rw-r--r--src/tbf_dl.cpp2
-rw-r--r--src/tbf_ul.cpp2
-rw-r--r--tests/tbf/TbfTest.cpp18
9 files changed, 19 insertions, 23 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 9f987ff..450c04e 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -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;
diff --git a/src/bts.h b/src/bts.h
index db5f3e8..635c3c7 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -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;
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 209fca6..18c5568 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -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);
diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h
index 87c8cdf..b4e7c13 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -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;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index d107548..5e9da45 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -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;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index eb043e5..43c8cbf 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -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()
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 024a5f3..653db14 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -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);
}
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index f8c860c..1f3cb01 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -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);
}
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 66e344e..1b85201 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -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();