summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-05-30 03:59:16 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-05-30 03:59:16 +0700
commit1a66c2991cbd90e5bdc51bfcfcfcd851b4abb2a3 (patch)
tree8a8029c9848985028ca2822c499474aefd311f9b /src
parent043136937a836236a9f013b0278a3ffeba51f4f4 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/host/trxcon/sched_lchan_rach.c12
-rw-r--r--src/host/trxcon/sched_trx.h10
2 files changed, 13 insertions, 9 deletions
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 tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts,
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 @@ int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts,
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 @@ int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts,
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 @@ int sched_prim_push(struct trx_instance *trx,
#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)