]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/eepro100.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / drivers / net / eepro100.c
index 96ed2710c21419286ed0ae02ac6db893b8a23442..9c06b25569419d73d96b4537e7db3b4339967032 100644 (file)
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 #include <miiphy.h>
 
 #undef DEBUG
 
-#if defined(CONFIG_CMD_NET) \
-       && defined(CONFIG_NET_MULTI) && defined(CONFIG_EEPRO100)
-
        /* Ethernet chip registers.
         */
 #define SCBStatus              0       /* Rx/Command Unit Status *Word* */
@@ -196,14 +194,14 @@ struct descriptor {                       /* A generic descriptor. */
        unsigned char params[0];
 };
 
-#define CFG_CMD_EL             0x8000
-#define CFG_CMD_SUSPEND                0x4000
-#define CFG_CMD_INT            0x2000
-#define CFG_CMD_IAS            0x0001  /* individual address setup */
-#define CFG_CMD_CONFIGURE      0x0002  /* configure */
+#define CONFIG_SYS_CMD_EL              0x8000
+#define CONFIG_SYS_CMD_SUSPEND         0x4000
+#define CONFIG_SYS_CMD_INT             0x2000
+#define CONFIG_SYS_CMD_IAS             0x0001  /* individual address setup */
+#define CONFIG_SYS_CMD_CONFIGURE       0x0002  /* configure */
 
-#define CFG_STATUS_C           0x8000
-#define CFG_STATUS_OK          0x2000
+#define CONFIG_SYS_STATUS_C            0x8000
+#define CONFIG_SYS_STATUS_OK           0x2000
 
        /* Misc.
         */
@@ -531,7 +529,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
        tx_next = ((tx_next + 1) % NUM_TX_DESC);
 
        cfg_cmd = (struct descriptor *) &tx_ring[tx_cur];
-       cfg_cmd->command = cpu_to_le16 ((CFG_CMD_SUSPEND | CFG_CMD_CONFIGURE));
+       cfg_cmd->command = cpu_to_le16 ((CONFIG_SYS_CMD_SUSPEND | CONFIG_SYS_CMD_CONFIGURE));
        cfg_cmd->status = 0;
        cfg_cmd->link = cpu_to_le32 (phys_to_bus ((u32) & tx_ring[tx_next]));
 
@@ -539,7 +537,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
                        sizeof (i82558_config_cmd));
 
        if (!wait_for_eepro100 (dev)) {
-               printf ("Error---CFG_CMD_CONFIGURE: Can not reset ethernet controller.\n");
+               printf ("Error---CONFIG_SYS_CMD_CONFIGURE: Can not reset ethernet controller.\n");
                goto Done;
        }
 
@@ -547,7 +545,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
        OUTW (dev, SCB_M | CU_START, SCBCmd);
 
        for (i = 0;
-            !(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_C);
+            !(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_C);
             i++) {
                if (i >= TOUT_LOOP) {
                        printf ("%s: Tx error buffer not ready\n", dev->name);
@@ -555,7 +553,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
                }
        }
 
-       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_OK)) {
+       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_OK)) {
                printf ("TX error status = 0x%08X\n",
                        le16_to_cpu (tx_ring[tx_cur].status));
                goto Done;
@@ -567,7 +565,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
        tx_next = ((tx_next + 1) % NUM_TX_DESC);
 
        ias_cmd = (struct descriptor *) &tx_ring[tx_cur];
-       ias_cmd->command = cpu_to_le16 ((CFG_CMD_SUSPEND | CFG_CMD_IAS));
+       ias_cmd->command = cpu_to_le16 ((CONFIG_SYS_CMD_SUSPEND | CONFIG_SYS_CMD_IAS));
        ias_cmd->status = 0;
        ias_cmd->link = cpu_to_le32 (phys_to_bus ((u32) & tx_ring[tx_next]));
 
@@ -583,7 +581,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
        OUTL (dev, phys_to_bus ((u32) & tx_ring[tx_cur]), SCBPointer);
        OUTW (dev, SCB_M | CU_START, SCBCmd);
 
-       for (i = 0; !(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_C);
+       for (i = 0; !(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_C);
                 i++) {
                if (i >= TOUT_LOOP) {
                        printf ("%s: Tx error buffer not ready\n",
@@ -592,7 +590,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis)
                }
        }
 
-       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_OK)) {
+       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_OK)) {
                printf ("TX error status = 0x%08X\n",
                        le16_to_cpu (tx_ring[tx_cur].status));
                goto Done;
@@ -642,7 +640,7 @@ static int eepro100_send (struct eth_device *dev, volatile void *packet, int len
        OUTL (dev, phys_to_bus ((u32) & tx_ring[tx_cur]), SCBPointer);
        OUTW (dev, SCB_M | CU_START, SCBCmd);
 
-       for (i = 0; !(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_C);
+       for (i = 0; !(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_C);
                 i++) {
                if (i >= TOUT_LOOP) {
                        printf ("%s: Tx error buffer not ready\n", dev->name);
@@ -650,7 +648,7 @@ static int eepro100_send (struct eth_device *dev, volatile void *packet, int len
                }
        }
 
-       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CFG_STATUS_OK)) {
+       if (!(le16_to_cpu (tx_ring[tx_cur].status) & CONFIG_SYS_STATUS_OK)) {
                printf ("TX error status = 0x%08X\n",
                        le16_to_cpu (tx_ring[tx_cur].status));
                goto Done;
@@ -944,5 +942,3 @@ static void read_hw_addr (struct eth_device *dev, bd_t * bis)
 #endif
        }
 }
-
-#endif