From 5bef5eb03bdf2db575943f06a8f0dcbe3b744aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Benedikt=20Kr=C3=BCger?= Date: Tue, 2 Aug 2011 12:43:53 +0200 Subject: [PATCH] merge && test for master --- drivers/net/mmnif.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/drivers/net/mmnif.c b/drivers/net/mmnif.c index f7b3cb27..cb7d947d 100644 --- a/drivers/net/mmnif.c +++ b/drivers/net/mmnif.c @@ -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));