Commit bd903cfe authored by Nick Ho's avatar Nick Ho

Modify IF Module to fit the FAPI Specification

parent 28991862
...@@ -9,19 +9,29 @@ void UL_indication(UL_IND_t UL_INFO) ...@@ -9,19 +9,29 @@ void UL_indication(UL_IND_t UL_INFO)
if(UL_INFO.test == 1) if(UL_INFO.test == 1)
{ {
/*If there is a preamble, do the initiate RA procedure*/ /*If there is a preamble, do the initiate RA procedure*/
if(UL_INFO.preamble_index && UL_INFO.timing_offset) if(UL_INFO.Number_SC>0)
NB_initiate_ra_proc(UL_INFO.module_id,UL_INFO.CC_id,UL_INFO.frame,UL_INFO.preamble_index,UL_INFO.timing_offset,UL_INFO.subframe); {
for(i=0;i<UL_INFO.Number_SC;i++)
{
NB_initiate_ra_proc(UL_INFO.module_id,
UL_INFO.CC_id,
UL_INFO.frame,
UL_INFO.Preamble_list[UL_INFO.Number_SC].preamble_index,
UL_INFO.Preamble_list[UL_INFO.Number_SC].timing_offset,
UL_INFO.subframe
);
}
}
/*If there is a Uplink SDU (even MSG3, NAK) need to send to MAC*/ /*If there is a Uplink SDU (even MSG3, NAK) need to send to MAC*/
for(i=0;i<UL_INFO.UE_NUM;i++) for(i=0;i<UL_INFO.UE_NUM;i++)
{ {
/*For MSG3, Normal Uplink Data, NAK*/ /*For MSG3, Normal Uplink Data, NAK*/
if(UL_INFO.UL_SPEC_Info[i].rntiP) if(UL_INFO.UL_SPEC_Info[i].RNTI)
NB_rx_sdu(UL_INFO.module_id, NB_rx_sdu(UL_INFO.module_id,
UL_INFO.CC_id, UL_INFO.CC_id,
UL_INFO.frame, UL_INFO.frame,
UL_INFO.subframe, UL_INFO.subframe,
UL_INFO.UL_SPEC_Info[i].rntiP, UL_INFO.UL_SPEC_Info[i].RNTI,
UL_INFO.UL_SPEC_Info[i].sdu, UL_INFO.UL_SPEC_Info[i].sdu,
UL_INFO.UL_SPEC_Info[i].sdu_lenP, UL_INFO.UL_SPEC_Info[i].sdu_lenP,
UL_INFO.UL_SPEC_Info[i].harq_pidP, UL_INFO.UL_SPEC_Info[i].harq_pidP,
......
...@@ -15,14 +15,33 @@ ...@@ -15,14 +15,33 @@
// uplink subframe P7 // uplink subframe P7
typedef struct{
//index of the preamble, detected initial subcarrier (0-47)
uint16_t preamble_index;
//timing offset by PHY
int16_t timing_offset;
//Indicates the NRACH CE level as configured in CONFIG (0,1,2 = CE level 0,1,2)
uint8_t NRACH_CE_Level;
//RA-RNTI
uint16_t RNTI;
//Timing Advance
uint16_t TA;
}NRACH_t;
/*UL_SPEC_t: /*UL_SPEC_t:
* A struture mainly describes the UE specific information. (for NB_rx_sdu) * A struture mainly describes the UE specific information. (for NB_rx_sdu)
* Corresponding to thhe RX_ULSCH.indication, CRC.inidcation, NB_HARQ.indication in FAPI * Corresponding to the RX_ULSCH.indication, CRC.inidcation, NB_HARQ.indication in FAPI
*/ */
typedef struct{ typedef struct{
// 0 = format 1 (data), 1 = formaat 2 (ACK/NACK)
uint8_t NPUSCH_format;
//An opaque handling returned in the RX.indication
uint32_t OPA_handle;
//rnti //rnti
rnti_t rntiP; uint16_t RNTI;
//Pointer to sdu //Pointer to sdu
uint8_t *sdu; uint8_t *sdu;
//Pointer to sdu length //Pointer to sdu length
...@@ -34,11 +53,12 @@ typedef struct{ ...@@ -34,11 +53,12 @@ typedef struct{
//CRC indication for the message is corrected or not for the Uplink HARQ //CRC indication for the message is corrected or not for the Uplink HARQ
uint8_t crc_ind; uint8_t crc_ind;
//This ACK NACK is for the Downlink HARQ received by the NPUSCH from UE //This ACK NACK is for the Downlink HARQ feedback received by the NPUSCH from UE
uint8_t NAK; uint8_t NAK;
}UL_SPEC_t; }UL_SPEC_t;
/*UL_IND_t: /*UL_IND_t:
* A structure handles all the uplink information. * A structure handles all the uplink information.
*/ */
...@@ -47,6 +67,7 @@ typedef struct{ ...@@ -47,6 +67,7 @@ typedef struct{
/*Start at the common part*/ /*Start at the common part*/
int test; int test;
//Module ID //Module ID
module_id_t module_id; module_id_t module_id;
//CC ID //CC ID
...@@ -55,25 +76,26 @@ typedef struct{ ...@@ -55,25 +76,26 @@ typedef struct{
frame_t frame; frame_t frame;
//subframe //subframe
sub_frame_t subframe; sub_frame_t subframe;
//Number of availble UE
int UE_NUM;
/*preamble part*/ /*preamble part*/
//index of the preamble //number of the subcarrier detected in the same time
uint16_t preamble_index; uint8_t Number_SC;
//timing offset by PHY //NRACH Indication parameters list
int16_t timing_offset; NRACH_t Preamble_list[48];
/*UE specific part*/ /*UE specific part*/
//Number of availble UE for Uplink
int UE_NUM;
//Uplink Schedule information
UL_SPEC_t UL_SPEC_Info[NUMBER_OF_UE_MAX]; UL_SPEC_t UL_SPEC_Info[NUMBER_OF_UE_MAX];
}UL_IND_t; }UL_IND_t;
// Downlink subframe P7 // Downlink subframe P7
typedef union{ typedef struct{
//The length (in bytes) //The length (in bytes)
uint16_t Length; uint16_t Length;
...@@ -88,7 +110,7 @@ typedef struct{ ...@@ -88,7 +110,7 @@ typedef struct{
}npbch_t; }npbch_t;
typedef union{ typedef struct{
//The length (in bytes) //The length (in bytes)
uint16_t Length; uint16_t Length;
...@@ -107,7 +129,7 @@ typedef struct{ ...@@ -107,7 +129,7 @@ typedef struct{
}npdsch_t; }npdsch_t;
typedef union{ typedef struct{
// The length (in bytes) // The length (in bytes)
uint16_t Length; uint16_t Length;
...@@ -136,6 +158,16 @@ typedef struct{ ...@@ -136,6 +158,16 @@ typedef struct{
}npdcch_t; }npdcch_t;
typedef union{
npdcch_t NB_DCI;
npdsch_t NB_DLSCH;
npbch_t NB_BCH;
}NB_DL_u;
typedef struct{ typedef struct{
...@@ -150,11 +182,7 @@ typedef struct{ ...@@ -150,11 +182,7 @@ typedef struct{
//subframe //subframe
sub_frame_t subframeP; sub_frame_t subframeP;
npdcch_t NB_DCI; NB_DL_u NB_DL;
npdsch_t NB_DLSCH;
npbch_t NB_BCH;
}Sched_Rsp_t; }Sched_Rsp_t;
......
...@@ -80,3 +80,7 @@ Comment: Complete the TX part, add the NB_generate_eNB_dlsch_params and NB_gener ...@@ -80,3 +80,7 @@ Comment: Complete the TX part, add the NB_generate_eNB_dlsch_params and NB_gener
Comment: Complete the dci_tools the part configuring the PHY and do the pack of dci at the same times. Comment: Complete the dci_tools the part configuring the PHY and do the pack of dci at the same times.
Add DCI packed format in dci_nb_iot.h Add DCI packed format in dci_nb_iot.h
6/6
Comment: Update the IF Module header file to fit the FAPI structure and types.
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