Commit 30b4c553 authored by nguyennd's avatar nguyennd
Browse files

LGAUTHIER, Duy, OK for e-MBMS, may be one remaining problem with stats

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5121 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 42f7ca06
...@@ -26,10 +26,10 @@ ________________________________________________________________*/ ...@@ -26,10 +26,10 @@ ________________________________________________________________*/
#endif #endif
//#include "rrm_config_structs.h" //#include "rrm_config_structs.h"
//#include "platform_types.h" //#include "platform_types.h"
/** @defgroup _mac_rrc_primitives_ MAC Layer Primitives for Communications with RRC /** @defgroup _mac_rrc_primitives_ MAC Layer Primitives for Communications with RRC
* @ingroup _openair_mac_layer_specs_ * @ingroup _openair_mac_layer_specs_
* @{ * @{
This subclause describes the primitives for communications between the RRC and MAC sub-layers. This subclause describes the primitives for communications between the RRC and MAC sub-layers.
This subclause describes the primitives for communications between the RRC and MAC sub-layers. This subclause describes the primitives for communications between the RRC and MAC sub-layers.
...@@ -39,7 +39,7 @@ The primitives responsible for relaying of radio and traffic measurements to the ...@@ -39,7 +39,7 @@ The primitives responsible for relaying of radio and traffic measurements to the
RRC signaling are : RRC signaling are :
-# MAC_MEAS_REQ: enables RRC to request a measurement process in the MAC (one-shot, periodic or event-driven). This configures -# MAC_MEAS_REQ: enables RRC to request a measurement process in the MAC (one-shot, periodic or event-driven). This configures
a measurement process in the MAC. a measurement process in the MAC.
-# MAC_MEAS_IND: indicates to RRC that a (periodic) measurement request is available. -# MAC_MEAS_IND: indicates to RRC that a (periodic) measurement request is available.
-# MAC_MEAS_CONFIRM: enables RRC to acknowledge a MAC-MEAS-Ind. -# MAC_MEAS_CONFIRM: enables RRC to acknowledge a MAC-MEAS-Ind.
These associate a set of measurements (described by the MAC_MEAS_t structure) to a particular logical channel. Each measurement has These associate a set of measurements (described by the MAC_MEAS_t structure) to a particular logical channel. Each measurement has
...@@ -48,30 +48,30 @@ instantaneous measurement reports. The latter is typically used to signal events ...@@ -48,30 +48,30 @@ instantaneous measurement reports. The latter is typically used to signal events
negotiated QoS values. These consequently trigger reconfiguration of services by the network. The averaging parameters used by the negotiated QoS values. These consequently trigger reconfiguration of services by the network. The averaging parameters used by the
MAC measurement process is described by the structure MAC_AVG_t. Note that it is the responsibility MAC measurement process is described by the structure MAC_AVG_t. Note that it is the responsibility
of the MAC-layer to relay PHY measurements which are directly available to the scheduling entity in the MAC-layer. of the MAC-layer to relay PHY measurements which are directly available to the scheduling entity in the MAC-layer.
RRC does not directly act on the PHY measurement sub-system. RRC does not directly act on the PHY measurement sub-system.
The primitives responsible for logical channel MAC configuration by the radio resource manager via RRC signaling are The primitives responsible for logical channel MAC configuration by the radio resource manager via RRC signaling are
-# MAC_CONFIG_REQ: enables RRC to configure a new logical channel description at the MAC layer. The associated QoS -# MAC_CONFIG_REQ: enables RRC to configure a new logical channel description at the MAC layer. The associated QoS
descriptor (MAC_LCHAN_DESC contains the parameters defining the logical channel resource scheduling. descriptor (MAC_LCHAN_DESC contains the parameters defining the logical channel resource scheduling.
-# MAC_CONFIG_CONFIRM: indicates to RRC that a given logical channel has or has not been configured. -# MAC_CONFIG_CONFIRM: indicates to RRC that a given logical channel has or has not been configured.
The primitives responsible for indicating data synchronization (or loss of) to RRC are The primitives responsible for indicating data synchronization (or loss of) to RRC are
-# MAC_SYNC : indicates to RRC that a physical link for a newly established logical channel has been used (reception) with -# MAC_SYNC : indicates to RRC that a physical link for a newly established logical channel has been used (reception) with
success. The parameter passed indicates the logical channel id. This represents the event of successfully decoding a particular logical success. The parameter passed indicates the logical channel id. This represents the event of successfully decoding a particular logical
channel for the first time. In the event that several logical channels share the same physical resources (e.g. BCCH and CCCH), it channel for the first time. In the event that several logical channels share the same physical resources (e.g. BCCH and CCCH), it
shall only be sent for the logical channel with the lowest id. shall only be sent for the logical channel with the lowest id.
-# MAC_OUT_OF_SYNC : UE primitive indicating to RRC that a physical link for a particular Node-B has been lossed. The parameter -# MAC_OUT_OF_SYNC : UE primitive indicating to RRC that a physical link for a particular Node-B has been lossed. The parameter
passed indicates the id of the Node-B. This represents the event of detecting an unacceptable error rate on the CHBCH of the Node-B in question. passed indicates the id of the Node-B. This represents the event of detecting an unacceptable error rate on the CHBCH of the Node-B in question.
and can be used in the case of handover between Node-B's. Note that this message is redundant since an equivalent way of obtaining the same and can be used in the case of handover between Node-B's. Note that this message is redundant since an equivalent way of obtaining the same
result could be based on an event-driven measurement report. result could be based on an event-driven measurement report.
*/ */
# define NB_SIG_CNX_CH 1 # define NB_SIG_CNX_CH 1
# define NB_CNX_CH MAX_MOBILES_PER_RG # define NB_CNX_CH MAX_MOBILES_PER_ENB
# define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE # define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
# define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE # define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define NUMBER_OF_MEASUREMENT_SUBBANDS 16 #define NUMBER_OF_MEASUREMENT_SUBBANDS 16
...@@ -151,7 +151,7 @@ typedef struct { ...@@ -151,7 +151,7 @@ typedef struct {
typedef struct { typedef struct {
//LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/ //LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
//unsigned short Process_id; /*!< \brief Id of new MAC measurement process*/ //unsigned short Process_id; /*!< \brief Id of new MAC measurement process*/
char Meas_status; /*!< \brief Status (0-positive, 1-negative)*/ char Meas_status; /*!< \brief Status (0-positive, 1-negative)*/
}__attribute__ ((__packed__)) MAC_MEAS_CONFIRM; }__attribute__ ((__packed__)) MAC_MEAS_CONFIRM;
/*!\brief This primitive parametrizes a MAC measurement process /*!\brief This primitive parametrizes a MAC measurement process
...@@ -221,7 +221,7 @@ typedef struct { ...@@ -221,7 +221,7 @@ typedef struct {
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/ uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
}__attribute__ ((__packed__)) LCHAN_DESC; }__attribute__ ((__packed__)) LCHAN_DESC;
#define LCHAN_DESC_SIZE sizeof(LCHAN_DESC) #define LCHAN_DESC_SIZE sizeof(LCHAN_DESC)
/*!\brief This primitive indicates to RRC that a particular logical channel has been established and that successful transmission has /*!\brief This primitive indicates to RRC that a particular logical channel has been established and that successful transmission has
been received. The parameter passed is the logical channel id. been received. The parameter passed is the logical channel id.
...@@ -240,7 +240,7 @@ typedef struct MAC_OUT_OF_SYNC { ...@@ -240,7 +240,7 @@ typedef struct MAC_OUT_OF_SYNC {
/*!\brief This primitive enables RRC to configure a new logical channel description at the MAC layer. /*!\brief This primitive enables RRC to configure a new logical channel description at the MAC layer.
*/ */
typedef struct{ typedef struct{
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/ LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
// unsigned short UE_eNB_index; //ID of CH who configued the LC (Need this to identify LC in the UE side) // unsigned short UE_eNB_index; //ID of CH who configued the LC (Need this to identify LC in the UE side)
uint8_t Lchan_type; // DCCH_LCHAN, DTCH_LCHAN uint8_t Lchan_type; // DCCH_LCHAN, DTCH_LCHAN
...@@ -250,7 +250,7 @@ typedef struct{ ...@@ -250,7 +250,7 @@ typedef struct{
//#ifndef CELLULAR //#ifndef CELLULAR
unsigned short UE_eNB_index; unsigned short UE_eNB_index;
//#endif //#endif
}__attribute__ ((__packed__)) MAC_CONFIG_REQ; }__attribute__ ((__packed__)) MAC_CONFIG_REQ;
#define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ) #define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ)
...@@ -279,7 +279,7 @@ typedef struct { ...@@ -279,7 +279,7 @@ typedef struct {
uint8_t Forg_fact; uint8_t Forg_fact;
unsigned short Rep_interval; unsigned short Rep_interval;
uint8_t Status; uint8_t Status;
unsigned int Last_report_frame; unsigned int Last_report_frame;
unsigned int Next_check_frame; unsigned int Next_check_frame;
uint8_t Active; uint8_t Active;
}__attribute__ ((__packed__)) DEFAULT_UE_MEAS; }__attribute__ ((__packed__)) DEFAULT_UE_MEAS;
...@@ -307,7 +307,7 @@ typedef struct { ...@@ -307,7 +307,7 @@ typedef struct {
uint8_t Forg_fact; uint8_t Forg_fact;
unsigned short Rep_interval; unsigned short Rep_interval;
unsigned int Last_report_frame; unsigned int Last_report_frame;
unsigned int Next_check_frame; unsigned int Next_check_frame;
uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
uint8_t Active; uint8_t Active;
}__attribute__ ((__packed__)) DEFAULT_CH_MEAS; }__attribute__ ((__packed__)) DEFAULT_CH_MEAS;
...@@ -329,7 +329,7 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS ...@@ -329,7 +329,7 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH]; // L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5]; uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
#endif #endif
void (*openair_rrc_top_init)(void); void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(uint8_t ); char (*openair_rrc_eNB_init)(uint8_t );
char (*openair_rrc_UE_init)(uint8_t, uint8_t); char (*openair_rrc_UE_init)(uint8_t, uint8_t);
RRC_status_t (*rrc_rx_tx)(uint8_t,uint32_t,uint8_t,uint8_t); RRC_status_t (*rrc_rx_tx)(uint8_t,uint32_t,uint8_t,uint8_t);
...@@ -354,7 +354,7 @@ typedef struct{ ...@@ -354,7 +354,7 @@ typedef struct{
void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short); void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short);
//RLC_INTERFACE_FUNCTIONS //RLC_INTERFACE_FUNCTIONS
void (*pdcp_run)(void); void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*); void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t ); signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index, int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
...@@ -362,7 +362,7 @@ typedef struct{ ...@@ -362,7 +362,7 @@ typedef struct{
MAC_MainConfig_t *mac_MainConfig, MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity, long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig, LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig, MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config, TDD_Config_t *tdd_Config,
uint8_t *SIwindowsize, uint8_t *SIwindowsize,
uint16_t *SIperiod uint16_t *SIperiod
...@@ -398,7 +398,7 @@ typedef struct{ ...@@ -398,7 +398,7 @@ typedef struct{
#define MEAS_OK 5 #define MEAS_OK 5
#define MEAS_TRIGGER 6 #define MEAS_TRIGGER 6
#define RRC_MEAS_REPORT_REQ 7 #define RRC_MEAS_REPORT_REQ 7
#define MEAS_REPORT 8 #define MEAS_REPORT 8
#define RAB_MEAS_IND 0 #define RAB_MEAS_IND 0
#define DEF_MEAS_IND 1 #define DEF_MEAS_IND 1
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#else #else
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET) # if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 : /* SR: When using ethernet network driver the packet size is 1512 :
* 1500 bytes IP packet + 12 bytes ethernet header * 1500 bytes IP packet + 14 bytes ethernet header
*/ */
# define MAX_IP_PACKET_SIZE 1512 # define MAX_IP_PACKET_SIZE 1514
# else # else
# define MAX_IP_PACKET_SIZE 1500 // 3000 # define MAX_IP_PACKET_SIZE 1500 // 3000
# endif # endif
...@@ -45,17 +45,24 @@ ...@@ -45,17 +45,24 @@
# define MAX_MODULES NB_MODULES_MAX # define MAX_MODULES NB_MODULES_MAX
#ifdef LARGE_SCALE #ifdef LARGE_SCALE
# define MAX_MOBILES_PER_RG 128 # define MAX_MOBILES_PER_ENB 128
# define MAX_RG 2 //# define MAX_RG 2
#else #else
# define MAX_MOBILES_PER_RG 16 # define MAX_MOBILES_PER_ENB 16
# define MAX_RG 2 //# define MAX_RG 2
#endif #endif
#define MAX_MANAGED_RG_PER_MOBILE 2 #define MAX_MANAGED_ENB_PER_MOBILE 2
#define DEFAULT_RAB_ID 3 #define DEFAULT_RAB_ID 3
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */ #define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if defined(Rel10)
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
#define NB_RAB_MAX maxDRB /* was 8, now 11 */ #define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9 #define RAB_SHIFT1 9
#define RAB_SHIFT2 3 #define RAB_SHIFT2 3
......
...@@ -382,7 +382,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, unsigned char gr ...@@ -382,7 +382,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, unsigned char gr
} }
return(nb_ue_in_pusch); return(nb_ue_in_pusch);
} }
#endif #endif
int8_t add_new_ue(module_id_t enb_mod_idP, rnti_t rntiP) { int8_t add_new_ue(module_id_t enb_mod_idP, rnti_t rntiP) {
module_id_t ue_mod_id; module_id_t ue_mod_id;
int j; int j;
...@@ -530,7 +530,7 @@ void rx_sdu(module_id_t enb_mod_idP,frame_t frameP,rnti_t rntiP,uint8_t *sdu, ui ...@@ -530,7 +530,7 @@ void rx_sdu(module_id_t enb_mod_idP,frame_t frameP,rnti_t rntiP,uint8_t *sdu, ui
module_id_t ue_mod_id = find_UE_id(enb_mod_idP,rntiP); module_id_t ue_mod_id = find_UE_id(enb_mod_idP,rntiP);
int ii,j; int ii,j;
start_meas(&eNB_mac_inst[enb_mod_idP].rx_ulsch_sdu); start_meas(&eNB_mac_inst[enb_mod_idP].rx_ulsch_sdu);
for(ii=0; ii<NB_RB_MAX; ii++) rx_lengths[ii] = 0; for(ii=0; ii<NB_RB_MAX; ii++) rx_lengths[ii] = 0;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU,1); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU,1);
...@@ -989,7 +989,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si ...@@ -989,7 +989,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned char *nprb,unsigned int *nCCE) { void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned char *nprb,unsigned int *nCCE) {
start_meas(&eNB_mac_inst[module_idP].schedule_si); start_meas(&eNB_mac_inst[module_idP].schedule_si);
unsigned char bcch_sdu_length; unsigned char bcch_sdu_length;
int mcs = -1; int mcs = -1;
void *BCCH_alloc_pdu=(void*)&eNB_mac_inst[module_idP].BCCH_alloc_pdu; void *BCCH_alloc_pdu=(void*)&eNB_mac_inst[module_idP].BCCH_alloc_pdu;
...@@ -1451,6 +1451,19 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -1451,6 +1451,19 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
else { // only MTCH in this subframeP else { // only MTCH in this subframeP
TBS = mac_xface->get_TBS(eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9, mac_xface->lte_frame_parms->N_RB_DL); TBS = mac_xface->get_TBS(eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9, mac_xface->lte_frame_parms->N_RB_DL);
} }
// get MTCH data from RLC (like for DTCH)
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: Schedule MTCH (area %d, sfAlloc %d)\n",Mod_id,frame,subframe,i,j);
header_len_mtch = 3;
LOG_D(MAC,"[eNB %d], Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
Mod_id,frame,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(Mod_id,frame,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
*/ */
// get MTCH data from RLC (like for DTCH) // get MTCH data from RLC (like for DTCH)
...@@ -1461,16 +1474,22 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -1461,16 +1474,22 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP,frameP,MTCH,TBS, module_idP,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch); TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG, rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch); TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
//printf("frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",frameP,subframeP, rlc_status.bytes_in_buffer); LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer >0) { if (rlc_status.bytes_in_buffer >0) {
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n", LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
module_idP,frameP,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch); module_idP,frameP,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, ENB_FLAG_YES, MBMS_FLAG_YES, sdu_lengths[num_sdus] = mac_rlc_data_req(
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG, module_idP,
0,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_YES,
MTCH,
(char*)&mch_buffer[sdu_length_total]); (char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]); //sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",module_idP,sdu_lengths[num_sdus],MTCH); LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",module_idP,sdu_lengths[num_sdus],MTCH);
...@@ -2024,7 +2043,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera ...@@ -2024,7 +2043,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
#ifdef CBA #ifdef CBA
if ((eNB_mac_inst[module_idP].num_active_cba_groups > 0) && (*nCCE == 0)) if ((eNB_mac_inst[module_idP].num_active_cba_groups > 0) && (*nCCE == 0))
schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, granted_UEs, nCCE, &nCCE_available, &first_rb); schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, granted_UEs, nCCE, &nCCE_available, &first_rb);
#endif #endif
stop_meas(&eNB_mac_inst[module_idP].schedule_ulsch); stop_meas(&eNB_mac_inst[module_idP].schedule_ulsch);
} }
...@@ -2224,7 +2243,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -2224,7 +2243,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
#else #else
if (round==0) if (round==0)
#endif #endif
{ {
LOG_D(MAC,"[eNB %d][PUSCH %x] Frame %d subframeP %d Scheduling UE %d (SR %d)\n", LOG_D(MAC,"[eNB %d][PUSCH %x] Frame %d subframeP %d Scheduling UE %d (SR %d)\n",
module_idP,rnti,frameP,subframeP,ue_mod_id, module_idP,rnti,frameP,subframeP,ue_mod_id,
...@@ -2238,7 +2257,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -2238,7 +2257,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
status = mac_get_rrc_status(module_idP,1,next_ue); status = mac_get_rrc_status(module_idP,1,next_ue);
#ifndef EXMIMO_IOT #ifndef EXMIMO_IOT
if (status < RRC_CONNECTED) if (status < RRC_CONNECTED)
cqi_req = 0; cqi_req = 0;
else else
...@@ -2669,7 +2688,7 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) { ...@@ -2669,7 +2688,7 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) {
void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,uint32_t RBalloc,uint8_t RA_scheduled,int mbsfn_flag) { void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,uint32_t RBalloc,uint8_t RA_scheduled,int mbsfn_flag) {
// loop over all allocated UEs and compute frequency allocations for PDSCH // loop over all allocated UEs and compute frequency allocations for PDSCH
module_id_t ue_mod_id = -1; module_id_t ue_mod_id = -1;
uint8_t first_rb,nb_rb=3; uint8_t first_rb,nb_rb=3;
...@@ -2689,9 +2708,9 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP ...@@ -2689,9 +2708,9 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
if (mbsfn_flag>0) if (mbsfn_flag>0)
return; return;
start_meas(&eNB_mac_inst[module_idP].fill_DLSCH_dci); start_meas(&eNB_mac_inst[module_idP].fill_DLSCH_dci);
// clear vrb_map // clear vrb_map
memset(vrb_map,0,100); memset(vrb_map,0,100);
...@@ -3454,10 +3473,10 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -3454,10 +3473,10 @@ void schedule_ue_spec(module_id_t module_idP,
int mcs; int mcs;
uint16_t min_rb_unit; uint16_t min_rb_unit;
short ta_update = 0; short ta_update = 0;
if (mbsfn_flag>0) if (mbsfn_flag>0)
return; return;
reset_meas(&eNB_mac_inst[module_idP].schedule_dlsch); reset_meas(&eNB_mac_inst[module_idP].schedule_dlsch);
switch (mac_xface->lte_frame_parms->N_RB_DL) { switch (mac_xface->lte_frame_parms->N_RB_DL) {
...@@ -3519,7 +3538,7 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -3519,7 +3538,7 @@ void schedule_ue_spec(module_id_t module_idP,
/// CALLING Pre_Processor for downlink scheduling (Returns estimation of RBs required by each UE and the allocation on sub-band) /// CALLING Pre_Processor for downlink scheduling (Returns estimation of RBs required by each UE and the allocation on sub-band)
start_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor); start_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
dlsch_scheduler_pre_processor(module_idP, dlsch_scheduler_pre_processor(module_idP,
frameP, frameP,
subframeP, subframeP,
...@@ -3527,7 +3546,7 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -3527,7 +3546,7 @@ void schedule_ue_spec(module_id_t module_idP,
pre_nb_available_rbs, pre_nb_available_rbs,
mac_xface->lte_frame_parms->N_RBGS, mac_xface->lte_frame_parms->N_RBGS,
rballoc_sub_UE); rballoc_sub_UE);
stop_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor); stop_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
for (ue_mod_id=0;ue_mod_id<granted_UEs;ue_mod_id++) { for (ue_mod_id=0;ue_mod_id<granted_UEs;ue_mod_id++) {
...@@ -3615,9 +3634,9 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -3615,9 +3634,9 @@ void schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]]; eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]];
LOG_T(MAC,"CQI %d\n",eNB_UE_stats->DL_cqi[0]); LOG_T(MAC,"CQI %d\n",eNB_UE_stats->DL_cqi[0]);
} }
else else
eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs; eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs;
if(eNB_UE_stats->dlsch_mcs1>22) if(eNB_UE_stats->dlsch_mcs1>22)
eNB_UE_stats->dlsch_mcs1=22; eNB_UE_stats->dlsch_mcs1=22;
...@@ -4306,7 +4325,7 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -4306,7 +4325,7 @@ void schedule_ue_spec(module_id_t module_idP,
} }
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {//, int calibration_flag) { void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {//, int calibration_flag) {
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler); start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
unsigned char nprb=0; unsigned char nprb=0;
unsigned int nCCE=0; unsigned int nCCE=0;
...@@ -4391,7 +4410,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -4391,7 +4410,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
eNB_mac_inst[module_idP].subframe = subframeP; eNB_mac_inst[module_idP].subframe = subframeP;
//if (subframeP%5 == 0) //if (subframeP%5 == 0)
#ifdef EXMIMO #ifdef EXMIMO
pdcp_run(frameP, 1, 0, module_idP); pdcp_run(frameP, 1, 0, module_idP);
/* /*
ret = pthread_mutex_trylock (&pdcp_mutex); ret = pthread_mutex_trylock (&pdcp_mutex);
...@@ -4709,5 +4728,5 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -4709,5 +4728,5 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,0); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,0);
stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler); stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
} }
...@@ -297,7 +297,7 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,uint8_t *sdu,uint16_t sdu ...@@ -297,7 +297,7 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,uint8_t *sdu,uint16_t sdu
LOG_T(MAC,"[eNB %d] First 32 bytes of DLSCH : \n"); LOG_T(MAC,"[eNB %d] First 32 bytes of DLSCH : \n");
for (i=0;i<32;i++) for (i=0;i<32;i++)
LOG_T(MAC,"%x.",sdu[i]); LOG_T(MAC,"%x.",sdu[i]);
LOG_T(MAC,"\n"); LOG_T(MAC,"\n");
#endif #endif
for (i=0;i<num_ce;i++) { for (i=0;i<num_ce;i++) {
...@@ -356,7 +356,7 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,uint8_t *sdu,uint16_t sdu ...@@ -356,7 +356,7 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,uint8_t *sdu,uint16_t sdu
for (j=0;j<rx_lengths[i];j++) for (j=0;j<rx_lengths[i];j++)
LOG_T(MAC,"%x.",(uint8_t)payload_ptr[j]); LOG_T(MAC,"%x.",(uint8_t)payload_ptr[j]);
LOG_T(MAC,"\n"); LOG_T(MAC,"\n");
#endif #endif
mac_rrc_data_ind(module_idP, mac_rrc_data_ind(module_idP,
frameP, frameP,
CCCH, CCCH,
...@@ -485,12 +485,12 @@ unsigned char *parse_mch_header(unsigned char *mac_header, ...@@ -485,12 +485,12 @@ unsigned char *parse_mch_header(unsigned char *mac_header,
void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint16_t sdu_len, uint8_t eNB_index, uint8_t sync_area) { void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint16_t sdu_len, uint8_t eNB_index, uint8_t sync_area) {
unsigned char num_sdu, i, *payload_ptr; unsigned char num_sdu, i, *payload_ptr;
unsigned char rx_lcids[NB_RB_MAX]; unsigned char rx_lcids[NB_RB_MAX];
unsigned short rx_lengths[NB_RB_MAX]; unsigned short rx_lengths[NB_RB_MAX];
start_meas(&UE_mac_inst[module_idP].rx_mch_sdu); start_meas(&UE_mac_inst[module_idP].rx_mch_sdu);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_IN); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_IN);
LOG_D(MAC,"[UE %d] Frame %d : process the mch PDU for sync area %d \n",module_idP,frameP, sync_area); LOG_D(MAC,"[UE %d] Frame %d : process the mch PDU for sync area %d \n",module_idP,frameP, sync_area);
LOG_D(MAC,"[UE %d] sdu: %x.%x\n", module_idP,sdu[0], sdu[1]); LOG_D(MAC,"[UE %d] sdu: %x.%x\n", module_idP,sdu[0], sdu[1]);
LOG_D(MAC,"[UE %d] parse_mch_header, demultiplex\n",module_idP); LOG_D(MAC,"[UE %d] parse_mch_header, demultiplex\n",module_idP);
...@@ -525,7 +525,7 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1 ...@@ -525,7 +525,7 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
frameP, frameP,
ENB_FLAG_NO, ENB_FLAG_NO,
MBMS_FLAG_YES, MBMS_FLAG_YES,
MTCH + (maxDRB + 3), MTCH, /*+ (maxDRB + 3),*/
(char *)payload_ptr, (char *)payload_ptr,
rx_lengths[i], rx_lengths[i],
1, 1,
...@@ -533,7 +533,12 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1 ...@@ -533,7 +533,12 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
} }