]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/hp100.c
Merge branch 'viro'
[karo-tx-linux.git] / drivers / net / hp100.c
index b71fab6e34f4268e0dc53ad9d675cac3f998309a..247c8ca86033693bfe99b01680ede5a54a3fe5f2 100644 (file)
@@ -96,7 +96,6 @@
 
 #undef HP100_MULTICAST_FILTER  /* Need to be debugged... */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/io.h>
 
@@ -277,7 +277,7 @@ static void hp100_RegisterDump(struct net_device *dev);
  * Convert an address in a kernel buffer to a bus/phys/dma address.
  * This work *only* for memory fragments part of lp->page_vaddr,
  * because it was properly DMA allocated via pci_alloc_consistent(),
- * so we just need to "retreive" the original mapping to bus/phys/dma
+ * so we just need to "retrieve" the original mapping to bus/phys/dma
  * address - Jean II */
 static inline dma_addr_t virt_to_whatever(struct net_device *dev, u32 * ptr)
 {
@@ -1500,7 +1500,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
                printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name);
 #endif
                /* not waited long enough since last tx? */
-               if (jiffies - dev->trans_start < HZ)
+               if (time_before(jiffies, dev->trans_start + HZ))
                        return -EAGAIN;
 
                if (hp100_check_lan(dev))
@@ -1653,7 +1653,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
                printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i);
 #endif
                /* not waited long enough since last failed tx try? */
-               if (jiffies - dev->trans_start < HZ) {
+               if (time_before(jiffies, dev->trans_start + HZ)) {
 #ifdef HP100_DEBUG
                        printk("hp100: %s: trans_start timing problem\n",
                               dev->name);
@@ -1719,17 +1719,10 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
        hp100_outw(i, FRAGMENT_LEN);    /* and first/only fragment length    */
 
        if (lp->mode == 2) {    /* memory mapped */
-               if (lp->mem_ptr_virt) { /* high pci memory was remapped */
-                       /* Note: The J2585B needs alignment to 32bits here!  */
-                       memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3);
-                       if (!ok_flag)
-                               memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
-               } else {
-                       /* Note: The J2585B needs alignment to 32bits here!  */
-                       isa_memcpy_toio(lp->mem_ptr_phys, skb->data, (skb->len + 3) & ~3);
-                       if (!ok_flag)
-                               isa_memset_io(lp->mem_ptr_phys, 0, HP100_MIN_PACKET_SIZE - skb->len);
-               }
+               /* Note: The J2585B needs alignment to 32bits here!  */
+               memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3);
+               if (!ok_flag)
+                       memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
        } else {                /* programmed i/o */
                outsl(ioaddr + HP100_REG_DATA32, skb->data,
                      (skb->len + 3) >> 2);
@@ -1799,10 +1792,7 @@ static void hp100_rx(struct net_device *dev)
                /* First we get the header, which contains information about the */
                /* actual length of the received packet. */
                if (lp->mode == 2) {    /* memory mapped mode */
-                       if (lp->mem_ptr_virt)   /* if memory was remapped */
-                               header = readl(lp->mem_ptr_virt);
-                       else
-                               header = isa_readl(lp->mem_ptr_phys);
+                       header = readl(lp->mem_ptr_virt);
                } else          /* programmed i/o */
                        header = hp100_inl(DATA32);
 
@@ -1834,13 +1824,9 @@ static void hp100_rx(struct net_device *dev)
                        ptr = skb->data;
 
                        /* Now transfer the data from the card into that area */
-                       if (lp->mode == 2) {
-                               if (lp->mem_ptr_virt)
-                                       memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len);
-                               /* Note alignment to 32bit transfers */
-                               else
-                                       isa_memcpy_fromio(ptr, lp->mem_ptr_phys, pkt_len);
-                       } else  /* io mapped */
+                       if (lp->mode == 2)
+                               memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len);
+                       else    /* io mapped */
                                insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2);
 
                        skb->protocol = eth_type_trans(skb, dev);