Commit cba37642 authored by matzakos's avatar matzakos

Continue unfinished merge with develop branch

parent e8c5e8bf
......@@ -56,6 +56,10 @@ openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac_proto.h
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/ra_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
......@@ -65,11 +69,7 @@ openair2/LAYER2/MAC/pre_processor.c
*******************************************************************************************************
deleted by them: openair1/PHY/TOOLS/file_output.c
deleted by them: openair1/SCHED/pusch_pc.c
both modified: openair2/LAYER2/MAC/ra_procedures.c
both modified: openair2/LAYER2/MAC/ue_procedures.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp.h
deleted by them: openair1/SCHED/pusch_pc.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp_proto_extern.h
both modified: openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
......@@ -168,11 +168,11 @@ openair2/LAYER2/MAC/pre_processor.c
both modified: openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
both modified: openair2/LAYER2/MAC/mac.h
both modified: openair2/LAYER2/MAC/mac_proto.h
both modified: openair2/LAYER2/MAC/pre_processor.c #We have done up to here
both modified: openair2/LAYER2/MAC/pre_processor.c
both modified: openair2/LAYER2/MAC/ra_procedures.c
both modified: openair2/LAYER2/MAC/ue_procedures.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp.h
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp.h #Conflicts solved up to here
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
both modified: openair2/LAYER2/PDCP_v10.1.0/pdcp_proto_extern.h
both modified: openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
......
......@@ -43,67 +43,10 @@
#include "UTIL/OPT/opt.h"
#include "OCG.h"
#include "OCG_extern.h"
<<<<<<< HEAD
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
extern uint8_t nfapi_mode;
extern UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
{
AssertFatal(CC_id == 0,
"Transmission on secondary CCs is not supported yet\n");
uint8_t prachConfigIndex =
UE_mac_inst[module_idP].radioResourceConfigCommon->
prach_Config.prach_ConfigInfo.prach_ConfigIndex;
uint8_t preambleformat;
if (UE_mac_inst[module_idP].tdd_Config) { // TDD
if (prachConfigIndex < 20) {
preambleformat = 0;
} else if (prachConfigIndex < 30) {
preambleformat = 1;
} else if (prachConfigIndex < 40) {
preambleformat = 2;
} else if (prachConfigIndex < 48) {
preambleformat = 3;
} else {
preambleformat = 4;
}
} else { // FDD
preambleformat = prachConfigIndex >> 2;
}
switch (preambleformat) {
case 0:
case 1:
return (0);
case 2:
case 3:
return (-3);
case 4:
return (8);
default:
AssertFatal(1 == 0,
"[UE %d] ue_procedures.c: FATAL, Illegal preambleformat %d, prachConfigIndex %d\n",
module_idP, preambleformat, prachConfigIndex);
}
}
=======
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
>>>>>>> main/develop
extern uint8_t nfapi_mode;
extern UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
......@@ -357,7 +300,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
{
uint8_t Size = 0;
UE_MODE_t UE_mode;
// Panos: Modification for phy_stub_ue operation
// Modification for phy_stub_ue operation
if(nfapi_mode == 3) { // Panos: phy_stub_ue mode
UE_mode = UE_mac_inst[module_idP].UE_mode[0];
LOG_D(MAC, "ue_get_rach , UE_mode: %d", UE_mode);
......@@ -366,21 +309,6 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
UE_mode = get_ue_mode(module_idP,0,eNB_indexP);
}
<<<<<<< HEAD
=======
uint8_t Size = 0;
UE_MODE_t UE_mode;
// Modification for phy_stub_ue operation
if(nfapi_mode == 3) { // phy_stub_ue mode
UE_mode = UE_mac_inst[module_idP].UE_mode[0];
LOG_D(MAC, "ue_get_rach , UE_mode: %d", UE_mode);
}
else { // Full stack mode
UE_mode = get_ue_mode(module_idP,0,eNB_indexP);
}
>>>>>>> main/develop
uint8_t lcid = CCCH;
uint16_t Size16;
struct LTE_RACH_ConfigCommon *rach_ConfigCommon =
......@@ -394,11 +322,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
"Transmission on secondary CCs is not supported yet\n");
if (UE_mode == PRACH) {
<<<<<<< HEAD
LOG_D(MAC, "ue_get_rach 3, RA_active value: %d", UE_mac_inst[module_idP].RA_active);
=======
LOG_D(MAC, "ue_get_rach 3, RA_active value: %d", UE_mac_inst[module_idP].RA_active);
>>>>>>> main/develop
LOG_D(MAC, "RA_active value: %d", UE_mac_inst[module_idP].RA_active);
if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon =
&UE_mac_inst[module_idP].
......@@ -484,11 +408,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
UE_mac_inst[module_idP].crnti,
eNB_indexP, frameP, subframeP,
ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
,0, 0
#endif
);
......@@ -506,16 +426,6 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
module_idP, frameP, rlc_status.bytes_in_buffer,
dcch_header_len);
<<<<<<< HEAD
sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, eNB_indexP, frameP, ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6, //not used
(char *) &ulsch_buff[0]
#ifdef Rel14
,0,0
#endif
);
LOG_D(MAC, "[UE %d] TX Got %d bytes for DCCH\n",
module_idP, sdu_lengths[0]);
=======
sdu_lengths = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, eNB_indexP, frameP, ENB_FLAG_NO, MBMS_FLAG_NO, DCCH, 6, //not used
(char *) &ulsch_buff[0]
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
......@@ -531,7 +441,6 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
LOG_E(MAC, "[UE %d] TX DCCH error\n",
module_idP );
>>>>>>> main/develop
update_bsr(module_idP, frameP, subframeP, eNB_indexP);
UE_mac_inst[module_idP].
scheduling_info.BSR[UE_mac_inst[module_idP].
......
......@@ -64,12 +64,6 @@
#define DEBUG_HEADER_PARSING 1
#define ENABLE_MAC_PAYLOAD_DEBUG 1
<<<<<<< HEAD
extern uint8_t usim_test;
=======
>>>>>>> main/develop
extern UL_IND_t *UL_INFO;
extern uint8_t nfapi_mode;
......@@ -478,13 +472,8 @@ ue_send_sdu(module_id_t module_idP,
LOG_E(MAC,
"[UE %d][RAPROC] Contention detected, RA failed\n",
module_idP);
<<<<<<< HEAD
if(nfapi_mode == 3) { // Panos: phy_stub mode
// Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
=======
if(nfapi_mode == 3) { // phy_stub mode
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
>>>>>>> main/develop
// PRACH state.
LOG_I(MAC, "nfapi_mode3: Setting UE_mode BACK to PRACH 1\n");
UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH;
......@@ -510,11 +499,7 @@ ue_send_sdu(module_id_t module_idP,
RA_contention_resolution_timer_active = 0;
if(nfapi_mode == 3) // phy_stub mode
{
<<<<<<< HEAD
//Panos: Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
=======
// Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
>>>>>>> main/develop
UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH;
}
else { // Full stack mode
......@@ -531,11 +516,7 @@ ue_send_sdu(module_id_t module_idP,
payload_ptr[0]);
#endif
<<<<<<< HEAD
// Panos: Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct?
=======
// Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct?
>>>>>>> main/develop
if (nfapi_mode!=3)
{
process_timing_advance(module_idP,CC_id,payload_ptr[0]);
......@@ -812,52 +793,6 @@ ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
num_sdu);
for (i = 0; i < num_sdu; i++) {
<<<<<<< HEAD
if (rx_lcids[i] == MCH_SCHDL_INFO) {
if (UE_mac_inst[module_idP].mcch_status == 1) {
LOG_I(MAC,
"[UE %d] Frame %d : MCH->MSI for sync area %d (eNB %d, %d bytes)\n",
module_idP, frameP, sync_area, eNB_index,
rx_lengths[i]);
// ??store necessary scheduling info to ue_mac_inst in order to
// calculate exact position of interested service (for the complex case has >1 mtch)
// set msi_status to 1
UE_mac_inst[module_idP].msi_status = 1;
}
} else if (rx_lcids[i] == MCCH_LCHANID) {
LOG_I(MAC,
"[UE %d] Frame %d : SDU %d MCH->MCCH for sync area %d (eNB %d, %d bytes)\n",
module_idP, frameP, i, sync_area, eNB_index,
rx_lengths[i]);
mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe
M_RNTI,
MCCH,
payload_ptr, rx_lengths[i], eNB_index,
sync_area);
} else if (rx_lcids[i] == MTCH) {
if (UE_mac_inst[module_idP].msi_status == 1) {
LOG_I(MAC,
"[UE %d] Frame %d : MCH->MTCH for sync area %d (eNB %d, %d bytes)\n",
module_idP, frameP, sync_area, eNB_index,
rx_lengths[i]);
mac_rlc_data_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index, frameP, ENB_FLAG_NO, MBMS_FLAG_YES, MTCH, /*+ (maxDRB + 3), */
(char *) payload_ptr, rx_lengths[i], 1,
NULL
#ifdef Rel14
,SL_RESET_RLC_FLAG_NO
#endif
);
}
} else {
LOG_W(MAC,
"[UE %d] Frame %d : unknown sdu %d rx_lcids[%d]=%d mcch status %d eNB %d \n",
module_idP, frameP, rx_lengths[i], i, rx_lcids[i],
UE_mac_inst[module_idP].mcch_status, eNB_index);
}
payload_ptr += rx_lengths[i];
=======
if (rx_lcids[i] == MCH_SCHDL_INFO) {
if (rx_lengths[i] & 0x01) {
LOG_E(MAC,"MCH Scheduling Information MAC Control Element should have an even size\n");
......@@ -928,7 +863,6 @@ ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
}
payload_ptr += rx_lengths[i];
>>>>>>> main/develop
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
......@@ -939,7 +873,6 @@ ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
}
void ue_send_sl_sdu(module_id_t module_idP,
<<<<<<< HEAD
uint8_t CC_id,
frame_t frameP,
sub_frame_t subframeP,
......@@ -1117,86 +1050,10 @@ void ue_send_sl_sdu(module_id_t module_idP,
eNB_index,
0);
}
=======
uint8_t CC_id,
frame_t frameP,
sub_frame_t subframeP,
uint8_t* sdu,
uint16_t sdu_len,
uint8_t eNB_index,
sl_discovery_flag_t sl_discovery_flag
) {
int rlc_sdu_len;
char *rlc_sdu;
uint32_t destinationL2Id =0x00000000;
if (sl_discovery_flag == SL_DISCOVERY_FLAG_NO) {
// Notes: 1. no control elements are supported yet
// 2. we exit with error if LCID != 3
// 3. we exit with error if E=1 (more than one SDU/CE)
// extract header
SLSCH_SUBHEADER_24_Bit_DST_LONG *longh = (SLSCH_SUBHEADER_24_Bit_DST_LONG *)sdu;
AssertFatal(longh->E==0,"E is non-zero\n");
AssertFatal(((longh->LCID==3)|(longh->LCID==10)),"LCID is %d (not 3 or 10)\n",longh->LCID);
//filter incoming packet based on destination address
destinationL2Id = (longh->DST07<<16) | (longh->DST815 <<8) | (longh->DST1623);
LOG_I( MAC, "[DestinationL2Id: 0x%08x] \n", destinationL2Id );
//in case of 1-n communication, verify that UE belongs to that group
int i=0;
for (i=0; i< MAX_NUM_DEST; i++)
if (UE_mac_inst[module_idP].destinationList[i] == destinationL2Id) break;
//match the destinationL2Id with UE L2Id or groupL2ID
if (!((destinationL2Id == UE_mac_inst[module_idP].sourceL2Id) | (i < MAX_NUM_DEST))){
LOG_I( MAC, "[Destination Id is neither matched with Source Id nor with Group Id, drop the packet!!! \n");
return;
}
if (longh->F==1) {
rlc_sdu_len = ((longh->L_MSB<<8)&0x7F00)|(longh->L_LSB&0xFF);
rlc_sdu = (char *)sdu+sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG);
}
else {
rlc_sdu_len = ((SLSCH_SUBHEADER_24_Bit_DST_SHORT *)sdu)->L;
rlc_sdu = (char *)sdu+sizeof(SLSCH_SUBHEADER_24_Bit_DST_SHORT);
}
mac_rlc_data_ind(
module_idP,
0x1234,
eNB_index,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
longh->LCID, //3/10
rlc_sdu,
rlc_sdu_len,
1,
NULL);
} else { //SL_DISCOVERY
uint16_t len = sdu_len;
LOG_I( MAC, "SL DISCOVERY \n");
mac_rrc_data_ind_ue(module_idP,
CC_id,
frameP,subframeP,
UE_mac_inst[module_idP].crnti,
SL_DISCOVERY,
sdu, //(uint8_t*)&UE_mac_inst[Mod_id].SL_Discovery[0].Rx_buffer.Payload[0],
len,
eNB_index,
0);
}
>>>>>>> main/develop
}
int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_area, unsigned char eNB_index)
<<<<<<< HEAD
=======
>>>>>>> main/develop
{
// currently there is one-to-one mapping between sf allocation pattern and sync area
if (mbsfn_sync_area >= MAX_MBSFN_AREA) {
......@@ -2324,20 +2181,12 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
lcid,
buflen_remain,
(char *)&ulsch_buff[sdu_length_total]
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
,0,
0
#endif
);
<<<<<<< HEAD
=======
>>>>>>> main/develop
AssertFatal(buflen_remain >= sdu_lengths[num_sdus],
"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
......@@ -2475,11 +2324,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
// build PHR and update the timers
if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) {
if(nfapi_mode ==3){
<<<<<<< HEAD
//Panos: Substitute with a static value for the MAC layer abstraction (phy_stub mode)
=======
//Substitute with a static value for the MAC layer abstraction (phy_stub mode)
>>>>>>> main/develop
phr_p->PH = 40;
}
else{
......@@ -2944,13 +2789,8 @@ ue_scheduler(const module_id_t module_idP,
LOG_E(MAC,
"Module id %u Contention resolution timer expired, RA failed\n",
module_idP);
<<<<<<< HEAD
if(nfapi_mode == 3) { // Panos: phy_stub mode
// Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
=======
if(nfapi_mode == 3) { // phy_stub mode
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
>>>>>>> main/develop
// PRACH state.
LOG_I(MAC, "nfapi_mode3: Setting UE_mode to PRACH 2 \n");
UE_mac_inst[module_idP].UE_mode[eNB_indexP] = PRACH;
......@@ -3276,99 +3116,6 @@ boolean_t
update_bsr(module_id_t module_idP, frame_t frameP,
sub_frame_t subframeP, eNB_index_t eNB_index)
{
<<<<<<< HEAD
mac_rlc_status_resp_t rlc_status;
boolean_t bsr_regular_triggered = FALSE;
uint8_t lcid;
uint8_t lcgid;
uint8_t num_lcid_with_data = 0; // for LCID with data only if LCGID is defined
uint16_t lcgid_buffer_remain[MAX_NUM_LCGID] = { 0, 0, 0, 0 };
int32_t lcid_bytes_in_buffer[MAX_NUM_LCID];
/* Array for ordering LCID with data per decreasing priority order */
uint8_t lcid_reordered_array[MAX_NUM_LCID] =
{ MAX_NUM_LCID, MAX_NUM_LCID, MAX_NUM_LCID, MAX_NUM_LCID,
MAX_NUM_LCID, MAX_NUM_LCID, MAX_NUM_LCID, MAX_NUM_LCID,
MAX_NUM_LCID,
MAX_NUM_LCID, MAX_NUM_LCID
};
uint8_t pos_next = 0;
uint8_t highest_priority = 16;
uint8_t array_index = 0;
// Reset All BSR Infos
lcid_bytes_in_buffer[0] = 0;
for (lcid = DCCH; lcid < MAX_NUM_LCID; lcid++) {
// Reset transmission status
lcid_bytes_in_buffer[lcid] = 0;
UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] =
LCID_EMPTY;
}
for (lcgid = 0; lcgid < MAX_NUM_LCGID; lcgid++) {
// Reset Buffer Info
UE_mac_inst[module_idP].scheduling_info.BSR[lcgid] = 0;
UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcgid] = 0;
}
//Get Buffer Occupancy and fill lcid_reordered_array
for (lcid = DCCH; lcid < MAX_NUM_LCID; lcid++) {
if (UE_mac_inst[module_idP].logicalChannelConfig[lcid]) {
lcgid = UE_mac_inst[module_idP].scheduling_info.LCGID[lcid];
// Store already available data to transmit per Group
if (lcgid < MAX_NUM_LCGID) {
lcgid_buffer_remain[lcgid] +=
UE_mac_inst[module_idP].
scheduling_info.LCID_buffer_remain[lcid];
}
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index, frameP, subframeP, ENB_FLAG_NO, MBMS_FLAG_NO, lcid, 0xFFFF
#ifdef Rel14
,0, 0
#endif
); //TBS is not used in RLC at this step, set a special value for debug
lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer;
if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC,
"[UE %d] PDCCH Tick : LCID%d LCGID%d has data to transmit =%d bytes at frame %d subframe %d\n",
module_idP, lcid, lcgid, rlc_status.bytes_in_buffer,
frameP, subframeP);
UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] =
LCID_NOT_EMPTY;
//Update BSR_bytes and position in lcid_reordered_array only if Group is defined
if (lcgid < MAX_NUM_LCGID) {
num_lcid_with_data++;
// sum lcid buffer which has same lcgid
UE_mac_inst[module_idP].scheduling_info.
BSR_bytes[lcgid] += rlc_status.bytes_in_buffer;
//Fill in the array
array_index = 0;
do {
if (UE_mac_inst[module_idP].logicalChannelConfig
[lcid]->ul_SpecificParameters->priority <=
highest_priority) {
//Insert if priority is higher or equal (lower or equal in value)
for (pos_next = num_lcid_with_data - 1;
pos_next > array_index; pos_next--) {
lcid_reordered_array[pos_next] =
lcid_reordered_array[pos_next - 1];
}
lcid_reordered_array[array_index] = lcid;
break;
}
array_index++;
}
while ((array_index < num_lcid_with_data)
&& (array_index < MAX_NUM_LCID));
}
=======
mac_rlc_status_resp_t rlc_status;
boolean_t bsr_regular_triggered = FALSE;
uint8_t lcid;
......@@ -3455,7 +3202,6 @@ update_bsr(module_id_t module_idP, frame_t frameP,
}
while ((array_index < num_lcid_with_data) && (array_index < MAX_NUM_LCID));
}
>>>>>>> main/develop
}
}
......@@ -3769,7 +3515,6 @@ int get_db_dl_PathlossChange(uint8_t dl_PathlossChange)
SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
<<<<<<< HEAD
UE_MAC_INST *ue = &UE_mac_inst[Mod_id];
SLSS_t *slss = &UE_mac_inst[Mod_id].slss;
......@@ -3790,10 +3535,6 @@ SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t su
LOG_D(MAC,"MIB-SL : %x.%x.%x.%x.%x\n",slss->slmib[0],slss->slmib[1],slss->slmib[2],slss->slmib[3],slss->slmib[4]);
}
return(slss);
=======
return((SLSS_t*)NULL);
>>>>>>> main/develop
}
SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
......@@ -3809,234 +3550,15 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
(uint8_t*)(sldch->payload), //&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0],
0, //eNB_indexP
0);
<<<<<<< HEAD
if (sldch->payload_length >0 ) {
LOG_D(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
return (sldch);
}
=======
if (sldch->payload_length >0 ) {
LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
return (sldch);
}
else
>>>>>>> main/develop
return((SLDCH_t*)NULL);
}
<<<<<<< HEAD
/*
=======
>>>>>>> main/develop
SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) {
mac_rlc_status_resp_t rlc_status; //, rlc_status_data;
uint32_t absSF = (frameP*10)+subframeP;
UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1};
int sdu_length;
//uint8_t sl_lcids[2] = {3, 10}; //list of lcids for SL - hardcoded
int i = 0;
// Note: this is hard-coded for now for the default SL configuration (4 SF PSCCH, 36 SF PSSCH)
SLSCH_t *slsch = &UE_mac_inst[module_idP].slsch;
LOG_D(MAC,"Checking SLSCH for absSF %d\n",absSF);
if ((absSF%40) == 0) { // fill PSCCH data later in first subframe of SL period
ue->sltx_active = 0;
<<<<<<< HEAD
for (i = 0; i < MAX_NUM_LCID; i++){
if (ue->sl_info[i].LCID > 0) {
// for (int j = 0; j < ue->numCommFlows; j++){
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].destinationL2Id >0) ){
if(UE_rrc_inst[0].Info[0].rnti == 0){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
}
else{
rlc_status = mac_rlc_status_ind(module_idP, UE_rrc_inst[0].Info[0].rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
}
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer \n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
ue->sltx_active = 1;
//store LCID, destinationL2Id
ue->slsch_lcid = ue->sl_info[i].LCID;
ue->destinationL2Id = ue->sl_info[i].destinationL2Id;
LOG_I(MAC,"LCID %d, source L2ID 0x%08x, destinationL2Id: 0x%08x \n",ue->slsch_lcid, ue->sourceL2Id, ue->destinationL2Id);
break;
}
}
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].groupL2Id >0) ){
if(UE_rrc_inst[0].Info[0].rnti == 0){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].groupL2Id);
}
else{
rlc_status = mac_rlc_status_ind(module_idP, UE_rrc_inst[0].Info[0].rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].groupL2Id);
}
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
ue->sltx_active = 1;
//store LCID, destinationL2Id
ue->slsch_lcid = ue->sl_info[i].LCID;
ue->destinationL2Id = ue->sl_info[i].groupL2Id;
LOG_I(MAC,"LCID %d, source L2ID 0x%08x, groupL2Id: 0x%08x \n",ue->slsch_lcid, ue->sourceL2Id, ue->destinationL2Id);
break;
}
}
// }
}
if ( ue->sltx_active == 1) break;
}
=======
for (i = 0; i < MAX_NUM_LCID; i++){
if (ue->SL_LCID[i] > 0) {
for (int j = 0; j < ue->numCommFlows; j++){
if ((ue->sourceL2Id > 0) && (ue->destinationList[j] >0) ){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->SL_LCID[i], 0xFFFF, ue->sourceL2Id, ue->destinationList[j]);
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
ue->sltx_active = 1;
//store LCID, destinationL2Id
ue->slsch_lcid = ue->SL_LCID[i];
ue->destinationL2Id = ue->destinationList[j];
break;
}
}
}
}
if ( ue->sltx_active == 1) break;
}
>>>>>>> main/develop
} // we're not in the SCCH period
else if (((absSF & 3) == 0 ) &&
(ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC
// 10 PRBs, mcs 19
int TBS = 4584/8;
int req;
if (TBS <= rlc_status.bytes_in_buffer) req = TBS;
else req = rlc_status.bytes_in_buffer;
if (req>0) {
<<<<<<< HEAD
if(UE_rrc_inst[0].Info[0].rnti == 0){
=======
>>>>>>> main/develop
sdu_length = mac_rlc_data_req(module_idP,
0x1234,
0,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
ue->slsch_lcid,
req,
(char*)(ue->slsch_pdu.payload + sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG))
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
,ue->sourceL2Id,
ue->destinationL2Id
#endif
);
<<<<<<< HEAD
}
else{
sdu_length = mac_rlc_data_req(module_idP,
UE_rrc_inst[0].Info[0].rnti,
0,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
ue->slsch_lcid,
req,
(char*)(ue->slsch_pdu.payload + sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG))
#ifdef Rel14
,ue->sourceL2Id,
ue->destinationL2Id
#endif
);
}
=======
>>>>>>> main/develop
// Notes: 1. hard-coded to 24-bit destination format for now
if (sdu_length > 0) {
LOG_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id);
slsch->payload = (unsigned char*)ue->slsch_pdu.payload;
if (sdu_length < 128) {
slsch->payload++;
SLSCH_SUBHEADER_24_Bit_DST_SHORT *shorth= (SLSCH_SUBHEADER_24_Bit_DST_SHORT *)slsch->payload;
shorth->F = 0;
shorth->L = sdu_length;
shorth->E = 0;
shorth->LCID = ue->slsch_lcid;
shorth->SRC07 = (ue->sourceL2Id>>16) & 0x000000ff;
shorth->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff;
shorth->SRC1623 = ue->sourceL2Id & 0x000000ff;
shorth->DST07 = (ue->destinationL2Id >>16) & 0x000000ff;
shorth->DST815 = (ue->destinationL2Id >>8) & 0x000000ff;
shorth->DST1623 = ue->destinationL2Id & 0x000000ff;
shorth->V = 0x1;
}
else {
SLSCH_SUBHEADER_24_Bit_DST_LONG *longh= (SLSCH_SUBHEADER_24_Bit_DST_LONG *)slsch->payload;
longh->F = 1;
longh->L_LSB = sdu_length&0xff;
longh->L_MSB = (sdu_length>>8)&0x7f;
longh->E = 0;
longh->LCID = ue->slsch_lcid;
longh->SRC07 = (ue->sourceL2Id >>16) & 0x000000ff;
longh->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff;
longh->SRC1623 = ue->sourceL2Id & 0x000000ff;
longh->DST07 = (ue->destinationL2Id >>16) & 0x000000ff;
longh->DST815 = (ue->destinationL2Id>>8) & 0x000000ff;
longh->DST1623 = ue->destinationL2Id & 0x000000ff;
longh->V = 0x1;
}
slsch->rvidx = 0;
slsch->payload_length = TBS;
// fill in SLSCH configuration
return(&ue->slsch);
}
else ue->sltx_active = 0;
}
} else if ((absSF%40)>3 && ue->sltx_active == 1) { // handle retransmission of SDU
LOG_I(MAC,"SFN.SF %d.%d : retransmission\n",frameP,subframeP);
slsch->rvidx = rvtab[absSF&3];
return(&ue->slsch);
}
return(NULL);
}
<<<<<<< HEAD
*/
extern const int trp8[TRP8_MAX+1][8];
SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP,int slsch_test) {
......@@ -4243,5 +3765,3 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
return(NULL);
}
=======
>>>>>>> main/develop
......@@ -96,11 +96,7 @@ boolean_t pdcp_data_req(
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
#endif
......@@ -187,11 +183,7 @@ boolean_t pdcp_data_req(
sdu_buffer_sizeP);
#endif
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
,NULL, NULL
#endif
);
......@@ -379,14 +371,6 @@ boolean_t pdcp_data_req(
,sourceL2Id
,destinationL2Id
#endif
<<<<<<< HEAD
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p
#ifdef Rel14
,sourceL2Id
,destinationL2Id
#endif
=======
>>>>>>> main/develop
);
}
......@@ -957,7 +941,7 @@ pdcp_run (
//-----------------------------------------------------------------------------
{
<<<<<<< HEAD
// Not sure if we need this
#if defined(ENABLE_ITTI)
MessageDef *msg_p;
const char *msg_name;
......@@ -966,8 +950,6 @@ pdcp_run (
protocol_ctxt_t ctxt;
#endif
=======
>>>>>>> main/develop
if (ctxt_pP->enb_flag) {
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].pdcp_run);
} else {
......@@ -1020,11 +1002,7 @@ pdcp_run (
RRC_DCCH_DATA_REQ (msg_p).sdu_size,
RRC_DCCH_DATA_REQ (msg_p).sdu_p,
RRC_DCCH_DATA_REQ (msg_p).mode
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
, NULL, NULL
#endif
);
......@@ -1827,7 +1805,7 @@ rrc_pdcp_config_req (
const uint32_t actionP,
const rb_id_t rb_idP,
const uint8_t security_modeP
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
......
......@@ -232,19 +232,11 @@ boolean_t pdcp_data_req(
const sdu_size_t sdu_buffer_size,
unsigned char* const sdu_buffer,
const pdcp_transmission_mode_t mode
<<<<<<< HEAD
#ifdef Rel14
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
#endif
));
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
#endif
);
>>>>>>> main/develop
/*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
* \brief This functions handles data transfer indications coming from RLC
......@@ -282,16 +274,12 @@ void rrc_pdcp_config_req (
const srb_flag_t srb_flagP,
const uint32_t actionP,
const rb_id_t rb_idP,
<<<<<<< HEAD
const uint8_t security_modeP
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
);)
=======
const uint8_t security_modeP);
>>>>>>> main/develop
);
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
* \brief Function for RRC to configure a Radio Bearer.
......@@ -421,11 +409,7 @@ typedef struct pdcp_data_req_header_s {
sdu_size_t data_size;
signed int inst;
ip_traffic_type_t traffic_type;
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
uint32_t sourceL2Id;
uint32_t destinationL2Id;
#endif
......@@ -436,11 +420,7 @@ typedef struct pdcp_data_ind_header_s {
sdu_size_t data_size;
signed int inst;
ip_traffic_type_t dummy_traffic_type;
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
uint32_t sourceL2Id;
uint32_t destinationL2Id;
#endif
......@@ -454,26 +434,14 @@ struct pdcp_netlink_element_s {
};
//TTN for D2D (PC5S)
<<<<<<< HEAD
#ifdef Rel14
=======
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
>>>>>>> main/develop
#define PDCP_SOCKET_PORT_NO 9999 //temporary value
#define PC5_SIGNALLING_PAYLOAD_SIZE 100 //should be updated with a correct value
int pdcp_pc5_sockfd;
struct sockaddr_in prose_ctrl_addr;
struct sockaddr_in prose_pdcp_addr;
struct sockaddr_in pdcp_sin;
<<<<<<< HEAD
/*<<<<<<< HEAD
int pdcp_pc5_socket_init(void);
=======*/
void pdcp_pc5_socket_init(void);
//>>>>>>> origin/on-off-integration
=======
void pdcp_pc5_socket_init(void);
>>>>>>> main/develop
typedef struct {
rb_id_t rb_id;
......@@ -486,11 +454,7 @@ typedef struct {
//new PC5S-message
typedef struct {
<<<<<<< HEAD
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
=======
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
>>>>>>> main/develop
} __attribute__((__packed__)) PC5SignallingMessage ;
//example of PC5-S messages
......@@ -503,20 +467,6 @@ typedef struct {
} __attribute__((__packed__)) sidelink_pc5s_element;
<<<<<<< HEAD
#endif
#if 0
/*
* Missing PDU information struct, a copy of this will be enqueued
* into pdcp.missing_pdus for every missing PDU
*/
typedef struct pdcp_missing_pdu_info_t {
pdcp_sn_t sequence_number;
} pdcp_missing_pdu_info_t;
=======
>>>>>>> main/develop
#endif
/*
......
......@@ -784,7 +784,7 @@ rrc_t310_expiration(
CONFIG_ACTION_REMOVE,
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id,
0
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
,0
#endif
......@@ -2533,7 +2533,7 @@ rrc_ue_process_mobilityControlInfo(
<<<<<<< HEAD:openair2/RRC/LITE/rrc_UE.c
LOG_N(RRC,"[UE %d] : Update needed for rrc_pdcp_config_req (deprecated) and rrc_rlc_config_req commands(deprecated)\n", ctxt_pP->module_id);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH,UNDEF_SECURITY_MODE
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
,0
#endif
......@@ -2545,7 +2545,7 @@ rrc_ue_process_mobilityControlInfo(
#endif
);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH1,UNDEF_SECURITY_MODE
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
,0
#endif
......@@ -2557,7 +2557,7 @@ rrc_ue_process_mobilityControlInfo(
#endif
);
rrc_pdcp_config_req (ctxt_pP, SRB_FLAG_NO, CONFIG_ACTION_REMOVE, DTCH,UNDEF_SECURITY_MODE
#ifdef Rel14
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
,0
#endif
......
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