2023-01-27 10:45:56 +00:00
|
|
|
/* Uplink TBF, 3GPP TS 44.060 */
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <osmocom/core/fsm.h>
|
|
|
|
|
|
|
|
#include <osmocom/gprs/rlcmac/rlcmac_private.h>
|
|
|
|
|
|
|
|
struct gprs_rlcmac_ul_tbf;
|
|
|
|
|
|
|
|
enum gprs_rlcmac_tbf_ul_fsm_states {
|
|
|
|
GPRS_RLCMAC_TBF_UL_ST_NEW = 0, /* new created TBF */
|
|
|
|
GPRS_RLCMAC_TBF_UL_ST_WAIT_ASSIGN, /* wait for Immediate Assignment */
|
|
|
|
GPRS_RLCMAC_TBF_UL_ST_FLOW, /* RLC/MAC flow, resource needed */
|
2023-02-01 17:04:32 +00:00
|
|
|
GPRS_RLCMAC_TBF_UL_ST_FINISHED, /* flow finished, wait for release */
|
2023-01-27 10:45:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gprs_rlcmac_tbf_ul_fsm_ctx {
|
|
|
|
struct osmo_fsm_inst *fi;
|
|
|
|
union { /* back pointer. union used to easily access superclass from ctx */
|
|
|
|
struct gprs_rlcmac_tbf *tbf;
|
|
|
|
struct gprs_rlcmac_ul_tbf *ul_tbf;
|
|
|
|
};
|
2023-02-16 12:09:04 +00:00
|
|
|
/* Number of packet access procedure timeouts (T3164, T3166) */
|
|
|
|
unsigned int pkt_acc_proc_attempts;
|
2023-01-27 10:45:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum tbf_ul_fsm_event {
|
|
|
|
GPRS_RLCMAC_TBF_UL_EV_UL_ASS_START,
|
|
|
|
GPRS_RLCMAC_TBF_UL_EV_UL_ASS_COMPL,
|
2023-02-16 12:09:04 +00:00
|
|
|
GPRS_RLCMAC_TBF_UL_EV_FIRST_UL_DATA_SENT,
|
2023-02-01 17:04:32 +00:00
|
|
|
GPRS_RLCMAC_TBF_UL_EV_LAST_UL_DATA_SENT,
|
2023-02-15 11:15:11 +00:00
|
|
|
GPRS_RLCMAC_TBF_UL_EV_FINAL_ACK_RECVD,
|
2023-01-27 10:45:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int gprs_rlcmac_tbf_ul_fsm_init(void);
|
|
|
|
void gprs_rlcmac_tbf_ul_fsm_set_log_cat(int logcat);
|
|
|
|
|
|
|
|
int gprs_rlcmac_tbf_ul_fsm_constructor(struct gprs_rlcmac_ul_tbf *ul_tbf);
|
|
|
|
void gprs_rlcmac_tbf_ul_fsm_destructor(struct gprs_rlcmac_ul_tbf *ul_tbf);
|
|
|
|
|
|
|
|
enum gprs_rlcmac_tbf_ul_fsm_states gprs_rlcmac_tbf_ul_state(const struct gprs_rlcmac_ul_tbf *ul_tbf);
|