Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33035 )
Change subject: BTS_Tests: f_est_dchan(): add support for CSD channel modes
......................................................................
Patch Set 1:
(1 comment)
File bts/BTS_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33035/comment/e002476a_a17e…
PS1, Line 2546: case (tr_RSL_ChanMode_SIGN)
> what? you can use templates as cases?
Yeah, why not? :) ETSI ES 201 873-1 defines the syntax as follows:
```
select "(" SingleExpression ")" "{"
{ case "(" { TemplateInstance[","] } ")" StatementBlock }+
[ case else StatementBlock ]
"}"
```
> I wonder how is that implemented, given that 2 templates could match the same value...
I guess the one that matches first wins.
> did you make sure this works as expected?
Yes. Actually we already do have templates-in-select in our code base:
```
bsc/BSC_Tests.ttcn: select (arfcn_) {
bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((259..293), false, ?)) { band := "GSM450"; }
bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((306..340), false, ?)) { band := "GSM480"; }
bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((438..511), false, ?)) { band := "GSM750"; }
bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((128..251), false, ?)) { band := "GSM850"; }
bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((0..124), false, ?)) { band := "GSM900"; }
```
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33035
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: I066657941dd751183aa5e937a6bfe9ab7837d46b
Gerrit-Change-Number: 33035
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 27 May 2023 09:11:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33063 )
Change subject: coding: gsm0503_tch_{fr,hr}_encode(): add ability to emit BFI
......................................................................
coding: gsm0503_tch_{fr,hr}_encode(): add ability to emit BFI
Every BTS needs to have some graceful handling for the scenario
where it is time to send out a speech frame on TCH DL, but there is
no frame to be sent. One possible solution is to transmit dummy
FACCH, but this option is unattractive for TCH/HS where FACCH
displaces two speech frames rather than one. A more elegant
solution is to emit a speech frame with inverted CRC3, causing
the MS receiver to declare a BFI condition to its Rx DTX handler.
Setting all u(k) bits to 0 is one way to produce such an inverted-CRC
speech frame (normal TCH FR/HR CRC3 for an all-zeros frame would be
111), and this method is in fact what sysmoBTS PHY is observed to do.
Add the same ability to gsm0503_tch_{fr,hr}_encode() functions,
indicated by payload length of 0.
Change-Id: Iade3310e16b906efb6892d28f474a0d15204e861
---
M src/coding/gsm0503_coding.c
1 file changed, 43 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/33063/1
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 724bea2..c3b7bbc 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -1941,6 +1941,20 @@
osmo_conv_encode(&gsm0503_tch_fr, conv, cB);
h = 0;
break;
+ case 0: /* no data, induce BFI in the receiver */
+ /* Do the same thing that sysmoBTS PHY does when fed a 0-length
+ * payload for DL: set all u(k) bits to 0, and do the same
+ * with all class 2 bits. This operation is NOT the same as
+ * an FR codec frame of all zero bits: with all-zeros d(k) input
+ * the CRC3 function will produce 111 output, whereas we
+ * transmit 000 in those parity bits too. The result will be
+ * an induced BFI (bad frame indication) condition in the
+ * receiver. */
+ memset(conv, 0, 185);
+ memset(cB + 378, 0, 78);
+ osmo_conv_encode(&gsm0503_tch_fr, conv, cB);
+ h = 0;
+ break;
case GSM_MACBLOCK_LEN: /* FACCH */
_xcch_encode_cB(cB, tch_data);
h = 1;
@@ -2084,8 +2098,9 @@
tch_hr_b_to_d(d, b);
osmo_crc8gen_set_bits(&gsm0503_tch_fr_crc3, d + 73, 22, p);
tch_hr_reorder(conv, d, p);
- osmo_conv_encode(&gsm0503_tch_hr, conv, cB);
memcpy(cB + 211, d + 95, 17);
+hr_conv_coding:
+ osmo_conv_encode(&gsm0503_tch_hr, conv, cB);
h = 0;
gsm0503_tch_hr_interleave(cB, iB);
for (i = 0; i < 4; i++) {
@@ -2093,6 +2108,11 @@
&bursts[i * 116], &h, i >> 1);
}
break;
+ case 0: /* no data, induce BFI in the receiver */
+ /* see comments in gsm0503_tch_fr_encode() - same deal here */
+ memset(conv, 0, 98);
+ memset(cB + 211, 0, 17);
+ goto hr_conv_coding;
case GSM_MACBLOCK_LEN: /* FACCH */
_xcch_encode_cB(cB, tch_data);
h = 1;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33063
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iade3310e16b906efb6892d28f474a0d15204e861
Gerrit-Change-Number: 33063
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33061 )
Change subject: trx: fix HR1 codec breakage from format change
......................................................................
trx: fix HR1 codec breakage from format change
As of commit 1160cabefb23, the common layer of osmo-bts accepts both
TS 101 318 and RFC 5993 formats for HR1 codec, and always passes
the more basic TS 101 318 format to the BTS model. Unfortunately,
osmo-bts-trx has model-specific code checking the payload length
that was overlooked in that patch, causing breakage. Fix that bug.
(The actual channel encoding function in libosmocoding already
accepts 14-byte payloads.)
Related: OS#5688
Fixes: I702e26c3ad5b9d8347e73c6cd23efa38a3a3407e
Change-Id: I0e251faeffb76d2604a4100c848141d239d1d86f
---
M src/osmo-bts-trx/sched_lchan_tchf.c
1 file changed, 20 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/33061/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 43a3784..0d0f52a 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -390,7 +390,7 @@
switch (tch_mode) {
case GSM48_CMODE_SPEECH_V1: /* FR / HR */
if (br->chan != TRXC_TCHF) /* HR */
- len = GSM_HR_BYTES_RTP_RFC5993;
+ len = GSM_HR_BYTES;
else
len = GSM_FR_BYTES;
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33061
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0e251faeffb76d2604a4100c848141d239d1d86f
Gerrit-Change-Number: 33061
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32912 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: remove obsolete context_map_check_released() call
......................................................................
remove obsolete context_map_check_released() call
When in map_rua_fsm_cleanup(), we are always already deallocating the
context map, i.e. neither RUA nor SCCP are active anymore. No need to
call context_map_check_released() again.
Change-Id: I4bf9a9de7861296ec38c3a37de0254ad9a41ef1b
---
M src/osmo-hnbgw/context_map_rua.c
1 file changed, 13 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c
index bc012f3..5a715c4 100644
--- a/src/osmo-hnbgw/context_map_rua.c
+++ b/src/osmo-hnbgw/context_map_rua.c
@@ -314,7 +314,6 @@
{
struct hnbgw_context_map *map = fi->priv;
map->rua_fi = NULL;
- context_map_check_released(map);
}
#define S(x) (1 << (x))
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32912
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I4bf9a9de7861296ec38c3a37de0254ad9a41ef1b
Gerrit-Change-Number: 32912
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32911 )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: drop dead code: cnlink.T_RafC
......................................................................
drop dead code: cnlink.T_RafC
This looks like working RANAP RESET handling, but is in fact dead code.
Instead of testing and completing this implementation, I will copy the
RESET handling FSM from osmo-bsc, which is proven to work well.
See Id3eefdea889a736fd5957b80280fa45b9547b792
"detect in/active CN links by RANAP RESET"
The future patch will start to use transmit_rst(). So instead of
dropping now and resurrecting later, let's keep the code -- but it has
to be '#if 0'-ed to avoid compiler complaints about the unused function.
Related: SYS#6412
Change-Id: I7cacaec631051cf5420202f2f0dd9665a5565b17
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw_cn.c
2 files changed, 28 insertions(+), 55 deletions(-)
Approvals:
neels: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index e3ec38b..e67a86a 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -61,24 +61,9 @@
uint32_t cid; /*!< Cell ID */
};
-enum hnbgw_cnlink_state {
- /* we have just been initialized or were disconnected */
- CNLINK_S_NULL,
- /* establishment of the SUA/SCCP link is pending */
- CNLINK_S_EST_PEND,
- /* establishment of the SUA/SCCP link was confirmed */
- CNLINK_S_EST_CONF,
- /* we have esnt the RANAP RESET and wait for the ACK */
- CNLINK_S_EST_RST_TX_WAIT_ACK,
- /* we have received the RANAP RESET ACK and are active */
- CNLINK_S_EST_ACTIVE,
-};
-
struct hnbgw_cnlink {
struct llist_head list;
- enum hnbgw_cnlink_state state;
- /* timer for re-transmitting the RANAP Reset */
- struct osmo_timer_list T_RafC;
+
/* reference to the SCCP User SAP by which we communicate */
struct osmo_sccp_instance *sccp;
struct osmo_sccp_user *sccp_user;
diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c
index a256b24..d9e35af 100644
--- a/src/osmo-hnbgw/hnbgw_cn.c
+++ b/src/osmo-hnbgw/hnbgw_cn.c
@@ -37,14 +37,9 @@
#include <osmocom/ranap/ranap_msg_factory.h>
#include <osmocom/hnbgw/context_map.h>
-/***********************************************************************
- * Outbound RANAP RESET to CN
- ***********************************************************************/
-
-void hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state);
-
-static int transmit_rst(RANAP_CN_DomainIndicator_t domain,
- struct osmo_sccp_addr *remote_addr)
+#if 0
+this code will soon move to new file cnlink.c
+static int transmit_rst(struct hnbgw_cnlink *cnlink)
{
struct msgb *msg;
RANAP_Cause_t cause = {
@@ -63,6 +58,7 @@
remote_addr,
msg);
}
+#endif
static int transmit_reset_ack(RANAP_CN_DomainIndicator_t domain,
const struct osmo_sccp_addr *remote_addr)
@@ -81,35 +77,6 @@
msg);
}
-/* Timer callback once T_RafC expires */
-static void cnlink_trafc_cb(void *unused)
-{
- transmit_rst(RANAP_CN_DomainIndicator_cs_domain, &g_hnbgw->sccp.iucs_remote_addr);
- transmit_rst(RANAP_CN_DomainIndicator_ps_domain, &g_hnbgw->sccp.iups_remote_addr);
- hnbgw_cnlink_change_state(g_hnbgw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK);
- /* The spec states that we should abandon after a configurable
- * number of times. We decide to simply continue trying */
-}
-
-/* change the state of a CN Link */
-void hnbgw_cnlink_change_state(struct hnbgw_cnlink *cnlink, enum hnbgw_cnlink_state state)
-{
- switch (state) {
- case CNLINK_S_NULL:
- case CNLINK_S_EST_PEND:
- break;
- case CNLINK_S_EST_CONF:
- cnlink_trafc_cb(NULL);
- break;
- case CNLINK_S_EST_RST_TX_WAIT_ACK:
- osmo_timer_schedule(&cnlink->T_RafC, 5, 0);
- break;
- case CNLINK_S_EST_ACTIVE:
- osmo_timer_del(&cnlink->T_RafC);
- break;
- }
-}
-
/***********************************************************************
* Incoming primitives from SCCP User SAP
***********************************************************************/
@@ -148,7 +115,8 @@
rc = ranap_decode_resetacknowledgeies(&ies, &omsg->value);
- hnbgw_cnlink_change_state(cnlink, CNLINK_S_EST_ACTIVE);
+ /* FUTURE: will do something useful in commit 'detect in/active CN links by RANAP RESET'
+ * Id3eefdea889a736fd5957b80280fa45b9547b792 */
ranap_free_resetacknowledgeies(&ies);
return rc;
@@ -527,7 +495,6 @@
cnlink = talloc_zero(g_hnbgw, struct hnbgw_cnlink);
INIT_LLIST_HEAD(&cnlink->map_list);
- cnlink->T_RafC.cb = cnlink_trafc_cb;
cnlink->next_conn_id = 1000;
cnlink->sccp_user = osmo_sccp_user_bind_pc(g_hnbgw->sccp.client, "OsmoHNBGW", sccp_sap_up,
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32911
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I7cacaec631051cf5420202f2f0dd9665a5565b17
Gerrit-Change-Number: 32911
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32913 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: unbloat: drop context_map_check_released()
......................................................................
unbloat: drop context_map_check_released()
When I implemented it, I thought context_map_check_released() would help
clarify context map deallocation, but instead it just bloats. Simplify
and tweak related comment.
Change-Id: I535780de0d3b09893ba89d66804e5e36b26db049
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/context_map.c
M src/osmo-hnbgw/context_map_rua.c
M src/osmo-hnbgw/context_map_sccp.c
4 files changed, 22 insertions(+), 18 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 2b60958..a2e76c3 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -156,6 +156,6 @@
bool map_rua_is_active(struct hnbgw_context_map *map);
bool map_sccp_is_active(struct hnbgw_context_map *map);
-void context_map_check_released(struct hnbgw_context_map *map);
+void context_map_free(struct hnbgw_context_map *map);
unsigned int msg_has_l2_data(const struct msgb *msg);
diff --git a/src/osmo-hnbgw/context_map.c b/src/osmo-hnbgw/context_map.c
index c9507be..f610087 100644
--- a/src/osmo-hnbgw/context_map.c
+++ b/src/osmo-hnbgw/context_map.c
@@ -247,12 +247,3 @@
LOG_MAP(map, DMAIN, LOGL_INFO, "Deallocating\n");
talloc_free(map);
}
-
-void context_map_check_released(struct hnbgw_context_map *map)
-{
- if (map_rua_is_active(map) || map_sccp_is_active(map)) {
- /* still active, do not release yet. */
- return;
- }
- context_map_free(map);
-}
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c
index 5a715c4..f50f711 100644
--- a/src/osmo-hnbgw/context_map_rua.c
+++ b/src/osmo-hnbgw/context_map_rua.c
@@ -294,13 +294,13 @@
static void map_rua_disconnected_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
struct hnbgw_context_map *map = fi->priv;
- /* For sanity, always tell SCCP to disconnect, if it hasn't done so. Dispatching MAP_SCCP_EV_RAN_DISC may send
- * SCCP into MAP_RUA_ST_DISCONNECTED, which calls context_map_check_released() and frees the hnbgw_context_map,
- * so don't free it a second time. If SCCP stays active, calling context_map_check_released() has no effect. */
+ /* From RUA's POV, we can now free the hnbgw_context_map.
+ * If SCCP is still active, tell it to disconnect -- in that case the SCCP side will call context_map_free().
+ * If SCCP is no longer active, free this map. */
if (map_sccp_is_active(map))
map_sccp_dispatch(map, MAP_SCCP_EV_RAN_DISC, NULL);
else
- context_map_check_released(map);
+ context_map_free(map);
}
static void map_rua_disconnected_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index 8e04fba..132d03e 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -419,13 +419,13 @@
static void map_sccp_disconnected_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
struct hnbgw_context_map *map = fi->priv;
- /* For sanity, always tell RUA to disconnect, if it hasn't done so. Dispatching MAP_RUA_EV_CN_DISC may send
- * RUA into MAP_RUA_ST_DISCONNECTED, which calls context_map_check_released() and frees the hnbgw_context_map,
- * so don't free it a second time. If RUA stays active, calling context_map_check_released() has no effect. */
+ /* From SCCP's POV, we can now free the hnbgw_context_map.
+ * If RUA is still active, tell it to disconnect -- in that case the RUA side will call context_map_free().
+ * If RUA is no longer active, free this map. */
if (map_rua_is_active(map))
map_rua_dispatch(map, MAP_RUA_EV_CN_DISC, NULL);
else
- context_map_check_released(map);
+ context_map_free(map);
}
static void map_sccp_disconnected_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32913
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I535780de0d3b09893ba89d66804e5e36b26db049
Gerrit-Change-Number: 32913
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged