This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/24176 )
Change subject: [VAMOS] struct gsm_bts_trx: fix the PHY instance pointer
......................................................................
[VAMOS] struct gsm_bts_trx: fix the PHY instance pointer
First of all, there is no reason to use a void pointer because
it's always 'struct phy_instance'. Also, no need to encapsulate
this pointer into 'role_bts' because there are no other roles in
osmo-bts (we used to have shared headers years ago).
This commit also fixes a bug in test_sysmobts_auto_band(), where a
pointer to 'struct femtol1_hdl' was directly assigned to trx.pinst.
Change-Id: I9bd6f0921e0c6bf824d38485486ad78864cbe17e
---
M include/osmo-bts/bts_trx.h
M include/osmo-bts/phy_link.h
M src/common/main.c
M src/common/phy_link.c
M src/common/vty.c
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/scheduler_trx.c
M tests/sysmobts/sysmobts_test.c
8 files changed, 15 insertions(+), 14 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index 7d60a73..100eaba 100644
--- a/include/osmo-bts/bts_trx.h
+++ b/include/osmo-bts/bts_trx.h
@@ -36,9 +36,8 @@
struct gsm_power_ctrl_params *ms_dpc_params; /* MS Dynamic Power Control */
bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */
- struct {
- void *l1h;
- } role_bts;
+ /* The associated PHY instance */
+ struct phy_instance *pinst;
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index 0c693bb..467ad52 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -173,7 +173,7 @@
static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx)
{
OSMO_ASSERT(trx);
- return trx->role_bts.l1h;
+ return trx->pinst;
}
int bts_model_phy_link_open(struct phy_link *plink);
diff --git a/src/common/main.c b/src/common/main.c
index 2503352..73efc25 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -341,7 +341,7 @@
}
llist_for_each_entry(trx, &g_bts->trx_list, list) {
- if (!trx->role_bts.l1h) {
+ if (!trx->pinst) {
fprintf(stderr, "TRX %u has no associated PHY instance\n",
trx->nr);
exit(1);
diff --git a/src/common/phy_link.c b/src/common/phy_link.c
index 77d7aa6..411f870 100644
--- a/src/common/phy_link.c
+++ b/src/common/phy_link.c
@@ -118,7 +118,7 @@
void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx)
{
- trx->role_bts.l1h = pinst;
+ trx->pinst = pinst;
pinst->trx = trx;
}
@@ -128,8 +128,8 @@
llist_del(&pinst->list);
/* remove reverse link from TRX */
- OSMO_ASSERT(pinst->trx->role_bts.l1h == pinst);
- pinst->trx->role_bts.l1h = NULL;
+ OSMO_ASSERT(pinst->trx->pinst == pinst);
+ pinst->trx->pinst = NULL;
pinst->trx = NULL;
talloc_free(pinst);
diff --git a/src/common/vty.c b/src/common/vty.c
index 9e428e7..3b59316 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -987,7 +987,7 @@
return CMD_WARNING;
}
- trx->role_bts.l1h = pinst;
+ trx->pinst = pinst;
pinst->trx = trx;
return CMD_SUCCESS;
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 112a6ab..491f7cd 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -138,8 +138,7 @@
static inline struct l1sched_trx *trx_l1sched_hdl(struct gsm_bts_trx *trx)
{
- struct phy_instance *pinst = trx->role_bts.l1h;
- struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+ struct trx_l1h *l1h = trx->pinst->u.osmotrx.hdl;
return &l1h->l1s;
}
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index efd4954..c173f5b 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -73,13 +73,13 @@
/* Check the "cache" first, so we eliminate frequent lookups */
idx = gsm0502_hop_seq_gen(&time, SCHED_FH_PARAMS_VALS(ts), NULL);
if (ts->fh_trx_list[idx] != NULL)
- return ts->fh_trx_list[idx]->role_bts.l1h;
+ return ts->fh_trx_list[idx]->pinst;
/* The "cache" may not be filled yet, lookup the transceiver */
llist_for_each_entry(trx, &ts->trx->bts->trx_list, list) {
if (trx->arfcn == ts->hopping.arfcn_list[idx]) {
ts->fh_trx_list[idx] = trx;
- return trx->role_bts.l1h;
+ return trx->pinst;
}
}
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c
index 4b01ed7..d1e9e69 100644
--- a/tests/sysmobts/sysmobts_test.c
+++ b/tests/sysmobts/sysmobts_test.c
@@ -52,14 +52,17 @@
{
struct gsm_bts bts;
struct gsm_bts_trx trx;
+ struct phy_instance pinst;
struct femtol1_hdl hdl;
int i;
memset(&bts, 0, sizeof(bts));
memset(&trx, 0, sizeof(trx));
+ memset(&pinst, 0, sizeof(pinst));
memset(&hdl, 0, sizeof(hdl));
trx.bts = &bts;
- trx.role_bts.l1h = &hdl;
+ trx.pinst = &pinst;
+ trx.pinst->u.sysmobts.hdl = &hdl;
/* claim to support all hw_info's */
hdl.hw_info.band_support = GSM_BAND_850 | GSM_BAND_900 |
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24176
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I9bd6f0921e0c6bf824d38485486ad78864cbe17e
Gerrit-Change-Number: 24176
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210511/8eed8dd9/attachment.htm>