URL
https://opencores.org/ocsvn/fade_ether_protocol/fade_ether_protocol/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 19 |
Rev 21 |
Line 136... |
Line 136... |
if(!v[i]) {
|
if(!v[i]) {
|
printf("mmap for device %s failed\n",devname);
|
printf("mmap for device %s failed\n",devname);
|
exit(1);
|
exit(1);
|
}
|
}
|
}
|
}
|
//Start the transmission
|
//Connect to appropriate FPGAs
|
for(i=0;i<=2;i++) {
|
for(i=0;i<=2;i++) {
|
if(active[i]) {
|
if(active[i]) {
|
res = ioctl(frs[i],L3_V1_IOC_GETMAC,&sl[i]);
|
res = ioctl(frs[i],L3_V1_IOC_GETMAC,&sl[i]);
|
printf("Result of get for slave %d : %d\n",i,res);
|
printf("Result of get for slave %d : %d\n",i,res);
|
if(res<0) {
|
if(res<0) {
|
Line 149... |
Line 149... |
}
|
}
|
} else {
|
} else {
|
leave[i]=1;
|
leave[i]=1;
|
}
|
}
|
}
|
}
|
|
//Send FADE reset command, so that FADE core is in predictable state
|
|
for(i=0;i<=2;i++) {
|
|
if(active[i]) {
|
|
int j;
|
|
for(j=0;j<3;j++) {
|
|
res = ioctl(frs[i],L3_V1_IOC_RESETMAC,&sl[i]);
|
|
if(res<0) {
|
|
printf("I couldn't RESET Ethernet device %d\n",i);
|
|
exit(1);
|
|
}
|
|
}
|
|
} else {
|
|
leave[i]=1;
|
|
}
|
|
}
|
//Start the second thread, which uses user commands
|
//Start the second thread, which uses user commands
|
pthread_create(&ucmd_thread, NULL, user_cmd_thread, NULL);
|
pthread_create(&ucmd_thread, NULL, user_cmd_thread, NULL);
|
int first_served=0;
|
int first_served=0;
|
do{
|
do{
|
struct pollfd pfd[3];
|
struct pollfd pfd[3];
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.