Commit 70920ffd authored by gauthier's avatar gauthier
Browse files

abstraction mode is OK

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5092 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent cdabfe0a
......@@ -154,9 +154,9 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, u8 eNB_id) {
#endif
#ifdef DEBUG_PHY
if ((mac_xface->frame%100==0) || (mac_xface->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, clear = %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
mac_xface->frame,clear,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,phy_vars_ue->rx_total_gain_dB,
if ((phy_vars_ue->frame%100==0) || (phy_vars_ue->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
phy_vars_ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,phy_vars_ue->rx_total_gain_dB,
TARGET_RX_POWER,MAX_RF_GAIN,MIN_RF_GAIN);
#endif //DEBUG_PHY
......
......@@ -69,11 +69,11 @@
#define MAX_NUM_CHANNEL_BITS (14*1200*6) // 14 symbols, 1200 REs, 12 bits/RE
#define MAX_NUM_RE (14*1200)
#define SI_RNTI 0xffff
#define M_RNTI 0xfffd
#define P_RNTI 0xfffe
#define CBA_RNTI 0xfff4
#define C_RNTI 0x1234
#define SI_RNTI (rnti_t)0xffff
#define M_RNTI (rnti_t)0xfffd
#define P_RNTI (rnti_t)0xfffe
#define CBA_RNTI (rnti_t)0xfff4
#define C_RNTI (rnti_t)0x1234
#define PMI_2A_11 0
#define PMI_2A_1m1 1
......@@ -677,9 +677,9 @@ typedef struct {
/// Position of first CCE of the dci
unsigned int nCCE;
/// flag to indicate that this is a RA response
uint8_t ra_flag;
boolean_t ra_flag;
/// rnti
uint16_t rnti;
rnti_t rnti;
/// Format
DCI_format_t format;
/// DCI pdu
......
......@@ -261,7 +261,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
unsigned int success=0;
u8 eNB,UE_id,i,j,number_of_cards=1;
u8 eNB,UE_id,i,j,number_of_cards_l=1;
u32 ulsch_errors=0;
u32 ulsch_round_attempts[4]={0,0,0,0},ulsch_round_errors[4]={0,0,0,0};
u32 harq_pid_ul, harq_pid_dl;
......@@ -277,9 +277,9 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
phy_vars_eNB->total_system_throughput = 0;//phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
// }
for (eNB=0;eNB<number_of_cards;eNB++) {
for (eNB=0;eNB<number_of_cards_l;eNB++) {
len += sprintf(&buffer[len],"[eNB PROC] eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
eNB,number_of_cards,
eNB,number_of_cards_l,
phy_vars_eNB->frame,
phy_vars_eNB->rx_total_gain_eNB_dB,
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_tot_dBm,
......
This diff is collapsed.
......@@ -67,47 +67,6 @@
#define CH_OFFSET 0x0004
#define CH_SHIFT 2
#ifdef MESH
//# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
#else
//# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# ifdef NODE_RG
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
//# else
//# // ifdef NODE_MT
//# // define MAX_RAB MAX_RAB_MOBILE
//# // define MAX_RB MAX_RB_MOBILE
//# //else
//# //error NODE_RG or NODE_MT must be defined
//# //endif
//# endif
#endif //MESH
// RLC_MODE
# define RLC_NONE (rlc_mode_t)0
# define RLC_MODE_AM (rlc_mode_t)1
# define RLC_MODE_TM (rlc_mode_t)2
# define RLC_MODE_UM (rlc_mode_t)3
//E_R
# define E_R_RLC_ER_RELEASE 1
# define E_R_RLC_ER_MODIFICATION 2
# define E_R_RLC_ER_RE_ESTABLISHMENT 4
# define E_R_RLC_ER_STOP 8
# define E_R_RLC_ER_CONTINUE 16
# define E_R_RLC_ER_NONE 0
// RLC_AM_SEND_MRW
# define SEND_MRW_OFF 15
# define SEND_MRW_ON 240
......@@ -134,7 +93,8 @@
# endif
# endif
#define UNUSED_PARAM_MBMS_SESSION_ID 0
#define UNUSED_PARAM_MBMS_SERVICE_ID 0
#ifdef USER_MODE
#define printk printf
......
......@@ -32,18 +32,20 @@ typedef unsigned int tb_size_t;
typedef u16_t rb_id_t;
typedef u16_t srb_id_t;
typedef u32_t frame_t;
typedef s32_t sframe_t;
typedef u32_t sub_frame_t;
typedef u8_t module_id_t;
typedef s8_t smodule_id_t;
typedef unsigned int mui_t;
typedef unsigned int confirm_t;
typedef unsigned int rb_type_t;
typedef unsigned int logical_chan_id_t;
typedef unsigned int num_tb_t;
typedef unsigned int crc_t;
typedef unsigned int rlc_tx_status_t;
typedef unsigned int rlc_mode_t;
typedef s16_t rlc_sn_t;
typedef u16_t rlc_usn_t;
typedef u16_t pdcp_sn_t;
typedef u32_t pdcp_hfn_t;
typedef int traffic_type_t;
typedef u32_t mbms_session_id_t;
typedef u16_t mbms_service_id_t;
......@@ -56,6 +58,25 @@ typedef unsigned short crc16_t;
typedef unsigned int crc32_t;
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
typedef enum link_direction_e {
UNKNOWN_DIR = 0,
DIR_UPLINK = 1,
DIR_DOWNLINK = 2
} link_direction_t;
typedef enum rb_type_e {
UNKNOWN_RADIO_BEARER = 0,
SIGNALLING_RADIO_BEARER = 1,
RADIO_ACCESS_BEARER = 2
} rb_type_t;
typedef enum MBMS_flag_e {
MBMS_FLAG_NO = 0,
......
......@@ -29,11 +29,6 @@
# define ACTION_MBMS_ADD 10
# define ACTION_MBMS_MODIFY 11
# define UPLINK 1
# define DOWNLINK 2
# define SIGNALLING_RADIO_BEARER 1
# define RADIO_ACCESS_BEARER 2
# define MOBILE 7
// equipment type
......
......@@ -203,7 +203,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
char* enb_ipv4_address_for_S1U = NULL;
char* enb_interface_name_for_S1_MME = NULL;
char* enb_ipv4_address_for_S1_MME = NULL;
char *astring = NULL;
char *address = NULL;
char *cidr = NULL;
......
......@@ -472,7 +472,7 @@ typedef struct{
/// NDI from last UL scheduling
uint8_t oldNDI_UL[8];
/// Flag to indicate UL has been scheduled at least once
int ul_active;
boolean_t ul_active;
// PHY interface info
......@@ -536,7 +536,7 @@ typedef struct{
typedef struct {
/// Flag to indicate this process is active
u8 RA_active;
boolean_t RA_active;
/// Size of DCI for RA-Response (bytes)
u8 RA_dci_size_bytes1;
/// Size of DCI for RA-Response (bits)
......@@ -1129,9 +1129,9 @@ void init_ue_sched_info(void);
void add_ue_ulsch_info (module_id_t module_idP, module_id_t ue_mod_idP, sub_frame_t subframe,UE_ULSCH_STATUS status);
void add_ue_dlsch_info (module_id_t module_idP, module_id_t ue_mod_idP, sub_frame_t subframe,UE_DLSCH_STATUS status);
module_id_t find_UE_id (module_id_t module_idP, rnti_t rnti) ;
u16 find_UE_RNTI (module_id_t module_idP, module_id_t ue_mod_idP);
rnti_t find_UE_RNTI (module_id_t module_idP, module_id_t ue_mod_idP);
u8 find_active_UEs (module_id_t module_idP);
u8 is_UE_active (module_id_t module_idP, module_id_t ue_mod_idP );
boolean_t is_UE_active (module_id_t module_idP, module_id_t ue_mod_idP );
u8 find_ulgranted_UEs(module_id_t module_idP);
u8 find_dlgranted_UEs(module_id_t module_idP);
u8 process_ue_cqi (module_id_t module_idP, module_id_t ue_mod_idP);
......@@ -1343,13 +1343,13 @@ BSR_SHORT *get_bsr_short(module_id_t module_idP, u8 bsr_len);
*/
BSR_LONG * get_bsr_long(module_id_t module_idP, u8 bsr_len);
/*! \fn int update_bsr(module_id_t module_idP, frame_t frameP, u8 lcid)
/*! \fn boolean_t update_bsr(module_id_t module_idP, frame_t frameP, u8 lcid)
\brief get the rlc stats and update the bsr level for each lcid
\param[in] Mod_id instance of the UE
\param[in] frame Frame index
\param[in] lcid logical channel identifier
*/
int update_bsr(module_id_t module_idP, frame_t frameP, u8 lcid, u8 lcgid);
boolean_t update_bsr(module_id_t module_idP, frame_t frameP, u8 lcid, u8 lcgid);
/*! \fn locate (int *table, int size, int value)
\brief locate the BSR level in the table as defined in 36.321. This function requires that he values in table to be monotonic, either increasing or decreasing. The returned value is not less than 0, nor greater than n-1, where n is the size of table.
......
......@@ -199,8 +199,8 @@ void initiate_ra_proc(module_id_t module_idP, frame_t frameP, u16 preamble_index
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d Initiating RA procedure for preamble index %d\n",module_idP,frameP,preamble_index);
for (i=0;i<NB_RA_PROC_MAX;i++) {
if (eNB_mac_inst[module_idP].RA_template[i].RA_active==0) {
eNB_mac_inst[module_idP].RA_template[i].RA_active=1;
if (eNB_mac_inst[module_idP].RA_template[i].RA_active==FALSE) {
eNB_mac_inst[module_idP].RA_template[i].RA_active=TRUE;
eNB_mac_inst[module_idP].RA_template[i].generate_rar=1;
eNB_mac_inst[module_idP].RA_template[i].generate_Msg4=0;
eNB_mac_inst[module_idP].RA_template[i].wait_ack_Msg4=0;
......@@ -224,7 +224,7 @@ void cancel_ra_proc(module_id_t module_idP, frame_t frameP, rnti_t rnti) {
for (i=0;i<NB_RA_PROC_MAX;i++) {
if (rnti == eNB_mac_inst[module_idP].RA_template[i].rnti) {
eNB_mac_inst[module_idP].RA_template[i].RA_active=0;
eNB_mac_inst[module_idP].RA_template[i].RA_active=FALSE;
eNB_mac_inst[module_idP].RA_template[i].generate_rar=0;
eNB_mac_inst[module_idP].RA_template[i].generate_Msg4=0;
eNB_mac_inst[module_idP].RA_template[i].wait_ack_Msg4=0;
......@@ -251,7 +251,7 @@ void terminate_ra_proc(module_id_t module_idP,frame_t frameP,rnti_t rnti,unsigne
eNB_mac_inst[module_idP].RA_template[i].rnti, rnti,
eNB_mac_inst[module_idP].RA_template[i].RA_active);
if ((eNB_mac_inst[module_idP].RA_template[i].rnti==rnti) &&
(eNB_mac_inst[module_idP].RA_template[i].RA_active==1)) {
(eNB_mac_inst[module_idP].RA_template[i].RA_active==TRUE)) {
payload_ptr = parse_ulsch_header(msg3,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,msg3_len);
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d Received CCCH: length %d, offset %d\n",
......@@ -307,16 +307,16 @@ module_id_t find_UE_id(module_id_t module_idP, rnti_t rnti) {
}
u16 find_UE_RNTI(module_id_t module_idP, module_id_t ue_mod_idP) {
rnti_t find_UE_RNTI(module_id_t module_idP, module_id_t ue_mod_idP) {
return (eNB_mac_inst[module_idP].UE_template[ue_mod_idP].rnti);
}
u8 is_UE_active(module_id_t module_idP, module_id_t ue_mod_idP ){
boolean_t is_UE_active(module_id_t module_idP, module_id_t ue_mod_idP ){
if (eNB_mac_inst[module_idP].UE_template[ue_mod_idP].rnti !=0 )
return 1;
return TRUE;
else
return 0 ;
return FALSE ;
}
u8 find_active_UEs(module_id_t module_idP){
......@@ -326,7 +326,7 @@ u8 find_active_UEs(module_id_t module_idP){
for (ue_mod_id=0;ue_mod_id<NUMBER_OF_UE_MAX;ue_mod_id++) {
if (((rnti=eNB_mac_inst[module_idP].UE_template[ue_mod_id].rnti) !=0)&&(eNB_mac_inst[module_idP].UE_template[ue_mod_id].ul_active==1)){
if (((rnti=eNB_mac_inst[module_idP].UE_template[ue_mod_id].rnti) !=0)&&(eNB_mac_inst[module_idP].UE_template[ue_mod_id].ul_active==TRUE)){
if (mac_xface->get_eNB_UE_stats(module_idP,rnti) != NULL){ // check at the phy enb_ue state for this rnti
nb_active_ue++;
......@@ -369,7 +369,7 @@ u8 find_num_active_UEs_in_cbagroup(module_id_t module_idP, unsigned char group_i
for (UE_id=group_id;UE_id<NUMBER_OF_UE_MAX;UE_id+=eNB_mac_inst[module_idP].num_active_cba_groups) {
if (((rnti=eNB_mac_inst[module_idP].UE_template[UE_id].rnti) !=0) &&
(eNB_mac_inst[module_idP].UE_template[UE_id].ul_active==1) &&
(eNB_mac_inst[module_idP].UE_template[UE_id].ul_active==TRUE) &&
(mac_get_rrc_status(module_idP,1,UE_id) > RRC_CONNECTED)){
// && (UE_is_to_be_scheduled(module_idP,UE_id)))
// check at the phy enb_ue state for this rnti
......@@ -383,9 +383,9 @@ u8 find_num_active_UEs_in_cbagroup(module_id_t module_idP, unsigned char group_i
return(nb_ue_in_pusch);
}
#endif
s8 add_new_ue(module_id_t enb_mod_idP, u16 rntiP) {
s8 add_new_ue(module_id_t enb_mod_idP, rnti_t rntiP) {
module_id_t ue_mod_id;
int j;
int j;
for (ue_mod_id=0;ue_mod_id<NUMBER_OF_UE_MAX;ue_mod_id++) {
if (eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_id].rnti == 0) {
......@@ -415,7 +415,7 @@ s8 mac_remove_ue(module_id_t enb_mod_idP, module_id_t ue_mod_idP) {
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_idP].ul_SR = 0;
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_idP].rnti = 0;
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_idP].ul_active = 0;
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_idP].ul_active = FALSE;
eNB_ulsch_info[enb_mod_idP][ue_mod_idP].rnti = 0;
eNB_ulsch_info[enb_mod_idP][ue_mod_idP].status = S_UL_NONE;
eNB_dlsch_info[enb_mod_idP][ue_mod_idP].rnti = 0;
......@@ -511,12 +511,12 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
void SR_indication(module_id_t enb_mod_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) {
s8 ue_mod_id = find_UE_id(enb_mod_idP, rntiP);
smodule_id_t ue_mod_id = find_UE_id(enb_mod_idP, rntiP);
if (ue_mod_id >= 0) {
LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d \n",enb_mod_idP,rntiP,frameP,subframeP, ue_mod_id);
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_id].ul_SR = 1;
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_id].ul_active = 1;
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_id].ul_active = TRUE;
} else {
AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
}
......@@ -602,7 +602,7 @@ void rx_sdu(module_id_t enb_mod_idP,frame_t frameP,rnti_t rntiP,u8 *sdu, u16 sdu
LOG_D(MAC,"[eNB %d] Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d(%d) \n",
enb_mod_idP,frameP, rx_lengths[i], ue_mod_id, rx_lcids[i], rx_lcids[i]);
mac_rlc_data_ind(enb_mod_idP,ue_mod_id, frameP,1,RLC_MBMS_NO,
mac_rlc_data_ind(enb_mod_idP,ue_mod_id, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,
rx_lcids[i],
(char *)payload_ptr,
rx_lengths[i],
......@@ -628,7 +628,7 @@ void rx_sdu(module_id_t enb_mod_idP,frame_t frameP,rnti_t rntiP,u8 *sdu, u16 sdu
enb_mod_idP,frameP, rx_lengths[i], ue_mod_id,rx_lcids[i],rx_lcids[i]);
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
mac_rlc_data_ind(enb_mod_idP,ue_mod_id, frameP,1,RLC_MBMS_NO,
mac_rlc_data_ind(enb_mod_idP,ue_mod_id, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,
DTCH,
(char *)payload_ptr,
rx_lengths[i],
......@@ -969,6 +969,7 @@ void add_common_dci(DCI_PDU *DCI_pdu,
DCI_pdu->Num_common_dci++;
LOG_D(MAC,"add common dci format %d for rnti %d \n",dci_fmt,rnti);
}
void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt,u8 ra_flag) {
......@@ -1453,7 +1454,7 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,1,RLC_MBMS_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+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
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);
......@@ -1461,10 +1462,10 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
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);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, 1, RLC_MBMS_YES,
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
(char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, RLC_MBMS_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);
eNB_mac_inst[module_idP].mtch_active=1;
sdu_lcids[num_sdus] = MTCH;
......@@ -1597,7 +1598,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
for (i=0;i<NB_RA_PROC_MAX;i++) {
if (RA_template[i].RA_active == 1) {
if (RA_template[i].RA_active == TRUE) {
LOG_I(MAC,"[eNB %d][RAPROC] RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n",
module_idP,i,RA_template[i].generate_rar,RA_template[i].generate_Msg4,RA_template[i].wait_ack_Msg4, RA_template[i].rnti);
......@@ -1886,7 +1887,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
RA_template[i].generate_Msg4=0;
RA_template[i].generate_Msg4_dci=1;
RA_template[i].wait_ack_Msg4=1;
RA_template[i].RA_active = 0;
RA_template[i].RA_active = FALSE;
lcid=0;
if ((TBsize - rrc_sdu_length - msg4_header) <= 2) {
......@@ -2002,7 +2003,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
// not sure about the break (can there be more than 1 active RA procedure?)
for (i=0;i<NB_RA_PROC_MAX;i++) {
if ((eNB_mac_inst[module_idP].RA_template[i].RA_active == 1) &&
if ((eNB_mac_inst[module_idP].RA_template[i].RA_active == TRUE) &&
(eNB_mac_inst[module_idP].RA_template[i].generate_rar == 0) &&
(eNB_mac_inst[module_idP].RA_template[i].Msg3_subframe == sched_subframe)) {
first_rb++;
......@@ -3216,7 +3217,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
else {
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,frameP,subframeP);
eNB_mac_inst[module_idP].RA_template[i].wait_ack_Msg4=0;
eNB_mac_inst[module_idP].RA_template[i].RA_active=0;
eNB_mac_inst[module_idP].RA_template[i].RA_active=FALSE;
}
}
}
......@@ -3818,8 +3819,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH,
(TBS-ta_len-header_len_dcch)); // transport block set size
......@@ -3830,8 +3831,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH,
(char *)&dlsch_buffer[sdu_lengths[0]]);
......@@ -3858,8 +3859,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH+1,
(TBS-ta_len-header_len_dcch-sdu_length_total)); // transport block set size less allocations for timing advance and
// DCCH SDU
......@@ -3871,8 +3872,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DCCH+1,
(char *)&dlsch_buffer[sdu_lengths[0]]);
......@@ -3897,8 +3898,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DTCH,
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
......@@ -3910,8 +3911,8 @@ void schedule_ue_spec(module_id_t module_idP,
module_idP,
ue_mod_id,
frameP,
1,
RLC_MBMS_NO,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DTCH,
(char*)&dlsch_buffer[sdu_length_total]);
......
......@@ -54,6 +54,7 @@
#include "defs.h"
#include "extern.h"
#include "assertions.h"
#include "PHY_INTERFACE/extern.h"
#include "PHY_INTERFACE/defs.h"
#include "PHY/defs.h"
......@@ -68,11 +69,6 @@
#include "SCHED/defs.h"
//#ifdef BIGPHYSAREA
//extern void *bigphys_malloc(int);
//#endif
/***********************************************************************/
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
......
......@@ -106,7 +106,7 @@ void store_dlsch_buffer (module_id_t Mod_id,
for(i=0;i< MAX_NUM_LCID; i++){ // loop over all the logical channels
rlc_status = mac_rlc_status_ind(Mod_id,next_ue, frameP,1,RLC_MBMS_NO,i,0 );
rlc_status = mac_rlc_status_ind(Mod_id,next_ue, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
eNB_mac_inst[Mod_id].UE_template[next_ue].dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
eNB_mac_inst[Mod_id].UE_template[next_ue].dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
eNB_mac_inst[Mod_id].UE_template[next_ue].dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
......
......@@ -296,7 +296,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,frame_t frameP, u8 eNB_ind
else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DCCH] > 0) {
// This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,0,RLC_MBMS_NO,
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
DCCH,
6);
if (UE_mac_inst[module_idP].crnti_before_ho)
......@@ -306,7 +306,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,frame_t frameP, u8 eNB_ind
LOG_D(MAC,"[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to send through PRACH(mac header len %d)\n",
module_idP,frameP, rlc_status.bytes_in_buffer,dcch_header_len);
sdu_lengths[0] = mac_rlc_data_req(eNB_indexP, module_idP,frameP,0, RLC_MBMS_NO,
sdu_lengths[0] = mac_rlc_data_req(eNB_indexP, module_idP,frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
DCCH,
(char *)&ulsch_buff[0]);
......@@ -355,7 +355,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,frame_t frameP, u8 eNB_ind
UE_mac_inst[module_idP].RA_tx_frame,UE_mac_inst[module_idP].RA_tx_subframe);
// compute backoff parameters
if (UE_mac_inst[module_idP].RA_backoff_cnt>0) {
frame_diff = (s32)frameP - UE_mac_inst[module_idP].RA_backoff_frame;
frame_diff = (sframe_t)frameP - UE_mac_inst[module_idP].RA_backoff_frame;
if (frame_diff < 0)
frame_diff = -frame_diff;
UE_mac_inst[module_idP].RA_backoff_cnt -= ((10*frame_diff) + (subframeP-UE_mac_inst[module_idP].RA_backoff_subframe));
......
......@@ -367,8 +367,8 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,u8 *sdu,u16 sdu_len,u8 eN
mac_rlc_data_ind(eNB_index,
module_idP,
frameP,
0,
RLC_MBMS_NO,
ENB_FLAG_NO,
MBMS_FLAG_NO,
DCCH,
(char *)payload_ptr,
rx_lengths[i],
......@@ -380,8 +380,8 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,u8 *sdu,u16 sdu_len,u8 eN
mac_rlc_data_ind(eNB_index,
module_idP,
frameP,
0,
RLC_MBMS_NO,
ENB_FLAG_NO,
MBMS_FLAG_NO,
DCCH1,
(char *)payload_ptr,
rx_lengths[i],
......@@ -401,8 +401,8 @@ void ue_send_sdu(module_id_t module_idP,frame_t frameP,u8 *sdu,u16 sdu_len,u8 eN
mac_rlc_data_ind(eNB_index,
module_idP,
frameP,
0,
RLC_MBMS_NO,
ENB_FLAG_NO,
MBMS_FLAG_NO,
DTCH,
(char *)payload_ptr,
rx_lengths[i],
......@@ -517,8 +517,8 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, u8 *sdu, u16 sdu_le
0,
module_idP,
frameP,
0,
RLC_MBMS_YES,
ENB_FLAG_NO,
MBMS_FLAG_YES,
MTCH + (maxDRB + 3),
(char *)payload_ptr,
rx_lengths[i],
......@@ -1080,14 +1080,14 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, u8 e
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH] == LCID_NOT_EMPTY) {
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,0,RLC_MBMS_NO,
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
DCCH,
(buflen-dcch_header_len-bsr_len-phr_len));
LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to "
"send (Transport Block size %d, mac header len %d)\n",
module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dcch_header_len);
sdu_lengths[0] += mac_rlc_data_req(0, module_idP,frameP,0, RLC_MBMS_NO,
sdu_lengths[0] += mac_rlc_data_req(0, module_idP,frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
DCCH,
(char *)&ulsch_buff[sdu_lengths[0]]);
......@@ -1106,7 +1106,7 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, u8 e
// DCCH1
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) {