Commit 27f044de authored by Nick Ho's avatar Nick Ho

Debug on some UL_Indication usages

parent dba5c0c5
......@@ -523,6 +523,8 @@ typedef struct {
IF_Module_NB_IoT_t *if_inst_NB_IoT;
Sched_Rsp_NB_IoT_t Sched_INFO;
} eNB_MAC_INST_NB_IoT;
// actually not here, but for now put it here
......
......@@ -25,15 +25,16 @@ unsigned char str10[] = "ack_msg4(retransmit)";
unsigned char str11[] = "msg3";
unsigned char str12[] = "msg3(retransmit)";
/*void init_RA_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint8_t preamble_index, ce_level_t ce_level, uint32_t sfn_id, uint16_t ta){
void init_RA_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint8_t preamble_index, ce_level_t ce_level, uint32_t sfn_id, uint16_t ta){
int i;
RA_TEMPLATE_NB_IoT *msg2_list_tail = mac_inst->RA_msg2_list.tail;
//RA_TEMPLATE_NB_IoT *msg2_list_tail = mac_inst->RA_msg2_list.tail;
RA_TEMPLATE_NB_IoT *migrate_node;
static int static_count=0;
printf("[%04d][RA scheduler][MSG1] RX %d\n", mac_inst->current_subframe, static_count++);
for(i=0; i<MAX_NUMBER_OF_UE_MAX_NB_IoT; ++i){
if(0 == mac_inst->RA_template[i].active){
migrate_node = &mac_inst->RA_template[i];
......@@ -51,11 +52,12 @@ unsigned char str12[] = "msg3(retransmit)";
migrate_node->ce_level = ce_level;
migrate_node->ra_rnti = (sfn_id>>2) + 1;
migrate_node->ta = ta;
migrate_node->next = (RA_template_NB_IoT *)0;
migrate_node->prev = (RA_template_NB_IoT *)0;
migrate_node->next = (RA_TEMPLATE_NB_IoT *)0;
migrate_node->prev = (RA_TEMPLATE_NB_IoT *)0;
printf("[%04d][RA scheduler][MSG1][CE%d] Receive MSG1 RNTI %d preamble index %d\n", mac_inst->current_subframe, migrate_node->ce_level, migrate_node->ra_rnti, migrate_node->preamble_index);
// insert to end of list
if((RA_template_NB_IoT *)0 == mac_inst->RA_msg2_list.head){
if((RA_TEMPLATE_NB_IoT *)0 == mac_inst->RA_msg2_list.head){
mac_inst->RA_msg2_list.head = migrate_node;
}else{
// not empty
......@@ -64,7 +66,8 @@ unsigned char str12[] = "msg3(retransmit)";
}
mac_inst->RA_msg2_list.tail = migrate_node;
}*/
}
// 7bytes
void fill_rar_NB_IoT(
......
......@@ -71,6 +71,8 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
/*Scheduler resource/environment setting*/
void init_RA_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint8_t preamble_index, ce_level_t ce_level, uint32_t sfn_id, uint16_t ta);
void init_tool_sib1(eNB_MAC_INST_NB_IoT *mac_inst);
void init_dlsf_info(eNB_MAC_INST_NB_IoT *mac_inst, DLSF_INFO_t *DLSF_info);
......
#include "IF_Module_L2_primitives_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
// Sched_INFO as a input for the scheduler
void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
{
int i=0;
uint32_t abs_subframe;
//UE_TEMPLATE_NB_IoT *UE_info;
//mac_NB_IoT_t *mac_inst;
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->NRACH.number_of_initial_scs_detected>0)
......@@ -17,14 +18,14 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
// initiate_ra here, some useful inforamtion :
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
/*init_RA_NB_IoT(UL_INFO->module_id,
UL_INFO->CC_id,
UL_INFO->frame,
init_RA_NB_IoT(mac_inst,
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16,
UL_INFO->subframe
);*/
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);
}
}
......@@ -64,7 +65,9 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
}
abs_subframe = UL_INFO->frame*10+UL_INFO->subframe;
//scheduler here
//Schedule subframe should be next four subframe, means that UL_INFO->frame*10+UL_INFO->subframe + 4
//eNB_dlsch_ulsch_scheduler_NB_IoT(mac_inst,abs_subframe);
eNB_dlsch_ulsch_scheduler_NB_IoT(mac_inst,abs_subframe);
}
\ No newline at end of file
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