changeset 47:13fffc41f989

ater: add support for HR-data-16k TRAU-UL frame output
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 12 Sep 2024 23:37:47 +0000
parents 12415d7ce262
children 3cc26391d24d
files ater/activate.c ater/submux.h ater/tx_func.c
diffstat 3 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ater/activate.c	Thu Sep 12 17:43:39 2024 +0000
+++ b/ater/activate.c	Thu Sep 12 23:37:47 2024 +0000
@@ -76,11 +76,11 @@
 void cmd_activate_csd(int argc, char **argv)
 {
 	int nr;
-	bool ir_16k;
+	bool ir_16k, is_hr;
 	struct ater_subslot *at;
 
-	if (argc != 3) {
-usage:		fprintf(stderr, "usage: %s 0|1|2|3 8|16\n", argv[0]);
+	if (argc < 3 || argc > 4) {
+usage:		fprintf(stderr, "usage: %s 0|1|2|3 8|16 [hr]\n", argv[0]);
 		return;
 	}
 	if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1])
@@ -92,6 +92,12 @@
 		ir_16k = true;
 	else
 		goto usage;
+	if (argv[3]) {
+		if (strcmp(argv[3], "hr"))
+			goto usage;
+		is_hr = true;
+	} else
+		is_hr = false;
 
 	at = &subslots[nr];
 	if (at->is_active) {
@@ -102,6 +108,7 @@
 	/* good to proceed now */
 	at->is_active = true;
 	at->is_data = true;
+	at->is_hr_data = is_hr;
 	init_trau_ul_frame_csd(nr, ir_16k);
 }
 
--- a/ater/submux.h	Thu Sep 12 17:43:39 2024 +0000
+++ b/ater/submux.h	Thu Sep 12 23:37:47 2024 +0000
@@ -20,6 +20,7 @@
 	int nr;
 	bool is_active;
 	bool is_data;
+	bool is_hr_data;
 	bool is_efr;
 	struct osmo_trau_frame ul_frame;
 	unsigned mfrm_count;
--- a/ater/tx_func.c	Thu Sep 12 17:43:39 2024 +0000
+++ b/ater/tx_func.c	Thu Sep 12 23:37:47 2024 +0000
@@ -87,6 +87,13 @@
 		msgb_free(msg);
 		return;
 	}
+	/*
+	 * A very ugly/hacky way of setting C5 for HR data,
+	 * working around libosmotrau API that is not designed
+	 * for such hacking.
+	 */
+	if (at->is_data && at->is_hr_data)
+		msg->tail[21] = 1;
 	msgb_put(msg, len);
 	osmo_i460_mux_enqueue(at->schan, msg);
 }