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.
This commit is contained in:
committed by
francescomani
parent
6beeb6eef1
commit
f380a48a3b
@@ -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:
|
|||||||
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);
|
void nr_rlc_set_rlf_handler(int ue_id, rlf_handler_t rlf_h)
|
||||||
if (!is_enb)
|
{
|
||||||
return;
|
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||||
|
nr_rlc_ue_t *ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ue_id);
|
||||||
#if 0
|
ue->rlf_handler = rlf_h;
|
||||||
msg = itti_alloc_new_message(TASK_RLC_ENB, RLC_SDU_INDICATION);
|
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||||
RLC_SDU_INDICATION(msg).rnti = ue->rnti;
|
|
||||||
RLC_SDU_INDICATION(msg).is_successful = 0;
|
|
||||||
RLC_SDU_INDICATION(msg).srb_id = rb_id;
|
|
||||||
RLC_SDU_INDICATION(msg).message_id = -1;
|
|
||||||
/* 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;
|
|||||||
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 {
|
|||||||
} 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;
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user