Change in osmocom-bb[master]: trxcon/scheduler: move PRIM_IS[_EXT]_RACH macros to sched_trx.h

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed May 29 23:47:37 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/14273


Change subject: trxcon/scheduler: move PRIM_IS[_EXT]_RACH macros to sched_trx.h
......................................................................

trxcon/scheduler: move PRIM_IS[_EXT]_RACH macros to sched_trx.h

Both PRIM_IS_RACH() and PRIM_IS_EXT_RACH() macros to be used for
handover RACH detection in the follow up changes, thus we need
have them widely available. Let's also give them better names:

  PRIM_IS_EXT_RACH -> PRIM_IS_RACH11
  PRIM_IS_RACH     -> PRIM_IS_RACH8

and introduce a new generic one for checking whether a given
primitive is RACH in general (either 8-bit or 11-bit) or not.

Change-Id: Ibc39c57fda000647be1829786f6423dcf3f435cd
---
M src/host/trxcon/sched_lchan_rach.c
M src/host/trxcon/sched_trx.h
2 files changed, 13 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/73/14273/1

diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c
index 565d693..7d202b8 100644
--- a/src/host/trxcon/sched_lchan_rach.c
+++ b/src/host/trxcon/sched_lchan_rach.c
@@ -40,12 +40,6 @@
 #include "trx_if.h"
 #include "l1ctl.h"
 
-/* FIXME: we need a better way to identify / distinguish primitives */
-#define PRIM_IS_EXT_RACH(prim) \
-	(prim->payload_len == sizeof(struct l1ctl_ext_rach_req))
-#define PRIM_IS_RACH(prim) \
-	(prim->payload_len == sizeof(struct l1ctl_rach_req))
-
 /* 3GPP TS 05.02, section 5.2.7 "Access burst (AB)" */
 #define RACH_EXT_TAIL_BITS_LEN	8
 #define RACH_SYNCH_SEQ_LEN	41
@@ -94,7 +88,7 @@
 	int i, rc;
 
 	/* Is it extended (11-bit) RACH or not? */
-	if (PRIM_IS_EXT_RACH(lchan->prim)) {
+	if (PRIM_IS_RACH11(lchan->prim)) {
 		ext_req = (struct l1ctl_ext_rach_req *) lchan->prim->payload;
 		synch_seq = ext_req->synch_seq;
 
@@ -120,7 +114,7 @@
 			sched_prim_drop(lchan);
 			return rc;
 		}
-	} else if (PRIM_IS_RACH(lchan->prim)) {
+	} else if (PRIM_IS_RACH8(lchan->prim)) {
 		req = (struct l1ctl_rach_req *) lchan->prim->payload;
 		synch_seq = RACH_SYNCH_SEQ_TS0;
 
@@ -162,7 +156,7 @@
 	memset(burst_ptr, 0, burst + GSM_BURST_LEN - burst_ptr);
 
 	LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s RACH (%s) fn=%u\n",
-		PRIM_IS_EXT_RACH(lchan->prim) ? "extended (11-bit)" : "regular (8-bit)",
+		PRIM_IS_RACH11(lchan->prim) ? "extended (11-bit)" : "regular (8-bit)",
 		get_value_string(rach_synch_seq_names, synch_seq), fn);
 
 	/* Forward burst to scheduler */
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index fcb78a7..6ef9ce4 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -309,6 +309,16 @@
 #define CHAN_IS_SACCH(chan) \
 	(trx_lchan_desc[chan].link_id & TRX_CH_LID_SACCH)
 
+/* FIXME: we need a better way to identify / distinguish primitives */
+#define PRIM_IS_RACH11(prim) \
+	(prim->payload_len == sizeof(struct l1ctl_ext_rach_req))
+
+#define PRIM_IS_RACH8(prim) \
+	(prim->payload_len == sizeof(struct l1ctl_rach_req))
+
+#define PRIM_IS_RACH(prim) \
+	(PRIM_IS_RACH8(prim) || PRIM_IS_RACH11(prim))
+
 #define PRIM_IS_TCH(prim) \
 	(CHAN_IS_TCH(prim->chan) && prim->payload_len != GSM_MACBLOCK_LEN)
 

-- 
To view, visit https://gerrit.osmocom.org/14273
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc39c57fda000647be1829786f6423dcf3f435cd
Gerrit-Change-Number: 14273
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190529/005c7a5a/attachment.html>


More information about the gerrit-log mailing list