Commit a20bfc96 authored by Cedric Roux's avatar Cedric Roux

remove NGAP_MAX_DRBS_PER_UE, replace by MAX_DRBS_PER_UE

parent 284b57ac
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
#define NR_NB_RB_MAX (29 + 3) /* NR_maxDRB from NR_asn_constant.hm + 3 SRBs */ #define NR_NB_RB_MAX (29 + 3) /* NR_maxDRB from NR_asn_constant.hm + 3 SRBs */
#define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */ #define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */
#define NGAP_MAX_DRBS_PER_UE (32) /* As defined in TS 38.413 9.2.1.1 - maxnoofDRBs */
#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
* defined for NGAP in TS 38.413 - maxnoofDRBs */
#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 NB_RB_MBMS_MAX (29 * 16) /* 29 = LTE_maxSessionPerPMCH + 16 = LTE_maxServiceCount from LTE_asn_constant.h */ #define NB_RB_MBMS_MAX (29 * 16) /* 29 = LTE_maxSessionPerPMCH + 16 = LTE_maxServiceCount from LTE_asn_constant.h */
......
...@@ -277,7 +277,7 @@ typedef struct pdusession_s { ...@@ -277,7 +277,7 @@ typedef struct pdusession_s {
/* S-GW Tunnel endpoint identifier */ /* S-GW Tunnel endpoint identifier */
uint32_t gtp_teid; uint32_t gtp_teid;
/* Stores the DRB ID of the DRBs used by this PDU Session */ /* Stores the DRB ID of the DRBs used by this PDU Session */
uint8_t used_drbs[NGAP_MAX_DRBS_PER_UE]; uint8_t used_drbs[MAX_DRBS_PER_UE];
uint32_t gNB_teid_N3; uint32_t gNB_teid_N3;
transport_layer_addr_t gNB_addr_N3; transport_layer_addr_t gNB_addr_N3;
uint32_t UPF_teid_N3; uint32_t UPF_teid_N3;
......
...@@ -179,7 +179,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -179,7 +179,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
switch (channel_idP) { switch (channel_idP) {
case 0: rb = ue->srb0; break; case 0: rb = ue->srb0; break;
case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; case 1 ... 3: rb = ue->srb[channel_idP - 1]; break;
case 4 ... NGAP_MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break; case 4 ... MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break;
default: rb = NULL; break; default: rb = NULL; break;
} }
...@@ -241,9 +241,9 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( ...@@ -241,9 +241,9 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP);
switch (channel_idP) { switch (channel_idP) {
case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; case 1 ... 3: rb = ue->srb[channel_idP - 1]; break;
case 4 ... NGAP_MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break; case 4 ... MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break;
default: rb = NULL; break; default: rb = NULL; break;
} }
if (rb != NULL) { if (rb != NULL) {
...@@ -333,9 +333,9 @@ int nr_rlc_get_available_tx_space( ...@@ -333,9 +333,9 @@ int nr_rlc_get_available_tx_space(
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP);
switch (channel_idP) { switch (channel_idP) {
case 1 ... 3: rb = ue->srb[channel_idP - 1]; break; case 1 ... 3: rb = ue->srb[channel_idP - 1]; break;
case 4 ... NGAP_MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break; case 4 ... MAX_DRBS_PER_UE: rb = ue->drb[channel_idP - 4]; break;
default: rb = NULL; break; default: rb = NULL; break;
} }
if (rb != NULL) { if (rb != NULL) {
......
...@@ -237,8 +237,8 @@ typedef enum { ...@@ -237,8 +237,8 @@ typedef enum {
typedef struct gNB_RRC_UE_s { typedef struct gNB_RRC_UE_s {
uint8_t primaryCC_id; uint8_t primaryCC_id;
drb_t established_drbs[NGAP_MAX_DRBS_PER_UE]; drb_t established_drbs[MAX_DRBS_PER_UE];
uint8_t DRB_active[NGAP_MAX_DRBS_PER_UE]; uint8_t DRB_active[MAX_DRBS_PER_UE];
NR_SRB_INFO_TABLE_ENTRY Srb[maxSRBs]; // 3gpp max is 3 SRBs, number 1..3, we waste the entry 0 for code simplicity NR_SRB_INFO_TABLE_ENTRY Srb[maxSRBs]; // 3gpp max is 3 SRBs, number 1..3, we waste the entry 0 for code simplicity
NR_MeasConfig_t *measConfig; NR_MeasConfig_t *measConfig;
......
...@@ -120,7 +120,7 @@ NR_DRB_ToAddModList_t *fill_DRB_configList(gNB_RRC_UE_t *ue) ...@@ -120,7 +120,7 @@ NR_DRB_ToAddModList_t *fill_DRB_configList(gNB_RRC_UE_t *ue)
if (ue->nb_of_pdusessions == 0) if (ue->nb_of_pdusessions == 0)
return NULL; return NULL;
int nb_drb_to_setup = rrc->configuration.drbs; int nb_drb_to_setup = rrc->configuration.drbs;
long drb_priority[NGAP_MAX_DRBS_PER_UE] = {0}; long drb_priority[MAX_DRBS_PER_UE] = {0};
uint8_t drb_id_to_setup_start = 0; uint8_t drb_id_to_setup_start = 0;
NR_DRB_ToAddModList_t *DRB_configList = CALLOC(sizeof(*DRB_configList), 1); NR_DRB_ToAddModList_t *DRB_configList = CALLOC(sizeof(*DRB_configList), 1);
for (int i = 0; i < ue->nb_of_pdusessions; i++) { for (int i = 0; i < ue->nb_of_pdusessions; i++) {
...@@ -399,7 +399,7 @@ static NR_DRB_ToAddModList_t *createDRBlist(gNB_RRC_UE_t *ue, bool reestablish) ...@@ -399,7 +399,7 @@ static NR_DRB_ToAddModList_t *createDRBlist(gNB_RRC_UE_t *ue, bool reestablish)
NR_DRB_ToAddMod_t *DRB_config = NULL; NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t *DRB_configList = CALLOC(sizeof(*DRB_configList), 1); NR_DRB_ToAddModList_t *DRB_configList = CALLOC(sizeof(*DRB_configList), 1);
for (int i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) { for (int i = 0; i < MAX_DRBS_PER_UE; i++) {
if (ue->established_drbs[i].status != DRB_INACTIVE) { if (ue->established_drbs[i].status != DRB_INACTIVE) {
DRB_config = generateDRB_ASN1(&ue->established_drbs[i]); DRB_config = generateDRB_ASN1(&ue->established_drbs[i]);
if (reestablish) { if (reestablish) {
...@@ -822,13 +822,13 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( ...@@ -822,13 +822,13 @@ rrc_gNB_modify_dedicatedRRCReconfiguration(
// search exist DRB_config // search exist DRB_config
int j; int j;
for (j = 0; i < NGAP_MAX_DRBS_PER_UE; j++) { for (j = 0; i < MAX_DRBS_PER_UE; j++) {
if (ue_p->established_drbs[j].status != DRB_INACTIVE if (ue_p->established_drbs[j].status != DRB_INACTIVE
&& ue_p->established_drbs[j].cnAssociation.sdap_config.pdusession_id == ue_p->pduSession[i].param.pdusession_id) && ue_p->established_drbs[j].cnAssociation.sdap_config.pdusession_id == ue_p->pduSession[i].param.pdusession_id)
break; break;
} }
if (j == NGAP_MAX_DRBS_PER_UE) { if (j == MAX_DRBS_PER_UE) {
ue_p->pduSession[i].xid = xid; ue_p->pduSession[i].xid = xid;
ue_p->pduSession[i].status = PDU_SESSION_STATUS_FAILED; ue_p->pduSession[i].status = PDU_SESSION_STATUS_FAILED;
ue_p->pduSession[i].cause = NGAP_CAUSE_RADIO_NETWORK; ue_p->pduSession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
......
...@@ -52,7 +52,7 @@ void generateDRB(gNB_RRC_UE_t *ue, ...@@ -52,7 +52,7 @@ void generateDRB(gNB_RRC_UE_t *ue,
est_drb->drb_id = drb_id; est_drb->drb_id = drb_id;
est_drb->reestablishPDCP = -1; est_drb->reestablishPDCP = -1;
est_drb->recoverPDCP = -1; est_drb->recoverPDCP = -1;
for (i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) { for (i = 0; i < MAX_DRBS_PER_UE; i++) {
if ((est_drb->cnAssociation.sdap_config.pdusession_id == 0 if ((est_drb->cnAssociation.sdap_config.pdusession_id == 0
|| est_drb->cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id) || est_drb->cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id)
&& est_drb->defaultDRBid == 0) { && est_drb->defaultDRBid == 0) {
...@@ -148,12 +148,12 @@ uint8_t next_available_drb(gNB_RRC_UE_t *ue, rrc_pdu_session_param_t *pdusession ...@@ -148,12 +148,12 @@ uint8_t next_available_drb(gNB_RRC_UE_t *ue, rrc_pdu_session_param_t *pdusession
uint8_t drb_id; uint8_t drb_id;
if (0 /*!is_gbr*/) { /* Find if Non-GBR DRB exists in the same PDU Session */ if (0 /*!is_gbr*/) { /* Find if Non-GBR DRB exists in the same PDU Session */
for (drb_id = 0; drb_id < NGAP_MAX_DRBS_PER_UE; drb_id++) for (drb_id = 0; drb_id < MAX_DRBS_PER_UE; drb_id++)
if (pdusession->param.used_drbs[drb_id] == DRB_ACTIVE_NONGBR) if (pdusession->param.used_drbs[drb_id] == DRB_ACTIVE_NONGBR)
return drb_id + 1; return drb_id + 1;
} }
/* GBR Flow or a Non-GBR DRB does not exist in the same PDU Session, find an available DRB */ /* GBR Flow or a Non-GBR DRB does not exist in the same PDU Session, find an available DRB */
for (drb_id = 0; drb_id < NGAP_MAX_DRBS_PER_UE; drb_id++) for (drb_id = 0; drb_id < MAX_DRBS_PER_UE; drb_id++)
if (ue->DRB_active[drb_id] == DRB_INACTIVE) if (ue->DRB_active[drb_id] == DRB_INACTIVE)
return drb_id + 1; return drb_id + 1;
/* From this point, we need to handle the case that all DRBs are already used by the UE. */ /* From this point, we need to handle the case that all DRBs are already used by the UE. */
......
...@@ -518,7 +518,7 @@ bool nr_sdap_delete_ue_entities(ue_id_t ue_id) ...@@ -518,7 +518,7 @@ bool nr_sdap_delete_ue_entities(ue_id_t ue_id)
} }
/* Handle scenario where ue_id matches the head of the list */ /* Handle scenario where ue_id matches the head of the list */
while (entityPtr != NULL && entityPtr->ue_id == ue_id && upperBound < NGAP_MAX_DRBS_PER_UE) { while (entityPtr != NULL && entityPtr->ue_id == ue_id && upperBound < MAX_DRBS_PER_UE) {
sdap_info.sdap_entity_llist = entityPtr->next_entity; sdap_info.sdap_entity_llist = entityPtr->next_entity;
free(entityPtr); free(entityPtr);
entityPtr = sdap_info.sdap_entity_llist; entityPtr = sdap_info.sdap_entity_llist;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define SDAP_CTRL_PDU_MAP_DEF_DRB (0) #define SDAP_CTRL_PDU_MAP_DEF_DRB (0)
#define SDAP_CTRL_PDU_MAP_RULE_DRB (1) #define SDAP_CTRL_PDU_MAP_RULE_DRB (1)
#define SDAP_MAX_PDU (9000) #define SDAP_MAX_PDU (9000)
#define SDAP_MAX_NUM_OF_ENTITIES (NGAP_MAX_DRBS_PER_UE * MAX_MOBILES_PER_ENB) #define SDAP_MAX_NUM_OF_ENTITIES (MAX_DRBS_PER_UE * MAX_MOBILES_PER_ENB)
#define SDAP_MAX_UE_ID (65536) #define SDAP_MAX_UE_ID (65536)
/* /*
......
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