NR RRC - Changed macros for active and inactive drbs

parent 68fe0ad4
...@@ -117,14 +117,14 @@ uint8_t next_available_drb(gNB_RRC_UE_t *rrc_ue, rnti_t rnti, uint8_t pdusession ...@@ -117,14 +117,14 @@ uint8_t next_available_drb(gNB_RRC_UE_t *rrc_ue, rnti_t rnti, uint8_t pdusession
uint8_t drb_id; uint8_t drb_id;
for (drb_id = 0; drb_id < MAX_DRBS_PER_UE; drb_id++) { for (drb_id = 0; drb_id < MAX_DRBS_PER_UE; drb_id++) {
if(ue->used_drbs[drb_id] == NULL_DRB && ue->pdus->drbs_established < MAX_DRBS_PER_PDUSESSION) { if(ue->used_drbs[drb_id] == DRB_INACTIVE && ue->pdus->drbs_established < MAX_DRBS_PER_PDUSESSION) {
ue->pdus->pdu_drbs[ue->pdus->drbs_established] = drb_id; /* Store drb_id to pdusession */ ue->pdus->pdu_drbs[ue->pdus->drbs_established] = drb_id; /* Store drb_id to pdusession */
ue->used_drbs[drb_id] = pdusession_id; /* Store the pdusession id that is using that drb */ ue->used_drbs[drb_id] = pdusession_id; /* Store the pdusession id that is using that drb */
ue->pdus->drbs_established++; /* Increment the index for drbs */ ue->pdus->drbs_established++; /* Increment the index for drbs */
return ++drb_id; return ++drb_id;
} }
} }
return NULL_DRB; return DRB_INACTIVE;
} }
nr_ue_t *nr_ue_new(rnti_t rnti) { nr_ue_t *nr_ue_new(rnti_t rnti) {
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#define MAX_DRBS_PER_UE (32) /* Maximum number of Data Radio Bearers per UE */ #define MAX_DRBS_PER_UE (32) /* Maximum number of Data Radio Bearers per UE */
#define MAX_PDUS_PER_UE (8) /* Maximum number of PDU Sessions per UE */ #define MAX_PDUS_PER_UE (8) /* Maximum number of PDU Sessions per UE */
#define NULL_DRB (0) /* Non existing DRB */ #define DRB_ACTIVE (1)
#define DRB_INACTIVE (0)
typedef struct nr_pdus_s { typedef struct nr_pdus_s {
uint8_t pdu_drbs[MAX_DRBS_PER_PDUSESSION]; /* Data Radio Bearers of PDU Session */ uint8_t pdu_drbs[MAX_DRBS_PER_PDUSESSION]; /* Data Radio Bearers of PDU Session */
uint8_t pdusession_id; uint8_t pdusession_id;
......
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