From 31b01065025ca0010c640d7e9fe98c3fc2c6485b Mon Sep 17 00:00:00 2001 From: Agmagor Date: Thu, 24 Nov 2016 19:51:17 +0100 Subject: [PATCH 1/3] Do not demote timeval members to int ; fix elapsed time unit in modem test --- srslte/examples/synch_file.c | 2 +- srslte/lib/modem/test/modem_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/srslte/examples/synch_file.c b/srslte/examples/synch_file.c index a9e3e7146..178e56e99 100644 --- a/srslte/examples/synch_file.c +++ b/srslte/examples/synch_file.c @@ -182,7 +182,7 @@ int main(int argc, char **argv) { } gettimeofday(&tdata[2], NULL); get_time_interval(tdata); - printf("done in %ld s %ld ms\n", (int) tdata[0].tv_sec, (int) tdata[0].tv_usec/1000); + printf("done in %ld s %ld ms\n", tdata[0].tv_sec, tdata[0].tv_usec/1000); printf("\n\tFr.Cnt\tN_id_2\tN_id_1\tSubf\tPSS Peak/Avg\tIdx\tm0\tm1\tCFO\n"); printf("\t===============================================================================\n"); diff --git a/srslte/lib/modem/test/modem_test.c b/srslte/lib/modem/test/modem_test.c index d233f7418..600115386 100644 --- a/srslte/lib/modem/test/modem_test.c +++ b/srslte/lib/modem/test/modem_test.c @@ -184,7 +184,7 @@ int main(int argc, char **argv) { srslte_demod_soft_demodulate(modulation, symbols, llr, num_bits / mod.nbits_x_symbol); gettimeofday(&y, NULL); - printf("\nElapsed time [ns]: %ld\n", (int) y.tv_usec - (int) x.tv_usec); + printf("\nElapsed time [us]: %ld\n", y.tv_usec - x.tv_usec); for (i=0;i=0 ? 1 : 0; } From f3b87ca95569bf9c3c5bbac34810d24c5a78ed6d Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 30 Nov 2016 14:51:09 -0500 Subject: [PATCH 2/3] fixed missing SO_REUSE* in old kernels --- srslte/lib/io/netsink.c | 4 ++++ srslte/lib/io/netsource.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/srslte/lib/io/netsink.c b/srslte/lib/io/netsink.c index bedb5fc92..39bd885a9 100644 --- a/srslte/lib/io/netsink.c +++ b/srslte/lib/io/netsink.c @@ -48,10 +48,14 @@ int srslte_netsink_init(srslte_netsink_t *q, char *address, int port, srslte_net } int enable = 1; +#if defined (SO_REUSEADDR) if (setsockopt(q->sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)) < 0) perror("setsockopt(SO_REUSEADDR) failed"); +#endif +#if defined (SO_REUSEPORT) if (setsockopt(q->sockfd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(int)) < 0) perror("setsockopt(SO_REUSEPORT) failed"); +#endif q->servaddr.sin_family = AF_INET; q->servaddr.sin_addr.s_addr=inet_addr(address); diff --git a/srslte/lib/io/netsource.c b/srslte/lib/io/netsource.c index f41296c3c..0e9c804c0 100644 --- a/srslte/lib/io/netsource.c +++ b/srslte/lib/io/netsource.c @@ -48,11 +48,14 @@ int srslte_netsource_init(srslte_netsource_t *q, char *address, int port, srslte // Make sockets reusable int enable = 1; +#if defined (SO_REUSEADDR) if (setsockopt(q->sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)) < 0) perror("setsockopt(SO_REUSEADDR) failed"); +#endif +#if defined (SO_REUSEPORT) if (setsockopt(q->sockfd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(int)) < 0) perror("setsockopt(SO_REUSEPORT) failed"); - +#endif q->type = type; q->servaddr.sin_family = AF_INET; From cfd0f01aa22a2e60fca897f1ecc08fdd6f3fdc67 Mon Sep 17 00:00:00 2001 From: Kewin Rausch Date: Fri, 17 Feb 2017 13:07:33 +0100 Subject: [PATCH 3/3] Fixed PRACH opportunity evaluator procedure to consider option 14 of PRACH Configuration Index as stated on 3GPP specifications. --- srslte/lib/phch/prach.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srslte/lib/phch/prach.c b/srslte/lib/phch/prach.c index 59ed3d072..a29475380 100644 --- a/srslte/lib/phch/prach.c +++ b/srslte/lib/phch/prach.c @@ -195,6 +195,11 @@ bool srslte_prach_tti_opportunity(srslte_prach_t *p, uint32_t current_tti, int a // Get SFN and sf_idx from the PRACH configuration index srslte_prach_sfn_t prach_sfn = srslte_prach_get_sfn(config_idx); + // This is the only option which provides always an opportunity for PRACH transmission. + if(config_idx == 14) { + return true; + } + if ((prach_sfn == SRSLTE_PRACH_SFN_EVEN && ((current_tti/10)%2)==0) || prach_sfn == SRSLTE_PRACH_SFN_ANY) {