fixeria submitted this change.

View Change

Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve
trxcon: get rid of GEN_MASK macro, define it locally

Change-Id: I9504f022ef1767276479f21b8228ac094d28a858
---
M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
M src/host/trxcon/src/trx_if.c
M src/host/trxcon/src/trxcon.c
3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
index 2a068b7..2c28f80 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h
@@ -1,7 +1,5 @@
#pragma once

-#define GEN_MASK(state) (0x01 << state)
-
struct l1sched_state;
struct trx_instance;
struct l1ctl_client;
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index b624962..d3bf160 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -45,6 +45,8 @@
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>

+#define S(x) (1 << (x))
+
static struct value_string trx_evt_names[] = {
{ 0, NULL } /* no events? */
};
@@ -52,8 +54,8 @@
static struct osmo_fsm_state trx_fsm_states[] = {
[TRX_STATE_OFFLINE] = {
.out_state_mask = (
- GEN_MASK(TRX_STATE_IDLE) |
- GEN_MASK(TRX_STATE_RSP_WAIT)),
+ S(TRX_STATE_IDLE) |
+ S(TRX_STATE_RSP_WAIT)),
.name = "OFFLINE",
},
[TRX_STATE_IDLE] = {
@@ -62,15 +64,15 @@
},
[TRX_STATE_ACTIVE] = {
.out_state_mask = (
- GEN_MASK(TRX_STATE_IDLE) |
- GEN_MASK(TRX_STATE_RSP_WAIT)),
+ S(TRX_STATE_IDLE) |
+ S(TRX_STATE_RSP_WAIT)),
.name = "ACTIVE",
},
[TRX_STATE_RSP_WAIT] = {
.out_state_mask = (
- GEN_MASK(TRX_STATE_IDLE) |
- GEN_MASK(TRX_STATE_ACTIVE) |
- GEN_MASK(TRX_STATE_OFFLINE)),
+ S(TRX_STATE_IDLE) |
+ S(TRX_STATE_ACTIVE) |
+ S(TRX_STATE_OFFLINE)),
.name = "RSP_WAIT",
},
};
diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c
index 09eae9b..d6f9157 100644
--- a/src/host/trxcon/src/trxcon.c
+++ b/src/host/trxcon/src/trxcon.c
@@ -49,6 +49,8 @@
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/l1sched.h>

+#define S(x) (1 << (x))
+
#define COPYRIGHT \
"Copyright (C) 2016-2022 by Vadim Yanitskiy <axilirator@gmail.com>\n" \
"Contributions by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>\n" \
@@ -288,17 +290,17 @@

static struct osmo_fsm_state trxcon_fsm_states[] = {
[TRXCON_STATE_IDLE] = {
- .in_event_mask = GEN_MASK(L1CTL_EVENT_CONNECT),
- .out_state_mask = GEN_MASK(TRXCON_STATE_MANAGED),
+ .in_event_mask = S(L1CTL_EVENT_CONNECT),
+ .out_state_mask = S(TRXCON_STATE_MANAGED),
.name = "IDLE",
.action = trxcon_fsm_idle_action,
},
[TRXCON_STATE_MANAGED] = {
.in_event_mask = (
- GEN_MASK(L1CTL_EVENT_DISCONNECT) |
- GEN_MASK(TRX_EVENT_RSP_ERROR) |
- GEN_MASK(TRX_EVENT_OFFLINE)),
- .out_state_mask = GEN_MASK(TRXCON_STATE_IDLE),
+ S(L1CTL_EVENT_DISCONNECT) |
+ S(TRX_EVENT_RSP_ERROR) |
+ S(TRX_EVENT_OFFLINE)),
+ .out_state_mask = S(TRXCON_STATE_IDLE),
.name = "MANAGED",
.action = trxcon_fsm_managed_action,
},

To view, visit change 28671. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I9504f022ef1767276479f21b8228ac094d28a858
Gerrit-Change-Number: 28671
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged