Commit 32b74d2f authored by Raymond Knopp's avatar Raymond Knopp

nr-softmodem compilation after merge with develop

parent 4d9ebf0a
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*/ */
#include "nr_pdcp_entity.h" #include "nr_pdcp_entity.h"
#include "nr_pdcp_entity_srb.h"
#include "nr_pdcp_entity_drb_am.h" #include "nr_pdcp_entity_drb_am.h"
#include "nr_pdcp_security_nea2.h" #include "nr_pdcp_security_nea2.h"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
nr_pdcp_entity_t *new_nr_pdcp_entity_srb( nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
int is_gnb, int rb_id, int is_gnb, int rb_id,
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_sdu)(const protocol_ctxt_t const *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
char *buf, int size), char *buf, int size),
void *deliver_sdu_data, void *deliver_sdu_data,
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
...@@ -38,7 +38,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb( ...@@ -38,7 +38,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
nr_pdcp_entity_srb_t *ret; nr_pdcp_entity_srb_t *ret;
ret = calloc(1, sizeof(nr_pdcp_entity_srb_t)); ret = calloc(1, sizeof(nr_pdcp_entity_t));
if (ret == NULL) { if (ret == NULL) {
LOG_E(PDCP, "%s:%d:%s: out of memory\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(PDCP, "%s:%d:%s: out of memory\n", __FILE__, __LINE__, __FUNCTION__);
exit(1); exit(1);
...@@ -60,12 +60,13 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb( ...@@ -60,12 +60,13 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
ret->common.maximum_nr_pdcp_sn = 4095; ret->common.maximum_nr_pdcp_sn = 4095;
ret->common.is_gnb = is_gnb;
return (nr_pdcp_entity_t *)ret; return (nr_pdcp_entity_t *)ret;
} }
nr_pdcp_entity_t *new_nr_pdcp_entity_drb_am( nr_pdcp_entity_t *new_nr_pdcp_entity_drb_am(
int is_gnb, int rb_id, int is_gnb, int rb_id,
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_sdu)(const protocol_ctxt_t const *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
char *buf, int size), char *buf, int size),
void *deliver_sdu_data, void *deliver_sdu_data,
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
......
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
typedef struct nr_pdcp_entity_t { typedef struct nr_pdcp_entity_t {
/* functions provided by the PDCP module */ /* functions provided by the PDCP module */
void (*recv_pdu)(protocol_ctxt_t *ctxt_pP,struct nr_pdcp_entity_t *entity, char *buffer, int size); void (*recv_pdu)(const protocol_ctxt_t const *ctxt_pP,struct nr_pdcp_entity_t *entity, char *buffer, int size);
void (*recv_sdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size, void (*recv_sdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size,
int sdu_id); int sdu_id);
void (*delete)(struct nr_pdcp_entity_t *entity); void (*delete)(struct nr_pdcp_entity_t *entity);
void (*set_integrity_key)(struct nr_pdcp_entity_t *entity, char *key); void (*set_integrity_key)(struct nr_pdcp_entity_t *entity, char *key);
/* callbacks provided to the PDCP module */ /* callbacks provided to the PDCP module */
void (*deliver_sdu)(protocol_ctxt_t *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_sdu)(const protocol_ctxt_t const *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
char *buf, int size); char *buf, int size);
void *deliver_sdu_data; void *deliver_sdu_data;
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
...@@ -65,7 +65,7 @@ typedef struct nr_pdcp_entity_t { ...@@ -65,7 +65,7 @@ typedef struct nr_pdcp_entity_t {
nr_pdcp_entity_t *new_nr_pdcp_entity_srb( nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
int is_gnb, int rb_id, int is_gnb, int rb_id,
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_sdu)(const protocol_ctxt_t const *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
char *buf, int size), char *buf, int size),
void *deliver_sdu_data, void *deliver_sdu_data,
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
...@@ -74,7 +74,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb( ...@@ -74,7 +74,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
nr_pdcp_entity_t *new_nr_pdcp_entity_drb_am( nr_pdcp_entity_t *new_nr_pdcp_entity_drb_am(
int is_gnb, int rb_id, int is_gnb, int rb_id,
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_sdu)(const protocol_ctxt_t const *ctxt_pP,void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
char *buf, int size), char *buf, int size),
void *deliver_sdu_data, void *deliver_sdu_data,
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity, void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
......
...@@ -26,16 +26,12 @@ ...@@ -26,16 +26,12 @@
#include <string.h> #include <string.h>
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
void nr_pdcp_entity_drb_am_recv_pdu( protocol_ctxt_t *ctxt_pP , nr_pdcp_entity_t *_entity, char *buffer, int size) void nr_pdcp_entity_drb_am_recv_pdu(const protocol_ctxt_t const *ctxt_pP , nr_pdcp_entity_t *_entity, char *buffer, int size)
{ {
nr_pdcp_entity_drb_am_t *entity = (nr_pdcp_entity_drb_am_t *)_entity; nr_pdcp_entity_drb_am_t *entity = (nr_pdcp_entity_drb_am_t *)_entity;
int sn; int sn;
if (size < 3) abort(); if (size < 3) abort();
<<<<<<< HEAD
if (!(buffer[0] & 0x80)) { printf("%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); exit(1); }
entity->common.deliver_sdu(ctxt_pP, entity->common.deliver_sdu_data,
=======
if (!(buffer[0] & 0x80)) if (!(buffer[0] & 0x80))
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
...@@ -48,8 +44,7 @@ void nr_pdcp_entity_drb_am_recv_pdu( protocol_ctxt_t *ctxt_pP , nr_pdcp_entity_t ...@@ -48,8 +44,7 @@ void nr_pdcp_entity_drb_am_recv_pdu( protocol_ctxt_t *ctxt_pP , nr_pdcp_entity_t
entity->common.cipher(entity->common.security_context, (unsigned char *)buffer+3, size-3, entity->common.cipher(entity->common.security_context, (unsigned char *)buffer+3, size-3,
entity->rb_id, sn, entity->common.is_gnb ? 0 : 1); entity->rb_id, sn, entity->common.is_gnb ? 0 : 1);
entity->common.deliver_sdu(entity->common.deliver_sdu_data, entity->common.deliver_sdu(ctxt_pP,entity->common.deliver_sdu_data,
>>>>>>> origin/develop
(nr_pdcp_entity_t *)entity, buffer+3, size-3); (nr_pdcp_entity_t *)entity, buffer+3, size-3);
} }
......
...@@ -33,7 +33,7 @@ typedef struct { ...@@ -33,7 +33,7 @@ typedef struct {
int discard_timer; /* unit: ms, -1 means infinity */ int discard_timer; /* unit: ms, -1 means infinity */
} nr_pdcp_entity_drb_am_t; } nr_pdcp_entity_drb_am_t;
void nr_pdcp_entity_drb_am_recv_pdu(protocol_ctxt_t *ctxt_pP,nr_pdcp_entity_t *entity, char *buffer, int size); void nr_pdcp_entity_drb_am_recv_pdu(const protocol_ctxt_t const *ctxt_pP,nr_pdcp_entity_t *entity, char *buffer, int size);
void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *entity, char *buffer, int size, void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *entity, char *buffer, int size,
int sdu_id); int sdu_id);
void nr_pdcp_entity_drb_am_set_integrity_key(nr_pdcp_entity_t *entity, char *key); void nr_pdcp_entity_drb_am_set_integrity_key(nr_pdcp_entity_t *entity, char *key);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
void nr_pdcp_entity_srb_recv_pdu(protocol_ctxt_t *ctxt_pP, nr_pdcp_entity_t *_entity, char *buffer, int size) void nr_pdcp_entity_srb_recv_pdu(const protocol_ctxt_t const *ctxt_pP, nr_pdcp_entity_t *_entity, char *buffer, int size)
{ {
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity; nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
......
...@@ -29,7 +29,7 @@ typedef struct { ...@@ -29,7 +29,7 @@ typedef struct {
int srb_id; int srb_id;
} nr_pdcp_entity_srb_t; } nr_pdcp_entity_srb_t;
void nr_pdcp_entity_srb_recv_pdu(protocol_ctxt_t *ctxt_pP, nr_pdcp_entity_t *_entity, char *buffer, int size); void nr_pdcp_entity_srb_recv_pdu(const protocol_ctxt_t const *ctxt_pP, nr_pdcp_entity_t *_entity, char *buffer, int size);
void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int size, int sdu_id); void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int size, int sdu_id);
void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key); void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key);
void nr_pdcp_entity_srb_delete(nr_pdcp_entity_t *_entity); void nr_pdcp_entity_srb_delete(nr_pdcp_entity_t *_entity);
......
...@@ -507,7 +507,7 @@ uint64_t pdcp_module_init(uint64_t _pdcp_optmask) ...@@ -507,7 +507,7 @@ uint64_t pdcp_module_init(uint64_t _pdcp_optmask)
return pdcp_optmask ; return pdcp_optmask ;
} }
static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t *entity, static void deliver_sdu_drb(const protocol_ctxt_t const *ctxt_pP,void *_ue, nr_pdcp_entity_t *entity,
char *buf, int size) char *buf, int size)
{ {
extern int nas_sock_fd[]; extern int nas_sock_fd[];
...@@ -605,7 +605,7 @@ rb_found: ...@@ -605,7 +605,7 @@ rb_found:
} }
static int ccch_or_dcch = 0; static int ccch_or_dcch = 0;
static void deliver_sdu_srb(protocol_ctxt_t *ctxt_pP, void *_ue, nr_pdcp_entity_t *entity, static void deliver_sdu_srb(const protocol_ctxt_t const *ctxt_pP, void *_ue, nr_pdcp_entity_t *entity,
char *buf, int size) char *buf, int size)
{ {
/* Implementation to be added */ /* Implementation to be added */
...@@ -789,6 +789,7 @@ boolean_t pdcp_data_ind( ...@@ -789,6 +789,7 @@ boolean_t pdcp_data_ind(
} }
if (rb != NULL) { if (rb != NULL) {
rb->recv_pdu(ctxt_pP,rb, (char *)sdu_buffer->data, sdu_buffer_size); rb->recv_pdu(ctxt_pP,rb, (char *)sdu_buffer->data, sdu_buffer_size);
} else { } else {
LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n", LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n",
...@@ -846,7 +847,7 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP) ...@@ -846,7 +847,7 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
} }
} }
static void add_srb(int rnti, struct NR_SRB_ToAddMod *s) static void add_srb(int is_gnb,int rnti, struct NR_SRB_ToAddMod *s)
{ {
nr_pdcp_entity_t *pdcp_srb; nr_pdcp_entity_t *pdcp_srb;
nr_pdcp_ue_t *ue; nr_pdcp_ue_t *ue;
...@@ -867,7 +868,7 @@ static void add_srb(int rnti, struct NR_SRB_ToAddMod *s) ...@@ -867,7 +868,7 @@ static void add_srb(int rnti, struct NR_SRB_ToAddMod *s)
LOG_W(PDCP, "%s:%d:%s: warning SRB %d already exist for ue %d, do nothing\n", LOG_W(PDCP, "%s:%d:%s: warning SRB %d already exist for ue %d, do nothing\n",
__FILE__, __LINE__, __FUNCTION__, srb_id, rnti); __FILE__, __LINE__, __FUNCTION__, srb_id, rnti);
} else { } else {
pdcp_srb = new_nr_pdcp_entity_srb(srb_id, deliver_sdu_srb, ue, deliver_pdu_srb, ue); pdcp_srb = new_nr_pdcp_entity_srb(is_gnb,srb_id, deliver_sdu_srb, ue, deliver_pdu_srb, ue);
nr_pdcp_ue_add_srb_pdcp_entity(ue, srb_id, pdcp_srb); nr_pdcp_ue_add_srb_pdcp_entity(ue, srb_id, pdcp_srb);
LOG_I(PDCP, "%s:%d:%s: added srb %d to ue %d\n", LOG_I(PDCP, "%s:%d:%s: added srb %d to ue %d\n",
...@@ -987,7 +988,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req( ...@@ -987,7 +988,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
if (srb2add_list != NULL) { if (srb2add_list != NULL) {
for (i = 0; i < srb2add_list->list.count; i++) { for (i = 0; i < srb2add_list->list.count; i++) {
add_srb(rnti, srb2add_list->list.array[i]); add_srb(ctxt_pP->enb_flag,rnti, srb2add_list->list.array[i]);
} }
} }
......
...@@ -812,17 +812,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( ...@@ -812,17 +812,6 @@ rrc_gNB_generate_defaultRRCReconfiguration(
ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.rnti,
rrc_gNB_mui, rrc_gNB_mui,
size); size);
#ifdef ITTI_SIM
MessageDef *message_p;
uint8_t *message_buffer;
message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, size);
memcpy (message_buffer, buffer, size);
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, GNB_RRC_DCCH_DATA_IND);
GNB_RRC_DCCH_DATA_IND (message_p).rbid = DCCH;
GNB_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
GNB_RRC_DCCH_DATA_IND (message_p).size = size;
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
#else
nr_rrc_data_req(ctxt_pP, nr_rrc_data_req(ctxt_pP,
DCCH, DCCH,
rrc_gNB_mui++, rrc_gNB_mui++,
......
...@@ -450,18 +450,6 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ( ...@@ -450,18 +450,6 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ(
/* TODO */ /* TODO */
} }
if (r_amf->plmn_Identity->mnc.list.count > 0) {
/* Use first indicated PLMN MNC if it is defined */
NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.mnc = *r_amf->plmn_Identity->mnc.list.array[selected_plmn_identity];
LOG_I(NGAP, "[gNB %d] Build NGAP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MNC %u ue %x\n",
ctxt_pP->module_id,
NGAP_NAS_FIRST_REQ (message_p).ue_identity.guami.mnc,
ue_context_pP->ue_context.rnti);
}
} else {
/* TODO */
}
/* amf_Identifier */ /* amf_Identifier */
uint32_t amf_Id = BIT_STRING_to_uint32(&r_amf->amf_Identifier); uint32_t amf_Id = BIT_STRING_to_uint32(&r_amf->amf_Identifier);
NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_region_id = amf_Id >> 16; NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_region_id = amf_Id >> 16;
......
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