pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email )
Change subject: gsmtap_util: Get rid of unused wq
......................................................................
gsmtap_util: Get rid of unused wq
struct gsmtap_inst went private in
1584b2ac39292aedddb8abd165957912fe9399c0 and
f38077ee6ab429ef3f0881a8ca7de4877032358a, which were merged prior to
libosmocore release 1.10.0. That release bumped the LIBVERSION major
counter, and hence that struct is officially not available and protected
by LIBVERSION ABI since then.
That means we can safely remove it from the implementation since nobody
compiled against this libversion should be using those fields directly anymore.
Related: OS#6213
Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
---
M src/core/gsmtap_util.c
1 file changed, 8 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/41700/1
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 62d3ffa..d6a9752 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -47,28 +47,14 @@
*
* \file gsmtap_util.c */
-/*! one gsmtap instance
- * Until gsmtap_inst_fd() is removed from the API at some point in the future, we have to keep the first member as
- * 'int' and the second as 'struct osmo_wqueue' (this effectively makes sure that the struct member wq.bfd.fd maintains
- * the same memory offset from the start of the struct) to ensure that inlined static 'instances' of gsmtap_inst_fd() in
- * old binaries keep working the way they used to even with gsmtap_inst objects obtained from newer versions of libosmocore */
+/*! one gsmtap instance */
struct gsmtap_inst {
- int osmo_io_mode; /*!< Indicates whether or not to use Osmo IO mode for message output (thus enabling use of tx queues).
- * This field member may not be changed or moved (backwards compatibility) */
- struct osmo_wqueue wq; /*!< the wait queue. This field member may not be changed or moved (backwards compatibility) */
-
- struct osmo_io_fd *out; /*!< Used when osmo_io_mode is nonzero */
+ int osmo_io_mode; /*!< Indicates whether or not to use Osmo IO mode for message output (thus enabling use of tx queues) */
+ int source_fd; /*!< the gsmtap source FD */
+ struct osmo_io_fd *out; /*!< Used when osmo_io_mode is nonzero */
int sink_fd;
};
-struct _gsmtap_inst_legacy {
- int ofd_wq_mode;
- struct osmo_wqueue wq;
- struct osmo_fd sink_ofd;
-};
-osmo_static_assert(offsetof(struct gsmtap_inst, wq) == offsetof(struct _gsmtap_inst_legacy, wq),
- gsmtap_inst_new_wq_offset_equals_legacy_wq_offset);
-
/*! Deprecated, use gsmtap_inst_fd2() instead
* \param[in] gti GSMTAP instance
* \returns file descriptor of GSMTAP instance */
@@ -82,7 +68,7 @@
* \returns file descriptor of GSMTAP instance */
int gsmtap_inst_fd2(const struct gsmtap_inst *gti)
{
- return gti->wq.bfd.fd;
+ return gti->source_fd;
}
/*! convert RSL channel number to GSMTAP channel type
@@ -485,15 +471,14 @@
gti = talloc_zero(NULL, struct gsmtap_inst);
gti->osmo_io_mode = ofd_wq_mode;
- /* Still using the wq member for its 'fd' field only, since we are keeping it for now, anyways */
- gti->wq.bfd.fd = fd;
+ gti->source_fd = fd;
gti->sink_fd = -1;
if (ofd_wq_mode) {
- gti->out = osmo_iofd_setup(gti, gti->wq.bfd.fd, "gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
+ gti->out = osmo_iofd_setup(gti, gti->source_fd, "gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
if (gti->out == NULL)
goto err_cleanup;
- if (osmo_iofd_register(gti->out, gti->wq.bfd.fd) < 0)
+ if (osmo_iofd_register(gti->out, gti->source_fd) < 0)
goto err_cleanup;
/* Use a big enough tx queue to avoid gsmtap messages being dropped: */
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
Gerrit-Change-Number: 41700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/39830?usp=email )
Change subject: fixup: rsl: properly initialize MS/BS Power Control state
......................................................................
fixup: rsl: properly initialize MS/BS Power Control state
Commit 75162427 fixed one problem, but introduced another one:
'''
/* Initialize MS Power Control defaults */
lchan->ms_power_ctrl = (struct lchan_power_ctrl_state) {
.max = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0),
.current = lchan->ms_power_ctrl.max, /* XXX */
};
'''
The intention here was to assign the same value to both 'max' and
'current' fields. However, field 'current' actually gets assigned
whatever value was assigned to field 'max' previously.
This regression was caught by running the BTS_Tests.TC_rsl_ms_pwr_ctrl
several times against the same osmo-bts-trx process.
Let's use the good-old memset() to initialize the MS/BS Power Control
state structures, and move initialization of 'max' and 'current' fields
to the else branches of the RSL_IE_{MS,BS}_POWER IE checks.
Change-Id: I46c881d5a3959c2542610ed767e0f131d01f9f98
Fixes: 75162427 ("rsl: properly initialize MS/BS Power Control state")
Related: SYS#4918, OS#6672
---
M src/common/rsl.c
1 file changed, 11 insertions(+), 14 deletions(-)
Approvals:
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 1104ef8..f16fe7c 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1987,17 +1987,9 @@
}
}
- /* Initialize MS Power Control defaults */
- lchan->ms_power_ctrl = (struct lchan_power_ctrl_state) {
- .max = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0),
- .current = lchan->ms_power_ctrl.max,
- };
-
- /* Initialize BS Power Control defaults */
- lchan->bs_power_ctrl = (struct lchan_power_ctrl_state) {
- .max = 2 * 15, /* maximum defined in 9.3.4 */
- .current = 0,
- };
+ /* Initialize MS/BS Power Control state */
+ memset(&lchan->ms_power_ctrl, 0, sizeof(lchan->ms_power_ctrl));
+ memset(&lchan->bs_power_ctrl, 0, sizeof(lchan->bs_power_ctrl));
/* 9.3.6 Channel Mode */
if (type != RSL_ACT_OSMO_PDCH) {
@@ -2054,13 +2046,18 @@
LOGPLCHAN(lchan, DRSL, LOGL_DEBUG, "BS Power attenuation %u dB\n",
lchan->bs_power_ctrl.current);
+ } else {
+ lchan->bs_power_ctrl.max = 2 * 15; /* maximum defined in 9.3.4 */
+ lchan->bs_power_ctrl.current = 0;
}
/* 9.3.13 MS Power */
- if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1)) {
+ if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1))
lchan->ms_power_ctrl.max = *TLVP_VAL(&tp, RSL_IE_MS_POWER) & 0x1F;
- lchan->ms_power_ctrl.current = lchan->ms_power_ctrl.max;
- }
+ else /* XXX: should we use the maximum power level instead of 0 dBm? */
+ lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
+ lchan->ms_power_ctrl.current = lchan->ms_power_ctrl.max;
+
/* 9.3.24 Timing Advance */
if (TLVP_PRES_LEN(&tp, RSL_IE_TIMING_ADVANCE, 1))
lchan->ta_ctrl.current = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/39830?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I46c881d5a3959c2542610ed767e0f131d01f9f98
Gerrit-Change-Number: 39830
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/39829?usp=email )
Change subject: rsl: rsl_rx_chan_activ(): set TA=0 if not indicated by the BSC
......................................................................
rsl: rsl_rx_chan_activ(): set TA=0 if not indicated by the BSC
Otherwise the TA loop would end up using whatever value was set
previously. Let's assume TA=0 if not indicated by the BSC.
Change-Id: I83f26ff06cebdfe8d4e75944f496e9678310e2a2
---
M src/common/rsl.c
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 7931a17..1104ef8 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2064,6 +2064,8 @@
/* 9.3.24 Timing Advance */
if (TLVP_PRES_LEN(&tp, RSL_IE_TIMING_ADVANCE, 1))
lchan->ta_ctrl.current = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE);
+ else /* assume TA=0 if not indicated by the BSC */
+ lchan->ta_ctrl.current = 0;
/* 9.3.31 (TLV) MS Power Parameters IE (vendor specific) */
if ((ie = TLVP_GET(&tp, RSL_IE_MS_POWER_PARAM)) != NULL) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/39829?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I83f26ff06cebdfe8d4e75944f496e9678310e2a2
Gerrit-Change-Number: 39829
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>