Commit 73723a56 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'RU-RAU-split' of https://gitlab.eurecom.fr/oai/openairinterface5g into RU-RAU-split

parents 49f86b0a 6d3fb2dc
When running lsusb, if you have:
Bus 001 Device 002: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
You need to run:
usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'
After what, running lsusb should give:
Bus 001 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Values of 'Bus' and 'Device' may differ of course.
...@@ -13,6 +13,16 @@ containing lines: ...@@ -13,6 +13,16 @@ containing lines:
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666" SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666" SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
To avoid NetworkManager to play with the bandrich, add also the line:
ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MM_DEVICE_IGNORE}="1"
Maybe also add; , ENV{ID_MM_DEVICE_IGNORE}="1"
to the two other lines.
Then run: udevadm control --reload-rules
And: service network-manager restart
Change vendor_id/model_id/serial/interface num to match yours. Change vendor_id/model_id/serial/interface num to match yours.
Use lsusb -v to find values. Use lsusb -v to find values.
......
...@@ -94,6 +94,7 @@ typedef struct { ...@@ -94,6 +94,7 @@ typedef struct {
enb_gui *e; enb_gui *e;
int ue; /* what UE is displayed in the UE specific views */ int ue; /* what UE is displayed in the UE specific views */
void *database; void *database;
int nb_rb;
} enb_data; } enb_data;
void is_on_changed(void *_d) void is_on_changed(void *_d)
...@@ -121,27 +122,6 @@ connection_dies: ...@@ -121,27 +122,6 @@ connection_dies:
if (pthread_mutex_unlock(&d->lock)) abort(); if (pthread_mutex_unlock(&d->lock)) abort();
} }
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
" -ON turn all logs ON\n"
" -OFF turn all logs OFF\n"
" note: you may pass several -on/-off/-ON/-OFF,\n"
" they will be processed in order\n"
" by default, all is off\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n"
" -debug-gui activate GUI debug logs\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
static void *gui_thread(void *_g) static void *gui_thread(void *_g)
{ {
gui *g = _g; gui *g = _g;
...@@ -314,14 +294,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, ...@@ -314,14 +294,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20); input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20);
widget_add_child(g, line, input_signal_plot, -1); widget_add_child(g, line, input_signal_plot, -1);
xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70); xy_plot_set_range(g, input_signal_plot, 0, 7680*10 * ed->nb_rb/25, 20, 70);
input_signal_log = new_framelog(h, database, input_signal_log = new_framelog(h, database,
"ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata"); "ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata");
/* a skip value of 10 means to process 1 frame over 10, that is /* a skip value of 10 means to process 1 frame over 10, that is
* more or less 10 frames per second * more or less 10 frames per second
*/ */
framelog_set_skip(input_signal_log, 10); framelog_set_skip(input_signal_log, 10);
input_signal_view = new_view_xy(7680*10, 10, input_signal_view = new_view_xy(7680*10 * ed->nb_rb/25, 10,
g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE); g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE);
logger_add_view(input_signal_log, input_signal_view); logger_add_view(input_signal_log, input_signal_view);
...@@ -661,6 +641,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database, ...@@ -661,6 +641,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database,
on_off(database, log, is_on, 1); on_off(database, log, is_on, 1);
} }
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -rb <RBs> setup for this number of RBs (default 25)\n"
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
" -ON turn all logs ON\n"
" -OFF turn all logs OFF\n"
" note: you may pass several -on/-off/-ON/-OFF,\n"
" they will be processed in order\n"
" by default, all is off\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n"
" -debug-gui activate GUI debug logs\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
int main(int n, char **v) int main(int n, char **v)
{ {
extern int volatile gui_logd; extern int volatile gui_logd;
...@@ -681,6 +683,8 @@ int main(int n, char **v) ...@@ -681,6 +683,8 @@ int main(int n, char **v)
reset_ue_ids(); reset_ue_ids();
enb_data.nb_rb = 25;
/* write on a socket fails if the other end is closed and we get SIGPIPE */ /* write on a socket fails if the other end is closed and we get SIGPIPE */
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
...@@ -691,6 +695,8 @@ int main(int n, char **v) ...@@ -691,6 +695,8 @@ 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], "-rb"))
{ if (i > n-2) usage(); enb_data.nb_rb = atoi(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 (!strcmp(v[i], "-p"))
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; } { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
...@@ -706,6 +712,11 @@ int main(int n, char **v) ...@@ -706,6 +712,11 @@ int main(int n, char **v)
usage(); usage();
} }
switch (enb_data.nb_rb) {
case 25: case 50: case 100: break;
default: printf("ERROR, bad value for -rb (%d)\n", enb_data.nb_rb); exit(1);
}
if (database_filename == NULL) { if (database_filename == NULL) {
printf("ERROR: provide a database file (-d)\n"); printf("ERROR: provide a database file (-d)\n");
exit(1); exit(1);
......
...@@ -2257,11 +2257,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2257,11 +2257,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
y[0] = &yseq0[0]; y[0] = &yseq0[0];
y[1] = &yseq1[0]; y[1] = &yseq1[0];
#if 0
// reset all bits to <NIL>, here we set <NIL> elements as 2 // reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX); // memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier. // here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++) for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1; e[i]=taus()&1;
#endif
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
memset(e, 0, DCI_BITS_MAX);
e_ptr = e; e_ptr = e;
......
...@@ -71,13 +71,13 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -71,13 +71,13 @@ void rx_sdu(const module_id_t enb_mod_idP,
uint8_t *sduP, uint8_t *sduP,
const uint16_t sdu_lenP, const uint16_t sdu_lenP,
const uint16_t timing_advance, const uint16_t timing_advance,
const uint8_t ul_cqi) { const uint8_t ul_cqi)
{
int current_rnti = rntiP;
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr; unsigned char rx_ces[MAX_NUM_CE],num_ce,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];
int UE_id = find_UE_id(enb_mod_idP,rntiP); int UE_id = find_UE_id(enb_mod_idP, current_rnti);
int RA_id; int RA_id;
int ii,j; int ii,j;
eNB_MAC_INST *eNB = RC.mac[enb_mod_idP]; eNB_MAC_INST *eNB = RC.mac[enb_mod_idP];
...@@ -98,16 +98,14 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -98,16 +98,14 @@ void rx_sdu(const module_id_t enb_mod_idP,
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);
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(0, sduP,sdu_lenP, 0, 3, rntiP, frameP, subframeP, 0,0); trace_pdu(0, sduP,sdu_lenP, 0, 3, current_rnti, frameP, subframeP, 0,0);
LOG_D(OPT,"[eNB %d][ULSCH] Frame %d rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][ULSCH] Frame %d rnti %x with size %d\n",
enb_mod_idP, frameP, rntiP, sdu_lenP); enb_mod_idP, frameP, current_rnti, sdu_lenP);
} }
if (UE_id!=-1) { if (UE_id!=-1) {
LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],
rntiP,UE_id,ul_cqi); current_rnti, UE_id,ul_cqi);
AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8, AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8,
"round >= 8\n"); "round >= 8\n");
...@@ -143,14 +141,14 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -143,14 +141,14 @@ void rx_sdu(const module_id_t enb_mod_idP,
} }
} }
else if ((RA_id = find_RA_id(enb_mod_idP,CC_idP,rntiP))!=-1) { // Check if this is an RA process for the rnti else if ((RA_id = find_RA_id(enb_mod_idP,CC_idP,current_rnti))!=-1) { // Check if this is an RA process for the rnti
AssertFatal(eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx>1, AssertFatal(eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx>1,
"maxHARQ %d should be greater than 1\n", "maxHARQ %d should be greater than 1\n",
(int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP,
RA_template[RA_id].msg3_round, RA_template[RA_id].msg3_round,
rntiP,RA_id,ul_cqi); current_rnti,RA_id,ul_cqi);
first_rb = RA_template->msg3_first_rb; first_rb = RA_template->msg3_first_rb;
...@@ -159,7 +157,7 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -159,7 +157,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
RA_template[RA_id].msg3_round, RA_template[RA_id].msg3_round,
(int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
if (RA_template[RA_id].msg3_round == eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx-1) { if (RA_template[RA_id].msg3_round == eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx-1) {
cancel_ra_proc(enb_mod_idP,CC_idP,frameP,rntiP); cancel_ra_proc(enb_mod_idP,CC_idP,frameP,current_rnti);
} }
else { else {
...@@ -174,15 +172,14 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -174,15 +172,14 @@ void rx_sdu(const module_id_t enb_mod_idP,
} }
} }
else { else {
LOG_W(MAC,"Cannot find UE or RA corresponding to ULSCH rnti %x, dropping it\n", LOG_W(MAC,"Cannot find UE or RA corresponding to ULSCH rnti %x, dropping it\n", current_rnti);
rntiP);
return; return;
} }
payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu)); T_INT(harq_pid), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu));
T(T_ENB_MAC_UE_UL_PDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_UL_PDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu), T_BUFFER(sduP, sdu_lenP)); T_INT(harq_pid), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu), T_BUFFER(sduP, sdu_lenP));
eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP; eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP;
...@@ -194,7 +191,7 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -194,7 +191,7 @@ void rx_sdu(const module_id_t enb_mod_idP,
// control element // control element
for (i=0; i<num_ce; i++) { for (i=0; i<num_ce; i++) {
T(T_ENB_MAC_UE_UL_CE, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_UL_CE, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
T_INT(rx_ces[i])); T_INT(rx_ces[i]));
switch (rx_ces[i]) { // implement and process BSR + CRNTI + switch (rx_ces[i]) { // implement and process BSR + CRNTI +
...@@ -209,28 +206,38 @@ void rx_sdu(const module_id_t enb_mod_idP, ...@@ -209,28 +206,38 @@ void rx_sdu(const module_id_t enb_mod_idP,
payload_ptr+=sizeof(POWER_HEADROOM_CMD); payload_ptr+=sizeof(POWER_HEADROOM_CMD);
break; break;
case CRNTI: case CRNTI: {
UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); int old_rnti = (((uint16_t)payload_ptr[0])<<8) + payload_ptr[1];
int old_UE_id = find_UE_id(enb_mod_idP, old_rnti);
LOG_D(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", LOG_D(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); enb_mod_idP, frameP, subframeP, CC_idP, rx_ces[i], i, num_ce, old_rnti, old_UE_id);
if (UE_id!=-1) { if (old_UE_id != -1) {
UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; /* TODO: if the UE did random access (followed by a MAC uplink with
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; * CRNTI) because none of its scheduling request was granted, then
* according to 36.321 5.4.4 the UE's MAC will notify RRC to release
* PUCCH/SRS. According to 36.331 5.3.13 the UE will then apply
* default configuration for CQI reporting and scheduling requests,
* which basically means that the CQI requests won't work anymore and
* that the UE won't do any scheduling request anymore as long as the
* eNB doesn't reconfigure the UE.
* We have to take care of this. As the code is, nothing is done and
* the UE state in the eNB is wrong.
*/
UE_id = old_UE_id;
UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0;
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0;
mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, old_rnti);
} }
printf("TODO: deal with CRNTI\n"); /* receiving CRNTI means that the current rnti has to go away */
abort(); cancel_ra_proc(enb_mod_idP,CC_idP,frameP,current_rnti);
current_rnti = old_rnti;
} }
crnti_rx=1; crnti_rx=1;
payload_ptr+=2; payload_ptr+=2;
/*
if (msg3_flagP != NULL) {
*msg3_flagP = 0;
}*/
break; break;
}
case TRUNCATED_BSR: case TRUNCATED_BSR:
case SHORT_BSR: { case SHORT_BSR: {
...@@ -370,9 +377,9 @@ abort(); ...@@ -370,9 +377,9 @@ abort();
for (i=0; i<num_sdu; i++) { for (i=0; i<num_sdu; i++) {
LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]);
T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
T_INT(rx_lcids[i]), T_INT(rx_lengths[i])); T_INT(rx_lcids[i]), T_INT(rx_lengths[i]));
T(T_ENB_MAC_UE_UL_SDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_UL_SDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(current_rnti), T_INT(frameP), T_INT(subframeP),
T_INT(rx_lcids[i]), T_INT(rx_lengths[i]), T_BUFFER(payload_ptr, rx_lengths[i])); T_INT(rx_lcids[i]), T_INT(rx_lengths[i]), T_BUFFER(payload_ptr, rx_lengths[i]));
switch (rx_lcids[i]) { switch (rx_lcids[i]) {
...@@ -384,7 +391,7 @@ abort(); ...@@ -384,7 +391,7 @@ abort();
} }
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
enb_mod_idP,CC_idP,frameP, enb_mod_idP,CC_idP,frameP,
payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], current_rnti);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0);
for (ii=0; ii<NB_RA_PROC_MAX; ii++) { for (ii=0; ii<NB_RA_PROC_MAX; ii++) {
...@@ -392,10 +399,10 @@ abort(); ...@@ -392,10 +399,10 @@ abort();
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n", LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n",
enb_mod_idP, CC_idP, ii, enb_mod_idP, CC_idP, ii,
RA_template->rnti, rntiP, RA_template->rnti, current_rnti,
RA_template->RA_active); RA_template->RA_active);
if ((RA_template->rnti==rntiP) && if ((RA_template->rnti==current_rnti) &&
(RA_template->RA_active==TRUE)) { (RA_template->RA_active==TRUE)) {
//payload_ptr = parse_ulsch_header(msg3,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,msg3_len); //payload_ptr = parse_ulsch_header(msg3,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,msg3_len);
...@@ -425,7 +432,7 @@ abort(); ...@@ -425,7 +432,7 @@ abort();
enb_mod_idP, enb_mod_idP,
CC_idP, CC_idP,
frameP,subframeP, frameP,subframeP,
rntiP, current_rnti,
CCCH, CCCH,
(uint8_t*)payload_ptr, (uint8_t*)payload_ptr,
rx_lengths[i], rx_lengths[i],
...@@ -479,7 +486,7 @@ abort(); ...@@ -479,7 +486,7 @@ abort();
mac_rlc_data_ind( mac_rlc_data_ind(
enb_mod_idP, enb_mod_idP,
rntiP, current_rnti,
enb_mod_idP, enb_mod_idP,
frameP, frameP,
ENB_FLAG_YES, ENB_FLAG_YES,
...@@ -528,7 +535,7 @@ abort(); ...@@ -528,7 +535,7 @@ abort();
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
mac_rlc_data_ind( mac_rlc_data_ind(
enb_mod_idP, enb_mod_idP,
rntiP, current_rnti,
enb_mod_idP, enb_mod_idP,
frameP, frameP,
ENB_FLAG_YES, ENB_FLAG_YES,
...@@ -561,7 +568,7 @@ abort(); ...@@ -561,7 +568,7 @@ abort();
} }
// Program ACK for PHICH // Program ACK for PHICH
LOG_D(MAC,"Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",rntiP,harq_pid,first_rb); LOG_D(MAC,"Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",current_rnti,harq_pid,first_rb);
nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body; nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi];
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
...@@ -595,10 +602,8 @@ abort(); ...@@ -595,10 +602,8 @@ abort();
stop_meas(&eNB->rx_ulsch_sdu); stop_meas(&eNB->rx_ulsch_sdu);
} }
uint32_t bytes_to_bsr_index(int32_t nbytes) uint32_t bytes_to_bsr_index(int32_t nbytes)
{ {
uint32_t i=0; uint32_t i=0;
if (nbytes<0) { if (nbytes<0) {
...@@ -615,13 +620,11 @@ uint32_t bytes_to_bsr_index(int32_t nbytes) ...@@ -615,13 +620,11 @@ uint32_t bytes_to_bsr_index(int32_t nbytes)
void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status) void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status)
{ {
eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP,UE_id); eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP,UE_id);
eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP; eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP;
eNB_ulsch_info[module_idP][CC_id][UE_id].status = status; eNB_ulsch_info[module_idP][CC_id][UE_id].status = status;
eNB_ulsch_info[module_idP][CC_id][UE_id].serving_num++; eNB_ulsch_info[module_idP][CC_id][UE_id].serving_num++;
} }
unsigned char *parse_ulsch_header(unsigned char *mac_header, unsigned char *parse_ulsch_header(unsigned char *mac_header,
...@@ -632,7 +635,6 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, ...@@ -632,7 +635,6 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
unsigned short *rx_lengths, unsigned short *rx_lengths,
unsigned short tb_length) unsigned short tb_length)
{ {
unsigned char not_done=1,num_ces=0,num_sdus=0,lcid,num_sdu_cnt; unsigned char not_done=1,num_ces=0,num_sdus=0,lcid,num_sdu_cnt;
unsigned char *mac_header_ptr = mac_header; unsigned char *mac_header_ptr = mac_header;
unsigned short length, ce_len=0; unsigned short length, ce_len=0;
...@@ -723,12 +725,8 @@ void set_msg3_subframe(module_id_t Mod_id, ...@@ -723,12 +725,8 @@ void set_msg3_subframe(module_id_t Mod_id,
void schedule_ulsch(module_id_t module_idP, void schedule_ulsch(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP) { sub_frame_t subframeP)
{
uint16_t first_rb[MAX_NUM_CCs],i; uint16_t first_rb[MAX_NUM_CCs],i;
int CC_id; int CC_id;
eNB_MAC_INST *eNB=RC.mac[module_idP]; eNB_MAC_INST *eNB=RC.mac[module_idP];
...@@ -736,7 +734,6 @@ void schedule_ulsch(module_id_t module_idP, ...@@ -736,7 +734,6 @@ void schedule_ulsch(module_id_t module_idP,
start_meas(&eNB->schedule_ulsch); start_meas(&eNB->schedule_ulsch);
int sched_subframe = (subframeP+4)%10; int sched_subframe = (subframeP+4)%10;
cc = &eNB->common_channels[0]; cc = &eNB->common_channels[0];
...@@ -829,18 +826,14 @@ void schedule_ulsch(module_id_t module_idP, ...@@ -829,18 +826,14 @@ void schedule_ulsch(module_id_t module_idP,
schedule_ulsch_rnti(module_idP, frameP, subframeP, sched_subframe,first_rb); schedule_ulsch_rnti(module_idP, frameP, subframeP, sched_subframe,first_rb);
stop_meas(&eNB->schedule_ulsch); stop_meas(&eNB->schedule_ulsch);
} }
void schedule_ulsch_rnti(module_id_t module_idP, void schedule_ulsch_rnti(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
unsigned char sched_subframeP, unsigned char sched_subframeP,
uint16_t *first_rb) uint16_t *first_rb)
{ {
int UE_id; int UE_id;
uint8_t aggregation = 2; uint8_t aggregation = 2;
rnti_t rnti = -1; rnti_t rnti = -1;
...@@ -872,8 +865,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -872,8 +865,6 @@ void schedule_ulsch_rnti(module_id_t module_idP,
nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu;
nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body; nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body;
ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[0]; ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[0];
...@@ -889,7 +880,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -889,7 +880,6 @@ void schedule_ulsch_rnti(module_id_t module_idP,
eNB->HI_DCI0_req[CC_id].sfn_sf = (frameP<<4)+subframeP; eNB->HI_DCI0_req[CC_id].sfn_sf = (frameP<<4)+subframeP;
// loop over all active UEs // loop over all active UEs
for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) {
...@@ -966,8 +956,6 @@ abort(); ...@@ -966,8 +956,6 @@ abort();
continue; continue;
} }
// if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel // if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel
UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id];
...@@ -1002,7 +990,6 @@ abort(); ...@@ -1002,7 +990,6 @@ abort();
else else
cqi_req = 0; cqi_req = 0;
//power control //power control
//compute the expected ULSCH RX power (for the stats) //compute the expected ULSCH RX power (for the stats)
...@@ -1117,7 +1104,6 @@ abort(); ...@@ -1117,7 +1104,6 @@ abort();
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP];
eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++;
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
...@@ -1158,8 +1144,6 @@ abort(); ...@@ -1158,8 +1144,6 @@ abort();
ul_req_tmp->number_of_pdus++; ul_req_tmp->number_of_pdus++;
eNB->ul_handle++; eNB->ul_handle++;
add_ue_ulsch_info(module_idP, add_ue_ulsch_info(module_idP,
CC_id, CC_id,
UE_id, UE_id,
...@@ -1168,10 +1152,8 @@ abort(); ...@@ -1168,10 +1152,8 @@ abort();
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
// increment first rb for next UE allocation // increment first rb for next UE allocation
first_rb[CC_id]+=rb_table[rb_table_index]; first_rb[CC_id]+=rb_table[rb_table_index];
} }
else { // round > 0 => retransmission else { // round > 0 => retransmission
T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
...@@ -1262,4 +1244,3 @@ abort(); ...@@ -1262,4 +1244,3 @@ abort();
} // loop over UE_id } // loop over UE_id
} // loop of CC_id } // loop of CC_id
} }
...@@ -366,6 +366,14 @@ static void dump_dl(Sched_Rsp_t *d) ...@@ -366,6 +366,14 @@ static void dump_dl(Sched_Rsp_t *d)
A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap); A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap);
A("XXXX up transmission_power %d\n", q->transmission_power); A("XXXX up transmission_power %d\n", q->transmission_power);
} }
if (p->pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) {
nfapi_hi_dci0_hi_pdu_rel8_t *q = &p->hi_pdu.hi_pdu_rel8;
A("XXXX up rb start %d\n", q->resource_block_start);
A("XXXX up cs2_drms %d\n", q->cyclic_shift_2_for_drms);
A("XXXX up ack %d\n", q->hi_value);
A("XXXX up i_phich %d\n", q->i_phich);
A("XXXX up power %d\n", q->transmission_power);
}
} }
} }
......
...@@ -50,7 +50,7 @@ eNBs = ...@@ -50,7 +50,7 @@ eNBs =
prach_zero_correlation = 1; prach_zero_correlation = 1;
prach_freq_offset = 2; prach_freq_offset = 2;
pucch_delta_shift = 1; pucch_delta_shift = 1;
pucch_nRB_CQI = 1; pucch_nRB_CQI = 0;
pucch_nCS_AN = 0; pucch_nCS_AN = 0;
pucch_n1_AN = 32; pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27; pdsch_referenceSignalPower = -27;
......
...@@ -50,7 +50,7 @@ eNBs = ...@@ -50,7 +50,7 @@ eNBs =
prach_zero_correlation = 1; prach_zero_correlation = 1;
prach_freq_offset = 2; prach_freq_offset = 2;
pucch_delta_shift = 1; pucch_delta_shift = 1;
pucch_nRB_CQI = 1; pucch_nRB_CQI = 0;
pucch_nCS_AN = 0; pucch_nCS_AN = 0;
pucch_n1_AN = 32; pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27; pdsch_referenceSignalPower = -27;
......
...@@ -53,7 +53,7 @@ eNBs = ...@@ -53,7 +53,7 @@ eNBs =
prach_zero_correlation = 1; prach_zero_correlation = 1;
prach_freq_offset = 2; prach_freq_offset = 2;
pucch_delta_shift = 1; pucch_delta_shift = 1;
pucch_nRB_CQI = 1; pucch_nRB_CQI = 0;
pucch_nCS_AN = 0; pucch_nCS_AN = 0;
pucch_n1_AN = 32; pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27; pdsch_referenceSignalPower = -27;
......
...@@ -53,7 +53,7 @@ eNBs = ...@@ -53,7 +53,7 @@ eNBs =
prach_zero_correlation = 1; prach_zero_correlation = 1;
prach_freq_offset = 2; prach_freq_offset = 2;
pucch_delta_shift = 1; pucch_delta_shift = 1;
pucch_nRB_CQI = 1; pucch_nRB_CQI = 0;
pucch_nCS_AN = 0; pucch_nCS_AN = 0;
pucch_n1_AN = 32; pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27; pdsch_referenceSignalPower = -27;
......
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