]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/sh_eth.c
net: Fix remaining API interface breakage
[u-boot] / drivers / net / sh_eth.c
index 08715759364a009083761f580bf049c694931580..d5ef29c8371c9c3473a8e00ca0a5acf0d157b8ec 100644 (file)
@@ -44,7 +44,9 @@
 #define flush_cache_wback(...)
 #endif
 
-int sh_eth_send(struct eth_device *dev, volatile void *packet, int len)
+#define TIMEOUT_CNT 1000
+
+int sh_eth_send(struct eth_device *dev, void *packet, int len)
 {
        struct sh_eth_dev *eth = dev->priv;
        int port = eth->port, ret = 0, timeout;
@@ -78,7 +80,7 @@ int sh_eth_send(struct eth_device *dev, volatile void *packet, int len)
                outl(EDTRR_TRNS, EDTRR(port));
 
        /* Wait until packet is transmitted */
-       timeout = 1000;
+       timeout = TIMEOUT_CNT;
        while (port_info->tx_desc_cur->td0 & TD_TACT && timeout--)
                udelay(100);
 
@@ -92,7 +94,6 @@ int sh_eth_send(struct eth_device *dev, volatile void *packet, int len)
        if (port_info->tx_desc_cur >= port_info->tx_desc_base + NUM_TX_DESC)
                port_info->tx_desc_cur = port_info->tx_desc_base;
 
-       return ret;
 err:
        return ret;
 }
@@ -102,15 +103,15 @@ int sh_eth_recv(struct eth_device *dev)
        struct sh_eth_dev *eth = dev->priv;
        int port = eth->port, len = 0;
        struct sh_eth_info *port_info = &eth->port_info[port];
-       volatile u8 *packet;
+       uchar *packet;
 
        /* Check if the rx descriptor is ready */
        if (!(port_info->rx_desc_cur->rd0 & RD_RACT)) {
                /* Check for errors */
                if (!(port_info->rx_desc_cur->rd0 & RD_RFE)) {
                        len = port_info->rx_desc_cur->rd1 & 0xffff;
-                       packet = (volatile u8 *)
-                           ADDR_TO_P2(port_info->rx_desc_cur->rd2);
+                       packet = (uchar *)
+                               ADDR_TO_P2(port_info->rx_desc_cur->rd2);
                        NetReceive(packet, len);
                }
 
@@ -134,7 +135,6 @@ int sh_eth_recv(struct eth_device *dev)
        return len;
 }
 
-#define EDMR_INIT_CNT 1000
 static int sh_eth_reset(struct sh_eth_dev *eth)
 {
        int port = eth->port;
@@ -146,13 +146,13 @@ static int sh_eth_reset(struct sh_eth_dev *eth)
 
        /* Perform a software reset and wait for it to complete */
        outl(EDMR_SRST, EDMR(port));
-       for (i = 0; i < EDMR_INIT_CNT; i++) {
+       for (i = 0; i < TIMEOUT_CNT ; i++) {
                if (!(inl(EDMR(port)) & EDMR_SRST))
                        break;
                udelay(1000);
        }
 
-       if (i == EDMR_INIT_CNT) {
+       if (i == TIMEOUT_CNT) {
                printf(SHETHER_NAME  ": Software reset timeout\n");
                ret = -EIO;
        }