merge && test for master

This commit is contained in:
Carl-Benedikt Krüger 2011-08-02 12:43:53 +02:00
parent f73f98ad0a
commit 5bef5eb03b

View file

@ -229,39 +229,6 @@ typedef struct mmnif
}mmnif_t;
#ifdef WIN32
__inline int get_my_core_no(void)
{
#ifndef RECV
return 1;
#else
return 0;
#endif
}
#else
__inline int get_my_core_no(void)
{
unsigned int tmp;
unsigned int pid;
unsigned int x,y,z;
/* Determine the local IP address from the core number in the
* tile ID register
*/
tmp = ReadConfigReg(local_crb + RCK_TILEID);
x = (tmp>>3) & 0x0f; /* bits 06:03 */
y = (tmp>>7) & 0x0f; /* bits 10:07 */
z = (tmp ) & 0x07; /* bits 02:00 */
pid = 12*y + 2*x + z;
/* Add 1 to the processor ID to avoid *.*.*.0 IP addresses */
return pid;
}
#endif
/*
* memory maped interface helper functions
*/
@ -973,7 +940,7 @@ err_t mmnif_init(struct netif* netif)
/* Generate MAC address */
mmnif_dev->hwaddr[0] = 0x11;mmnif_dev->hwaddr[1] = 0x22;mmnif_dev->hwaddr[2] = 0x33;
mmnif_dev->hwaddr[3] = 0x44;mmnif_dev->hwaddr[4] = 0x55;mmnif_dev->hwaddr[5] = get_my_core_no()*0x11 +0x66;
mmnif_dev->hwaddr[3] = 0x44;mmnif_dev->hwaddr[4] = 0x55;mmnif_dev->hwaddr[5] = RCCE_UE()*0x11 +0x66;
/*
* Initialize the snmp variables and counters inside the struct netif.
@ -1321,10 +1288,10 @@ int mmnif_open()
* Note: core 1 is the router core
*/
IP4_ADDR(&gw, 0,0,0,0);
IP4_ADDR(&ipaddr, 192,168,0,get_my_core_no() +1);
IP4_ADDR(&ipaddr, 192,168,0,RCCE_UE() +1);
IP4_ADDR(&netmask, 255,255,255,0);
own_ip_address+= get_my_core_no() +1;
own_ip_address+= RCCE_UE() +1;
#ifdef WIN32
mmnif_dev = malloc(sizeof(struct netif));