Commit 8713e749 authored by Raymond Knopp's avatar Raymond Knopp

changes from Cedric

parent 215a27c1
...@@ -124,7 +124,7 @@ endmacro(add_list_string_option) ...@@ -124,7 +124,7 @@ endmacro(add_list_string_option)
#################################################### ####################################################
# compilation flags # compilation flags
############################################# #############################################
set(CMAKE_BUILD_TYPE "Debug") #set(CMAKE_BUILD_TYPE "Debug")
if (CMAKE_BUILD_TYPE STREQUAL "") if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo") set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif() endif()
...@@ -1106,6 +1106,15 @@ set (MAC_SRC ...@@ -1106,6 +1106,15 @@ set (MAC_SRC
${MAC_DIR}/config.c ${MAC_DIR}/config.c
) )
set_source_files_properties(${RLC_DIR}/rlc_mac.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${RLC_AM_DIR}/rlc_am.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${RLC_AM_DIR}/rlc_am_status_report.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${RLC_AM_DIR}/rlc_am_receiver.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${RLC_AM_DIR}/rlc_am_retransmit.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${MAC_DIR}/ue_procedures.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${MAC_DIR}/eNB_scheduler.c PROPERTIES COMPILE_FLAGS "-g -O0")
set_source_files_properties(${MAC_DIR}/eNB_scheduler_primitives.c PROPERTIES COMPILE_FLAGS "-g -O0")
if (${FAPI}) if (${FAPI})
set (MAC_SRC ${MAC_SRC} set (MAC_SRC ${MAC_SRC}
${MAC_DIR}/ff-mac.c ${MAC_DIR}/ff-mac.c
...@@ -1113,6 +1122,8 @@ set (MAC_SRC ${MAC_SRC} ...@@ -1113,6 +1122,8 @@ set (MAC_SRC ${MAC_SRC}
) )
endif (${FAPI}) endif (${FAPI})
set_source_files_properties(${MAC_DIR}/ff-mac.c PROPERTIES COMPILE_FLAGS "-g -O0")
if (${FAPI_TRACER}) if (${FAPI_TRACER})
set (MAC_SRC ${MAC_SRC} set (MAC_SRC ${MAC_SRC}
${MAC_DIR}/ffdebug.c ${MAC_DIR}/ffdebug.c
...@@ -1699,7 +1710,7 @@ target_link_libraries (lte-softmodem-nos1 ...@@ -1699,7 +1710,7 @@ target_link_libraries (lte-softmodem-nos1
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB}) target_link_libraries (lte-softmodem ${T_LIB})
# rrh # rrh
################################ ################################
......
...@@ -99,6 +99,14 @@ ID = ENB_MAC_UE_DL_PDU_WITH_DATA ...@@ -99,6 +99,14 @@ ID = ENB_MAC_UE_DL_PDU_WITH_DATA
DESC = MAC downlink PDU for an UE DESC = MAC downlink PDU for an UE
GROUP = ALL:MAC:ENB GROUP = ALL:MAC:ENB
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
ID = UE_MAC_UE_UL_PDU_WITH_DATA
DESC = MAC uplink sent PDU by the UE
GROUP = ALL:MAC:UE:HEAVY
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu : buffer,data
ID = UE_MAC_UE_DL_PDU_WITH_DATA
DESC = MAC downlink received PDU by the UE
GROUP = ALL:MAC:UE:HEAVY
FORMAT = int,UE_ID : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
#RLC logs #RLC logs
ID = ENB_RLC_DL ID = ENB_RLC_DL
......
...@@ -51,7 +51,7 @@ void ul(void *_d, event e) ...@@ -51,7 +51,7 @@ void ul(void *_d, event e)
/* for newer version of wireshark? */ /* for newer version of wireshark? */
fsf = (e.e[d->ul_frame].i << 4) + e.e[d->ul_subframe].i; fsf = (e.e[d->ul_frame].i << 4) + e.e[d->ul_subframe].i;
/* for older version? */ /* for older version? */
fsf = e.e[d->ul_subframe].i; //fsf = e.e[d->ul_subframe].i;
PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG); PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
PUTC(&d->buf, (fsf>>8) & 255); PUTC(&d->buf, (fsf>>8) & 255);
PUTC(&d->buf, fsf & 255); PUTC(&d->buf, fsf & 255);
...@@ -86,7 +86,7 @@ void dl(void *_d, event e) ...@@ -86,7 +86,7 @@ void dl(void *_d, event e)
/* for newer version of wireshark? */ /* for newer version of wireshark? */
fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i; fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i;
/* for older version? */ /* for older version? */
fsf = e.e[d->dl_subframe].i; //fsf = e.e[d->dl_subframe].i;
PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG); PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
PUTC(&d->buf, (fsf>>8) & 255); PUTC(&d->buf, (fsf>>8) & 255);
PUTC(&d->buf, fsf & 255); PUTC(&d->buf, fsf & 255);
...@@ -177,7 +177,7 @@ void usage(void) ...@@ -177,7 +177,7 @@ void usage(void)
printf( printf(
"options:\n" "options:\n"
" -d <database file> this option is mandatory\n" " -d <database file> this option is mandatory\n"
" -in <dump file> read events from this dump file\n" " -i <dump file> read events from this dump file\n"
" -ip <IP address> send packets to this IP address (default %s)\n" " -ip <IP address> send packets to this IP address (default %s)\n"
" -p <port> send packets to this port (default %d)\n", " -p <port> send packets to this port (default %d)\n",
DEFAULT_IP, DEFAULT_IP,
...@@ -205,7 +205,7 @@ int main(int n, char **v) ...@@ -205,7 +205,7 @@ int main(int n, char **v)
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
if (!strcmp(v[i], "-d")) if (!strcmp(v[i], "-d"))
{ if (i > n-2) usage(); database_filename = v[++i]; continue; } { if (i > n-2) usage(); database_filename = v[++i]; continue; }
if (!strcmp(v[i], "-in")) if (!strcmp(v[i], "-i"))
{ if (i > n-2) usage(); input_filename = v[++i]; continue; } { if (i > n-2) usage(); input_filename = v[++i]; continue; }
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; } if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; }
...@@ -231,6 +231,7 @@ int main(int n, char **v) ...@@ -231,6 +231,7 @@ int main(int n, char **v)
h = new_handler(database); h = new_handler(database);
ul_id = event_id_from_name(database, "ENB_MAC_UE_UL_PDU_WITH_DATA"); ul_id = event_id_from_name(database, "ENB_MAC_UE_UL_PDU_WITH_DATA");
//dl_id = event_id_from_name(database, "UE_MAC_UE_DL_PDU_WITH_DATA");
dl_id = event_id_from_name(database, "ENB_MAC_UE_DL_PDU_WITH_DATA"); dl_id = event_id_from_name(database, "ENB_MAC_UE_DL_PDU_WITH_DATA");
setup_data(&d, database, ul_id, dl_id); setup_data(&d, database, ul_id, dl_id);
......
...@@ -80,6 +80,7 @@ int main(int n, char **v) ...@@ -80,6 +80,7 @@ int main(int n, char **v)
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; } { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
if (!strcmp(v[i], "-OFF")) if (!strcmp(v[i], "-OFF"))
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; } { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
printf("unknown option %s\n", v[i]);
usage(); usage();
} }
......
...@@ -18,6 +18,7 @@ static void append(view *_this, char *s) ...@@ -18,6 +18,7 @@ static void append(view *_this, char *s)
struct stdout *this = (struct stdout *)_this; struct stdout *this = (struct stdout *)_this;
if (pthread_mutex_lock(&this->lock)) abort(); if (pthread_mutex_lock(&this->lock)) abort();
printf("%s\n", s); printf("%s\n", s);
fflush(stdout);
if (pthread_mutex_unlock(&this->lock)) abort(); if (pthread_mutex_unlock(&this->lock)) abort();
} }
......
...@@ -194,6 +194,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t ...@@ -194,6 +194,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
if ((rb_alloc&1) != 0) if ((rb_alloc&1) != 0)
rb_alloc2[0] |= (1<<24); rb_alloc2[0] |= (1<<24);
} else { } else {
#if 0
subset = rb_alloc&1; subset = rb_alloc&1;
shift = (rb_alloc>>1)&1; shift = (rb_alloc>>1)&1;
...@@ -203,6 +204,14 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t ...@@ -203,6 +204,14 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
//printf("rb_alloc2 (type 1) %x\n",rb_alloc2); //printf("rb_alloc2 (type 1) %x\n",rb_alloc2);
} }
#endif
subset = (rb_alloc>>12)&1;
shift = (rb_alloc>>11)&1;
for (i=0; i<11; i++) {
if ((rb_alloc&(1<<(10-i))) != 0)
rb_alloc2[0] |= (1<<(2*i));
}
if ((shift == 0) && (subset == 1)) if ((shift == 0) && (subset == 1))
rb_alloc2[0]<<=1; rb_alloc2[0]<<=1;
...@@ -210,6 +219,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t ...@@ -210,6 +219,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
rb_alloc2[0]<<=4; rb_alloc2[0]<<=4;
else if ((shift == 1) && (subset == 1)) else if ((shift == 1) && (subset == 1))
rb_alloc2[0]<<=3; rb_alloc2[0]<<=3;
printf("YOYO rb_alloc2 %x (from %x)\n", rb_alloc2[0], rb_alloc);
} }
break; break;
...@@ -7223,7 +7233,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -7223,7 +7233,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
if (cqi_req == 1) { if (cqi_req == 1) {
fprintf(stderr, "cqi_req = 1 in dci_tools!\n");
ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
ulsch->harq_processes[harq_pid]->O_RI = 0; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
switch(transmission_mode) { switch(transmission_mode) {
// The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling // The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling
......
...@@ -423,6 +423,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -423,6 +423,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
Qprime = Qprime/(8*sumKr); Qprime = Qprime/(8*sumKr);
} }
if (Qprime > nb_rb * 12 * ulsch_harq->Nsymb_pusch) { fprintf(stderr, "reduce Qprime %d -> %d\n", Qprime, nb_rb * 12 * ulsch_harq->Nsymb_pusch); Qprime = nb_rb * 12 * ulsch_harq->Nsymb_pusch; }
G = nb_rb * (12 * Q_m) * (ulsch_harq->Nsymb_pusch); G = nb_rb * (12 * Q_m) * (ulsch_harq->Nsymb_pusch);
...@@ -432,6 +434,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -432,6 +434,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK); msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
#endif #endif
if (Q_CQI) fprintf(stderr, "G %d Q_CQI %d Q_RI %d\n", G, Q_CQI, Q_RI);
G = G - Q_RI - Q_CQI; G = G - Q_RI - Q_CQI;
if ((int)G < 0) { if ((int)G < 0) {
...@@ -919,6 +923,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -919,6 +923,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
// CQI // CQI
// printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]); // printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]);
ulsch_harq->cqi_crc_status = 0;
if (Q_CQI>0) { if (Q_CQI>0) {
memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32)); memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32));
......
...@@ -190,6 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { ...@@ -190,6 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti);
#endif #endif
LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rntiP);
//msg("[PHY] UE_id %d\n",i); //msg("[PHY] UE_id %d\n",i);
clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]); clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]);
clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]); clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]);
...@@ -2143,7 +2144,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t ...@@ -2143,7 +2144,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0; phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0;
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", LOG_E(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n",
phy_vars_eNB->Mod_id, phy_vars_eNB->Mod_id,
phy_vars_eNB->CC_id, phy_vars_eNB->CC_id,
frame, frame,
...@@ -2944,7 +2945,18 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe); ...@@ -2944,7 +2945,18 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
#endif #endif
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0;
#if FAPI
/* a hack to report nice CQI all the time it's asked */
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->Or1) {
int cqi_subband[13];
int k;
for (k = 0; k < 13; k++)
cqi_subband[k] = 15;
mac_xface->fapi_dl_cqi_report(phy_vars_eNB->Mod_id, phy_vars_eNB->ulsch_eNB[i]->rnti, frame, subframe, 15, cqi_subband, 0);
}
#endif
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) { if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
fprintf(stderr, "extract CQI! Or1 = %d\n", phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->Or1);
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
//if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50)) //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
...@@ -2988,7 +3000,7 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe); ...@@ -2988,7 +3000,7 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round); LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round);
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
LOG_D(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", LOG_E(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n",
phy_vars_eNB->Mod_id, phy_vars_eNB->Mod_id,
phy_vars_eNB->CC_id, phy_vars_eNB->CC_id,
frame,subframe, i, frame,subframe, i,
...@@ -3011,7 +3023,7 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe); ...@@ -3011,7 +3023,7 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round == if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round ==
phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) { phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) {
LOG_D(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", LOG_E(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n",
phy_vars_eNB->Mod_id, i); phy_vars_eNB->Mod_id, i);
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
if (phy_vars_eNB->mac_enabled==1) { if (phy_vars_eNB->mac_enabled==1) {
...@@ -3259,6 +3271,17 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe); ...@@ -3259,6 +3271,17 @@ printf("PHY RX f/sf %d/%d sched_sf %d\n", frame, subframe, sched_subframe);
0, 0,
0); 0);
LOG_I(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n",
phy_vars_eNB->Mod_id,frame,subframe,
phy_vars_eNB->eNB_UE_stats[i].sector,
harq_pid,
i,
ret,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid],
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]);
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n",
phy_vars_eNB->Mod_id,frame,subframe, phy_vars_eNB->Mod_id,frame,subframe,
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
* \warning * \warning
*/ */
#include "T.h"
#include "assertions.h" #include "assertions.h"
#include "defs.h" #include "defs.h"
#include "PHY/defs.h" #include "PHY/defs.h"
...@@ -2690,6 +2692,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac ...@@ -2690,6 +2692,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
#endif #endif
#endif #endif
if (phy_vars_ue->mac_enabled == 1) { if (phy_vars_ue->mac_enabled == 1) {
T(T_UE_MAC_UE_DL_PDU_WITH_DATA, T_INT(phy_vars_ue->Mod_id), T_INT(phy_vars_ue->dlsch_ue[eNB_id][0]->rnti),
T_INT(frame_rx), T_INT(subframe_prev), T_INT(phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid),
T_BUFFER(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS>>3));
mac_xface->ue_send_sdu(phy_vars_ue->Mod_id, mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
CC_id, CC_id,
frame_rx, frame_rx,
......
This diff is collapsed.
...@@ -1180,7 +1180,8 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP ...@@ -1180,7 +1180,8 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP
UE_id = find_UE_id(mod_idP, rntiP); UE_id = find_UE_id(mod_idP, rntiP);
if (UE_id == -1) { if (UE_id == -1) {
LOG_E(MAC, "%s:%d:%s: rnti %x: no such UE\n", __FILE__, __LINE__, __FUNCTION__, rntiP); LOG_E(MAC, "%s:%d:%s: rnti %x: no such UE\n", __FILE__, __LINE__, __FUNCTION__, rntiP);
abort(); return;
//abort();
} }
fapi = eNB_mac_inst[mod_idP].fapi; fapi = eNB_mac_inst[mod_idP].fapi;
......
...@@ -326,7 +326,7 @@ rlc_am_get_pdus ( ...@@ -326,7 +326,7 @@ rlc_am_get_pdus (
case RLC_DATA_TRANSFER_READY_STATE: case RLC_DATA_TRANSFER_READY_STATE:
// TRY TO SEND CONTROL PDU FIRST // TRY TO SEND CONTROL PDU FIRST
if ((rlc_pP->nb_bytes_requested_by_mac > 2) && (rlc_pP->status_requested)) { if ((rlc_pP->nb_bytes_requested_by_mac >= 2) && (rlc_pP->status_requested)) {
// When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall: // When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall:
// - if t-StatusProhibit is not running: // - if t-StatusProhibit is not running:
// - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer; // - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer;
......
...@@ -653,6 +653,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment( ...@@ -653,6 +653,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
// fill the segment pdu_p with Lis and data // fill the segment pdu_p with Lis and data
//--------------------------------------------------------------- //---------------------------------------------------------------
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] fill the segment pdu_p with Lis and data, test_num_li %d\n", LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] fill the segment pdu_p with Lis and data, test_num_li %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
test_num_li); test_num_li);
if (test_num_li > 0) { if (test_num_li > 0) {
......
...@@ -3445,6 +3445,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -3445,6 +3445,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
#ifdef FAPI
extern int cqi_ready[65536]; cqi_ready[ctxt_pP->rnti] = 1;
#endif
int i; int i;
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
int oip_ifup = 0; int oip_ifup = 0;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <nettle/nettle-meta.h> #include <nettle/nettle-meta.h>
#include <nettle/aes.h> #include <nettle/aes.h>
#include <nettle/ctr.h> #include <nettle/ctr.h>
//#include <nettle/version.h>
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
...@@ -199,8 +200,12 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out) ...@@ -199,8 +200,12 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out)
} }
#endif #endif
#if NETTLE_VERSION_MAJOR >= 3
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key);
#else
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length, nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
stream_cipher->key); stream_cipher->key);
#endif
nettle_ctr_crypt(ctx, nettle_aes128.encrypt, nettle_ctr_crypt(ctx, nettle_aes128.encrypt,
nettle_aes128.block_size, m, nettle_aes128.block_size, m,
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <nettle/nettle-meta.h> #include <nettle/nettle-meta.h>
#include <nettle/aes.h> #include <nettle/aes.h>
#include <nettle/ctr.h> #include <nettle/ctr.h>
//#include <nettle/version.h>
#include "assertions.h" #include "assertions.h"
#include "conversions.h" #include "conversions.h"
...@@ -85,8 +86,12 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out) ...@@ -85,8 +86,12 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out)
} }
#endif #endif
#if NETTLE_VERSION_MAJOR >= 3
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key);
#else
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length, nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
stream_cipher->key); stream_cipher->key);
#endif
nettle_ctr_crypt(ctx, nettle_aes128.encrypt, nettle_ctr_crypt(ctx, nettle_aes128.encrypt,
nettle_aes128.block_size, m, nettle_aes128.block_size, m,
......
...@@ -172,6 +172,7 @@ static void trx_usrp_end(openair0_device *device) ...@@ -172,6 +172,7 @@ static void trx_usrp_end(openair0_device *device)
*/ */
static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
{ {
int ret;
usrp_state_t *s = (usrp_state_t*)device->priv; usrp_state_t *s = (usrp_state_t*)device->priv;
s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate);
if(flags) if(flags)
...@@ -182,13 +183,13 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -182,13 +183,13 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
if (cc>1) { if (cc>1) {
std::vector<void *> buff_ptrs; std::vector<void *> buff_ptrs;
for (int i=0;i<cc;i++) buff_ptrs.push_back(buff[i]); for (int i=0;i<cc;i++) buff_ptrs.push_back(buff[i]);
s->tx_stream->send(buff_ptrs, nsamps, s->tx_md); ret = s->tx_stream->send(buff_ptrs, nsamps, s->tx_md);
} }
else else
s->tx_stream->send(buff[0], nsamps, s->tx_md); ret = s->tx_stream->send(buff[0], nsamps, s->tx_md);
s->tx_md.start_of_burst = false; s->tx_md.start_of_burst = false;
return 0; return ret;
} }
/*! \brief Receive samples from hardware. /*! \brief Receive samples from hardware.
......
...@@ -52,7 +52,7 @@ eNBs = ...@@ -52,7 +52,7 @@ eNBs =
pusch_n_SB = 1; pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE"; pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame"; pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0; pusch_hoppingOffset = 1;
pusch_groupHoppingEnabled = "ENABLE"; pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0; pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE"; pusch_sequenceHoppingEnabled = "DISABLE";
...@@ -65,7 +65,7 @@ eNBs = ...@@ -65,7 +65,7 @@ eNBs =
srs_ackNackST =; srs_ackNackST =;
srs_MaxUpPts =;*/ srs_MaxUpPts =;*/
pusch_p0_Nominal = -108; pusch_p0_Nominal = -90; //-108;
pusch_alpha = "AL1"; pusch_alpha = "AL1";
pucch_p0_Nominal = -96; //-108; pucch_p0_Nominal = -96; //-108;
msg3_delta_Preamble = 6; msg3_delta_Preamble = 6;
......
...@@ -2210,6 +2210,7 @@ static void* eNB_thread( void* arg ) ...@@ -2210,6 +2210,7 @@ static void* eNB_thread( void* arg )
#endif #endif
/* TODO: is it the right place for master tick? */ /* TODO: is it the right place for master tick? */
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(frame % 1024), T_INT(sf)); T(T_ENB_MASTER_TICK, T_INT(0), T_INT(frame % 1024), T_INT(sf));
#if 0
if (frame>50) { if (frame>50) {
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
#ifdef EXMIMO #ifdef EXMIMO
...@@ -2258,6 +2259,38 @@ static void* eNB_thread( void* arg ) ...@@ -2258,6 +2259,38 @@ static void* eNB_thread( void* arg )
} }
} }
} }
#endif
/* do TX */
int CC_id;
for (CC_id=0; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_proc_t *proc = &PHY_vars_eNB_g[0][CC_id]->proc[sf];
// printf("call phy_procedures_eNB_TX CC_id %d sf %d %lu\n", proc->CC_id, sf, daclock());
phy_procedures_eNB_TX( proc->subframe, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay, NULL );
// printf("done phy_procedures_eNB_TX CC_id %d sf %d %lu\n", proc->CC_id, sf, daclock());
// printf("call do_OFDM_mod_rt CC_id %d sf %d %ld\n", proc->CC_id, sf, daclock());
do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] );
// printf("done do_OFDM_mod_rt CC_id %d sf %d %ld\n", proc->CC_id, sf, daclock());
proc->frame_tx++;
if (proc->frame_tx==1024)
proc->frame_tx=0;
}
/* do RX */
for (CC_id=0; CC_id < MAX_NUM_CCs; CC_id++) {
if (CC_id != 0) continue;
eNB_proc_t *proc = &PHY_vars_eNB_g[0][CC_id]->proc[sf];
// printf("call phy_procedures_eNB_RX CC_id %d sf %d %lu\n", proc->CC_id, sf, daclock());
phy_procedures_eNB_RX( proc->subframe, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay );
if ((subframe_select(&PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms,proc->subframe_rx) == SF_S)) {
phy_procedures_eNB_S_RX( proc->subframe, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay );
}
// printf("done phy_procedures_eNB_RX CC_id %d sf %d %lu\n", proc->CC_id, sf, daclock());
proc->frame_rx++;
if (proc->frame_rx==1024)
proc->frame_rx=0;
}
} }
#ifdef EXMIMO #ifdef EXMIMO
...@@ -3747,6 +3780,8 @@ int main( int argc, char **argv ) ...@@ -3747,6 +3780,8 @@ int main( int argc, char **argv )
#ifdef RTAI #ifdef RTAI
main_eNB_thread = rt_thread_create(eNB_thread, NULL, PTHREAD_STACK_MIN); main_eNB_thread = rt_thread_create(eNB_thread, NULL, PTHREAD_STACK_MIN);
#else #else
if (pthread_attr_setstacksize( &attr_dlsch_threads, 1024*PTHREAD_STACK_MIN ) != 0) abort();
error_code = pthread_create( &main_eNB_thread, &attr_dlsch_threads, eNB_thread, NULL ); error_code = pthread_create( &main_eNB_thread, &attr_dlsch_threads, eNB_thread, NULL );
if (error_code!= 0) { if (error_code!= 0) {
......
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