Changes to SDAP code

1. Removed SDAP struct from protocol context.
2. Added configuration for the SDAP.
3. SDAP doesn't use pdcp_entities, the values come from function arguements.
4. Make nr_pdcp_ue_manager accessible from SDAP.
5. Avoid using the PDCP locking mechanism in SDAP.
6. Removed nr_pdcp_find_entity_sdap function.
7. Rename dummy eNB function to make GTP compile (no SDAP).
8. Fix: Regression issues with LTE
9. Fix: Regression issues with NR CU/DU
This commit is contained in:
athanassopoulos
2022-04-01 17:04:08 +02:00
parent 30f14c7e55
commit cf30f61e65
14 changed files with 225 additions and 134 deletions
+19 -6
View File
@@ -30,12 +30,15 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id) {
const uint32_t *destinationL2Id,
const uint8_t qfi,
const boolean_t rqi,
const int pdusession_id) {
nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, ctxt_p->sdap.pdusession_id);
sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, pdusession_id);
if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, ctxt_p->sdap.pdusession_id);
LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, pdusession_id);
return 0;
}
@@ -49,16 +52,22 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
sdu_buffer,
pt_mode,
sourceL2Id,
destinationL2Id);
destinationL2Id,
qfi,
rqi);
return ret;
}
void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity,
void sdap_data_ind(rb_id_t pdcp_entity,
int is_gnb,
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
char *buf,
int size) {
nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(rnti, pdcp_entity->pdusession_id);
sdap_entity = nr_sdap_get_entity(rnti, pdusession_id);
if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found\n", __FILE__, __LINE__, __FUNCTION__);
@@ -67,6 +76,10 @@ void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity,
sdap_entity->rx_entity(sdap_entity,
pdcp_entity,
is_gnb,
has_sdap,
has_sdapULheader,
pdusession_id,
rnti,
buf,
size);
+9 -2
View File
@@ -41,7 +41,10 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id
const uint32_t *destinationL2Id,
const uint8_t qfi,
const boolean_t rqi,
const int pdusession_id
);
/*
@@ -50,7 +53,11 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p,
* Uplink - gNB
* Downlink - nrUE
*/
void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity,
void sdap_data_ind(rb_id_t pdcp_entity,
int is_gnb,
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
char *buf,
int size
+63 -56
View File
@@ -23,7 +23,7 @@
#include "common/utils/LOG/log.h"
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.h"
#include <stdlib.h>
#include <string.h>
@@ -35,6 +35,17 @@ typedef struct {
static nr_sdap_entity_info sdap_info;
nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager(void);
void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){
nr_pdcp_ue_t *ue;
nr_pdcp_ue_manager_t *nr_pdcp_ue_manager;
nr_pdcp_ue_manager = nr_pdcp_sdap_get_ue_manager();
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
ue->drb[sdap_ctrl_pdu_drb-1]->recv_sdu(ue->drb[sdap_ctrl_pdu_drb-1], (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED);
return;
}
static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
protocol_ctxt_t *ctxt_p,
const srb_flag_t srb_flag,
@@ -45,7 +56,9 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id
const uint32_t *destinationL2Id,
const uint8_t qfi,
const boolean_t 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;
@@ -60,11 +73,11 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
}
uint8_t sdap_buf[SDAP_MAX_PDU];
nr_pdcp_entity_t *pdcp_entity = entity->qfi2drb_map(entity, ctxt_p->sdap.qfi, rb_id);
rb_id_t pdcp_entity = entity->qfi2drb_map(entity, qfi, rb_id);
if(pdcp_entity){
sdap_drb_id = pdcp_entity->rb_id;
pdcp_ent_has_sdap = pdcp_entity->has_sdap;
sdap_drb_id = pdcp_entity;
pdcp_ent_has_sdap = entity->qfi2drb_table[qfi].hasSdap;
}
if(!pdcp_ent_has_sdap){
@@ -99,8 +112,8 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
* Construct the DL SDAP data PDU.
*/
nr_sdap_dl_hdr_t sdap_hdr;
sdap_hdr.QFI = ctxt_p->sdap.qfi;
sdap_hdr.RQI = ctxt_p->sdap.rqi;
sdap_hdr.QFI = qfi;
sdap_hdr.RQI = rqi;
sdap_hdr.RDI = 0; // SDAP Hardcoded Value
/* Add the SDAP DL Header to the buffer */
memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH);
@@ -118,9 +131,9 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
* construct the UL SDAP data PDU as specified in the subclause 6.2.2.3.
*/
nr_sdap_ul_hdr_t sdap_hdr;
sdap_hdr.QFI = ctxt_p->sdap.qfi;
sdap_hdr.QFI = qfi;
sdap_hdr.R = 0;
sdap_hdr.DC = ctxt_p->sdap.dc;
sdap_hdr.DC = rqi;
/* Add the SDAP UL Header to the buffer */
memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH);
memcpy(&sdap_buf[SDAP_HDR_LENGTH], sdu_buffer, sdu_buffer_size);
@@ -154,15 +167,19 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity,
}
static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
nr_pdcp_entity_t *pdcp_entity,
rb_id_t pdcp_entity,
int is_gnb,
int has_sdap,
int has_sdapHeader,
int pdusession_id,
int rnti,
char *buf,
int size) {
/* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */
int offset=0;
if(pdcp_entity->is_gnb) { // gNB
if(pdcp_entity->has_sdap && pdcp_entity->has_sdapULheader ) { // Handling the SDAP Header
if(is_gnb) { // gNB
if(has_sdap && has_sdapHeader ) { // Handling the SDAP Header
offset = SDAP_HDR_LENGTH;
nr_sdap_ul_hdr_t *sdap_hdr = (nr_sdap_ul_hdr_t *)buf;
LOG_D(SDAP, "RX Entity Received QFI : %u\n", sdap_hdr->QFI);
@@ -192,16 +209,16 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).length = size-offset;
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).rnti = rnti;
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = pdcp_entity->pdusession_id;
GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = pdusession_id;
LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
} else { //nrUE
/*
* TS 37.324 5.2 Data transfer
* 5.2.2 Downlink
* if the DRB from which this SDAP data PDU is received is configured by RRC with the presence of SDAP header.
*/
if(pdcp_entity->has_sdap && pdcp_entity->has_sdapDLheader) { // Handling the SDAP Header
if(has_sdap && has_sdapHeader) { // Handling the SDAP Header
offset = SDAP_HDR_LENGTH;
/*
* TS 37.324 5.2 Data transfer
@@ -224,9 +241,9 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
* 5.3.2 Reflective mapping
* If there is no stored QoS flow to DRB mapping rule for the QoS flow and a default DRB is configured.
*/
if(!entity->qfi2drb_table[sdap_hdr->QFI] && entity->default_drb->rb_id){
if(!entity->qfi2drb_table[sdap_hdr->QFI].drb_id && entity->default_drb){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
@@ -239,10 +256,10 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
* the DRB according to the stored QoS flow to DRB mapping rule is configured by RRC
* with the presence of UL SDAP header
*/
if( (pdcp_entity->rb_id != entity->qfi2drb_table[sdap_hdr->QFI]->rb_id) &&
pdcp_entity->has_sdapULheader ){
if( (pdcp_entity != entity->qfi2drb_table[sdap_hdr->QFI].drb_id) &&
has_sdapHeader ){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
@@ -251,7 +268,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
* 5.3.2 Reflective mapping
* store the QoS flow to DRB mapping of the DL SDAP data PDU as the QoS flow to DRB mapping rule for the UL.
*/
entity->qfi2drb_table[sdap_hdr->QFI]->rb_id = pdcp_entity->rb_id;
entity->qfi2drb_table[sdap_hdr->QFI].drb_id = pdcp_entity;
}
/*
@@ -280,45 +297,35 @@ 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, uint8_t drb){
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap){
if(qfi < SDAP_MAX_QFI &&
qfi > SDAP_MAP_RULE_EMPTY &&
drb > 0 &&
drb <= AVLBL_DRB)
{
nr_pdcp_entity_t *pdcp_entity;
pdcp_entity = nr_pdcp_find_entity_sdap(entity->rnti, drb);
if(!pdcp_entity){
LOG_D(SDAP, "Map Update failed - PDCP Entity does not exist, should create it\n");
LOG_D(SDAP, "Map Update failed - Mapping to default DRB\n");
entity->qfi2drb_table[qfi] = entity->default_drb;
}
entity->qfi2drb_table[qfi] = pdcp_entity;
LOG_D(SDAP, "Updated QFI to DRB Map: QFI %u -> DRB %d \n", qfi, entity->qfi2drb_table[qfi]->rb_id);
entity->qfi2drb_table[qfi].drb_id = drb;
entity->qfi2drb_table[qfi].hasSdap = hasSdap;
LOG_D(SDAP, "Updated QFI to DRB Map: QFI %u -> DRB %ld \n", qfi, entity->qfi2drb_table[qfi].drb_id);
LOG_D(SDAP, "DRB %ld %s\n", entity->qfi2drb_table[qfi].drb_id, hasSdap ? "has SDAP" : "does not have SDAP");
}
}
void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi){
entity->qfi2drb_table[qfi] = SDAP_NO_MAPPING_RULE;
entity->qfi2drb_table[qfi].drb_id = SDAP_NO_MAPPING_RULE;
LOG_D(SDAP, "Deleted QFI to DRB Map for QFI %u \n", qfi);
}
nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id){
nr_pdcp_entity_t *pdcp_entity;
rb_id_t nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t upper_layer_rb_id){
rb_id_t pdcp_entity;
pdcp_entity = entity->qfi2drb_table[qfi];
pdcp_entity = entity->qfi2drb_table[qfi].drb_id;
if(pdcp_entity){
return pdcp_entity;
} else if(entity->default_drb) {
LOG_D(SDAP, "Mapped QFI %u to Default DRB\n", qfi);
entity->qfi2drb_map_update(entity, qfi, entity->default_drb->rb_id);
return entity->default_drb;
} else {
/* Update map for Hardcode DRB ID given from upper layer (ue/enb_tun_read_thread rb_id)*/
entity->qfi2drb_map_update(entity, qfi, upper_layer_rb_id);
return SDAP_MAP_RULE_EMPTY;
}
@@ -336,28 +343,28 @@ nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi){
return sdap_end_marker_hdr;
}
nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi){
nr_pdcp_entity_t *drb_of_endmarker = NULL;
rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi){
rb_id_t drb_of_endmarker = 0;
if(map_type == SDAP_CTRL_PDU_MAP_DEF_DRB){
drb_of_endmarker = entity->default_drb;
LOG_D(SDAP, "Mapped Control PDU to default drb\n");
}
if(map_type == SDAP_CTRL_PDU_MAP_RULE_DRB){
drb_of_endmarker = entity->qfi2drb_map(entity, dl_qfi, pdcp_entity->rb_id);
drb_of_endmarker = entity->qfi2drb_map(entity, dl_qfi, pdcp_entity);
LOG_D(SDAP, "Mapped Control PDU according to the mapping rule, qfi %u \n", dl_qfi);
}
return drb_of_endmarker;
}
void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){
void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){
if(sdap_ctrl_pdu_drb){
sdap_ctrl_pdu_drb->recv_sdu(sdap_ctrl_pdu_drb, (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED);
nr_pdcp_submit_sdap_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, ctrl_pdu);
LOG_D(SDAP, "Sent Control PDU to PDCP Layer.\n");
}
}
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
nr_pdcp_entity_t *pdcp_entity,
rb_id_t pdcp_entity,
uint16_t rnti,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount,
@@ -367,20 +374,21 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
for(int i = 0; i < mappedQFIs2AddCount; i++){
qfi = mapped_qfi_2_add[i];
if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi] == SDAP_NO_MAPPING_RULE){
if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi].drb_id == SDAP_NO_MAPPING_RULE){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi);
nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi);
rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi);
existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
if(existing_sdap_entity->qfi2drb_table[qfi]->rb_id != drb_identity && pdcp_entity->has_sdapULheader){
if(existing_sdap_entity->qfi2drb_table[qfi].drb_id != drb_identity && existing_sdap_entity->qfi2drb_table[qfi].hasSdap){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi);
nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi);
rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi);
existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
}
}
nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti,
nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap,
uint16_t rnti,
int pdusession_id,
boolean_t is_defaultDRB,
uint8_t drb_identity,
@@ -390,7 +398,7 @@ nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti,
if(nr_sdap_get_entity(rnti, pdusession_id)) {
LOG_E(SDAP, "SDAP Entity for UE already exists.\n");
nr_sdap_entity_t *existing_sdap_entity = nr_sdap_get_entity(rnti, pdusession_id);
nr_pdcp_entity_t *pdcp_entity = existing_sdap_entity->default_drb;
rb_id_t pdcp_entity = existing_sdap_entity->default_drb;
nr_sdap_ue_qfi2drb_config(existing_sdap_entity, pdcp_entity, rnti, mapped_qfi_2_add, mappedQFIs2AddCount, drb_identity);
return existing_sdap_entity;
}
@@ -418,15 +426,14 @@ nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti,
sdap_entity->qfi2drb_map = nr_sdap_qfi2drb_map;
if(is_defaultDRB) {
nr_pdcp_entity_t *pdcp_entity = nr_pdcp_find_entity_sdap(sdap_entity->rnti, drb_identity);
sdap_entity->default_drb = pdcp_entity;
LOG_I(SDAP, "Default DRB for the created SDAP entity: %d \n", sdap_entity->default_drb->rb_id);
sdap_entity->default_drb = drb_identity;
LOG_I(SDAP, "Default DRB for the created SDAP entity: %ld \n", sdap_entity->default_drb);
if(mappedQFIs2AddCount) {
for (int i = 0; i < mappedQFIs2AddCount; i++)
{
LOG_D(SDAP, "Mapped QFI to Add : %ld \n", mapped_qfi_2_add[i]);
sdap_entity->qfi2drb_map_update(sdap_entity, mapped_qfi_2_add[i], sdap_entity->default_drb->rb_id);
sdap_entity->qfi2drb_map_update(sdap_entity, mapped_qfi_2_add[i], sdap_entity->default_drb, has_sdap);
}
}
}
+29 -14
View File
@@ -62,19 +62,26 @@ typedef struct nr_sdap_ul_hdr_s {
uint8_t DC:1;
} __attribute__((packed)) nr_sdap_ul_hdr_t;
typedef struct qfi2drb_s {
rb_id_t drb_id;
boolean_t 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);
typedef struct nr_sdap_entity_s {
uint16_t rnti;
nr_pdcp_entity_t *default_drb;
rb_id_t default_drb;
int pdusession_id;
nr_pdcp_entity_t *qfi2drb_table[SDAP_MAX_QFI];
qfi2drb_t qfi2drb_table[SDAP_MAX_QFI];
void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, uint8_t drb);
void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap);
void (*qfi2drb_map_delete)(struct nr_sdap_entity_s *entity, uint8_t qfi);
nr_pdcp_entity_t *(*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, long upper_layer_rb_id);
rb_id_t (*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t upper_layer_rb_id);
nr_sdap_ul_hdr_t (*sdap_construct_ctrl_pdu)(uint8_t qfi);
nr_pdcp_entity_t *(*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi);
void (*sdap_submit_ctrl_pdu)(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
rb_id_t (*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi);
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,
@@ -87,10 +94,17 @@ typedef struct nr_sdap_entity_s {
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id);
const uint32_t *destinationL2Id,
const uint8_t qfi,
const boolean_t rqi
);
void (*rx_entity)(struct nr_sdap_entity_s *entity,
nr_pdcp_entity_t *pdcp_entity,
rb_id_t pdcp_entity,
int is_gnb,
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
char *buf,
int size);
@@ -100,7 +114,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, uint8_t drb);
void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap);
/* QFI to DRB Mapping Related Function */
void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi);
@@ -114,7 +128,7 @@ void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi);
* If there is no stored QoS flow to DRB mapping rule for the QoS flow as specified in the subclause 5.3, map the SDAP SDU to the default DRB
* else, map the SDAP SDU to the DRB according to the stored QoS flow to DRB mapping rule.
*/
nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id);
rb_id_t nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t upper_layer_rb_id);
/*
* TS 37.324 5.3 QoS flow to DRB Mapping
@@ -128,20 +142,20 @@ nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi);
* 1.) default DRB or
* 2.) DRB according to the stored QoS flow to DRB mapping rule
*/
nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi);
rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi);
/*
* TS 37.324 5.3 QoS flow to DRB Mapping
* Submit the end-marker control PDU to the lower layer.
*/
void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
/*
* TS 37.324 5.3 QoS flow to DRB Mapping
* 5.3.1 Configuration Procedures
*/
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
nr_pdcp_entity_t *pdcp_entity,
rb_id_t pdcp_entity,
uint16_t rnti,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount,
@@ -151,7 +165,8 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
* TS 37.324 4.4 5.1.1 SDAP entity establishment
* Establish an SDAP entity.
*/
nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti,
nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap,
uint16_t rnti,
int pdusession_id,
boolean_t is_defaultDRB,
uint8_t default_DRB,