|
|
@ -29,6 +29,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <complex.h>
|
|
|
|
#include <complex.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CURRENT_FFTSIZE srslte_symbol_sz(q->cell.nof_prb)
|
|
|
|
#define CURRENT_FFTSIZE srslte_symbol_sz(q->cell.nof_prb)
|
|
|
|
#define CURRENT_SFLEN SRSLTE_SF_LEN(CURRENT_FFTSIZE)
|
|
|
|
#define CURRENT_SFLEN SRSLTE_SF_LEN(CURRENT_FFTSIZE)
|
|
|
@ -62,6 +64,7 @@ int srslte_ue_dl_init(srslte_ue_dl_t *q,
|
|
|
|
q->cell = cell;
|
|
|
|
q->cell = cell;
|
|
|
|
q->pkt_errors = 0;
|
|
|
|
q->pkt_errors = 0;
|
|
|
|
q->pkts_total = 0;
|
|
|
|
q->pkts_total = 0;
|
|
|
|
|
|
|
|
q->pending_ul_dci_rnti = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (srslte_ofdm_rx_init(&q->fft, q->cell.cp, q->cell.nof_prb)) {
|
|
|
|
if (srslte_ofdm_rx_init(&q->fft, q->cell.cp, q->cell.nof_prb)) {
|
|
|
|
fprintf(stderr, "Error initiating FFT\n");
|
|
|
|
fprintf(stderr, "Error initiating FFT\n");
|
|
|
@ -257,6 +260,15 @@ int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3
|
|
|
|
srslte_dci_location_t locations[MAX_CANDIDATES];
|
|
|
|
srslte_dci_location_t locations[MAX_CANDIDATES];
|
|
|
|
uint32_t nof_locations = srslte_pdcch_ue_locations(&q->pdcch, locations, MAX_CANDIDATES, sf_idx, cfi, rnti);
|
|
|
|
uint32_t nof_locations = srslte_pdcch_ue_locations(&q->pdcch, locations, MAX_CANDIDATES, sf_idx, cfi, rnti);
|
|
|
|
uint16_t crc_rem = 0;
|
|
|
|
uint16_t crc_rem = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rnti) {
|
|
|
|
|
|
|
|
/* Do not search if an UL DCI is already pending */
|
|
|
|
|
|
|
|
if (q->pending_ul_dci_rnti == rnti) {
|
|
|
|
|
|
|
|
q->pending_ul_dci_rnti = 0;
|
|
|
|
|
|
|
|
memcpy(dci_msg, &q->pending_ul_dci_msg, sizeof(srslte_dci_msg_t));
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32_t i=0;i<nof_locations && crc_rem != rnti;i++) {
|
|
|
|
for (uint32_t i=0;i<nof_locations && crc_rem != rnti;i++) {
|
|
|
|
if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &locations[i], SRSLTE_DCI_FORMAT0, &crc_rem)) {
|
|
|
|
if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &locations[i], SRSLTE_DCI_FORMAT0, &crc_rem)) {
|
|
|
|
fprintf(stderr, "Error decoding DCI msg\n");
|
|
|
|
fprintf(stderr, "Error decoding DCI msg\n");
|
|
|
@ -272,6 +284,9 @@ int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg, uint3
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t srslte_ue_dl_get_ncce(srslte_ue_dl_t *q) {
|
|
|
|
uint32_t srslte_ue_dl_get_ncce(srslte_ue_dl_t *q) {
|
|
|
@ -322,11 +337,12 @@ int srslte_ue_dl_find_dl_dci_type(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg,
|
|
|
|
fprintf(stderr, "Error decoding DCI msg\n");
|
|
|
|
fprintf(stderr, "Error decoding DCI msg\n");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (formats[f] == SRSLTE_DCI_FORMAT1A) {
|
|
|
|
if (crc_rem == rnti && formats[f] == SRSLTE_DCI_FORMAT1A && dci_msg->data[0] != 1) {
|
|
|
|
if (dci_msg->data[0] != 1) {
|
|
|
|
/* Save Format 0 msg. Recovered next call to srslte_ue_dl_find_ul_dci() */
|
|
|
|
|
|
|
|
q->pending_ul_dci_rnti = crc_rem;
|
|
|
|
|
|
|
|
memcpy(&q->pending_ul_dci_msg, dci_msg, sizeof(srslte_dci_msg_t));
|
|
|
|
crc_rem = 0;
|
|
|
|
crc_rem = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG("Decoded DCI message RNTI: 0x%x\n", crc_rem);
|
|
|
|
DEBUG("Decoded DCI message RNTI: 0x%x\n", crc_rem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|