Attention is currently required from: fixeria, laforge, pespin.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-bts/+/42704?usp=email )
Change subject: trx: add JSON stats export for WebSDR API
......................................................................
Patch Set 8:
(1 comment)
Patchset:
PS8:
> As mentioned in the osmo-trx similar commit, I doubt this has to be merged into the repository. […]
Similar to the osmo-trx case, this is only built when --with-websdr is enabled, so it does not affect the default/native builds.
In the WebSDR setup, VTY/CTRL/stats interfaces are not directly accessible from the web frontend. While it is technically possible to emulate VTY access via callbacks (e.g. trigger a VTY command, capture its textual output and forward it to the frontend for parsing), this would require modifying core VTY paths (e.g. vty_out) under conditional compilation.
That approach would be more invasive and harder to maintain than keeping this separate implementation. Also, in this case I only need a limited subset of information (mainly stats from osmo-bts-trx), so introducing a full VTY round-trip + parsing would be unnecessary overhead.
So the intention here is to keep the core code untouched and provide a minimal, isolated path for the WebSDR use case.
Of course, I’m open to alternative approaches if there is a cleaner way to achieve this.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42704?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ifb82adfab879a65ecd222c45e06551983aa90a0f
Gerrit-Change-Number: 42704
Gerrit-PatchSet: 8
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 May 2026 16:30:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: falconia, fixeria, pespin.
csaba.sipos has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42714?usp=email )
Change subject: nokia: make Rx diversity configurable
......................................................................
Patch Set 3:
(1 comment)
File src/osmo-bsc/bts_nokia_site.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/42714/comment/de62206d_f0d90e3f?usp… :
PS3, Line 1214: fu_config[len + 7] = bts->nokia.rx_diversity;
> Through hard-coded bits in `bts_config_2[]` array. […]
@pespin@sysmocom.de And just to confirm: with Rx diversity capable models (Metro/Ultra and now Multiradio) the BTS manager also indicates after bootstrap that the TRXes are running in 2way RX diversity mode, plus the lab test also indicate that the two RX channels are doing MRC. Which means in a nutshell that this config option really does work :-)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42714?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I73bd91b717a8c8b338bacb6ed9db73bb07245c12
Gerrit-Change-Number: 42714
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: csaba.sipos <metro4(a)freemail.hu>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 May 2026 16:29:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-bts/+/42701?usp=email )
Change subject: bts: guard AMR RTP decoder stub with HAVE_LIBOSMOCODEC_STATIC
......................................................................
Patch Set 6:
(1 comment)
File configure.ac:
https://gerrit.osmocom.org/c/osmo-bts/+/42701/comment/737d2821_30c5f62a?usp… :
PS6, Line 350: if test -n "$osmocodec_libdir" && test -f "$osmocodec_libdir/libosmocodec.a" ; then
> AFAIU the fact that an static library exists doesn't mean you are statically linking against that li […]
You are right in general, but in this case it is under the condition that --with-websdr is enabled, where only static linking is possible (Emscripten/WASM target).
So the library is not just built as static, it is actually linked statically into the final module.
I would be happy to hear suggestions if there is a better way to structure or verify this.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42701?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie19ae2013893575a2f74a87af2151034abf57870
Gerrit-Change-Number: 42701
Gerrit-PatchSet: 6
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 May 2026 16:21:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-bts/+/42699?usp=email )
Change subject: abis: add helper to update BTS identity
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS6:
> This function in osmo-bts should only be added/merged once there's a patch using it. […]
Sure. It will be used in src/osmo-bts-trx/osmo-bts-trx-websdr.c as part of this patch: https://gerrit.osmocom.org/c/osmo-bts/+/42703
I can also squash this change with that patch if you prefer.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42699?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibafd66a1e1dc42ad0063c412087bee10d212fe33
Gerrit-Change-Number: 42699
Gerrit-PatchSet: 6
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 May 2026 16:15:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42718?usp=email )
Change subject: nokia skip-reset: make consistent with other vty settings
......................................................................
nokia skip-reset: make consistent with other vty settings
All other Nokia-specific vty settings use is_nokia_bts() helper
function, while the code for skip-reset directly compares
bts->type against GSM_BTS_TYPE_NOKIA_SITE. Change to use the
helper function: it is consistent with other vty settings,
and avoids one more place that erroneously refers to *Site
instead of all Nokia BTS.
Change-Id: Ie8cdac51f82185e2d4f37a8da00acba633670052
---
M src/osmo-bsc/bts_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index 54a9fab..cbf00d0 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -399,7 +399,7 @@
{
struct gsm_bts *bts = vty->index;
- if (bts->type != GSM_BTS_TYPE_NOKIA_SITE) {
+ if (!is_nokia_bts(bts)) {
vty_out(vty, "%% BTS is not of Nokia type%s", VTY_NEWLINE);
return CMD_WARNING;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42718?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie8cdac51f82185e2d4f37a8da00acba633670052
Gerrit-Change-Number: 42718
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42713?usp=email )
Change subject: nokia vty: change help strings away from "*Site"
......................................................................
nokia vty: change help strings away from "*Site"
Support for Nokia BTS in OsmoBSC is being expanded from just *Site
family to also include Flexi Multiradio - therefore, help strings
and error messages in vty should be changed accordingly.
FIXME: names of Nokia-specific vty settings still begin with
nokia_site, ditto for the name of the BTS model. TODO: decide
on a proper long-term solution.
Change-Id: I55556b7b5aa5bc6efcbee815e9011497a933697c
---
M src/osmo-bsc/bts_vty.c
1 file changed, 5 insertions(+), 7 deletions(-)
Approvals:
falconia: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index d69fb1f..54a9fab 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -387,7 +387,7 @@
"Set the IPA RSL IP Address of the BSC\n"
"Destination IP address for RSL connection\n");
-#define NOKIA_STR "Nokia *Site related commands\n"
+#define NOKIA_STR "Nokia BTS related commands\n"
DEFUN_USRATTR(cfg_bts_nokia_site_skip_reset,
cfg_bts_nokia_site_skip_reset_cmd,
@@ -400,7 +400,7 @@
struct gsm_bts *bts = vty->index;
if (bts->type != GSM_BTS_TYPE_NOKIA_SITE) {
- vty_out(vty, "%% BTS is not of Nokia *Site type%s", VTY_NEWLINE);
+ vty_out(vty, "%% BTS is not of Nokia type%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -420,8 +420,7 @@
struct gsm_bts *bts = vty->index;
if (!is_nokia_bts(bts)) {
- vty_out(vty, "%% BTS is not of Nokia *Site type%s",
- VTY_NEWLINE);
+ vty_out(vty, "%% BTS is not of Nokia type%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -442,8 +441,7 @@
struct gsm_bts *bts = vty->index;
if (!is_nokia_bts(bts)) {
- vty_out(vty, "%% BTS is not of Nokia *Site type%s",
- VTY_NEWLINE);
+ vty_out(vty, "%% BTS is not of Nokia type%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -464,7 +462,7 @@
struct gsm_bts *bts = vty->index;
if (!is_nokia_bts(bts)) {
- vty_out(vty, "%% BTS is not of Nokia *Site type%s", VTY_NEWLINE);
+ vty_out(vty, "%% BTS is not of Nokia type%s", VTY_NEWLINE);
return CMD_WARNING;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42713?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I55556b7b5aa5bc6efcbee815e9011497a933697c
Gerrit-Change-Number: 42713
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42712?usp=email )
Change subject: nokia: add support for Flexi Multiradio
......................................................................
nokia: add support for Flexi Multiradio
Previous support existed for Nokia MetroSite, UltraSite and InSite
models, resulting in BTS model name "nokia_site". However, there
exist newer Nokia BTS models that also support E1 Abis and can be
supported by OsmoBSC with relatively small changes: Flexi EDGE,
Flexi Multiradio and Flexi Multiradio 10. Out of these newer
models, American 2G Cooperative (the present patch author's current
organization) has only Flexi MR at the present time - hence this
model shall be the first "new" Nokia BTS to be supported.
The first change required in order to support Flexi MR is ability
to receive long OML messages that have been segmented by the BTS:
the new BTS sends a much longer BTS_CONF_REQ message, and we have
to handle it correctly.
Change-Id: Icd429552c3b5e90d6c5d3ae5f52afd6550e3cebc
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts_nokia_site.c
2 files changed, 138 insertions(+), 30 deletions(-)
Approvals:
falconia: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index a10d3c4..48b84af 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -333,6 +333,23 @@
gsm_bts_nr_t bts_nr; /* See (struct gsm_bts *)->nr */
};
+/* Both the standard GSM 12.21 flavor of OML and Nokia's proprietary flavor
+ * use segmentation, meaning that messages longer than 256 bytes (maximum
+ * that can fit into one LAPD frame with standard N201=260, with GSM 12.21
+ * FOM header taking up 4 bytes) have to be split and transferred one segment
+ * at a time. While this mechanism appears to be not needed for any currently
+ * supported BTS that uses standard GSM 12.21 NM, we have to implement it
+ * for Nokia BTS in both Rx and Tx directions: we have to send at least one
+ * long OML message for all supported Nokia models, whereas Rx of long messages
+ * becomes a requirement with newer Flexi Multiradio BTS.
+ *
+ * In order to implement Rx of segmented OML messages, we need a reassembly
+ * buffer, and in order to size this buffer, we need an upper limit on the
+ * number of segments. The following definition tunes this limit.
+ */
+#define NOKIA_OML_MAX_SEGMENT_LEN 256
+#define NOKIA_OML_MAX_RX_SEGMENTS 5
+
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
@@ -491,6 +508,13 @@
wait_reset:2, /* we are waiting for reset to complete */
hopping_mode:1; /* hopping type selection for Nokia */
struct osmo_timer_list reset_timer;
+ /* segmented OML Rx buffer */
+ struct {
+ uint8_t buffer[NOKIA_OML_MAX_SEGMENT_LEN * NOKIA_OML_MAX_RX_SEGMENTS];
+ bool active;
+ uint8_t seg_count;
+ uint16_t byte_count;
+ } oml_seg_rx;
} nokia;
};
diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index 10a4c5d..3b06d4b 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -1,4 +1,5 @@
-/* Nokia XXXsite family specific code */
+/* Nokia BTS vendor-specific code, currently supporting Site family
+ * and Flexi Multiradio. */
/* (C) 2011 by Dieter Spaar <spaar(a)mirider.augusta.de>
*
@@ -1410,9 +1411,9 @@
struct msgb *msg = nm_msgb_alloc();
if (seq == 0)
- max_send = 256 - sizeof(struct abis_om_nokia_hdr);
+ max_send = NOKIA_OML_MAX_SEGMENT_LEN - sizeof(struct abis_om_nokia_hdr);
else
- max_send = 256;
+ max_send = NOKIA_OML_MAX_SEGMENT_LEN;
if (len_remain > max_send) {
len_to_send = max_send;
@@ -1761,17 +1762,18 @@
* - receive ACK, start RSL link(s)
* ACK some other messages received from the BTS.
*
- * Probably its also possible to configure the BTS without a reset, this
- * has not been tested yet.
+ * It is also possible to configure the BTS without a reset, but in this case
+ * the BTS does not accept any changes in configuration - therefore, the mode
+ * of skipping BSC-driven BTS reset is only for use during osmo-bsc development,
+ * when the developer-operator resets the BTS manually before each test run.
*/
#define FIND_ELEM(data, data_len, ei, var, len) (find_element(data, data_len, ei, var, len) == len)
-static int abis_nm_rcvmsg_fom(struct msgb *mb)
+static int abis_nm_rcvmsg_fom(struct e1inp_sign_link *sign_link,
+ uint8_t *l3_msg, unsigned l3_msg_len)
{
- struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)mb->dst;
struct gsm_bts *bts = sign_link->trx->bts;
- struct abis_om_hdr *oh = msgb_l2(mb);
- struct abis_om_nokia_hdr *noh = msgb_l3(mb);
+ struct abis_om_nokia_hdr *noh = (struct abis_om_nokia_hdr *) l3_msg;
uint8_t mt = noh->msg_type;
int ret = 0;
uint16_t ref = ntohs(noh->reference);
@@ -1787,18 +1789,13 @@
int ei_alarm_detail_len = 0;
int len_data;
-
- if (bts->nokia.wait_reset) {
- LOG_BTS(bts, DNM, LOGL_INFO, "Ignoring message while waiting for reset: %s\n", msgb_hexdump(mb));
- return ret;
- }
-
- if (oh->length < sizeof(struct abis_om_nokia_hdr)) {
- LOG_BTS(bts, DNM, LOGL_ERROR, "Message too short: %s\n", msgb_hexdump(mb));
+ if (l3_msg_len < sizeof(struct abis_om_nokia_hdr)) {
+ LOG_BTS(bts, DNM, LOGL_ERROR, "Message too short: %s\n",
+ osmo_hexdump(l3_msg, l3_msg_len));
return -EINVAL;
}
- len_data = oh->length - sizeof(struct abis_om_nokia_hdr);
+ len_data = l3_msg_len - sizeof(struct abis_om_nokia_hdr);
LOG_BTS(bts, DNM, LOGL_INFO, "Rx (0x%02X) %s\n", mt, get_msg_type_name_string(mt));
#if 0 /* debugging */
dump_elements(noh->data, len_data);
@@ -1839,8 +1836,11 @@
LOG_BTS(bts, DNM, LOGL_ERROR, "Rx No ACK (%u): don't know how to proceed\n", ack);
/* TODO: properly handle failures (NACK) */
}
- } else
- LOG_BTS(bts, DNM, LOGL_ERROR, "Rx MSG_ACK but no EI_ACK found: %s\n", msgb_hexdump(mb));
+ } else {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Rx MSG_ACK but no EI_ACK found: %s\n",
+ osmo_hexdump(l3_msg, l3_msg_len));
+ }
/* TODO: the assumption for the following is that no NACK was received */
@@ -1997,7 +1997,87 @@
return ret;
}
-/* TODO: put in a separate file ? */
+static int abis_nm_rcvmsg_fom_seg(struct msgb *msg)
+{
+ struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)msg->dst;
+ struct gsm_bts *bts = sign_link->trx->bts;
+ struct abis_om_hdr *oh = msgb_l2(msg);
+ unsigned seg_len = oh->length;
+ uint8_t expect_seq;
+
+ /* 0 length segments aren't possible, valid range for segment length
+ * is [1,256] bytes, with code of 0 meaning 256. */
+ if (seg_len == 0)
+ seg_len = NOKIA_OML_MAX_SEGMENT_LEN;
+ if (msgb_l3len(msg) < seg_len) {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Message too short per FOM header: %s\n",
+ msgb_hexdump(msg));
+ return -EINVAL;
+ }
+
+ switch (oh->placement) {
+ case ABIS_OM_PLACEMENT_ONLY:
+ case ABIS_OM_PLACEMENT_FIRST:
+ /* clear any previous reassembly */
+ bts->nokia.oml_seg_rx.active = false;
+ expect_seq = 0;
+ break;
+ case ABIS_OM_PLACEMENT_MIDDLE:
+ case ABIS_OM_PLACEMENT_LAST:
+ if (!bts->nokia.oml_seg_rx.active) {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Rx ABIS OML fragment without prior part(s)\n");
+ return -EINVAL;
+ }
+ expect_seq = bts->nokia.oml_seg_rx.seg_count;
+ break;
+ default:
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Rx ABIS OML placement 0x%x is invalid\n",
+ oh->placement);
+ bts->nokia.oml_seg_rx.active = false;
+ return -EINVAL;
+ }
+ if (oh->sequence != expect_seq) {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Rx ABIS OML sequence 0x%x != expected 0x%x\n",
+ oh->sequence, expect_seq);
+ bts->nokia.oml_seg_rx.active = false;
+ return -EINVAL;
+ }
+
+ switch (oh->placement) {
+ case ABIS_OM_PLACEMENT_ONLY:
+ return abis_nm_rcvmsg_fom(sign_link, msgb_l3(msg), seg_len);
+ case ABIS_OM_PLACEMENT_FIRST:
+ bts->nokia.oml_seg_rx.active = true;
+ bts->nokia.oml_seg_rx.seg_count = 0;
+ bts->nokia.oml_seg_rx.byte_count = 0;
+ break;
+ case ABIS_OM_PLACEMENT_MIDDLE:
+ case ABIS_OM_PLACEMENT_LAST:
+ if (bts->nokia.oml_seg_rx.seg_count >= NOKIA_OML_MAX_RX_SEGMENTS) {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "segmented OML message exceeds current limit of %d segments\n",
+ NOKIA_OML_MAX_RX_SEGMENTS);
+ bts->nokia.oml_seg_rx.active = false;
+ return -EMSGSIZE;
+ }
+ break;
+ default:
+ OSMO_ASSERT(0);
+ }
+ memcpy(bts->nokia.oml_seg_rx.buffer + bts->nokia.oml_seg_rx.byte_count,
+ msgb_l3(msg), seg_len);
+ bts->nokia.oml_seg_rx.byte_count += seg_len;
+ bts->nokia.oml_seg_rx.seg_count++;
+ if (oh->placement != ABIS_OM_PLACEMENT_LAST)
+ return 0;
+ bts->nokia.oml_seg_rx.active = false;
+ return abis_nm_rcvmsg_fom(sign_link, bts->nokia.oml_seg_rx.buffer,
+ bts->nokia.oml_seg_rx.byte_count);
+}
int abis_nokia_rcvmsg(struct msgb *msg)
{
@@ -2006,14 +2086,18 @@
struct abis_om_hdr *oh = msgb_l2(msg);
int rc = 0;
- /* Various consistency checks */
- if (oh->placement != ABIS_OM_PLACEMENT_ONLY) {
- LOG_BTS(bts, DNM, LOGL_ERROR, "Rx ABIS OML placement 0x%x not supported\n", oh->placement);
- if (oh->placement != ABIS_OM_PLACEMENT_FIRST)
- return -EINVAL;
+ if (bts->nokia.wait_reset) {
+ LOG_BTS(bts, DNM, LOGL_INFO, "Ignoring message while waiting for reset: %s\n", msgb_hexdump(msg));
+ msgb_free(msg);
+ return 0;
}
- if (oh->sequence != 0) {
- LOG_BTS(bts, DNM, LOGL_ERROR, "Rx ABIS OML sequence 0x%x != 0x00\n", oh->sequence);
+
+ /* Various consistency checks */
+ if (msgb_l2len(msg) < sizeof(*oh)) {
+ LOG_BTS(bts, DNM, LOGL_ERROR,
+ "Message too short for FOM header: %s\n",
+ msgb_hexdump(msg));
+ msgb_free(msg);
return -EINVAL;
}
msg->l3h = (unsigned char *)oh + sizeof(*oh);
@@ -2021,7 +2105,7 @@
switch (oh->mdisc) {
case ABIS_OM_MDISC_FOM:
LOG_BTS(bts, DNM, LOGL_INFO, "Rx ABIS_OM_MDISC_FOM\n");
- rc = abis_nm_rcvmsg_fom(msg);
+ rc = abis_nm_rcvmsg_fom_seg(msg);
break;
case ABIS_OM_MDISC_MANUF:
LOG_BTS(bts, DNM, LOGL_INFO, "Rx ABIS_OM_MDISC_MANUF: ignoring\n");
@@ -2032,7 +2116,7 @@
break;
default:
LOG_BTS(bts, DNM, LOGL_ERROR, "Rx unknown ABIS OML message discriminator 0x%x\n", oh->mdisc);
- return -EINVAL;
+ rc = -EINVAL;
}
msgb_free(msg);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42712?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icd429552c3b5e90d6c5d3ae5f52afd6550e3cebc
Gerrit-Change-Number: 42712
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>