.. | .. |
---|
5 | 5 | */ |
---|
6 | 6 | |
---|
7 | 7 | #include <linux/module.h> |
---|
| 8 | +#include <linux/pgtable.h> |
---|
8 | 9 | |
---|
9 | 10 | #include <linux/kernel.h> |
---|
10 | 11 | #include <linux/types.h> |
---|
.. | .. |
---|
34 | 35 | #include <asm/io.h> |
---|
35 | 36 | #include <asm/openprom.h> |
---|
36 | 37 | #include <asm/oplib.h> |
---|
37 | | -#include <asm/pgtable.h> |
---|
38 | 38 | |
---|
39 | 39 | #include "sunbmac.h" |
---|
40 | 40 | |
---|
.. | .. |
---|
209 | 209 | } |
---|
210 | 210 | } |
---|
211 | 211 | |
---|
212 | | -static void bigmac_init_rings(struct bigmac *bp, int from_irq) |
---|
| 212 | +static void bigmac_init_rings(struct bigmac *bp, bool non_blocking) |
---|
213 | 213 | { |
---|
214 | 214 | struct bmac_init_block *bb = bp->bmac_block; |
---|
215 | 215 | int i; |
---|
216 | 216 | gfp_t gfp_flags = GFP_KERNEL; |
---|
217 | 217 | |
---|
218 | | - if (from_irq || in_interrupt()) |
---|
| 218 | + if (non_blocking) |
---|
219 | 219 | gfp_flags = GFP_ATOMIC; |
---|
220 | 220 | |
---|
221 | 221 | bp->rx_new = bp->rx_old = bp->tx_new = bp->tx_old = 0; |
---|
.. | .. |
---|
489 | 489 | } |
---|
490 | 490 | } |
---|
491 | 491 | |
---|
492 | | -static int bigmac_init_hw(struct bigmac *, int); |
---|
| 492 | +static int bigmac_init_hw(struct bigmac *, bool); |
---|
493 | 493 | |
---|
494 | 494 | static int try_next_permutation(struct bigmac *bp, void __iomem *tregs) |
---|
495 | 495 | { |
---|
.. | .. |
---|
549 | 549 | if (ret == -1) { |
---|
550 | 550 | printk(KERN_ERR "%s: Link down, cable problem?\n", |
---|
551 | 551 | bp->dev->name); |
---|
552 | | - ret = bigmac_init_hw(bp, 0); |
---|
| 552 | + ret = bigmac_init_hw(bp, true); |
---|
553 | 553 | if (ret) { |
---|
554 | 554 | printk(KERN_ERR "%s: Error, cannot re-init the " |
---|
555 | 555 | "BigMAC.\n", bp->dev->name); |
---|
.. | .. |
---|
617 | 617 | add_timer(&bp->bigmac_timer); |
---|
618 | 618 | } |
---|
619 | 619 | |
---|
620 | | -static int bigmac_init_hw(struct bigmac *bp, int from_irq) |
---|
| 620 | +static int bigmac_init_hw(struct bigmac *bp, bool non_blocking) |
---|
621 | 621 | { |
---|
622 | 622 | void __iomem *gregs = bp->gregs; |
---|
623 | 623 | void __iomem *cregs = bp->creg; |
---|
.. | .. |
---|
635 | 635 | qec_init(bp); |
---|
636 | 636 | |
---|
637 | 637 | /* Alloc and reset the tx/rx descriptor chains. */ |
---|
638 | | - bigmac_init_rings(bp, from_irq); |
---|
| 638 | + bigmac_init_rings(bp, non_blocking); |
---|
639 | 639 | |
---|
640 | 640 | /* Initialize the PHY. */ |
---|
641 | 641 | bigmac_tcvr_init(bp); |
---|
.. | .. |
---|
749 | 749 | } |
---|
750 | 750 | |
---|
751 | 751 | printk(" RESET\n"); |
---|
752 | | - bigmac_init_hw(bp, 1); |
---|
| 752 | + bigmac_init_hw(bp, true); |
---|
753 | 753 | } |
---|
754 | 754 | |
---|
755 | 755 | /* BigMAC transmit complete service routines. */ |
---|
.. | .. |
---|
781 | 781 | |
---|
782 | 782 | DTX(("skb(%p) ", skb)); |
---|
783 | 783 | bp->tx_skbs[elem] = NULL; |
---|
784 | | - dev_kfree_skb_irq(skb); |
---|
| 784 | + dev_consume_skb_irq(skb); |
---|
785 | 785 | |
---|
786 | 786 | elem = NEXT_TX(elem); |
---|
787 | 787 | } |
---|
.. | .. |
---|
921 | 921 | return ret; |
---|
922 | 922 | } |
---|
923 | 923 | timer_setup(&bp->bigmac_timer, bigmac_timer, 0); |
---|
924 | | - ret = bigmac_init_hw(bp, 0); |
---|
| 924 | + ret = bigmac_init_hw(bp, false); |
---|
925 | 925 | if (ret) |
---|
926 | 926 | free_irq(dev->irq, bp); |
---|
927 | 927 | return ret; |
---|
.. | .. |
---|
941 | 941 | return 0; |
---|
942 | 942 | } |
---|
943 | 943 | |
---|
944 | | -static void bigmac_tx_timeout(struct net_device *dev) |
---|
| 944 | +static void bigmac_tx_timeout(struct net_device *dev, unsigned int txqueue) |
---|
945 | 945 | { |
---|
946 | 946 | struct bigmac *bp = netdev_priv(dev); |
---|
947 | 947 | |
---|
948 | | - bigmac_init_hw(bp, 0); |
---|
| 948 | + bigmac_init_hw(bp, true); |
---|
949 | 949 | netif_wake_queue(dev); |
---|
950 | 950 | } |
---|
951 | 951 | |
---|