Commit f380a48a authored by Robert Schmidt's avatar Robert Schmidt Committed by francescomani

RLC: add per-UE RLF callback

If the RLC cannot retransmit a package, 3GPP specs say that we should
declare radio link failure (RLF). Up to this commit, the code did
nothing though. In this commit, add a per-UE RLF callback; the RLC will
call into this function to signal that RLF has been detected through
maximum retransmissions on a particular RLC bearer.
parent 6beeb6ee
...@@ -619,10 +619,6 @@ static void max_retx_reached(void *_ue, nr_rlc_entity_t *entity) ...@@ -619,10 +619,6 @@ static void max_retx_reached(void *_ue, nr_rlc_entity_t *entity)
int i; int i;
int is_srb; int is_srb;
int rb_id; int rb_id;
#if 0
MessageDef *msg;
#endif
int is_enb;
/* is it SRB? */ /* is it SRB? */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
...@@ -650,23 +646,18 @@ rb_found: ...@@ -650,23 +646,18 @@ rb_found:
is_srb ? "SRB" : "DRB", is_srb ? "SRB" : "DRB",
rb_id); rb_id);
/* TODO: do something for DRBs? */ if (ue->rlf_handler)
if (is_srb == 0) ue->rlf_handler(ue->ue_id);
return; else
LOG_W(RLC, "UE %04x: RLF detected, but no callable RLF handler registered\n", ue->ue_id);
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager); }
if (!is_enb)
return;
#if 0 void nr_rlc_set_rlf_handler(int ue_id, rlf_handler_t rlf_h)
msg = itti_alloc_new_message(TASK_RLC_ENB, RLC_SDU_INDICATION); {
RLC_SDU_INDICATION(msg).rnti = ue->rnti; nr_rlc_manager_lock(nr_rlc_ue_manager);
RLC_SDU_INDICATION(msg).is_successful = 0; nr_rlc_ue_t *ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ue_id);
RLC_SDU_INDICATION(msg).srb_id = rb_id; ue->rlf_handler = rlf_h;
RLC_SDU_INDICATION(msg).message_id = -1; nr_rlc_manager_unlock(nr_rlc_ue_manager);
/* TODO: accept more than 1 instance? here we send to instance id 0 */
itti_send_msg_to_task(TASK_RRC_ENB, 0, msg);
#endif
} }
void nr_rlc_reestablish_entity(int ue_id, int lc_id) void nr_rlc_reestablish_entity(int ue_id, int lc_id)
......
...@@ -44,6 +44,8 @@ struct NR_LogicalChannelConfig; ...@@ -44,6 +44,8 @@ struct NR_LogicalChannelConfig;
void nr_rlc_add_srb(int ue_id, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig); void nr_rlc_add_srb(int ue_id, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
void nr_rlc_add_drb(int ue_id, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig); void nr_rlc_add_drb(int ue_id, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
void nr_rlc_set_rlf_handler(int ue_id, rlf_handler_t rlf_h);
logical_chan_id_t nr_rlc_get_lcid_from_rb(int ue_id, bool is_srb, int rb_id); logical_chan_id_t nr_rlc_get_lcid_from_rb(int ue_id, bool is_srb, int rb_id);
void nr_rlc_reestablish_entity(int ue_id, int lc_id); void nr_rlc_reestablish_entity(int ue_id, int lc_id);
void nr_rlc_remove_ue(int ue_id); void nr_rlc_remove_ue(int ue_id);
......
...@@ -37,12 +37,15 @@ typedef struct nr_rlc_rb_t { ...@@ -37,12 +37,15 @@ typedef struct nr_rlc_rb_t {
} choice; } choice;
} nr_rlc_rb_t; } nr_rlc_rb_t;
typedef void (*rlf_handler_t)(int rnti);
typedef struct nr_rlc_ue_t { typedef struct nr_rlc_ue_t {
int ue_id; int ue_id;
nr_rlc_entity_t *srb0; nr_rlc_entity_t *srb0;
nr_rlc_entity_t *srb[3]; nr_rlc_entity_t *srb[3];
nr_rlc_entity_t *drb[MAX_DRBS_PER_UE]; nr_rlc_entity_t *drb[MAX_DRBS_PER_UE];
nr_rlc_rb_t lcid2rb[32]; nr_rlc_rb_t lcid2rb[32];
rlf_handler_t rlf_handler;
} nr_rlc_ue_t; } nr_rlc_ue_t;
/***********************************************************************/ /***********************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment