drivers/video/msm: update to new kernel
[safe/jmp/linux-2.6] / drivers / net / hamachi.c
index 310ee03..f7519a5 100644 (file)
@@ -145,6 +145,7 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (5*HZ)
 
+#include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -173,8 +174,8 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 static const char version[] __devinitconst =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE "  Written by Donald Becker\n"
-KERN_INFO "   Some modifications by Eric kasten <kasten@nscl.msu.edu>\n"
-KERN_INFO "   Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n";
+"   Some modifications by Eric kasten <kasten@nscl.msu.edu>\n"
+"   Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n";
 
 
 /* IP_MF appears to be only defined in <netinet/ip.h>, however,
@@ -557,7 +558,8 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void hamachi_timer(unsigned long data);
 static void hamachi_tx_timeout(struct net_device *dev);
 static void hamachi_init_ring(struct net_device *dev);
-static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t hamachi_start_xmit(struct sk_buff *skb,
+                                     struct net_device *dev);
 static irqreturn_t hamachi_interrupt(int irq, void *dev_instance);
 static int hamachi_rx(struct net_device *dev);
 static inline int hamachi_tx(struct net_device *dev);
@@ -1080,11 +1082,14 @@ static void hamachi_tx_timeout(struct net_device *dev)
        {
                printk(KERN_DEBUG "  Rx ring %p: ", hmp->rx_ring);
                for (i = 0; i < RX_RING_SIZE; i++)
-                       printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length));
-               printk("\n"KERN_DEBUG"  Tx ring %p: ", hmp->tx_ring);
+                       printk(KERN_CONT " %8.8x",
+                              le32_to_cpu(hmp->rx_ring[i].status_n_length));
+               printk(KERN_CONT "\n");
+               printk(KERN_DEBUG"  Tx ring %p: ", hmp->tx_ring);
                for (i = 0; i < TX_RING_SIZE; i++)
-                       printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length));
-               printk("\n");
+                       printk(KERN_CONT " %4.4x",
+                              le32_to_cpu(hmp->tx_ring[i].status_n_length));
+               printk(KERN_CONT "\n");
        }
 
        /* Reinit the hardware and make sure the Rx and Tx processes
@@ -1163,7 +1168,7 @@ static void hamachi_tx_timeout(struct net_device *dev)
        hmp->rx_ring[RX_RING_SIZE-1].status_n_length |= cpu_to_le32(DescEndRing);
 
        /* Trigger an immediate transmit demand. */
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
        hmp->stats.tx_errors++;
 
        /* Restart the chip's Tx/Rx processes . */
@@ -1260,7 +1265,8 @@ do { \
 } while (0)
 #endif
 
-static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t hamachi_start_xmit(struct sk_buff *skb,
+                                     struct net_device *dev)
 {
        struct hamachi_private *hmp = netdev_priv(dev);
        unsigned entry;
@@ -1280,7 +1286,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
                status=readw(hmp->base + TxStatus);
                if( !(status & 0x0001) || (status & 0x0002))
                        writew(0x0001, hmp->base + TxCmd);
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        /* Caution: the write order is important here, set the field
@@ -1364,13 +1370,12 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
                hmp->tx_full = 1;
                netif_stop_queue(dev);
        }
-       dev->trans_start = jiffies;
 
        if (hamachi_debug > 4) {
                printk(KERN_DEBUG "%s: Hamachi transmit frame #%d queued in slot %d.\n",
                           dev->name, hmp->cur_tx, entry);
        }
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up
@@ -1754,13 +1759,13 @@ static int hamachi_close(struct net_device *dev)
 
 #ifdef __i386__
        if (hamachi_debug > 2) {
-               printk("\n"KERN_DEBUG"  Tx ring at %8.8x:\n",
+               printk(KERN_DEBUG "  Tx ring at %8.8x:\n",
                           (int)hmp->tx_ring_dma);
                for (i = 0; i < TX_RING_SIZE; i++)
-                       printk(" %c #%d desc. %8.8x %8.8x.\n",
+                       printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x.\n",
                                   readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ',
                                   i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr);
-               printk("\n"KERN_DEBUG "  Rx ring %8.8x:\n",
+               printk(KERN_DEBUG "  Rx ring %8.8x:\n",
                           (int)hmp->rx_ring_dma);
                for (i = 0; i < RX_RING_SIZE; i++) {
                        printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n",
@@ -1771,7 +1776,7 @@ static int hamachi_close(struct net_device *dev)
                                        u16 *addr = (u16 *)
                                                hmp->rx_skbuff[i]->data;
                                        int j;
-
+                                       printk(KERN_DEBUG "Addr: ");
                                        for (j = 0; j < 0x50; j++)
                                                printk(" %4.4x", addr[j]);
                                        printk("\n");