Commit 17322170 authored by David Price's avatar David Price

Merged RU-RAU-split as of 18 Oct

parents 1ec934f9 599ba826
...@@ -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.
......
...@@ -36,7 +36,7 @@ static void get_message(int s) ...@@ -36,7 +36,7 @@ static void get_message(int s)
int is_on; int is_on;
if (read(s, &t, 1) != 1) QUIT("get_message fails"); if (read(s, &t, 1) != 1) QUIT("get_message fails");
printf("got mess %d\n", t); printf("T tracer: got mess %d\n", t);
switch (t) { switch (t) {
case 0: case 0:
/* toggle all those IDs */ /* toggle all those IDs */
......
...@@ -63,7 +63,7 @@ static int get_connection(char *addr, int port) ...@@ -63,7 +63,7 @@ static int get_connection(char *addr, int port)
socklen_t alen; socklen_t alen;
int s, t; int s, t;
printf("waiting for connection on %s:%d\n", addr, port); printf("T tracer: waiting for connection on %s:%d\n", addr, port);
s = socket(AF_INET, SOCK_STREAM, 0); s = socket(AF_INET, SOCK_STREAM, 0);
if (s == -1) { perror("socket"); exit(1); } if (s == -1) { perror("socket"); exit(1); }
...@@ -82,7 +82,7 @@ static int get_connection(char *addr, int port) ...@@ -82,7 +82,7 @@ static int get_connection(char *addr, int port)
if (t == -1) { perror("accept"); exit(1); } if (t == -1) { perror("accept"); exit(1); }
close(s); close(s);
printf("connected\n"); printf("T tracer: connected\n");
return t; return t;
} }
...@@ -150,7 +150,7 @@ process: ...@@ -150,7 +150,7 @@ process:
while (size) { while (size) {
int l = write(f->socket_remote, b, size); int l = write(f->socket_remote, b, size);
if (l <= 0) { if (l <= 0) {
printf("forward error\n"); printf("T tracer: forward error\n");
close(f->socket_remote); close(f->socket_remote);
f->socket_remote = -1; f->socket_remote = -1;
break; break;
...@@ -268,7 +268,7 @@ static void *forwarder(int port, int s) ...@@ -268,7 +268,7 @@ static void *forwarder(int port, int s)
f->memusage = 0; f->memusage = 0;
f->last_warning_memusage = 0; f->last_warning_memusage = 0;
printf("waiting for remote tracer on port %d\n", port); printf("T tracer: waiting for remote tracer on port %d\n", port);
f->remote_port = port; f->remote_port = port;
f->socket_remote = get_connection("0.0.0.0", port); f->socket_remote = get_connection("0.0.0.0", port);
...@@ -305,7 +305,7 @@ static void forward(void *_forwarder, char *buf, int size) ...@@ -305,7 +305,7 @@ static void forward(void *_forwarder, char *buf, int size)
if (f->memusage > f->last_warning_memusage && if (f->memusage > f->last_warning_memusage &&
f->memusage - f->last_warning_memusage > 100000000) { f->memusage - f->last_warning_memusage > 100000000) {
f->last_warning_memusage += 100000000; f->last_warning_memusage += 100000000;
printf("WARNING: memory usage is over %"PRIu64"MB\n", printf("T tracer: WARNING: memory usage is over %"PRIu64"MB\n",
f->last_warning_memusage / 1000000); f->last_warning_memusage / 1000000);
} else } else
if (f->memusage < f->last_warning_memusage && if (f->memusage < f->last_warning_memusage &&
......
...@@ -36,7 +36,8 @@ void reset_ue_ids(void) ...@@ -36,7 +36,8 @@ void reset_ue_ids(void)
int ue_id_from_rnti(void *_priv, int rnti) int ue_id_from_rnti(void *_priv, int rnti)
{ {
rnti = 0; /* HACK, to be removed */ if (rnti < 0) rnti = 65534; /* HACK, to be removed */
if (rnti < 0 || rnti > 65535) { printf("bad rnti %d\n", rnti); exit(1); } if (rnti < 0 || rnti > 65535) { printf("bad rnti %d\n", rnti); exit(1); }
/* rnti not seen yet? give it a new ue_id */ /* rnti not seen yet? give it a new ue_id */
if (ue_id[rnti] == -1) { if (ue_id[rnti] == -1) {
...@@ -93,6 +94,7 @@ typedef struct { ...@@ -93,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)
...@@ -120,27 +122,6 @@ connection_dies: ...@@ -120,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;
...@@ -313,14 +294,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, ...@@ -313,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);
...@@ -660,6 +641,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database, ...@@ -660,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;
...@@ -680,6 +683,8 @@ int main(int n, char **v) ...@@ -680,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();
...@@ -690,6 +695,8 @@ int main(int n, char **v) ...@@ -690,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; }
...@@ -705,6 +712,11 @@ int main(int n, char **v) ...@@ -705,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);
......
...@@ -12,7 +12,9 @@ void usage(void) ...@@ -12,7 +12,9 @@ void usage(void)
"usage: [options] <file> <frame> <subframe>\n" "usage: [options] <file> <frame> <subframe>\n"
"options:\n" "options:\n"
" -d <database file> this option is mandatory\n" " -d <database file> this option is mandatory\n"
" -o <output file> this option is mandatory\n"
" -v verbose\n" " -v verbose\n"
" -c <number of subframes> default to 1\n"
); );
exit(1); exit(1);
} }
...@@ -25,15 +27,23 @@ int main(int n, char **v) ...@@ -25,15 +27,23 @@ int main(int n, char **v)
int input_event_id; int input_event_id;
database_event_format f; database_event_format f;
char *file = NULL; char *file = NULL;
char *output_file = NULL;
FILE *out;
int fd; int fd;
int frame = -1, subframe = -1; int frame = -1, subframe = -1;
int frame_arg, subframe_arg, buffer_arg; int frame_arg, subframe_arg, buffer_arg;
int verbose = 0; int verbose = 0;
int number_of_subframes = 1;
int processed_subframes = 0;
for (i = 1; i < n; i++) { for (i = 1; i < n; i++) {
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], "-o"))
{ if (i > n-2) usage(); output_file = v[++i]; continue; }
if (!strcmp(v[i], "-c"))
{ if (i > n-2) usage(); number_of_subframes = atoi(v[++i]); continue; }
if (!strcmp(v[i], "-v")) { verbose = 1; continue; } if (!strcmp(v[i], "-v")) { verbose = 1; continue; }
if (file == NULL) { file = v[i]; continue; } if (file == NULL) { file = v[i]; continue; }
if (frame == -1) { frame = atoi(v[i]); continue; } if (frame == -1) { frame = atoi(v[i]); continue; }
...@@ -47,6 +57,19 @@ int main(int n, char **v) ...@@ -47,6 +57,19 @@ int main(int n, char **v)
exit(1); exit(1);
} }
if (number_of_subframes < 1) {
printf("bad value for option -c, must be at least 1 and is %d\n",
number_of_subframes);
exit(1);
}
if (output_file == NULL) {
printf("gimme -o <output file>, thanks\n");
exit(1);
}
out = fopen(output_file, "w"); if(out==NULL){perror(output_file);exit(1);}
database = parse_database(database_filename); database = parse_database(database_filename);
load_config_file(database_filename); load_config_file(database_filename);
...@@ -99,11 +122,22 @@ short *x = e.e[buffer_arg].b; ...@@ -99,11 +122,22 @@ short *x = e.e[buffer_arg].b;
x[i] *= 14; x[i] *= 14;
} }
#endif #endif
fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, stdout); if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1)
fflush(stdout); { perror(output_file); exit(1); }
return 0; processed_subframes++;
number_of_subframes--;
if (!number_of_subframes) {
if (fclose(out)) perror(output_file);
printf("%d subframes dumped\n", processed_subframes);
return 0;
}
subframe++;
if (subframe == 10) { subframe = 0; frame=(frame+1)%1024; }
} }
printf("frame %d subframe %d not found\n", frame, subframe); printf("frame %d subframe %d not found\n", frame, subframe);
printf("%d subframes dumped\n", processed_subframes);
fclose(out);
return 0; return 0;
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -267,33 +267,28 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32))); ...@@ -267,33 +267,28 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
#endif #endif
} }
// Convert to time domain for visualization // Convert to time domain for visualization
memset(temp_in_ifft_0,0,frame_parms->ofdm_symbol_size*sizeof(int32_t));
for(i=0; i<Msc_RS; i++) for(i=0; i<Msc_RS; i++)
((int32_t*)temp_in_ifft_0)[i] = ul_ch_estimates[aa][symbol_offset+i]; ((int32_t*)temp_in_ifft_0)[i] = ul_ch_estimates[aa][symbol_offset+i];
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
idft128((int16_t*) temp_in_ifft_0, idft128((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
idft512((int16_t*) temp_in_ifft_0, idft512((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t*) temp_in_ifft_0, idft1024((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
idft2048((int16_t*) temp_in_ifft_0, idft2048((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
......
...@@ -2262,11 +2262,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2262,11 +2262,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;
......
...@@ -835,11 +835,13 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) ...@@ -835,11 +835,13 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n",
rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index); rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
if ((eNB->dlsch[i][0]->harq_mask >0) && if ((eNB->dlsch[i][0]->harq_mask >0) &&
(eNB->dlsch[i][0]->rnti==rnti)) return(i); (eNB->dlsch[i][0]->rnti==rnti)) return i;
else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
} }
if (type == SEARCH_EXIST) return(-1); if (type == SEARCH_EXIST) return -1;
else return(first_free_index); if (first_free_index != -1)
eNB->dlsch[first_free_index][0]->rnti = 0;
return first_free_index;
} }
int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
...@@ -849,13 +851,15 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) ...@@ -849,13 +851,15 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
AssertFatal(eNB!=NULL,"eNB is null\n"); AssertFatal(eNB!=NULL,"eNB is null\n");
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
AssertFatal(eNB->ulsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i); AssertFatal(eNB->ulsch[i]!=NULL,"eNB->ulsch[%d] is null\n",i);
if ((eNB->ulsch[i]->harq_mask >0) && if ((eNB->ulsch[i]->harq_mask >0) &&
(eNB->ulsch[i]->rnti==rnti)) return(i); (eNB->ulsch[i]->rnti==rnti)) return i;
else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
} }
if (type == SEARCH_EXIST) return(-1); if (type == SEARCH_EXIST) return -1;
else return(first_free_index); if (first_free_index != -1)
eNB->ulsch[first_free_index]->rnti = 0;
return first_free_index;
} }
...@@ -929,7 +933,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ...@@ -929,7 +933,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
dlsch0_harq->round=0; dlsch0_harq->round=0;
} }
else { // process is inactive, so activate and set round to 0 else { // process is inactive, so activate and set round to 0
dlsch0->harq_mask |= (1<<rel8->harq_process);
dlsch0_harq->round=0; dlsch0_harq->round=0;
} }
dlsch0_harq->ndi = rel8->new_data_indicator_1; dlsch0_harq->ndi = rel8->new_data_indicator_1;
...@@ -937,8 +940,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ...@@ -937,8 +940,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci
dlsch0->active = 1; dlsch0->active = 1;
if (rel8->rnti_type == 2) if (rel8->rnti_type == 2)
dlsch0_harq->round = 0; dlsch0_harq->round = 0;
LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round,
dlsch0_harq->ndi,rel8->new_data_indicator_1); dlsch0_harq->ndi,rel8->new_data_indicator_1, rel8->rnti_type);
switch (rel8->dci_format) { switch (rel8->dci_format) {
...@@ -1127,6 +1130,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_ ...@@ -1127,6 +1130,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_
if (dlsch0_harq->round == 0) if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0->harq_mask |= (1<<rel8->harq_process);
if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti); if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti);
break; break;
...@@ -1288,6 +1293,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_ ...@@ -1288,6 +1293,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_
LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0);
dlsch0->harq_ids[subframe] = rel8->harq_process; dlsch0->harq_ids[subframe] = rel8->harq_process;
dlsch0->harq_mask |= (1<<rel8->harq_process);
dlsch0->rnti = rel8->rnti; dlsch0->rnti = rel8->rnti;
...@@ -2283,11 +2289,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ...@@ -2283,11 +2289,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
nfapi_hi_dci0_dci_pdu *pdu) nfapi_hi_dci0_dci_pdu *pdu)
{ {
uint8_t UE_id;
AssertFatal((UE_id=find_ulsch(pdu->dci_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing UE ULSCH for rnti %x\n",pdu->dci_pdu_rel8.rnti);
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
uint32_t cqi_req = pdu->dci_pdu_rel8.cqi_csi_request; uint32_t cqi_req = pdu->dci_pdu_rel8.cqi_csi_request;
...@@ -2447,17 +2448,15 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ...@@ -2447,17 +2448,15 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
} }
} }
void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) { void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe)
{
uint8_t harq_pid; uint8_t harq_pid;
uint8_t UE_id; uint8_t UE_id;
boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE;
AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE;
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
...@@ -2465,6 +2464,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2465,6 +2464,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
harq_pid = ulsch_pdu->ulsch_pdu_rel8.harq_process_number; harq_pid = ulsch_pdu->ulsch_pdu_rel8.harq_process_number;
ulsch->harq_mask |= 1 << harq_pid;
ulsch->harq_processes[harq_pid]->frame = frame; ulsch->harq_processes[harq_pid]->frame = frame;
ulsch->harq_processes[harq_pid]->subframe = subframe; ulsch->harq_processes[harq_pid]->subframe = subframe;
...@@ -2500,12 +2500,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2500,12 +2500,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7) else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
LOG_D(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n", LOG_D(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n",
eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS, eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS,
frame,subframe); frame,subframe);
ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type;
// Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be
...@@ -2531,8 +2529,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2531,8 +2529,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else ulsch->harq_processes[harq_pid]->round++; else ulsch->harq_processes[harq_pid]->round++;
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
LOG_D(PHY,"Filling ULSCH %x (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti, new_ulsch, ulsch->rnti,
UE_id,
new_ulsch,
frame, frame,
subframe, subframe,
harq_pid, harq_pid,
...@@ -2542,12 +2542,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2542,12 +2542,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
ulsch->harq_processes[harq_pid]->Qm, ulsch->harq_processes[harq_pid]->Qm,
ulsch->harq_processes[harq_pid]->TBS, ulsch->harq_processes[harq_pid]->TBS,
ulsch->harq_processes[harq_pid]->round); ulsch->harq_processes[harq_pid]->round);
} }
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
{ {
switch (dci->format) { switch (dci->format) {
...@@ -6420,12 +6416,11 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ...@@ -6420,12 +6416,11 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
return(9); return(9);