aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-22 02:17:21 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-22 02:53:00 +0300
commite0154aa09bbcab1a03a368dede544d7c93fe68df (patch)
treebc3a49722ff2da23a665ccb4e1de69f7826fb9a4
parentcosmetic: s/repeated_acch_capability/rep_acch_cap/g (diff)
downloadOsmoBTS-e0154aa09bbcab1a03a368dede544d7c93fe68df.tar.xz
OsmoBTS-e0154aa09bbcab1a03a368dede544d7c93fe68df.zip
struct gsm_lchan: group ACCH repetition state fields
Change-Id: I2680c88f2a51b64f085a92233bc125338622babf Related: SYS#5114
-rw-r--r--include/osmo-bts/lchan.h13
-rw-r--r--src/common/l1sap.c38
-rw-r--r--src/common/lchan.c4
-rw-r--r--src/common/measurement.c16
-rw-r--r--src/common/vty.c6
-rw-r--r--src/osmo-bts-trx/sched_lchan_xcch.c2
6 files changed, 41 insertions, 38 deletions
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 03b31441..3eb4f935 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -304,13 +304,16 @@ struct gsm_lchan {
/* ECU (Error Concealment Unit) state */
struct osmo_ecu_state *ecu_state;
+ /* Repeated ACCH capabilities and current state */
struct abis_rsl_osmo_rep_acch_cap rep_acch_cap;
- bool repeated_dl_facch_active;
- bool repeated_ul_sacch_active;
- bool repeated_dl_sacch_active;
+ struct {
+ bool dl_facch_active;
+ bool ul_sacch_active;
+ bool dl_sacch_active;
- /* Message buffer to store DL-SACCH repeation candidate */
- struct msgb *rep_sacch;
+ /* Message buffer to store DL-SACCH repeation candidate */
+ struct msgb *dl_sacch_msg;
+ } rep_acch;
/* Cached early Immediate Assignment message: if the Immediate Assignment arrives before the channel is
* confirmed active, then cache it here and send it once the channel is confirmed to be active. This is related
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index cbe43b4c..d94e3bcf 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1037,15 +1037,15 @@ static inline struct msgb *lapdm_phsap_dequeue_msg_sacch(struct gsm_lchan *lchan
* possible candidates in order to have one ready in case the MS enables
* SACCH repetition. */
- if (lchan->rep_sacch) {
+ if (lchan->rep_acch.dl_sacch_msg) {
if (lchan->meas.l1_info.srr_sro == 0) {
/* Toss previous repetition candidate */
- msgb_free(lchan->rep_sacch);
- lchan->rep_sacch = NULL;
+ msgb_free(lchan->rep_acch.dl_sacch_msg);
+ lchan->rep_acch.dl_sacch_msg = NULL;
} else {
/* Use previous repetition candidate */
- msg = lchan->rep_sacch;
- lchan->rep_sacch = NULL;
+ msg = lchan->rep_acch.dl_sacch_msg;
+ lchan->rep_acch.dl_sacch_msg = NULL;
return msg;
}
}
@@ -1059,7 +1059,7 @@ static inline struct msgb *lapdm_phsap_dequeue_msg_sacch(struct gsm_lchan *lchan
/* Only LAPDm frames for SAPI 0 may become a repetition
* candidate. */
if (sapi == 0)
- lchan->rep_sacch = msgb_copy(msg, "rep_sacch");
+ lchan->rep_acch.dl_sacch_msg = msgb_copy(msg, "rep_sacch");
return msg;
}
@@ -1143,20 +1143,20 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
p = msgb_put(msg, GSM_MACBLOCK_LEN);
/* L1-header, if not set/modified by layer 1 */
p[0] = lchan->ms_power_ctrl.current;
- if (lchan->repeated_ul_sacch_active)
+ if (lchan->rep_acch.ul_sacch_active)
p[0] |= 0x40; /* See also: 3GPP TS 44.004, section 7.1 */
p[1] = lchan->ta_ctrl.current;
le = &lchan->lapdm_ch.lapdm_acch;
if (lchan->rep_acch_cap.dl_sacch) {
/* Check if MS requests SACCH repetition and update state accordingly */
if (lchan->meas.l1_info.srr_sro) {
- if (lchan->repeated_dl_sacch_active == false)
+ if (lchan->rep_acch.dl_sacch_active == false)
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: inactive => active\n");
- lchan->repeated_dl_sacch_active = true;
+ lchan->rep_acch.dl_sacch_active = true;
} else {
- if (lchan->repeated_dl_sacch_active == true)
+ if (lchan->rep_acch.dl_sacch_active == true)
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: active => inactive\n");
- lchan->repeated_dl_sacch_active = false;
+ lchan->rep_acch.dl_sacch_active = false;
}
pp_msg = lapdm_phsap_dequeue_msg_sacch(lchan, le);
} else {
@@ -1166,7 +1166,7 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
if (lchan->ts->trx->bts->dtxd)
dtxd_facch = true;
le = &lchan->lapdm_ch.lapdm_dcch;
- if (lchan->repeated_dl_facch_active && lchan->rsl_cmode != RSL_CMOD_SPD_SIGN)
+ if (lchan->rep_acch.dl_facch_active && lchan->rsl_cmode != RSL_CMOD_SPD_SIGN)
pp_msg = lapdm_phsap_dequeue_msg_facch(lchan, le, fn);
else
pp_msg = lapdm_phsap_dequeue_msg(le);
@@ -1427,20 +1427,20 @@ static void repeated_ul_sacch_active_decision(struct gsm_lchan *lchan,
{
uint16_t upper = 0;
uint16_t lower = 0;
- bool prev_repeated_ul_sacch_active = lchan->repeated_ul_sacch_active;
+ bool prev_repeated_ul_sacch_active = lchan->rep_acch.ul_sacch_active;
/* This is an optimization so that we exit as quickly as possible if
* there are no uplink SACCH repetition capabilities present.
* However If the repeated UL-SACCH capabilities vanish for whatever
* reason, we must be sure that UL-SACCH repetition is disabled. */
if (!lchan->rep_acch_cap.ul_sacch) {
- lchan->repeated_ul_sacch_active = false;
+ lchan->rep_acch.ul_sacch_active = false;
goto out;
}
/* Threshold disabled (repetition is always on) */
if (lchan->rep_acch_cap.rxqual == 0) {
- lchan->repeated_ul_sacch_active = true;
+ lchan->rep_acch.ul_sacch_active = true;
goto out;
}
@@ -1459,14 +1459,14 @@ static void repeated_ul_sacch_active_decision(struct gsm_lchan *lchan,
/* If upper/rxqual == 0, then repeated UL-SACCH is always on */
if (ber10k >= upper)
- lchan->repeated_ul_sacch_active = true;
+ lchan->rep_acch.ul_sacch_active = true;
else if (ber10k <= lower)
- lchan->repeated_ul_sacch_active = false;
+ lchan->rep_acch.ul_sacch_active = false;
out:
- if (lchan->repeated_ul_sacch_active == prev_repeated_ul_sacch_active)
+ if (lchan->rep_acch.ul_sacch_active == prev_repeated_ul_sacch_active)
return;
- if (lchan->repeated_ul_sacch_active)
+ if (lchan->rep_acch.ul_sacch_active)
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "UL-SACCH repetition: inactive => active\n");
else
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "UL-SACCH repetition: active => inactive\n");
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 9661010a..423ecc13 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -296,8 +296,8 @@ void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
msgb_free(lchan->tch.rep_facch[1].msg);
lchan->tch.rep_facch[0].msg = NULL;
lchan->tch.rep_facch[1].msg = NULL;
- msgb_free(lchan->rep_sacch);
- lchan->rep_sacch = NULL;
+ msgb_free(lchan->rep_acch.dl_sacch_msg);
+ lchan->rep_acch.dl_sacch_msg = NULL;
/* fall through */
default:
if (lchan->early_rr_ia) {
diff --git a/src/common/measurement.c b/src/common/measurement.c
index ec061313..52431c53 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -798,7 +798,7 @@ static void repeated_dl_facch_active_decision(struct gsm_lchan *lchan,
uint8_t upper;
uint8_t lower;
uint8_t rxqual;
- bool prev_repeated_dl_facch_active = lchan->repeated_dl_facch_active;
+ bool prev_repeated_dl_facch_active = lchan->rep_acch.dl_facch_active;
/* This is an optimization so that we exit as quickly as possible if
* there are no FACCH repetition capabilities present. However If the
@@ -806,13 +806,13 @@ static void repeated_dl_facch_active_decision(struct gsm_lchan *lchan,
* sure that FACCH repetition is disabled. */
if (!lchan->rep_acch_cap.dl_facch_cmd
&& !lchan->rep_acch_cap.dl_facch_all) {
- lchan->repeated_dl_facch_active = false;
+ lchan->rep_acch.dl_facch_active = false;
goto out;
}
/* Threshold disabled (always on) */
if (lchan->rep_acch_cap.rxqual == 0) {
- lchan->repeated_dl_facch_active = true;
+ lchan->rep_acch.dl_facch_active = true;
goto out;
}
@@ -820,7 +820,7 @@ static void repeated_dl_facch_active_decision(struct gsm_lchan *lchan,
* (repeated SACCH requested) then it makes sense to enable
* FACCH repetition too. */
if (lchan->meas.l1_info.srr_sro) {
- lchan->repeated_dl_facch_active = true;
+ lchan->rep_acch.dl_facch_active = true;
goto out;
}
@@ -852,14 +852,14 @@ static void repeated_dl_facch_active_decision(struct gsm_lchan *lchan,
rxqual = meas_res->rxqual_full;
if (rxqual >= upper)
- lchan->repeated_dl_facch_active = true;
+ lchan->rep_acch.dl_facch_active = true;
else if (rxqual <= lower)
- lchan->repeated_dl_facch_active = false;
+ lchan->rep_acch.dl_facch_active = false;
out:
- if (lchan->repeated_dl_facch_active == prev_repeated_dl_facch_active)
+ if (lchan->rep_acch.dl_facch_active == prev_repeated_dl_facch_active)
return;
- if (lchan->repeated_dl_facch_active)
+ if (lchan->rep_acch.dl_facch_active)
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-FACCH repetition: inactive => active\n");
else
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-FACCH repetition: active => inactive\n");
diff --git a/src/common/vty.c b/src/common/vty.c
index b894ba80..124f7ef2 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1723,7 +1723,7 @@ static void lchan_acch_rep_state_dump(struct vty *vty, unsigned int indent,
VTY_NEWLINE);
else
cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
- if (lchan->repeated_dl_facch_active)
+ if (lchan->rep_acch.dl_facch_active)
cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
else
cfg_out(vty, "retransmission currently inactive%s",
@@ -1737,7 +1737,7 @@ static void lchan_acch_rep_state_dump(struct vty *vty, unsigned int indent,
VTY_NEWLINE);
else
cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
- if (lchan->repeated_dl_sacch_active)
+ if (lchan->rep_acch.dl_sacch_active)
cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
else
cfg_out(vty, "retransmission currently inactive%s",
@@ -1751,7 +1751,7 @@ static void lchan_acch_rep_state_dump(struct vty *vty, unsigned int indent,
VTY_NEWLINE);
else
cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
- if (lchan->repeated_ul_sacch_active)
+ if (lchan->rep_acch.ul_sacch_active)
cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
else
cfg_out(vty, "retransmission currently inactive%s",
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index e2baefd2..e8f46c1a 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -60,7 +60,7 @@ int rx_data_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
uint16_t ber10k;
int rc;
struct gsm_lchan *lchan = chan_state->lchan;
- bool rep_sacch = L1SAP_IS_LINK_SACCH(trx_chan_desc[bi->chan].link_id) && lchan->repeated_ul_sacch_active;
+ bool rep_sacch = L1SAP_IS_LINK_SACCH(trx_chan_desc[bi->chan].link_id) && lchan->rep_acch.ul_sacch_active;
/* If handover RACH detection is turned on, treat this burst as an Access Burst.
* Handle NOPE.ind as usually to ensure proper Uplink measurement reporting. */