[PATCH] osmocom-bb[master]: host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 22 15:33:30 UTC 2018


Review at  https://gerrit.osmocom.org/6800

host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition

Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
---
M src/host/trxcon/sched_lchan_common.c
M src/host/trxcon/sched_lchan_xcch.c
2 files changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/00/6800/1

diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c
index 8f06165..925a441 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -32,6 +32,8 @@
 #include <osmocom/core/logging.h>
 #include <osmocom/core/bits.h>
 
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+
 #include "l1ctl_proto.h"
 #include "scheduler.h"
 #include "sched_trx.h"
@@ -106,7 +108,7 @@
 	memcpy(data->payload, l2, l2_len);
 
 	/* Put a packet to higher layers */
-	l1ctl_tx_data_ind(trx->l1l, data, l2_len == 23 ?
+	l1ctl_tx_data_ind(trx->l1l, data, l2_len == GSM_MACBLOCK_LEN ?
 		L1CTL_DATA_IND : L1CTL_TRAFFIC_IND);
 	talloc_free(data);
 
@@ -135,7 +137,7 @@
 	data->frame_nr = htonl(fn);
 
 	/* Choose a confirmation type */
-	conf_type = l2_len == 23 ?
+	conf_type = l2_len == GSM_MACBLOCK_LEN ?
 		L1CTL_DATA_CONF : L1CTL_TRAFFIC_CONF;
 
 	l1ctl_tx_data_conf(trx->l1l, data, conf_type);
diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c
index 0aff9ac..7d4786d 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -32,6 +32,7 @@
 #include <osmocom/core/bits.h>
 
 #include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/coding/gsm0503_coding.h>
 
 #include "l1ctl_proto.h"
@@ -47,9 +48,9 @@
 	sbit_t *bits, int8_t rssi, float toa)
 {
 	const struct trx_lchan_desc *lchan_desc;
+	uint8_t l2[GSM_MACBLOCK_LEN], *mask;
 	int n_errors, n_bits_total, rc;
 	sbit_t *buffer, *offset;
-	uint8_t l2[23], *mask;
 	uint32_t *first_fn;
 
 	/* Set up pointers */
@@ -111,7 +112,7 @@
 	}
 
 	/* Send a L2 frame to the higher layers */
-	sched_send_data_ind(trx, ts, lchan, l2, 23);
+	sched_send_data_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN);
 
 	/* TODO: AGC, TA loops */
 	return 0;
@@ -206,7 +207,7 @@
 		*mask = 0x00;
 
 		/* Confirm data sending */
-		sched_send_data_conf(trx, ts, lchan, fn, 23);
+		sched_send_data_conf(trx, ts, lchan, fn, GSM_MACBLOCK_LEN);
 	}
 
 	return 0;

-- 
To view, visit https://gerrit.osmocom.org/6800
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list