Commit 55660e87 authored by laurent's avatar laurent

RACH working, fails later during MME authentication

parent cb41822b
This diff is collapsed.
...@@ -64,6 +64,9 @@ typedef struct { ...@@ -64,6 +64,9 @@ typedef struct {
enum pckType { enum pckType {
fs6UlConfig=25, fs6UlConfig=25,
fs6DlConfig=26, fs6DlConfig=26,
fs6ULConfigCCH=27,
fs6ULsch=28,
fs6ULcch=29,
}; };
typedef struct { typedef struct {
...@@ -111,12 +114,39 @@ typedef struct { ...@@ -111,12 +114,39 @@ typedef struct {
} fs6_dl_uespec_t; } fs6_dl_uespec_t;
typedef struct { typedef struct {
int16_t UE_id;
LTE_eNB_UCI cch_vars;
} fs6_dl_uespec_ulcch_element_t;
typedef struct {
enum pckType type:8;
int16_t nb_active_ue;
} fs6_dl_uespec_ulcch_t;
typedef struct {
enum pckType type:8;
short UE_id; short UE_id;
short harq_id; short harq_id;
short segment; short segment;
short segLen; short segLen;
} fs6_ul_uespec_t; } fs6_ul_uespec_t;
typedef struct {
int UEid;
int frame;
int subframe;
uint8_t harq_ack[4];
uint8_t tdd_mapping_mode;
uint16_t tdd_multiplexing_mask;
unsigned short n0_subband_power_dB;
} fs6_ul_uespec_uci_element_t;
typedef struct {
enum pckType type:8;
int16_t nb_active_ue;
} fs6_ul_uespec_uci_t;
bool createUDPsock (char *sourceIP, char *sourcePort, char *destIP, char *destPort, UDPsock_t *result); bool createUDPsock (char *sourceIP, char *sourcePort, char *destIP, char *destPort, UDPsock_t *result);
int receiveSubFrame(UDPsock_t *sock, void *bufferZone, int bufferSize, uint16_t contentType); int receiveSubFrame(UDPsock_t *sock, void *bufferZone, int bufferSize, uint16_t contentType);
int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, uint16_t contentType); int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, uint16_t contentType);
...@@ -130,7 +160,9 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui ...@@ -130,7 +160,9 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui
#define hUL(xBuf) ((fs6_ul_t*)(((commonUDP_t *)xBuf)+1)) #define hUL(xBuf) ((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))
#define hDLUE(xBuf) ((fs6_dl_uespec_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1)) #define hDLUE(xBuf) ((fs6_dl_uespec_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hTxULUE(xBuf) ((fs6_dl_ulsched_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1)) #define hTxULUE(xBuf) ((fs6_dl_ulsched_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hTxULcch(xBuf) ((fs6_dl_uespec_ulcch_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hULUE(xBuf) ((fs6_ul_uespec_t*) (((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))+1)) #define hULUE(xBuf) ((fs6_ul_uespec_t*) (((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hULUEuci(xBuf) ((fs6_ul_uespec_uci_t*) (((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))+1))
static inline size_t alignedSize(uint8_t *ptr) { static inline size_t alignedSize(uint8_t *ptr) {
commonUDP_t *header=(commonUDP_t *) ptr; commonUDP_t *header=(commonUDP_t *) ptr;
......
...@@ -139,9 +139,9 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui ...@@ -139,9 +139,9 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui
*currentHeader=*UDPheader; *currentHeader=*UDPheader;
currentHeader->blockID=blockId; currentHeader->blockID=blockId;
memcpy(commonUDPdata((void *)currentHeader), commonUDPdata(bufferZone), secondHeaderSize); memcpy(commonUDPdata((void *)currentHeader), commonUDPdata(bufferZone), secondHeaderSize);
blockId++;
} }
blockId++;
int sz=alignedSize(bufferZone); int sz=alignedSize(bufferZone);
// Let's use the first address returned by getaddrinfo() // Let's use the first address returned by getaddrinfo()
int ret=sendto(sock->sockHandler, bufferZone, sz, 0, int ret=sendto(sock->sockHandler, bufferZone, sz, 0,
...@@ -155,6 +155,7 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui ...@@ -155,6 +155,7 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui
nbBlocks--; nbBlocks--;
} while (nbBlocks); } while (nbBlocks);
LOG_D(HW,"Sent: TS: %lu\n", UDPheader->timestamp); LOG_D(HW,"Sent: TS: %lu, nb blocks %d, size of first block: %lu \n",
UDPheader->timestamp, UDPheader->nbBlocks, alignedSize((void *)UDPheader));
return 0; return 0;
} }
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "transport_proto.h" #include "transport_proto.h"
extern WORKER_CONF_t get_thread_worker_conf(void); extern WORKER_CONF_t get_thread_worker_conf(void);
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen);
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) {
int i,r; int i,r;
...@@ -619,7 +620,8 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -619,7 +620,8 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) { if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) {
// r is the segment id, // r is the segment id,
// Kr is the segment length in short // Kr is the segment length in short
sendFs6Ul(eNB, UE_id, harq_pid, r, &ulsch_harq->d[r][96], Kr*sizeof(int16_t)); // *3 because LTE redudancy scheme
sendFs6Ul(eNB, UE_id, harq_pid, r, &ulsch_harq->d[r][96], Kr*sizeof(int16_t)*3);
return 0; return 0;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "SCHED/sched_common.h" #include "SCHED/sched_common.h"
#include "nfapi_interface.h" #include "nfapi_interface.h"
void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); void fill_uci_harq_indication(int UEid, PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask);
void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling);
void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti);
void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat); void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat);
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <time.h> #include <time.h>
#include "intertask_interface.h" #include "intertask_interface.h"
void sendFs6Ulharq(int UEid, PHY_VARS_eNB *eNB, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask);
nfapi_ue_release_request_body_t release_rntis; nfapi_ue_release_request_body_t release_rntis;
...@@ -768,7 +769,7 @@ uci_procedures(PHY_VARS_eNB *eNB, ...@@ -768,7 +769,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
frame,subframe, frame,subframe,
pucch_b0b1[0][0],metric[0]); pucch_b0b1[0][0],metric[0]);
uci->stat = metric[0]; uci->stat = metric[0];
fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff); fill_uci_harq_indication(i, eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff);
} else { // frame_type == TDD } else { // frame_type == TDD
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
frame,subframe,i, frame,subframe,i,
...@@ -881,7 +882,7 @@ uci_procedures(PHY_VARS_eNB *eNB, ...@@ -881,7 +882,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
} }
uci->stat = metric[0]; uci->stat = metric[0];
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode fill_uci_harq_indication(i, eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode
} else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)) { // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 } else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)) { // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
if (pucch_b0b1[0][0] == 4 || if (pucch_b0b1[0][0] == 4 ||
pucch_b0b1[1][0] == 4) { // there isn't a likely transmission pucch_b0b1[1][0] == 4) { // there isn't a likely transmission
...@@ -917,7 +918,7 @@ uci_procedures(PHY_VARS_eNB *eNB, ...@@ -917,7 +918,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
} }
uci->stat = max(metric[0],metric[1]); uci->stat = max(metric[0],metric[1]);
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode fill_uci_harq_indication(i, eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
} //else if ((uci->tdd_bundling == 0) && (res==2)) } //else if ((uci->tdd_bundling == 0) && (res==2))
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)) { // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)) { // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3
if (harq_ack[0] == 4 || if (harq_ack[0] == 4 ||
...@@ -988,7 +989,7 @@ uci_procedures(PHY_VARS_eNB *eNB, ...@@ -988,7 +989,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
} }
uci->stat = max_metric; uci->stat = max_metric;
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode fill_uci_harq_indication(i, eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
} }
} //else if ((uci->tdd_bundling == 0) && (res==3)) } //else if ((uci->tdd_bundling == 0) && (res==3))
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)) { // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)) { // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4
...@@ -1110,14 +1111,14 @@ uci_procedures(PHY_VARS_eNB *eNB, ...@@ -1110,14 +1111,14 @@ uci_procedures(PHY_VARS_eNB *eNB,
} }
uci->stat = max_metric; uci->stat = max_metric;
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode fill_uci_harq_indication(i, eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
} // else if ((uci->tdd_bundling == 0) && (res==4)) } // else if ((uci->tdd_bundling == 0) && (res==4))
else { // bundling else { // bundling
harq_ack[0] = pucch_b0b1[0][0]; harq_ack[0] = pucch_b0b1[0][0];
harq_ack[1] = pucch_b0b1[0][1]; harq_ack[1] = pucch_b0b1[0][1];
uci->stat = metric[0]; uci->stat = metric[0];
LOG_D(PHY,"bundling: (%d,%d), metric %d\n",harq_ack[0],harq_ack[1],uci->stat); LOG_D(PHY,"bundling: (%d,%d), metric %d\n",harq_ack[0],harq_ack[1],uci->stat);
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode fill_uci_harq_indication(i, eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode
} }
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
...@@ -1754,7 +1755,12 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har ...@@ -1754,7 +1755,12 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
void fill_uci_harq_indication (PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) {
if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) {
sendFs6Ulharq(UEid, eNB, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask);
return;
}
int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST); int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
//AssertFatal(UE_id>=0,"UE_id doesn't exist rnti:%x\n", uci->rnti); //AssertFatal(UE_id>=0,"UE_id doesn't exist rnti:%x\n", uci->rnti);
......
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