clps711xfb: convert to proc_fops
[safe/jmp/linux-2.6] / drivers / net / ns83820.c
index 940962a..1f6327d 100644 (file)
 #include <linux/compiler.h>
 #include <linux/prefetch.h>
 #include <linux/ethtool.h>
+#include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/if_vlan.h>
 #include <linux/rtnetlink.h>
@@ -647,8 +648,8 @@ static void phy_intr(struct net_device *ndev)
                dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n",
                        tbisr, tanar, tanlpar);
 
-               if ( (fullduplex = (tanlpar & TANAR_FULL_DUP)
-                     && (tanar & TANAR_FULL_DUP)) ) {
+               if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) &&
+                     (tanar & TANAR_FULL_DUP)) ) {
 
                        /* both of us are full duplex */
                        writel(readl(dev->base + TXCFG)
@@ -660,12 +661,12 @@ static void phy_intr(struct net_device *ndev)
                        writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT,
                               dev->base + GPIOR);
 
-               } else if(((tanlpar & TANAR_HALF_DUP)
-                          && (tanar & TANAR_HALF_DUP))
-                       || ((tanlpar & TANAR_FULL_DUP)
-                           && (tanar & TANAR_HALF_DUP))
-                       || ((tanlpar & TANAR_HALF_DUP)
-                           && (tanar & TANAR_FULL_DUP))) {
+               } else if (((tanlpar & TANAR_HALF_DUP) &&
+                           (tanar & TANAR_HALF_DUP)) ||
+                          ((tanlpar & TANAR_FULL_DUP) &&
+                           (tanar & TANAR_HALF_DUP)) ||
+                          ((tanlpar & TANAR_HALF_DUP) &&
+                           (tanar & TANAR_FULL_DUP))) {
 
                        /* one or both of us are half duplex */
                        writel((readl(dev->base + TXCFG)
@@ -719,16 +720,16 @@ static void phy_intr(struct net_device *ndev)
 
        newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN;
 
-       if (newlinkstate & LINK_UP
-           && dev->linkstate != newlinkstate) {
+       if (newlinkstate & LINK_UP &&
+           dev->linkstate != newlinkstate) {
                netif_start_queue(ndev);
                netif_wake_queue(ndev);
                printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n",
                        ndev->name,
                        speeds[speed],
                        fullduplex ? "full" : "half");
-       } else if (newlinkstate & LINK_DOWN
-                  && dev->linkstate != newlinkstate) {
+       } else if (newlinkstate & LINK_DOWN &&
+                  dev->linkstate != newlinkstate) {
                netif_stop_queue(ndev);
                printk(KERN_INFO "%s: link now down.\n", ndev->name);
        }
@@ -1077,7 +1078,8 @@ static void ns83820_cleanup_tx(struct ns83820 *dev)
  * while trying to track down a bug in either the zero copy code or
  * the tx fifo (hence the MAX_FRAG_LEN).
  */
-static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t ns83820_hard_start_xmit(struct sk_buff *skb,
+                                          struct net_device *ndev)
 {
        struct ns83820 *dev = PRIV(ndev);
        u32 free_idx, cmdsts, extsts;
@@ -1097,7 +1099,7 @@ again:
        if (unlikely(dev->CFG_cache & CFG_LNKSTS)) {
                netif_stop_queue(ndev);
                if (unlikely(dev->CFG_cache & CFG_LNKSTS))
-                       return 1;
+                       return NETDEV_TX_BUSY;
                netif_start_queue(ndev);
        }
 
@@ -1115,7 +1117,7 @@ again:
                        netif_start_queue(ndev);
                        goto again;
                }
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        if (free_idx == dev->tx_intr_idx) {