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/.
neels gerrit-no-reply at lists.osmocom.orgneels has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/17440 )
Change subject: virtphy: Fix GSMTAP ARFCN use with multi-TRX BTS
......................................................................
virtphy: Fix GSMTAP ARFCN use with multi-TRX BTS
In case we get assignments to secondary TRXs, the ARFCN of that
TRX must be used, and not the serving cell BCCH ARFCN.
Change-Id: Ief6cf5816969d819ff9506be70bec9b8d0d9d9be
---
M src/host/virt_phy/include/virtphy/virt_l1_model.h
M src/host/virt_phy/src/gsmtapl1_if.c
M src/host/virt_phy/src/l1ctl_sap.c
M src/host/virt_phy/src/virt_prim_data.c
M src/host/virt_phy/src/virt_prim_traffic.c
5 files changed, 35 insertions(+), 14 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h
index e2485fc..99ad39f 100644
--- a/src/host/virt_phy/include/virtphy/virt_l1_model.h
+++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h
@@ -68,6 +68,7 @@
struct {
uint8_t chan_type; // like rsl chantype 08.58 -> Chapter 9.3.1 */
+ uint16_t band_arfcn;
uint8_t tn; // timeslot number 1-7
uint8_t subslot; // subslot of the dedicated channel, SDCCH/4:[0-3], SDCCH/8:[0-7]
diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c
index 3fa69c4..83b01fe 100644
--- a/src/host/virt_phy/src/gsmtapl1_if.c
+++ b/src/host/virt_phy/src/gsmtapl1_if.c
@@ -81,7 +81,7 @@
struct l1ctl_info_ul *ul;
struct gsmtap_hdr *gh;
struct msgb *outmsg; /* msg to send with gsmtap header prepended */
- uint16_t arfcn = ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */
+ uint16_t arfcn;
uint8_t signal_dbm = 63; /* signal strength */
uint8_t snr = 63; /* signal noise ratio, 63 is best */
uint8_t *data = msgb_l2(msg); /* data to transmit (whole message without l1 header) */
@@ -92,6 +92,16 @@
uint8_t timeslot; /* tdma timeslot to send in (0-7) */
uint8_t gsmtap_chan; /* the gsmtap channel */
+ switch (ms->state.state) {
+ case MS_STATE_DEDICATED:
+ case MS_STATE_TBF:
+ arfcn = ms->state.dedicated.band_arfcn;
+ break;
+ default:
+ arfcn = ms->state.serving_cell.arfcn;
+ break;
+ }
+
switch (l1h->msg_type) {
case L1CTL_DATA_TBF_REQ:
ul = NULL;
@@ -235,18 +245,24 @@
gsm_fn2gsmtime(&ms->state.downlink_time, fn);
- /* we do not forward messages to l23 if we are in network search state */
- if (ms->state.state == MS_STATE_IDLE_SEARCHING)
+ switch (ms->state.state) {
+ case MS_STATE_IDLE_SEARCHING:
+ /* we do not forward messages to l23 if we are in network search state */
return;
-
- /* forward downlink msg to fbsb sync routine if we are in sync state */
- if (ms->state.state == MS_STATE_IDLE_SYNCING) {
+ case MS_STATE_IDLE_SYNCING:
+ /* forward downlink msg to fbsb sync routine if we are in sync state */
prim_fbsb_sync(ms, msg);
return;
- }
- /* generally ignore all messages coming from another arfcn than the camped one */
- if (ms->state.serving_cell.arfcn != arfcn) {
- return;
+ case MS_STATE_DEDICATED:
+ /* generally ignore all messages coming from another arfcn than the camped one */
+ if (arfcn != ms->state.dedicated.band_arfcn)
+ return;
+ break;
+ default:
+ /* generally ignore all messages coming from another arfcn than the camped one */
+ if (arfcn != ms->state.serving_cell.arfcn)
+ return;
+ break;
}
virt_l1_sched_sync_time(ms, ms->state.downlink_time, 0);
diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c
index 7669c86..0ff5412 100644
--- a/src/host/virt_phy/src/l1ctl_sap.c
+++ b/src/host/virt_phy/src/l1ctl_sap.c
@@ -286,9 +286,11 @@
rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot);
- LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_EST_REQ (chan_nr=0x%02x, tn=%u, ss=%u)\n",
- ul->chan_nr, timeslot, subslot);
+ LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_DM_EST_REQ (chan_nr=0x%02x, arfcn=%u, tn=%u, ss=%u)\n",
+ ul->chan_nr, ntohs(est_req->h0.band_arfcn), timeslot, subslot);
+ OSMO_ASSERT(est_req->h == 0); /* we don't do hopping */
+ ms->state.dedicated.band_arfcn = ntohs(est_req->h0.band_arfcn);
ms->state.dedicated.chan_type = rsl_chantype;
ms->state.dedicated.tn = timeslot;
ms->state.dedicated.subslot = subslot;
diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c
index 96534aa..65368b8 100644
--- a/src/host/virt_phy/src/virt_prim_data.c
+++ b/src/host/virt_phy/src/virt_prim_data.c
@@ -47,7 +47,8 @@
static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg)
{
gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg);
- l1ctl_tx_data_conf(ms, fn, 0, ms->state.serving_cell.arfcn);
+ /* FIXME: get ARFCN from msg payload */
+ l1ctl_tx_data_conf(ms, fn, 0, ms->state.dedicated.band_arfcn);
}
/**
diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c
index 3d2b2b1..0e08a12 100644
--- a/src/host/virt_phy/src/virt_prim_traffic.c
+++ b/src/host/virt_phy/src/virt_prim_traffic.c
@@ -47,7 +47,8 @@
static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg)
{
gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg);
- l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.serving_cell.arfcn);
+ /* FIXME: get ARFCN from msg payload */
+ l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.dedicated.band_arfcn);
}
/**
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/17440
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ief6cf5816969d819ff9506be70bec9b8d0d9d9be
Gerrit-Change-Number: 17440
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
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/20200309/4408e8cd/attachment.htm>