|
|
@ -242,7 +242,7 @@ uint32_t dci_format0_sizeof_(uint32_t nof_prb) {
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dci_format1A_sizeof(uint32_t nof_prb) {
|
|
|
|
uint32_t dci_format1A_sizeof(uint32_t nof_prb) {
|
|
|
|
uint32_t n;
|
|
|
|
uint32_t n;
|
|
|
|
n = 1 + 1 + riv_nbits(nof_prb) + 5 + 3 + 1 + 2 + 2;
|
|
|
|
n = 1 + 1 + riv_nbits(nof_prb) + 5 + harq_pid_len + 1 + 2 + 2;
|
|
|
|
while (n < dci_format0_sizeof_(nof_prb)) {
|
|
|
|
while (n < dci_format0_sizeof_(nof_prb)) {
|
|
|
|
n++;
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -262,7 +262,7 @@ uint32_t dci_format0_sizeof(uint32_t nof_prb) {
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dci_format1_sizeof(uint32_t nof_prb) {
|
|
|
|
uint32_t dci_format1_sizeof(uint32_t nof_prb) {
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb)) + 5 + 3 + 1 + 2
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb)) + 5 + harq_pid_len + 1 + 2
|
|
|
|
+ 2;
|
|
|
|
+ 2;
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
n++;
|
|
|
|
n++;
|
|
|
@ -318,7 +318,7 @@ uint32_t precoding_bits_f2(uint32_t nof_ports) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dci_format2_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t dci_format2_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2)+precoding_bits_f2(nof_ports);
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2)+precoding_bits_f2(nof_ports);
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
n++;
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -338,7 +338,7 @@ uint32_t precoding_bits_f2a(uint32_t nof_ports) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dci_format2A_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t dci_format2A_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2)+precoding_bits_f2a(nof_ports);
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2)+precoding_bits_f2a(nof_ports);
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
n++;
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -350,7 +350,7 @@ uint32_t dci_format2A_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dci_format2B_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t dci_format2B_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2);
|
|
|
|
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2);
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
if (nof_prb > 10) {
|
|
|
|
n++;
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -457,7 +457,7 @@ int dci_format0_pack(srslte_ra_ul_dci_t *data, srslte_dci_msg_t *msg, uint32_t n
|
|
|
|
*y++ = data->cqi_request;
|
|
|
|
*y++ = data->cqi_request;
|
|
|
|
|
|
|
|
|
|
|
|
// Padding with zeros
|
|
|
|
// Padding with zeros
|
|
|
|
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb);
|
|
|
|
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1);
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
*y++ = 0;
|
|
|
|
*y++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -476,7 +476,7 @@ int dci_format0_unpack(srslte_dci_msg_t *msg, srslte_ra_ul_dci_t *data, uint32_t
|
|
|
|
uint32_t n_ul_hop;
|
|
|
|
uint32_t n_ul_hop;
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb)) {
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1)) {
|
|
|
|
fprintf(stderr, "Invalid message length for format 0\n");
|
|
|
|
fprintf(stderr, "Invalid message length for format 0\n");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -569,7 +569,7 @@ int dci_format1_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t n
|
|
|
|
srslte_bit_unpack(data->tpc_pucch, &y, 2);
|
|
|
|
srslte_bit_unpack(data->tpc_pucch, &y, 2);
|
|
|
|
|
|
|
|
|
|
|
|
// Padding with zeros
|
|
|
|
// Padding with zeros
|
|
|
|
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb);
|
|
|
|
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1);
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
*y++ = 0;
|
|
|
|
*y++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -584,7 +584,7 @@ int dci_format1_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32_t
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT1 message */
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT1 message */
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb)) {
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1)) {
|
|
|
|
fprintf(stderr, "Invalid message length for format 1\n");
|
|
|
|
fprintf(stderr, "Invalid message length for format 1\n");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -714,7 +714,7 @@ int dci_format1As_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Padding with zeros
|
|
|
|
// Padding with zeros
|
|
|
|
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb);
|
|
|
|
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1);
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
while (y - msg->data < n) {
|
|
|
|
*y++ = 0;
|
|
|
|
*y++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -733,7 +733,7 @@ int dci_format1As_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
|
|
|
|
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb)) {
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1)) {
|
|
|
|
fprintf(stderr, "Invalid message length for format 1A\n");
|
|
|
|
fprintf(stderr, "Invalid message length for format 1A\n");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -926,7 +926,7 @@ int dci_format1Cs_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
|
|
|
|
/* pack bits */
|
|
|
|
/* pack bits */
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
uint8_t *y = msg->data;
|
|
|
|
|
|
|
|
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1C, nof_prb)) {
|
|
|
|
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1C, nof_prb, 1)) {
|
|
|
|
fprintf(stderr, "Invalid message length for format 1C\n");
|
|
|
|
fprintf(stderr, "Invalid message length for format 1C\n");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1204,16 +1204,16 @@ int srslte_dci_msg_get_type(srslte_dci_msg_t *msg, srslte_dci_msg_type_t *type,
|
|
|
|
uint16_t msg_rnti)
|
|
|
|
uint16_t msg_rnti)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG("Get message type: nof_bits=%d, msg_rnti=0x%x\n", msg->nof_bits, msg_rnti);
|
|
|
|
DEBUG("Get message type: nof_bits=%d, msg_rnti=0x%x\n", msg->nof_bits, msg_rnti);
|
|
|
|
if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb)
|
|
|
|
if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1)
|
|
|
|
&& !msg->data[0]) {
|
|
|
|
&& !msg->data[0]) {
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_PUSCH_SCHED;
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_PUSCH_SCHED;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT0;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT0;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb)) {
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1)) {
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED; // only these 2 types supported
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED; // only these 2 types supported
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb)) {
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1)) {
|
|
|
|
/* The RNTI is not the only condition. Also some fields in the packet.
|
|
|
|
/* The RNTI is not the only condition. Also some fields in the packet.
|
|
|
|
* if (msg_rnti >= SRSLTE_CRNTI_START && msg_rnti <= SRSLTE_CRNTI_END) {
|
|
|
|
* if (msg_rnti >= SRSLTE_CRNTI_START && msg_rnti <= SRSLTE_CRNTI_END) {
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_RA_PROC_PDCCH;
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_RA_PROC_PDCCH;
|
|
|
@ -1224,7 +1224,7 @@ int srslte_dci_msg_get_type(srslte_dci_msg_t *msg, srslte_dci_msg_type_t *type,
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1A;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1A;
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1C, nof_prb)) {
|
|
|
|
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1C, nof_prb, 1)) {
|
|
|
|
if (msg_rnti == SRSLTE_MRNTI) {
|
|
|
|
if (msg_rnti == SRSLTE_MRNTI) {
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_MCCH_CHANGE;
|
|
|
|
type->type = SRSLTE_DCI_MSG_TYPE_MCCH_CHANGE;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1C;
|
|
|
|
type->format = SRSLTE_DCI_FORMAT1C;
|
|
|
|