]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/plb2800_eth.c
Merge branch 'master' of git://git.denx.de/u-boot-net
[karo-tx-uboot.git] / drivers / net / plb2800_eth.c
index 0ae5d808a6f9d055ad73f2202737adf4c58f1dbb..93782c23ff41cd2d26ef5140df4de168974d3c46 100644 (file)
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NET) \
-       && defined(CONFIG_NET_MULTI) && defined(CONFIG_PLB2800_ETHER)
-
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/addrspace.h>
 
 
@@ -85,8 +82,7 @@ typedef volatile struct {
 
 
 static int plb2800_eth_init(struct eth_device *dev, bd_t * bis);
-static int plb2800_eth_send(struct eth_device *dev, volatile void *packet,
-                                                 int length);
+static int plb2800_eth_send(struct eth_device *dev, void *packet, int length);
 static int plb2800_eth_recv(struct eth_device *dev);
 static void plb2800_eth_halt(struct eth_device *dev);
 
@@ -109,7 +105,7 @@ int plb2800_eth_initialize(bd_t * bis)
        if (!(dev = (struct eth_device *) malloc (sizeof *dev)))
        {
                printf("Failed to allocate memory\n");
-               return 0;
+               return -1;
        }
        memset(dev, 0, sizeof(*dev));
 
@@ -144,7 +140,7 @@ int plb2800_eth_initialize(bd_t * bis)
        printf("Leaving plb2800_eth_initialize()\n");
 #endif
 
-       return 1;
+       return 0;
 }
 
 static int plb2800_eth_init(struct eth_device *dev, bd_t * bis)
@@ -165,8 +161,7 @@ static int plb2800_eth_init(struct eth_device *dev, bd_t * bis)
 }
 
 
-static int plb2800_eth_send(struct eth_device *dev, volatile void *packet,
-                                                 int length)
+static int plb2800_eth_send(struct eth_device *dev, void *packet, int length)
 {
        int                    i;
        int                    res         = -1;
@@ -333,7 +328,7 @@ static void plb2800_set_mac_addr(struct eth_device *dev, unsigned char * addr)
        DA_LOOKUP = temp;
 
        /* Set MA_LEARN register */
-       temp = 50 << MA_DEST_SHF;       /* static entry */
+       temp = 50 << MA_DEST_SHF;       /* static entry */
        MA_LEARN = temp;
 
        /* set destination address */
@@ -392,5 +387,3 @@ static unsigned char * plb2800_get_mac_addr(void)
 
        return addr;
 }
-
-#endif /* CONFIG_PLB2800_ETHER */