tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index
......................................................................
icE1usb fw: Use 'int' as the default type for port index
No benefit to use uint8_t and for consistency with later patches,
use 'int' here too.
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: I50a76476af844acf20436b9d410cb917b723590d
---
M firmware/ice40-riscv/icE1usb/e1.h
M firmware/ice40-riscv/icE1usb/misc.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/37/26837/1
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h
index 9ceffdd..862d568 100644
--- a/firmware/ice40-riscv/icE1usb/e1.h
+++ b/firmware/ice40-riscv/icE1usb/e1.h
@@ -57,5 +57,5 @@
E1P_LED_ST_BLINK_FAST = 3
};
-extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led,
+extern void e1_platform_led_set(int port, enum e1_platform_led led,
enum e1_platform_led_state state);
diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c
index 3117be9..a25bcc5 100644
--- a/firmware/ice40-riscv/icE1usb/misc.c
+++ b/firmware/ice40-riscv/icE1usb/misc.c
@@ -53,7 +53,7 @@
}
void
-e1_platform_led_set(uint8_t port, enum e1_platform_led led,
+e1_platform_led_set(int port, enum e1_platform_led led,
enum e1_platform_led_state state)
{
uint32_t tmp;
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I50a76476af844acf20436b9d410cb917b723590d
Gerrit-Change-Number: 26837
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26836 )
Change subject: icE1usb fw: Fix computation of received E1 frames from USB
......................................................................
icE1usb fw: Fix computation of received E1 frames from USB
Several issues :
- The reported length includes the CRC so it's minus 6 and
not minus 4. (2 for CRC, 4 for header)
- Cast length to int to make it signed so the minus works
- If the packet is empty, this would be negative (no header),
underflow, and then try to submit a giant number of frames
to the E1 hardware
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: Ib754e460290fe2e1551a0090e30a51846131d07d
---
M firmware/ice40-riscv/icE1usb/usb_e1.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/36/26836/1
diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c
index 3de6071..ed4826f 100644
--- a/firmware/ice40-riscv/icE1usb/usb_e1.c
+++ b/firmware/ice40-riscv/icE1usb/usb_e1.c
@@ -171,8 +171,9 @@
usb_data_read(&hdr, ptr, 4);
/* Empty data into the FIFO */
- int n = ((csr & USB_BD_LEN_MSK) - 4) / 32;
- n = e1_tx_feed_data((ptr >> 2) + 1, n);
+ int n = ((int)(csr & USB_BD_LEN_MSK) - 6) / 32;
+ if (n > 0)
+ e1_tx_feed_data((ptr >> 2) + 1, n);
refill:
/* Refill it */
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26836
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Ib754e460290fe2e1551a0090e30a51846131d07d
Gerrit-Change-Number: 26836
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: newchange
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/26691 )
Change subject: initial osmocom boilerplate source tree
......................................................................
Patch Set 5: Code-Review+1
(1 comment)
https://gerrit.osmocom.org/c/osmo-upf/+/26691/5/README.md
File README.md:
https://gerrit.osmocom.org/c/osmo-upf/+/26691/5/README.md@37
PS5, Line 37: h
URL works (via redirect) but one could use the correct/new URL of mailman3
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/26691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I4352dd8738a1a9de6ba2fc250ee8eef69c65ff1e
Gerrit-Change-Number: 26691
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jan 2022 15:35:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26874 )
Change subject: bsc: Fix TC_rsl_drop_counter due to IPA_Emulation component being alive-type
......................................................................
bsc: Fix TC_rsl_drop_counter due to IPA_Emulation component being alive-type
IPA_Emulation component was marked with the "alive" type recently, in
order to avoid race conditions leading to errors during tear down of the
test.
It turns out, the way "alive" keeps the component alive is by means of
not closing the sockets when the component is stopped. As a result,
TC_rsl_drop_counter test stopped working properly because it was
specting a TCP FIN to be sent to osmo-bsc when the component was
stopped.
In order to fix it, add a new CFG port to the IPA_Emulation component on
which one can operate. Add a a new method to tell the component to close
the socket.
Then, put that in BSC_Tests into a function which was actually unsued
until now, and use it in the test in order to have the specific logic
enclosed in a function helper.
Fixes: 7138913d664c33b2404e3d293ab820fb3516ff73
Change-Id: I68163b053313d9907ba8e40954a5933d14cb7db6
---
M bsc/BSC_Tests.ttcn
M library/IPA_Emulation.ttcnpp
2 files changed, 56 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/26874/1
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index c485ec5..7bfc387 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -595,6 +595,8 @@
port IPA_CODEC_PT IPA; /* Required for compilation of TC_rsl_unknown_unit_id() */
/* CTRL muxed over IPA in SCCPlite conn BSC<->MSC (or BSC-NAT) */
port IPA_CTRL_PT SCCPLITE_IPA_CTRL;
+ /* Configure/manage IPA_Emulation: */
+ port IPA_CFG_PT IPA_CFG_PORT;
var MGCP_Emulation_CT vc_MGCP;
port TELNETasp_PT BSCVTY;
@@ -926,6 +928,7 @@
}
map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+ connect(clnt.vc_IPA:CFG_PORT, self:IPA_CFG_PORT);
if (handler_mode) {
connect(clnt.vc_IPA:IPA_RSL_PORT, clnt.vc_RSL:IPA_PT);
} else {
@@ -955,9 +958,22 @@
}
function f_ipa_rsl_stop(inout IPA_Client clnt) runs on test_CT {
+ var IPL4asp_Types.Result res := {
+ errorCode := omit,
+ connId := omit,
+ os_error_code := omit,
+ os_error_text := omit
+ };
+
if (not isbound(clnt) or not isbound(clnt.vc_IPA)) {
return;
}
+
+ /* Alive components don't finish sockets (TCP FIN) when they are
+ * stopped. Hence, we need to manually call close() on them to make sure
+ * the IUT knows about it. */
+ f_ipa_cfg_disconnect(IPA_CFG_PORT, res);
+
clnt.vc_IPA.stop;
if (isbound(clnt.vc_RSL)) {
clnt.vc_RSL.stop;
@@ -3555,7 +3571,7 @@
rsl_fail := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail");
- bts[0].rsl.vc_IPA.stop;
+ f_ipa_rsl_stop(bts[0].rsl);
f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail", rsl_fail+1);
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 5cdf324..0cd7314 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -206,6 +206,9 @@
type component IPA_Emulation_CT {
/* down-facing port to IPA codec port */
port IPA_CODEC_PT IPA_PORT;
+ /* Down facing port to configure the component */
+ port IPA_CFG_PT CFG_PORT;
+
#ifdef IPA_EMULATION_SCCP
/* up-facing port to SCCP */
port MTP3asp_SP_PT MTP3_SP_PORT;
@@ -286,6 +289,17 @@
osmo_rand := ""
};
+signature IPA_CFG_disconnect(inout IPL4asp_Types.Result res);
+type port IPA_CFG_PT procedure {
+ inout IPA_CFG_disconnect;
+} with { extension "internal" };
+
+function f_ipa_cfg_disconnect(IPA_CFG_PT pt, inout IPL4asp_Types.Result res) {
+ pt.call(IPA_CFG_disconnect:{res}) {
+ [] pt.getreply(IPA_CFG_disconnect:{?}) -> param (res) {};
+ }
+}
+
/* Function to use to connect as client to a remote IPA Server */
function f_connect(charstring remote_host, IPL4asp_Types.PortNumber remote_port,
charstring local_host, IPL4asp_Types.PortNumber local_port,
@@ -318,6 +332,25 @@
g_is_bsc_mgw := false;
}
+private function f_close() runs on IPA_Emulation_CT return IPL4asp_Types.Result {
+ var IPL4asp_Types.Result res;
+ select (g_mode) {
+ case (IPA_MODE_CLIENT) {
+ res := IPA_CodecPort_CtrlFunct.f_IPL4_close(IPA_PORT, g_self_conn_id, {tcp := {}});
+ g_self_conn_id := -1;
+ }
+ case (IPA_MODE_SERVER) {
+ res := IPA_CodecPort_CtrlFunct.f_IPL4_close(IPA_PORT, g_last_conn_id, {tcp := {}});
+ g_last_conn_id := -1;
+ }
+ case else {
+ setverdict(fail, "Unknown mode");
+ mtc.stop;
+ }
+ }
+ return res;
+}
+
#ifdef IPA_EMULATION_SCCP
template ASP_MTP3_TRANSFERind ts_MTP3_XFER_ind(integer opc, octetstring data) := {
sio := { '10'B, '00'B, '0011'B },
@@ -661,6 +694,7 @@
var Socket_API_Definitions.PortEvent port_evt;
var octetstring payload;
var ASP_IPA_Unitdata ipa_ud;
+ var IPL4asp_Types.Result res;
#ifdef IPA_EMULATION_CTRL
var CtrlMessage ctrl_msg;
#endif
@@ -888,6 +922,11 @@
IPA_PORT.send(f_from_asp(f_ipa_conn_id(), ipa_ud));
}
+ /* Received call to configure/operate the component */
+ [] CFG_PORT.getcall(IPA_CFG_disconnect:{?}) {
+ res := f_close();
+ CFG_PORT.reply(IPA_CFG_disconnect:{res});
+ }
}
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26874
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I68163b053313d9907ba8e40954a5933d14cb7db6
Gerrit-Change-Number: 26874
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange