Use (std) bool instead of custom bool types
OAI is riddled with boolean_t, FALSE, TRUE, etc. This makes no sense, as there is a standard bool type, and could lead to nasty bugs if a definition of a bool is non-standard (0 == false, true == !false). This commit removes all non-standard bools in the whole project.
This commit is contained in:
@@ -21,19 +21,19 @@
|
||||
|
||||
#include "nr_sdap.h"
|
||||
|
||||
boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const boolean_t rqi,
|
||||
const int pdusession_id) {
|
||||
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const bool rqi,
|
||||
const int pdusession_id) {
|
||||
nr_sdap_entity_t *sdap_entity;
|
||||
sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, pdusession_id);
|
||||
|
||||
@@ -42,19 +42,19 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean_t ret = sdap_entity->tx_entity(sdap_entity,
|
||||
ctxt_p,
|
||||
srb_flag,
|
||||
rb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id,
|
||||
qfi,
|
||||
rqi);
|
||||
bool ret = sdap_entity->tx_entity(sdap_entity,
|
||||
ctxt_p,
|
||||
srb_flag,
|
||||
rb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id,
|
||||
qfi,
|
||||
rqi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,20 +32,19 @@
|
||||
* Downlink - gNB
|
||||
* Uplink - nrUE
|
||||
*/
|
||||
boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const boolean_t rqi,
|
||||
const int pdusession_id
|
||||
);
|
||||
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const bool rqi,
|
||||
const int pdusession_id);
|
||||
|
||||
/*
|
||||
* TS 37.324 4.4 Functions
|
||||
|
||||
@@ -46,23 +46,22 @@ void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_u
|
||||
return;
|
||||
}
|
||||
|
||||
static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
|
||||
protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const boolean_t rqi
|
||||
) {
|
||||
static bool nr_sdap_tx_entity(nr_sdap_entity_t *entity,
|
||||
protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const bool rqi) {
|
||||
/* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */
|
||||
int offset=0;
|
||||
boolean_t ret=false;
|
||||
bool ret = false;
|
||||
/*Hardcode DRB ID given from upper layer (ue/enb_tun_read_thread rb_id), it will change if we have SDAP*/
|
||||
rb_id_t sdap_drb_id = rb_id;
|
||||
int pdcp_ent_has_sdap = 0;
|
||||
@@ -297,7 +296,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
|
||||
}
|
||||
}
|
||||
|
||||
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap){
|
||||
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, bool hasSdap) {
|
||||
if(qfi < SDAP_MAX_QFI &&
|
||||
qfi > SDAP_MAP_RULE_EMPTY &&
|
||||
drb > 0 &&
|
||||
@@ -390,7 +389,7 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
|
||||
nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap,
|
||||
uint16_t rnti,
|
||||
int pdusession_id,
|
||||
boolean_t is_defaultDRB,
|
||||
bool is_defaultDRB,
|
||||
uint8_t drb_identity,
|
||||
NR_QFI_t *mapped_qfi_2_add,
|
||||
uint8_t mappedQFIs2AddCount)
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct nr_sdap_ul_hdr_s {
|
||||
|
||||
typedef struct qfi2drb_s {
|
||||
rb_id_t drb_id;
|
||||
boolean_t hasSdap;
|
||||
bool hasSdap;
|
||||
} qfi2drb_t;
|
||||
|
||||
void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
|
||||
@@ -75,7 +75,7 @@ typedef struct nr_sdap_entity_s {
|
||||
int pdusession_id;
|
||||
qfi2drb_t qfi2drb_table[SDAP_MAX_QFI];
|
||||
|
||||
void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap);
|
||||
void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t drb, bool hasSdap);
|
||||
void (*qfi2drb_map_delete)(struct nr_sdap_entity_s *entity, uint8_t qfi);
|
||||
rb_id_t (*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t upper_layer_rb_id);
|
||||
|
||||
@@ -84,20 +84,19 @@ typedef struct nr_sdap_entity_s {
|
||||
void (*sdap_submit_ctrl_pdu)(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
|
||||
|
||||
|
||||
boolean_t (*tx_entity)(struct nr_sdap_entity_s *entity,
|
||||
protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const boolean_t rqi
|
||||
);
|
||||
bool (*tx_entity)(struct nr_sdap_entity_s *entity,
|
||||
protocol_ctxt_t *ctxt_p,
|
||||
const srb_flag_t srb_flag,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t confirm,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t pt_mode,
|
||||
const uint32_t *sourceL2Id,
|
||||
const uint32_t *destinationL2Id,
|
||||
const uint8_t qfi,
|
||||
const bool rqi);
|
||||
|
||||
void (*rx_entity)(struct nr_sdap_entity_s *entity,
|
||||
rb_id_t pdcp_entity,
|
||||
@@ -114,7 +113,7 @@ typedef struct nr_sdap_entity_s {
|
||||
} nr_sdap_entity_t;
|
||||
|
||||
/* QFI to DRB Mapping Related Function */
|
||||
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap);
|
||||
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, bool hasSdap);
|
||||
|
||||
/* QFI to DRB Mapping Related Function */
|
||||
void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi);
|
||||
@@ -168,7 +167,7 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
|
||||
nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap,
|
||||
uint16_t rnti,
|
||||
int pdusession_id,
|
||||
boolean_t is_defaultDRB,
|
||||
bool is_defaultDRB,
|
||||
uint8_t default_DRB,
|
||||
NR_QFI_t *mapped_qfi_2_add,
|
||||
uint8_t mappedQFIs2AddCount);
|
||||
|
||||
Reference in New Issue
Block a user