Mark several fsm related internal symbols as static

After some earlier refactoring, those fields are only used internally in
the module, and hence can be marked as static.

Change-Id: Ibf2a6ee5636ae7102ffd13b7497769652bcc3202
This commit is contained in:
Pau Espin 2023-01-27 13:19:55 +01:00
parent 9e732ae4b1
commit 76ef66698c
9 changed files with 37 additions and 49 deletions

View File

@ -31,13 +31,13 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32] = {
static const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32] = {
[TBF_DL_ASS_NONE] = {},
[TBF_DL_ASS_SEND_ASS] = {},
[TBF_DL_ASS_WAIT_ACK] = {},
};
const struct value_string tbf_dl_ass_fsm_event_names[] = {
static const struct value_string tbf_dl_ass_fsm_event_names[] = {
{ TBF_DL_ASS_EV_SCHED_ASS, "SCHED_ASS" },
{ TBF_DL_ASS_EV_CREATE_RLCMAC_MSG, "CREATE_RLCMAC_MSG" },
{ TBF_DL_ASS_EV_RX_ASS_CTRL_ACK, "RX_ASS_CTRL_ACK" },
@ -45,7 +45,16 @@ const struct value_string tbf_dl_ass_fsm_event_names[] = {
{ 0, NULL }
};
struct msgb *create_packet_dl_assign(const struct tbf_dl_ass_fsm_ctx *ctx,
/* Transition to a state, using the T timer defined in tbf_dl_ass_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_dl_ass_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_dl_ass_fsm_timeouts, \
the_pcu->T_defs, \
-1)
static struct msgb *create_packet_dl_assign(const struct tbf_dl_ass_fsm_ctx *ctx,
const struct tbf_dl_ass_ev_create_rlcmac_msg_ctx *d)
{
struct msgb *msg;

View File

@ -41,16 +41,6 @@ struct tbf_dl_ass_fsm_ctx {
struct gprs_rlcmac_tbf* tbf; /* back pointer */
};
extern const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32];
/* Transition to a state, using the T timer defined in tbf_dl_ass_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_dl_ass_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_dl_ass_fsm_timeouts, \
the_pcu->T_defs, \
-1)
extern struct osmo_fsm tbf_dl_ass_fsm;

View File

@ -29,7 +29,7 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_dl_fsm_timeouts[32] = {
static const struct osmo_tdef_state_timeout tbf_dl_fsm_timeouts[32] = {
[TBF_ST_NEW] = {},
[TBF_ST_ASSIGN] = { },
[TBF_ST_FLOW] = { },

View File

@ -21,15 +21,6 @@
/* Note: This file contains shared code for UL/DL TBF FSM. See tbf_dl_fsm.c and
* tbf_ul_fsm.c for the actual implementations of the FSM */
/* Transition to a state, using the T timer defined in tbf_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_fsm_timeouts, \
the_pcu->T_defs, \
-1)
const struct value_string tbf_fsm_event_names[] = {
{ TBF_EV_ASSIGN_ADD_CCCH, "ASSIGN_ADD_CCCH" },
{ TBF_EV_ASSIGN_ADD_PACCH, "ASSIGN_ADD_PACCH" },

View File

@ -33,13 +33,13 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32] = {
static const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32] = {
[TBF_UL_ACK_ST_NONE] = {},
[TBF_UL_ACK_ST_SCHED_UL_ACK] = {},
[TBF_UL_ACK_ST_WAIT_ACK] = {},
};
const struct value_string tbf_ul_ack_fsm_event_names[] = {
static const struct value_string tbf_ul_ack_fsm_event_names[] = {
{ TBF_UL_ACK_EV_SCHED_ACK, "SCHED_ACK" },
{ TBF_UL_ACK_EV_CREATE_RLCMAC_MSG, "CREATE_RLCMAC_MSG" },
{ TBF_UL_ACK_EV_RX_CTRL_ACK, "RX_CTRL_ACK" },
@ -47,6 +47,15 @@ const struct value_string tbf_ul_ack_fsm_event_names[] = {
{ 0, NULL }
};
/* Transition to a state, using the T timer defined in tbf_ul_ack_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_ul_ack_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_ul_ack_fsm_timeouts, \
the_pcu->T_defs, \
-1)
static struct msgb *create_ul_ack_nack(const struct tbf_ul_ack_fsm_ctx *ctx,
const struct tbf_ul_ack_ev_create_rlcmac_msg_ctx *d,
bool final)

View File

@ -42,16 +42,6 @@ struct tbf_ul_ack_fsm_ctx {
struct gprs_rlcmac_ul_tbf *tbf; /* back pointer */
};
extern const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32];
/* Transition to a state, using the T timer defined in tbf_ul_ack_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_ul_ack_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_ul_ack_fsm_timeouts, \
the_pcu->T_defs, \
-1)
extern struct osmo_fsm tbf_ul_ack_fsm;

View File

@ -31,14 +31,14 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32] = {
static const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32] = {
[TBF_UL_ASS_NONE] = {},
[TBF_UL_ASS_SEND_ASS] = {},
[TBF_UL_ASS_SEND_ASS_REJ] = {},
[TBF_UL_ASS_WAIT_ACK] = {},
};
const struct value_string tbf_ul_ass_fsm_event_names[] = {
static const struct value_string tbf_ul_ass_fsm_event_names[] = {
{ TBF_UL_ASS_EV_SCHED_ASS, "SCHED_ASS" },
{ TBF_UL_ASS_EV_SCHED_ASS_REJ, "SCHED_ASS_REJ" },
{ TBF_UL_ASS_EV_CREATE_RLCMAC_MSG, "CREATE_RLCMAC_MSG" },
@ -48,6 +48,15 @@ const struct value_string tbf_ul_ass_fsm_event_names[] = {
{ 0, NULL }
};
/* Transition to a state, using the T timer defined in tbf_ul_ass_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_ul_ass_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_ul_ass_fsm_timeouts, \
the_pcu->T_defs, \
-1)
static struct msgb *create_packet_access_reject(const struct tbf_ul_ass_fsm_ctx *ctx)
{
struct msgb *msg;
@ -71,7 +80,7 @@ static struct msgb *create_packet_access_reject(const struct tbf_ul_ass_fsm_ctx
}
struct msgb *create_packet_ul_assign(const struct tbf_ul_ass_fsm_ctx *ctx,
static struct msgb *create_packet_ul_assign(const struct tbf_ul_ass_fsm_ctx *ctx,
const struct tbf_ul_ass_ev_create_rlcmac_msg_ctx *d)
{
struct msgb *msg = NULL;

View File

@ -44,16 +44,6 @@ struct tbf_ul_ass_fsm_ctx {
struct gprs_rlcmac_tbf* tbf; /* back pointer */
};
extern const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32];
/* Transition to a state, using the T timer defined in tbf_ul_ass_fsm_timeouts.
* The actual timeout value is in turn obtained from conn->T_defs.
* Assumes local variable fi exists. */
#define tbf_ul_ass_fsm_state_chg(fi, NEXT_STATE) \
osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \
tbf_ul_ass_fsm_timeouts, \
the_pcu->T_defs, \
-1)
extern struct osmo_fsm tbf_ul_ass_fsm;

View File

@ -29,7 +29,7 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_ul_fsm_timeouts[32] = {
static const struct osmo_tdef_state_timeout tbf_ul_fsm_timeouts[32] = {
[TBF_ST_NEW] = {},
[TBF_ST_ASSIGN] = { },
[TBF_ST_FLOW] = { },