Commit c5196908 authored by nikaeinn's avatar nikaeinn

* Update the relay node (RN) procedure when multicast relaying is enabled

* Fix the non-continous indexing of the PDCP array (replace rb_id by lc_id)
* Add a new test case 03 for Rel10 and eMBMS  
  


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4149 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e46fb846
......@@ -336,7 +336,7 @@ typedef struct {
#define NUMBER_OF_RN_MAX 3
typedef enum {no_relay=0,unicast_relay=1,multicast_relay=2} relaying_mode_t;
typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_relay} relaying_type_t;
typedef struct
{
......
......@@ -125,9 +125,9 @@ void cleanup_dlsch_threads(void);
@param next_slot Index of next_slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_mode indicates the relaying operation: 0: no_relaying, 1: unicast relaying, 2: multicast relaying
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_mode_t r_mode);
void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type);
/*!
\brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
@param last_slot Index of last slot (0-19)
......@@ -136,9 +136,26 @@ void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eN
@param eNB_id ID of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode
@param relaying_mode indicates the relaying operation: 0: no_relaying, 1: unicast relaying, 2: multicast relaying
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_mode_t r_mode);
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_type_t r_type);
#ifdef Rel10
/*!
\brief Top-level entry routine for relay node procedures when acting as eNB. This proc will make us of the existing eNB procs.
@param last_slot Index of last slot (0-19)
@param next_slot Index of next_slot (0-19)
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type);
/*!
\brief Top-level entry routine for relay node procedures actinf as UE. This proc will make us of the existing UE procs.
@param last_slot Index of last slot (0-19)
@param next_slot Index of next_slot (0-19)
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type);
#endif
/*!
\brief Scheduling for UE TX procedures in normal subframes.
......@@ -147,8 +164,9 @@ void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param mode calib/normal mode
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode);
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type);
/*!
\brief Scheduling for UE RX procedures in normal subframes.
@param last_slot Index of last slot (0-19)
......@@ -156,9 +174,9 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode
@param r_mode instruct PHY to operate as normal (0), unicast relay (1), or multicast relay (2)
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode);
int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type);
/*!
\brief Scheduling for UE TX procedures in TDD S-subframes.
......@@ -166,8 +184,9 @@ int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abst
@param phy_vars_ue Pointer to UE variables on which to act
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_mode_t r_mode);
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_type_t r_type);
/*!
\brief Scheduling for UE RX procedures in TDD S-subframes.
......@@ -175,42 +194,45 @@ void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 a
@param phy_vars_ue Pointer to UE variables on which to act
@param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag, relaying_mode_t r_mode);
void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag, relaying_type_t r_type);
/*!
\brief Scheduling for eNB TX procedures in normal subframes.
@param next_slot Index of next slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_mode instruct PHY to operate as normal (0), unicast relay (1), or multicast relay (2),
@note: r_mode could be extended to support other values to indicate the type of relaying AF,DF,QF, and QMF
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type);
/*!
\brief Scheduling for eNB RX procedures in normal subframes.
@param last_slot Index of last slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type);
/*!
\brief Scheduling for eNB TX procedures in TDD S-subframes.
@param next_slot Index of next slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type);
/*!
\brief Scheduling for eNB RX procedures in TDD S-subframes.
@param last_slot Index of next slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_S_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
void phy_procedures_eNB_S_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type);
/*!
\brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
......
......@@ -410,10 +410,13 @@ void phy_procedures_emos_eNB_TX(unsigned char next_slot, PHY_VARS_eNB *phy_vars_
}
*/
void phy_procedures_eNB_S_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
void phy_procedures_eNB_S_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type) {
unsigned char sect_id=0;
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif
if (last_slot%2 == 0) {
for (sect_id=0;sect_id<number_of_cards;sect_id++) {
......@@ -885,7 +888,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, u8 subframe, PHY_VARS_eNB *phy_vars_eNB) {
int QPSK[4]={AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)};
int QPSK2[4]={AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)};
void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type) {
u8 *pbch_pdu=&phy_vars_eNB->pbch_pdu[0];
// unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0;
u16 input_buffer_length, re_allocated=0;
......@@ -918,6 +921,11 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[%s %d] Frame %d subframe %d : Doing phy_procedures_eNB_TX(%d)\n",
(r_type == multicast_relay) ? "RN/eNB" : "eNB",
phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot>>1, next_slot);
#endif
#ifdef OPENAIR2
// Get scheduling info for next subframe during odd slot of previous subframe (next_slot is even)
if (next_slot%2 == 0)
......@@ -2397,7 +2405,7 @@ void ulsch_decoding_procedures(unsigned char last_slot, unsigned int i, PHY_VARS
}
void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type) {
//RX processing
u32 l, ret,i,j;
u32 sect_id=0;
......@@ -2419,6 +2427,9 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8
int frame = ((last_slot>>1)>=8 ? -1 : 0 )+ phy_vars_eNB->frame;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif
if (abstraction_flag == 0) {
remove_7_5_kHz(phy_vars_eNB,last_slot);
......@@ -3357,44 +3368,58 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8
#undef DEBUG_PHY_PROC
void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_mode_t r_mode) {
#ifdef Rel10
int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type){
int do_proc=0;// do nothing
switch(r_type){
case no_relay:
do_proc= no_relay; // perform the normal eNB operation
break;
case multicast_relay:
if ( ((next_slot >>1) < 6) || ((next_slot >>1) > 8))
do_proc = 0; // do nothing
else // SF#6, SF#7 and SF#8
do_proc = multicast_relay; // do PHY procedures eNB TX
break;
default: // should'not be here
LOG_W(PHY,"Not supported relay type %d, do nothing\n", r_type);
do_proc=0;
break;
}
return do_proc;
}
#endif
void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type) {
/*
if (phy_vars_eNB->frame >= 1000)
mac_xface->macphy_exit("Exiting after 1000 Frames\n");
*/
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER, (last_slot + 1) % 20);
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER, phy_vars_eNB->frame);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,1);
if (((phy_vars_eNB->lte_frame_parms.frame_type == 1)&&(subframe_select(&phy_vars_eNB->lte_frame_parms,next_slot>>1)==SF_DL))||
(phy_vars_eNB->lte_frame_parms.frame_type == 0)){
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_TX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot);
#endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_mode);
#ifdef Rel10
if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 )
#endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type);
}
if (((phy_vars_eNB->lte_frame_parms.frame_type == 1 )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_UL))||
(phy_vars_eNB->lte_frame_parms.frame_type == 0)){
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif
phy_procedures_eNB_RX(last_slot,phy_vars_eNB,abstraction_flag,r_mode);
phy_procedures_eNB_RX(last_slot,phy_vars_eNB,abstraction_flag,r_type);
}
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,next_slot>>1)==SF_S) &&
((next_slot&1)==0)) {
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_TX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot);
#endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_mode);
#ifdef Rel10
if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 )
#endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type);
}
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_S) &&
((last_slot&1)==0)){
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif
phy_procedures_eNB_S_RX(last_slot,phy_vars_eNB,abstraction_flag,r_mode);
phy_procedures_eNB_S_RX(last_slot,phy_vars_eNB,abstraction_flag,r_type);
}
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0);
......
......@@ -557,7 +557,7 @@ int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
PRACH_RESOURCES_t prach_resources_local;
#endif
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode) {
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type) {
// int i_d;
u16 first_rb, nb_rb;
......@@ -1292,7 +1292,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
}
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_mode_t r_mode) {
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_type_t r_type) {
int aa;//i,aa;
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
......@@ -2163,7 +2163,7 @@ int lte_ue_pdcch_procedures(u8 eNB_id,u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8
}
int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode) {
int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type) {
u16 l,m,n_symb;
// int eNB_id = 0,
......@@ -2184,7 +2184,11 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
//msg("UE_RX 1 last_slot %d \n",last_slot);
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX(%d)\n",
(r_type == multicast_relay) ? "RN/UE" : "UE",
phy_vars_ue->Mod_id,phy_vars_ue->frame, last_slot>>1, last_slot);
#endif
if (phy_vars_ue->lte_frame_parms.Ncp == 0) { // normal prefix
pilot1 = 4;
pilot2 = 7;
......@@ -3015,8 +3019,30 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
return (0);
}
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_mode_t r_mode) {
#ifdef Rel10
int phy_procedures_RN_UE_RX(u8 last_slot, u8 next_slot, relaying_type_t r_type) {
int do_proc =0; // do nothing by default
switch(r_type){
case no_relay:
do_proc=no_relay; // perform the normal UE operation
break;
case multicast_relay:
if (last_slot > 12)
do_proc = 0; // do nothing
else // SF#1, SF#2, SF3, SF#3, SF#4, SF#5, SF#6(do rx slot 12)
do_proc =multicast_relay ; // do PHY procedures UE RX
break;
default: // should'not be here
LOG_W(PHY,"Not supported relay type %d, do nothing \n", r_type);
do_proc= 0;
break;
}
return do_proc;
}
#endif
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_type_t r_type) {
#undef DEBUG_PHY_PROC
......@@ -3040,22 +3066,28 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_UL)||
(phy_vars_ue->lte_frame_parms.frame_type == 0)){
phy_procedures_UE_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_mode);
phy_procedures_UE_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_type);
}
if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_DL) ||
(phy_vars_ue->lte_frame_parms.frame_type == 0)){
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_mode);
#ifdef Rel10
if (phy_procedures_RN_UE_RX(last_slot, next_slot, r_type) != 0 )
#endif
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_type);
#ifdef EMOS
phy_procedures_emos_UE_RX(phy_vars_ue,last_slot,eNB_id);
#endif
}
if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_S) &&
((next_slot&1)==1)) {
phy_procedures_UE_S_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,r_mode);
phy_procedures_UE_S_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,r_type);
}
if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_S) &&
((last_slot&1)==0)) {
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode, r_mode);
#ifdef Rel10
if (phy_procedures_RN_UE_RX(last_slot, next_slot, r_type) != 0 )
#endif
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode, r_type);
}
#ifdef OPENAIR2
......
......@@ -1325,7 +1325,7 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
// there is MCCH
if (mcch_flag == 1) {
LOG_D(MAC,"Scheduler: MCCH MESSAGE is transmitted in this subframe \n" );
LOG_D(MAC,"Scheduler: MCCH MESSAGE is transmitted in this subframe %d \n", subframe);
mcch_sdu_length = mac_rrc_data_req(Mod_id,
frame,
......@@ -1334,20 +1334,20 @@ int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe) {
1,// this is eNB
Mod_id);
if (mcch_sdu_length > 0) {
LOG_D(MAC,"[eNB %d] Frame %d : MCCH->MCH, Received %d bytes from RRC \n",Mod_id,frame,mcch_sdu_length);
LOG_D(MAC,"[eNB %d] Frame %d subframe %d : MCCH->MCH, Received %d bytes from RRC \n",Mod_id,frame,subframe,mcch_sdu_length);
header_len_mcch = 2;
if (mac_xface->lte_frame_parms->frame_type == TDD) {
LOG_D(MAC,"[eNB %d] Frame %d : Scheduling MCCH->MCH (TDD) for MCCH message %d bytes (mcs %d )\n",
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: Scheduling MCCH->MCH (TDD) for MCCH message %d bytes (mcs %d )\n",
Mod_id,
frame,
frame,subframe,
mcch_sdu_length,
mcch_mcs);
}
else {
LOG_I(MAC,"[eNB %d] Frame %d : Scheduling MCCH->MCH (FDD) for MCCH message %d bytes (mcs %d)\n",
LOG_I(MAC,"[eNB %d] Frame %d subframe %d: Scheduling MCCH->MCH (FDD) for MCCH message %d bytes (mcs %d)\n",
Mod_id,
frame,
frame, subframe,
mcch_sdu_length,
mcch_mcs);
}
......
......@@ -86,7 +86,7 @@ BOOL pdcp_data_req(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb
#ifdef PDCP_UNIT_TEST
pdcp_t* pdcp = test_pdcp_entity;
#else
pdcp_t* pdcp = &pdcp_array[module_id][rb_id];
pdcp_t* pdcp = &pdcp_array[module_id][rb_id%NB_RB_MAX];
#endif
u8 i;
u8 pdcp_header_len=0, pdcp_tailer_len=0;
......@@ -266,7 +266,7 @@ BOOL pdcp_data_ind(module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rb
pdcp_t* pdcp = pdcp_test_entity;
list_t* sdu_list = test_list;
#else
pdcp_t* pdcp = &pdcp_array[module_id][rb_id];
pdcp_t* pdcp = &pdcp_array[module_id][rb_id%NB_RB_MAX];
list_t* sdu_list = &pdcp_sdu_list;
#endif
mem_block_t *new_sdu = NULL;
......@@ -541,8 +541,9 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag
if (srb2add_list != NULL) {
for (cnt=0;cnt<srb2add_list->list.count;cnt++) {
srb_id = srb2add_list->list.array[cnt]->srb_Identity;
lc_id = srb_id;
rb_id = (index * NB_RB_MAX) + srb_id;
if (pdcp_array[module_id][rb_id].instanciated_instance == module_id + 1)
if (pdcp_array[module_id][lc_id].instanciated_instance == module_id + 1)
action = ACTION_MODIFY;
else
action = ACTION_ADD;
......@@ -596,7 +597,7 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag
lc_id = -1;
}
rb_id = (index * NB_RB_MAX) + lc_id;
if (pdcp_array[module_id][rb_id].instanciated_instance == module_id + 1)
if (pdcp_array[module_id][lc_id].instanciated_instance == module_id + 1)
action = ACTION_MODIFY;
else
action = ACTION_ADD;
......@@ -733,93 +734,93 @@ BOOL pdcp_config_req_asn1 (module_id_t module_id, u32 frame, u8_t eNB_flag, u16
u8 security_mode){
switch (action) {
case ACTION_ADD:
pdcp_array[module_id][rb_id].instanciated_instance = module_id + 1;
pdcp_array[module_id][rb_id].lcid = lc_id;
pdcp_array[module_id][rb_id].header_compression_profile=header_compression_profile;
pdcp_array[module_id][rb_id].cipheringAlgorithm=security_mode & 0x0f;
pdcp_array[module_id][rb_id].integrityProtAlgorithm=(security_mode>>4) & 0xf;
pdcp_array[module_id][rb_id].status_report = rb_report;
pdcp_array[module_id][lc_id].instanciated_instance = module_id + 1;
pdcp_array[module_id][lc_id].lcid = lc_id;
pdcp_array[module_id][lc_id].header_compression_profile=header_compression_profile;
pdcp_array[module_id][lc_id].cipheringAlgorithm=security_mode & 0x0f;
pdcp_array[module_id][lc_id].integrityProtAlgorithm=(security_mode>>4) & 0xf;
pdcp_array[module_id][lc_id].status_report = rb_report;
if (rb_sn == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits)
pdcp_array[module_id][rb_id].seq_num_size = 7;
pdcp_array[module_id][lc_id].seq_num_size = 7;
else if (rb_sn == PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits)
pdcp_array[module_id][rb_id].seq_num_size=12;
pdcp_array[module_id][lc_id].seq_num_size=12;
else
pdcp_array[module_id][rb_id].seq_num_size=5;
pdcp_array[module_id][lc_id].seq_num_size=5;
pdcp_array[module_id][rb_id].rlc_mode = rlc_mode;
pdcp_array[module_id][rb_id].next_pdcp_tx_sn = 0;
pdcp_array[module_id][rb_id].next_pdcp_rx_sn = 0;
pdcp_array[module_id][rb_id].tx_hfn = 0;
pdcp_array[module_id][rb_id].rx_hfn = 0;
pdcp_array[module_id][rb_id].last_submitted_pdcp_rx_sn = 4095;
pdcp_array[module_id][rb_id].first_missing_pdu = -1;
pdcp_array[module_id][lc_id].rlc_mode = rlc_mode;
pdcp_array[module_id][lc_id].next_pdcp_tx_sn = 0;
pdcp_array[module_id][lc_id].next_pdcp_rx_sn = 0;
pdcp_array[module_id][lc_id].tx_hfn = 0;
pdcp_array[module_id][lc_id].rx_hfn = 0;
pdcp_array[module_id][lc_id].last_submitted_pdcp_rx_sn = 4095;
pdcp_array[module_id][lc_id].first_missing_pdu = -1;
LOG_I(PDCP,"[%s %d] Config request : Action ADD for %s %d: Frame %d radio bearer id %d configured with SN size %d bits and RLC %s\n",
LOG_I(PDCP,"[%s %d] Config request : Action ADD for %s %d: Frame %d LCID %d (rb id %d) configured with SN size %d bits and RLC %s\n",
(eNB_flag) ? "eNB" : "UE", module_id,
(eNB_flag) ? "UE" : "eNB", index,
frame, rb_id, pdcp_array[module_id][rb_id].seq_num_size,
frame, lc_id, rb_id, pdcp_array[module_id][lc_id].seq_num_size,
(rlc_mode == 1) ? "AM" : (rlc_mode == 2) ? "TM" : "UM");
LOG_D(PDCP, "[MSC_NEW][FRAME %05d][PDCP][MOD %02d][RB %02d]\n", frame, module_id,rb_id);
break;
case ACTION_MODIFY:
pdcp_array[module_id][rb_id].header_compression_profile=header_compression_profile;
pdcp_array[module_id][rb_id].cipheringAlgorithm=security_mode & 0x0f;
pdcp_array[module_id][rb_id].integrityProtAlgorithm=(security_mode>>4) & 0xf;
pdcp_array[module_id][rb_id].status_report = rb_report;
pdcp_array[module_id][rb_id].rlc_mode = rlc_mode;
pdcp_array[module_id][lc_id].header_compression_profile=header_compression_profile;
pdcp_array[module_id][lc_id].cipheringAlgorithm=security_mode & 0x0f;
pdcp_array[module_id][lc_id].integrityProtAlgorithm=(security_mode>>4) & 0xf;
pdcp_array[module_id][lc_id].status_report = rb_report;
pdcp_array[module_id][lc_id].rlc_mode = rlc_mode;
if (rb_sn == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits)
pdcp_array[module_id][rb_id].seq_num_size = 7;
pdcp_array[module_id][lc_id].seq_num_size = 7;
else if (rb_sn == PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits)
pdcp_array[module_id][rb_id].seq_num_size=12;
pdcp_array[module_id][lc_id].seq_num_size=12;
else
pdcp_array[module_id][rb_id].seq_num_size=5;
pdcp_array[module_id][lc_id].seq_num_size=5;
LOG_I(PDCP,"[%s %d] Config request : Action MODIFY for %s %d: Frame %d radio bearer id %d configured with SN size %d and RLC %s \n",
LOG_I(PDCP,"[%s %d] Config request : Action MODIFY for %s %d: Frame %d LCID %d RB id %d configured with SN size %d and RLC %s \n",
(eNB_flag) ? "eNB" : "UE", module_id,
(eNB_flag) ? "UE" : "eNB", index,
frame, rb_id, rb_sn,
frame, lc_id, rb_id, rb_sn,
(rlc_mode == 1) ? "AM" : (rlc_mode == 2) ? "TM" : "UM");
break;
case ACTION_REMOVE:
pdcp_array[module_id][rb_id].instanciated_instance = 0;
pdcp_array[module_id][rb_id].lcid= 0;
pdcp_array[module_id][rb_id].header_compression_profile=0x0;
pdcp_array[module_id][rb_id].cipheringAlgorithm=0xff;
pdcp_array[module_id][rb_id].integrityProtAlgorithm=0xff;
pdcp_array[module_id][rb_id].status_report = 0;
pdcp_array[module_id][rb_id].rlc_mode = RLC_NONE;
pdcp_array[module_id][rb_id].next_pdcp_tx_sn = 0;
pdcp_array[module_id][rb_id].next_pdcp_rx_sn = 0;
pdcp_array[module_id][rb_id].tx_hfn = 0;
pdcp_array[module_id][rb_id].rx_hfn = 0;
pdcp_array[module_id][rb_id].last_submitted_pdcp_rx_sn = 4095;
pdcp_array[module_id][rb_id].seq_num_size = 0;
pdcp_array[module_id][rb_id].first_missing_pdu = -1;
LOG_I(PDCP,"[%s %d] Config request : ACTION_REMOVE: Frame %d radio bearer id %d configured\n",
(eNB_flag) ? "eNB" : "UE", module_id, frame, rb_id);
pdcp_array[module_id][lc_id].instanciated_instance = 0;
pdcp_array[module_id][lc_id].lcid= 0;
pdcp_array[module_id][lc_id].header_compression_profile=0x0;
pdcp_array[module_id][lc_id].cipheringAlgorithm=0xff;
pdcp_array[module_id][lc_id].integrityProtAlgorithm=0xff;
pdcp_array[module_id][lc_id].status_report = 0;
pdcp_array[module_id][lc_id].rlc_mode = RLC_NONE;
pdcp_array[module_id][lc_id].next_pdcp_tx_sn = 0;
pdcp_array[module_id][lc_id].next_pdcp_rx_sn = 0;
pdcp_array[module_id][lc_id].tx_hfn = 0;
pdcp_array[module_id][lc_id].rx_hfn = 0;
pdcp_array[module_id][lc_id].last_submitted_pdcp_rx_sn = 4095;
pdcp_array[module_id][lc_id].seq_num_size = 0;
pdcp_array[module_id][lc_id].first_missing_pdu = -1;
LOG_I(PDCP,"[%s %d] Config request : ACTION_REMOVE: Frame %d LCID %d RBID %d configured\n",
(eNB_flag) ? "eNB" : "UE", module_id, frame, lc_id,rb_id);
break;
case ACTION_MBMS_ADD:
case ACTION_MBMS_MODIFY:
pdcp_mbms_array[module_id][rb_id].instanciated_instance = module_id + 1 ;
pdcp_mbms_array[module_id][rb_id].service_id = mch_id;
pdcp_mbms_array[module_id][rb_id].session_id = lc_id;
pdcp_mbms_array[module_id][rb_id].rb_id = rb_id;
pdcp_mbms_array[module_id][lc_id].instanciated_instance = module_id + 1 ;
pdcp_mbms_array[module_id][lc_id].service_id = mch_id;
pdcp_mbms_array[module_id][lc_id].session_id = lc_id;
pdcp_mbms_array[module_id][lc_id].rb_id = rb_id;
LOG_I(PDCP,"[%s %d] Config request : ACTION_MBMS_ADD: Frame %d service_id/mch index %d, session_id/lcid %d, rbid %d configured\n",
(eNB_flag == 1) ? "eNB" : "UE", module_id, frame, mch_id, lc_id, rb_id);
break;
case ACTION_SET_SECURITY_MODE:
if ((security_mode >= 0 ) && (security_mode <=0x77)) {
pdcp_array[module_id][rb_id].cipheringAlgorithm= security_mode & 0x0f;
pdcp_array[module_id][rb_id].integrityProtAlgorithm = (security_mode>>4) & 0xf;
pdcp_array[module_id][lc_id].cipheringAlgorithm= security_mode & 0x0f;
pdcp_array[module_id][lc_id].integrityProtAlgorithm = (security_mode>>4) & 0xf