changes to get index in eiger server

This commit is contained in:
Maliakal Dhanya
2014-11-17 14:46:28 +01:00
parent b24f374155
commit 194b41bfc5
7 changed files with 269 additions and 78 deletions

View File

@ -42,6 +42,7 @@
short Beb_bit_mode;
void BebInfo_BebInfo(struct BebInfo* bebInfo, unsigned int beb_num){
bebInfo->beb_number=beb_num;
bebInfo->serial_address=0;
@ -136,13 +137,14 @@ void Beb_Beb(int arg1){
Beb_SetByteOrder();
/*
ll_beb_new_memory = &ll_beb_new_memory_local;
Local_LocalLinkInterface(ll_beb_new_memory);
if(!Local_InitNewMemory(ll_beb_new_memory,XPAR_PLB_LL_NEW_MEMORY, arg1))
printf("New Memory FAIL\n");
else
printf("New Memory OK\n");
*/
}
@ -156,6 +158,7 @@ void Beb_ClearBebInfos(){
int Beb_InitBebInfos(){//file name at some point
Beb_ClearBebInfos();
struct BebInfo b0;
BebInfo_BebInfo(&b0,0);
if(BebInfo_SetSerialAddress(&b0,0xff)) { //all bebs for reset and possibly get request data?
@ -173,6 +176,7 @@ int Beb_InitBebInfos(){//file name at some point
beb_infos.push_back(b);
*/
return Beb_CheckSourceStuffBebInfo();
}
@ -182,7 +186,7 @@ int Beb_SetBebSrcHeaderInfos(unsigned int beb_number, int ten_gig, char* src_mac
//so that the values can be reset externally for now....
unsigned int i = Beb_GetBebInfoIndex(beb_number);
if(!i){ printf("returning 000\n");return 0;} //i must be greater than 0, zero is the global send
/******* if(!i) return 0;****************************/ //i must be greater than 0, zero is the global send
BebInfo_SetHeaderInfo(&beb_infos[i],ten_gig,src_mac,src_ip,src_port);
printf("Printing Beb info number (%d) :\n",i);
@ -254,12 +258,13 @@ int Beb_CheckSourceStuffBebInfo(){
}
unsigned int Beb_GetBebInfoIndex(unsigned int beb_numb){
if(!beb_numb) return 0;
/******************** if(!beb_numb) return 0;******************************/
unsigned int i;
for(i=1;i<bebInfoSize;i++)
if(beb_numb==BebInfo_GetBebNumber(&beb_infos[i]))
if(beb_numb==BebInfo_GetBebNumber(&beb_infos[i])){
printf("found beb index:%d, for beb number:%d\n",i,beb_numb);
return i;
}
return 0;
}
@ -320,7 +325,7 @@ int Beb_SetByteOrder(){
int Beb_SetUpUDPHeader(unsigned int beb_number, int ten_gig, unsigned int header_number, char* dst_mac, char* dst_ip, unsigned int dst_port){
unsigned int i = Beb_GetBebInfoIndex(beb_number);
if(!i) return 0; //i must be greater than 0, zero is the global send
/***********************************if(!i) return 0; *************************************///i must be greater than 0, zero is the global send
Beb_send_ndata = 14;
Beb_send_data[0] = ten_gig ? 0x00020000 : 0x00010000; //write to fanout numbers 1 or 2
@ -337,7 +342,7 @@ int Beb_SetUpUDPHeader(unsigned int beb_number, int ten_gig, unsigned int header
int Beb_SetHeaderData(unsigned int beb_number, int ten_gig, char* dst_mac, char* dst_ip, unsigned int dst_port){
unsigned int i = Beb_GetBebInfoIndex(beb_number);
if(!i) return 0; //i must be greater than 0, zero is the global send
/***********************************if(!i) return 0; *************************************///i must be greater than 0, zero is the global send
return Beb_SetHeaderData1(BebInfo_GetSrcMAC(&beb_infos[i],ten_gig),BebInfo_GetSrcIP(&beb_infos[i],ten_gig),BebInfo_GetSrcPort(&beb_infos[i],ten_gig),dst_mac,dst_ip,dst_port);
}