diff options
Diffstat (limited to 'drivers/net/hp100.c')
-rw-r--r-- | drivers/net/hp100.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 55c7ed608391..247c8ca86033 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -115,6 +115,7 @@ | |||
115 | #include <linux/delay.h> | 115 | #include <linux/delay.h> |
116 | #include <linux/init.h> | 116 | #include <linux/init.h> |
117 | #include <linux/bitops.h> | 117 | #include <linux/bitops.h> |
118 | #include <linux/jiffies.h> | ||
118 | 119 | ||
119 | #include <asm/io.h> | 120 | #include <asm/io.h> |
120 | 121 | ||
@@ -1499,7 +1500,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1499 | printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); | 1500 | printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); |
1500 | #endif | 1501 | #endif |
1501 | /* not waited long enough since last tx? */ | 1502 | /* not waited long enough since last tx? */ |
1502 | if (jiffies - dev->trans_start < HZ) | 1503 | if (time_before(jiffies, dev->trans_start + HZ)) |
1503 | return -EAGAIN; | 1504 | return -EAGAIN; |
1504 | 1505 | ||
1505 | if (hp100_check_lan(dev)) | 1506 | if (hp100_check_lan(dev)) |
@@ -1652,7 +1653,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1652 | printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i); | 1653 | printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i); |
1653 | #endif | 1654 | #endif |
1654 | /* not waited long enough since last failed tx try? */ | 1655 | /* not waited long enough since last failed tx try? */ |
1655 | if (jiffies - dev->trans_start < HZ) { | 1656 | if (time_before(jiffies, dev->trans_start + HZ)) { |
1656 | #ifdef HP100_DEBUG | 1657 | #ifdef HP100_DEBUG |
1657 | printk("hp100: %s: trans_start timing problem\n", | 1658 | printk("hp100: %s: trans_start timing problem\n", |
1658 | dev->name); | 1659 | dev->name); |
@@ -1718,17 +1719,10 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1718 | hp100_outw(i, FRAGMENT_LEN); /* and first/only fragment length */ | 1719 | hp100_outw(i, FRAGMENT_LEN); /* and first/only fragment length */ |
1719 | 1720 | ||
1720 | if (lp->mode == 2) { /* memory mapped */ | 1721 | if (lp->mode == 2) { /* memory mapped */ |
1721 | if (lp->mem_ptr_virt) { /* high pci memory was remapped */ | 1722 | /* Note: The J2585B needs alignment to 32bits here! */ |
1722 | /* Note: The J2585B needs alignment to 32bits here! */ | 1723 | memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3); |
1723 | memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3); | 1724 | if (!ok_flag) |
1724 | if (!ok_flag) | 1725 | memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len); |
1725 | memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len); | ||
1726 | } else { | ||
1727 | /* Note: The J2585B needs alignment to 32bits here! */ | ||
1728 | isa_memcpy_toio(lp->mem_ptr_phys, skb->data, (skb->len + 3) & ~3); | ||
1729 | if (!ok_flag) | ||
1730 | isa_memset_io(lp->mem_ptr_phys, 0, HP100_MIN_PACKET_SIZE - skb->len); | ||
1731 | } | ||
1732 | } else { /* programmed i/o */ | 1726 | } else { /* programmed i/o */ |
1733 | outsl(ioaddr + HP100_REG_DATA32, skb->data, | 1727 | outsl(ioaddr + HP100_REG_DATA32, skb->data, |
1734 | (skb->len + 3) >> 2); | 1728 | (skb->len + 3) >> 2); |
@@ -1798,10 +1792,7 @@ static void hp100_rx(struct net_device *dev) | |||
1798 | /* First we get the header, which contains information about the */ | 1792 | /* First we get the header, which contains information about the */ |
1799 | /* actual length of the received packet. */ | 1793 | /* actual length of the received packet. */ |
1800 | if (lp->mode == 2) { /* memory mapped mode */ | 1794 | if (lp->mode == 2) { /* memory mapped mode */ |
1801 | if (lp->mem_ptr_virt) /* if memory was remapped */ | 1795 | header = readl(lp->mem_ptr_virt); |
1802 | header = readl(lp->mem_ptr_virt); | ||
1803 | else | ||
1804 | header = isa_readl(lp->mem_ptr_phys); | ||
1805 | } else /* programmed i/o */ | 1796 | } else /* programmed i/o */ |
1806 | header = hp100_inl(DATA32); | 1797 | header = hp100_inl(DATA32); |
1807 | 1798 | ||
@@ -1833,13 +1824,9 @@ static void hp100_rx(struct net_device *dev) | |||
1833 | ptr = skb->data; | 1824 | ptr = skb->data; |
1834 | 1825 | ||
1835 | /* Now transfer the data from the card into that area */ | 1826 | /* Now transfer the data from the card into that area */ |
1836 | if (lp->mode == 2) { | 1827 | if (lp->mode == 2) |
1837 | if (lp->mem_ptr_virt) | 1828 | memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len); |
1838 | memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len); | 1829 | else /* io mapped */ |
1839 | /* Note alignment to 32bit transfers */ | ||
1840 | else | ||
1841 | isa_memcpy_fromio(ptr, lp->mem_ptr_phys, pkt_len); | ||
1842 | } else /* io mapped */ | ||
1843 | insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2); | 1830 | insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2); |
1844 | 1831 | ||
1845 | skb->protocol = eth_type_trans(skb, dev); | 1832 | skb->protocol = eth_type_trans(skb, dev); |