int dci_msg_unpack_pdsch(dci_msg_t *msg, ra_pdsch_t *data, int nof_prb, bool crc_is_crnti) { if (msg->location.nof_bits == dci_format_sizeof(Format1, nof_prb)) { return dci_format1_unpack(msg, data, nof_prb); } else if (msg->location.nof_bits == dci_format_sizeof(Format1A, nof_prb)) { return dci_format1As_unpack(msg, data, nof_prb, crc_is_crnti); } else if (msg->location.nof_bits == dci_format_sizeof(Format1C, nof_prb)) { return dci_format1Cs_unpack(msg, data, nof_prb); } else { return -1; } }
int recv_dci(char *input, char *output, int len) { struct dci_format1 dci; /* Only format1 is currently supported */ int rbg_mask = 0; int i; if (len == 0) { return 0; } else { memset(&dci,0,sizeof(struct dci_format1)); dci.harq_pnum_len = 3; dci.carrier_indicator_len=2; if (param_get_int_name("nof_rbg",&dci.nof_rbg)) { modinfo("could not get parameter nof_rbg\n"); } if (dci_format1_unpack(input,len,&dci)<0) { moderror("Reading DCI Format 1 packet\n"); return -1; } for (i=0;i<MAX_RBG_SET;i++) { rbg_mask |= (dci.rbg_mask[i] & 0x1) << (i); } } #ifdef _COMPILE_ALOE len = 0; int n; n = param_remote_set_ptr(&output[len], mcs_rx, &dci.mcs, sizeof(int)); if (n == -1) { moderror("Setting parameter mcs\n"); return -1; } len += n; n = param_remote_set_ptr(&output[len], nof_rbg_rx, &dci.nof_rbg, sizeof(int)); if (n == -1) { moderror("Setting parameter nof_rbg\n"); return -1; } len += n; n = param_remote_set_ptr(&output[len], rbg_mask_rx, &rbg_mask, sizeof(int)); if (n == -1) { moderror("Setting parameter rbg_mask\n"); return -1; } len += n; set_output_samples(0,len); modinfo_msg("received mcs=%d, nof_rbg=%d, rbgmask=0x%x\n",dci.mcs,dci.nof_rbg,rbg_mask); #endif return len; }