Commit 8700faaa authored by wujing's avatar wujing

Merge branch 'develop_nfapi_rm2161' into develop

parents 5fcac7f6 9dc50e6c
This diff is collapsed.
......@@ -45,6 +45,7 @@ int16_t *primary_synch2_time;
#ifndef OCP_FRAMEWORK
PHY_VARS_UE ***PHY_vars_UE_g;
RAN_CONTEXT_t RC;
UL_RCC_IND_t UL_RCC_INFO;
//PHY_VARS_eNB ***PHY_vars_eNB_g;
//PHY_VARS_RN **PHY_vars_RN_g;
......
......@@ -841,7 +841,9 @@ if(nfapi_mode !=2)
}
if (nfapi_mode && do_oai && !dont_send) {
oai_nfapi_tx_req(Sched_INFO->TX_req);
if(Sched_INFO->TX_req->tx_request_body.number_of_pdus > 0){
oai_nfapi_tx_req(Sched_INFO->TX_req);
}
oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu
Sched_INFO->RELEASE_rnti_req->sfn_sf = frame << 4 | subframe;
......
......@@ -17,10 +17,34 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern uint8_t nfapi_mode;
extern uint16_t sf_ahead;
extern UL_RCC_IND_t UL_RCC_INFO;
uint16_t frame_cnt=0;
void handle_rach(UL_IND_t *UL_info) {
int i;
if(nfapi_mode == 2){
for(uint8_t j = 0;j < NUM_NFPAI_SUBFRAME;j++){
if (UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles>0) {
AssertFatal(UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_RCC_INFO.rach_ind[j].sfn_sf));
initiate_ra_proc(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.rach_ind[j].sfn_sf),
NFAPI_SFNSF2SF(UL_RCC_INFO.rach_ind[j].sfn_sf),
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.preamble,
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list[0].preamble_rel8.rnti
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
#endif
);
free(UL_RCC_INFO.rach_ind[j].rach_indication_body.preamble_list);
UL_RCC_INFO.rach_ind[j].rach_indication_body.number_of_preambles = 0;
UL_RCC_INFO.rach_ind[j].header.message_id = 0;
}
}
}else{
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
......@@ -38,6 +62,7 @@ void handle_rach(UL_IND_t *UL_info) {
#endif
);
}
}
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
......@@ -72,6 +97,22 @@ void handle_sr(UL_IND_t *UL_info) {
{
oai_nfapi_sr_indication(&UL_info->sr_ind);
}
}else if(nfapi_mode == 2){
for(uint8_t j = 0;j < NUM_NFPAI_SUBFRAME;j++){
if(UL_RCC_INFO.sr_ind[j].sr_indication_body.number_of_srs > 0){
for (i=0;i<UL_RCC_INFO.sr_ind[j].sr_indication_body.number_of_srs;i++){
SR_indication(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.sr_ind[j].sfn_sf),
NFAPI_SFNSF2SF(UL_RCC_INFO.sr_ind[j].sfn_sf),
UL_RCC_INFO.sr_ind[j].sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
UL_RCC_INFO.sr_ind[j].sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
}
free(UL_RCC_INFO.sr_ind[j].sr_indication_body.sr_pdu_list);
UL_RCC_INFO.sr_ind[j].sr_indication_body.number_of_srs=0;
UL_RCC_INFO.sr_ind[j].header.message_id = 0;
}
}
}
else
{
......@@ -105,6 +146,26 @@ void handle_cqi(UL_IND_t *UL_info) {
UL_info->cqi_ind.cqi_indication_body.number_of_cqis=0;
}
}else if(nfapi_mode == 2){
for(uint8_t j = 0;j < NUM_NFPAI_SUBFRAME;j++){
if(UL_RCC_INFO.cqi_ind[j].cqi_indication_body.number_of_cqis > 0){
for (i=0;i<UL_RCC_INFO.cqi_ind[j].cqi_indication_body.number_of_cqis;i++){
cqi_indication(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.cqi_ind[j].sfn_sf),
NFAPI_SFNSF2SF(UL_RCC_INFO.cqi_ind[j].sfn_sf),
UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_pdu_list[i].rx_ue_information.rnti,
&UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_pdu_list[i].cqi_indication_rel9,
UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_raw_pdu_list[i].pdu,
&UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_pdu_list[i].ul_cqi_information);
}
free(UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_pdu_list);
free(UL_RCC_INFO.cqi_ind[j].cqi_indication_body.cqi_raw_pdu_list);
UL_RCC_INFO.cqi_ind[j].cqi_indication_body.number_of_cqis=0;
UL_RCC_INFO.cqi_ind[j].header.message_id = 0;
}
}
}
else
{
......@@ -138,6 +199,22 @@ void handle_harq(UL_IND_t *UL_info) {
}
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
}else if(nfapi_mode == 2){
for(uint8_t j = 0;j < NUM_NFPAI_SUBFRAME;j++){
if(UL_RCC_INFO.harq_ind[j].harq_indication_body.number_of_harqs > 0){
for (i=0;i<UL_RCC_INFO.harq_ind[j].harq_indication_body.number_of_harqs;i++){
harq_indication(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.harq_ind[j].sfn_sf),
NFAPI_SFNSF2SF(UL_RCC_INFO.harq_ind[j].sfn_sf),
&UL_RCC_INFO.harq_ind[j].harq_indication_body.harq_pdu_list[i]);
}
free(UL_RCC_INFO.harq_ind[j].harq_indication_body.harq_pdu_list);
UL_RCC_INFO.harq_ind[j].harq_indication_body.number_of_harqs=0;
UL_RCC_INFO.harq_ind[j].header.message_id = 0;
}
}
}
else
{
......@@ -174,6 +251,57 @@ void handle_ulsch(UL_IND_t *UL_info) {
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
}
}
else if(nfapi_mode == 2){
for(uint8_t k = 0;k < NUM_NFPAI_SUBFRAME;k++){
if((UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus>0) && (UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs>0)){
for (i=0;i<UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus;i++) {
for (j=0;j<UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs;j++) {
// find crc_indication j corresponding rx_indication i
LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n",
j,UL_RCC_INFO.crc_ind[k].crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i,UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
if (UL_RCC_INFO.crc_ind[k].crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti == UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n",
j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
if (UL_RCC_INFO.crc_ind[k].crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
rx_sdu(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.rx_ind[k].sfn_sf), //UL_info->frame,
NFAPI_SFNSF2SF(UL_RCC_INFO.rx_ind[k].sfn_sf), //UL_info->subframe,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
(uint8_t *)NULL,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
}
else {
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
rx_sdu(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_RCC_INFO.rx_ind[k].sfn_sf), //UL_info->frame,
NFAPI_SFNSF2SF(UL_RCC_INFO.rx_ind[k].sfn_sf), //UL_info->subframe,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].data,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
}
break;
if(UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].data != NULL){
free(UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list[i].data);
}
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
free(UL_RCC_INFO.crc_ind[k].crc_indication_body.crc_pdu_list);
free(UL_RCC_INFO.rx_ind[k].rx_indication_body.rx_pdu_list);
UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs = 0;
UL_RCC_INFO.crc_ind[k].header.message_id =0;
UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus = 0;
UL_RCC_INFO.rx_ind[k].header.message_id = 0;
}
}
}
else
{
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
......
......@@ -90,7 +90,27 @@ typedef struct{
} UL_IND_t;
// Downlink subframe P7
#define NUM_NFPAI_SUBFRAME 5
typedef struct{
/// harq indication list
nfapi_harq_indication_t harq_ind[NUM_NFPAI_SUBFRAME];
/// crc indication list
nfapi_crc_indication_t crc_ind[NUM_NFPAI_SUBFRAME];
/// SR indication list
nfapi_sr_indication_t sr_ind[NUM_NFPAI_SUBFRAME];
/// CQI indication list
nfapi_cqi_indication_t cqi_ind[NUM_NFPAI_SUBFRAME];
/// RACH indication list
nfapi_rach_indication_t rach_ind[NUM_NFPAI_SUBFRAME];
/// RX indication
nfapi_rx_indication_t rx_ind[NUM_NFPAI_SUBFRAME];
} UL_RCC_IND_t;
typedef struct{
/// Module ID
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment