diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-01-14 12:53:53 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-01-18 11:38:38 +0100 |
commit | a281495008082768be15b5aa63271cce1ee128e0 (patch) | |
tree | cf81a3f4629ef7b1616f98902bb622bf80115dde | |
parent | 03de898d193e7e73c0cb700a2d00e2b6a913c458 (diff) |
Move alpha,gamma fields from BTS to PCU
Change-Id: I2fdd9c8a7393157183fff64084bb10e2a3b1dc63
-rw-r--r-- | src/bts.cpp | 5 | ||||
-rw-r--r-- | src/bts.h | 1 | ||||
-rw-r--r-- | src/gprs_pcu.c | 1 | ||||
-rw-r--r-- | src/gprs_pcu.h | 1 | ||||
-rw-r--r-- | src/pcu_vty.c | 14 | ||||
-rw-r--r-- | src/tbf.cpp | 6 | ||||
-rw-r--r-- | tests/emu/pcu_emu.cpp | 2 |
7 files changed, 12 insertions, 18 deletions
diff --git a/src/bts.cpp b/src/bts.cpp index f9657144..3200b40a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -200,7 +200,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj) bts->n3101 = 10; bts->n3103 = 4; bts->n3105 = 8; - bts->alpha = 0; /* a = 0.0 */ bts->si13_is_set = false; bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ @@ -966,7 +965,7 @@ send_imm_ass_rej: plen = Encoding::write_immediate_assignment( &m_bts.trx[trx_no].pdch[ts_no], tbf, bv, false, rip->ra, Fn, ta, usf, false, sb_fn, - m_bts.alpha, m_bts.gamma, -1, + pcu->vty.alpha, pcu->vty.gamma, -1, rip->burst_type); do_rate_ctr_inc(CTR_IMMEDIATE_ASSIGN_UL_TBF); } @@ -1048,7 +1047,7 @@ void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, bool poll, uint16_t pgroup) tbf, immediate_assignment, true, 125, (tbf->pdch[ts_no]->last_rts_fn + 21216) % GSM_MAX_FN, tbf->ta(), 7, poll, tbf->poll_fn, - m_bts.alpha, m_bts.gamma, -1, + pcu->vty.alpha, pcu->vty.gamma, -1, GSM_L1_BURST_TYPE_ACCESS_0); if (plen >= 0) { do_rate_ctr_inc(CTR_IMMEDIATE_ASSIGN_DL_TBF); @@ -106,7 +106,6 @@ struct gprs_rlcmac_bts { uint8_t n3105; struct gprs_rlcmac_trx trx[8]; - uint8_t alpha, gamma; bool dl_tbf_preemptive_retransmission; uint8_t si13[GSM_MACBLOCK_LEN]; bool si13_is_set; diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c index e08094b5..f791e431 100644 --- a/src/gprs_pcu.c +++ b/src/gprs_pcu.c @@ -50,6 +50,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx) pcu->vty.max_cs_dl = MAX_GPRS_CS; pcu->vty.max_mcs_ul = MAX_EDGE_MCS; pcu->vty.max_mcs_dl = MAX_EDGE_MCS; + pcu->vty.alpha = 0; /* a = 0.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 4920966c..d6d2dcad 100644 --- a/src/gprs_pcu.h +++ b/src/gprs_pcu.h @@ -75,6 +75,7 @@ struct gprs_pcu { uint8_t max_cs_dl, max_cs_ul; uint8_t max_mcs_dl, max_mcs_ul; uint8_t force_two_phase; + uint8_t alpha, gamma; } vty; struct gsmtap_inst *gsmtap; diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 83fb166f..06e16749 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -229,8 +229,8 @@ static int config_write_pcu(struct vty *vty) vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE); if (the_pcu->vty.force_two_phase) vty_out(vty, " two-phase-access%s", VTY_NEWLINE); - vty_out(vty, " alpha %d%s", bts->alpha, VTY_NEWLINE); - vty_out(vty, " gamma %d%s", bts->gamma * 2, VTY_NEWLINE); + vty_out(vty, " alpha %d%s", the_pcu->vty.alpha, VTY_NEWLINE); + vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE); if (!bts->dl_tbf_preemptive_retransmission) vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE); if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT)) @@ -804,10 +804,7 @@ DEFUN_ATTR(cfg_pcu_alpha, "Alpha in units of 0.1\n", CMD_ATTR_IMMEDIATE) { - struct gprs_rlcmac_bts *bts = bts_main_data(); - - bts->alpha = atoi(argv[0]); - + the_pcu->vty.alpha = atoi(argv[0]); return CMD_SUCCESS; } @@ -818,10 +815,7 @@ DEFUN_ATTR(cfg_pcu_gamma, "Gamma in even unit of dBs\n", CMD_ATTR_IMMEDIATE) { - struct gprs_rlcmac_bts *bts = bts_main_data(); - - bts->gamma = atoi(argv[0]) / 2; - + the_pcu->vty.gamma = atoi(argv[0]) / 2; return CMD_SUCCESS; } diff --git a/src/tbf.cpp b/src/tbf.cpp index c42081b6..eb043e5b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -926,7 +926,7 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn, uint8_t ts) Encoding::write_packet_downlink_assignment(mac_control_block, old_tfi_is_valid, m_tfi, (direction == GPRS_RLCMAC_DL_TBF), new_dl_tbf, poll_ass_dl, rrbp, - bts_data()->alpha, bts_data()->gamma, -1, 0, + the_pcu->vty.alpha, the_pcu->vty.gamma, -1, 0, is_egprs_enabled()); LOGP(DTBF, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++\n"); rc = encode_gsm_rlcmac_downlink(&bv, mac_control_block); @@ -1029,8 +1029,8 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); Encoding::write_packet_uplink_assignment(mac_control_block, m_tfi, (direction == GPRS_RLCMAC_DL_TBF), tlli(), - is_tlli_valid(), new_tbf, 1, rrbp, bts_data()->alpha, - bts_data()->gamma, -1, is_egprs_enabled()); + is_tlli_valid(), new_tbf, 1, rrbp, the_pcu->vty.alpha, + the_pcu->vty.gamma, -1, is_egprs_enabled()); LOGP(DTBF, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++\n"); rc = encode_gsm_rlcmac_downlink(&bv, mac_control_block); diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index 7534b841..96aacda0 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -72,13 +72,13 @@ static void init_main_bts() bts->n3101 = 10; bts->n3103 = 4; bts->n3105 = 8; - bts->alpha = 0; /* a = 0.0 */ } static void init_pcu(struct gprs_pcu *pcu) { if (!pcu->alloc_algorithm) pcu->alloc_algorithm = alloc_algorithm_b; + pcu->vty.alpha = 0; /* a = 0.0 */ } static void bvci_unblocked(struct gprs_bssgp_pcu *pcu) |