diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/net/mace.c | |
parent | 3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff) | |
parent | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff) |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/net/mace.c')
-rw-r--r-- | drivers/net/mace.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 451acdca2a21..feebbd92aff2 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -101,7 +101,6 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
101 | struct mace_data *mp; | 101 | struct mace_data *mp; |
102 | const unsigned char *addr; | 102 | const unsigned char *addr; |
103 | int j, rev, rc = -EBUSY; | 103 | int j, rev, rc = -EBUSY; |
104 | DECLARE_MAC_BUF(mac); | ||
105 | 104 | ||
106 | if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { | 105 | if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { |
107 | printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n", | 106 | printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n", |
@@ -144,7 +143,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
144 | } | 143 | } |
145 | SET_NETDEV_DEV(dev, &mdev->ofdev.dev); | 144 | SET_NETDEV_DEV(dev, &mdev->ofdev.dev); |
146 | 145 | ||
147 | mp = dev->priv; | 146 | mp = netdev_priv(dev); |
148 | mp->mdev = mdev; | 147 | mp->mdev = mdev; |
149 | macio_set_drvdata(mdev, dev); | 148 | macio_set_drvdata(mdev, dev); |
150 | 149 | ||
@@ -165,7 +164,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
165 | in_8(&mp->mace->chipid_lo); | 164 | in_8(&mp->mace->chipid_lo); |
166 | 165 | ||
167 | 166 | ||
168 | mp = (struct mace_data *) dev->priv; | 167 | mp = netdev_priv(dev); |
169 | mp->maccc = ENXMT | ENRCV; | 168 | mp->maccc = ENXMT | ENRCV; |
170 | 169 | ||
171 | mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000); | 170 | mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000); |
@@ -241,8 +240,8 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
241 | goto err_free_rx_irq; | 240 | goto err_free_rx_irq; |
242 | } | 241 | } |
243 | 242 | ||
244 | printk(KERN_INFO "%s: MACE at %s, chip revision %d.%d\n", | 243 | printk(KERN_INFO "%s: MACE at %pM, chip revision %d.%d\n", |
245 | dev->name, print_mac(mac, dev->dev_addr), | 244 | dev->name, dev->dev_addr, |
246 | mp->chipid >> 8, mp->chipid & 0xff); | 245 | mp->chipid >> 8, mp->chipid & 0xff); |
247 | 246 | ||
248 | return 0; | 247 | return 0; |
@@ -276,7 +275,7 @@ static int __devexit mace_remove(struct macio_dev *mdev) | |||
276 | 275 | ||
277 | macio_set_drvdata(mdev, NULL); | 276 | macio_set_drvdata(mdev, NULL); |
278 | 277 | ||
279 | mp = dev->priv; | 278 | mp = netdev_priv(dev); |
280 | 279 | ||
281 | unregister_netdev(dev); | 280 | unregister_netdev(dev); |
282 | 281 | ||
@@ -312,7 +311,7 @@ static void dbdma_reset(volatile struct dbdma_regs __iomem *dma) | |||
312 | 311 | ||
313 | static void mace_reset(struct net_device *dev) | 312 | static void mace_reset(struct net_device *dev) |
314 | { | 313 | { |
315 | struct mace_data *mp = (struct mace_data *) dev->priv; | 314 | struct mace_data *mp = netdev_priv(dev); |
316 | volatile struct mace __iomem *mb = mp->mace; | 315 | volatile struct mace __iomem *mb = mp->mace; |
317 | int i; | 316 | int i; |
318 | 317 | ||
@@ -367,7 +366,7 @@ static void mace_reset(struct net_device *dev) | |||
367 | 366 | ||
368 | static void __mace_set_address(struct net_device *dev, void *addr) | 367 | static void __mace_set_address(struct net_device *dev, void *addr) |
369 | { | 368 | { |
370 | struct mace_data *mp = (struct mace_data *) dev->priv; | 369 | struct mace_data *mp = netdev_priv(dev); |
371 | volatile struct mace __iomem *mb = mp->mace; | 370 | volatile struct mace __iomem *mb = mp->mace; |
372 | unsigned char *p = addr; | 371 | unsigned char *p = addr; |
373 | int i; | 372 | int i; |
@@ -388,7 +387,7 @@ static void __mace_set_address(struct net_device *dev, void *addr) | |||
388 | 387 | ||
389 | static int mace_set_address(struct net_device *dev, void *addr) | 388 | static int mace_set_address(struct net_device *dev, void *addr) |
390 | { | 389 | { |
391 | struct mace_data *mp = (struct mace_data *) dev->priv; | 390 | struct mace_data *mp = netdev_priv(dev); |
392 | volatile struct mace __iomem *mb = mp->mace; | 391 | volatile struct mace __iomem *mb = mp->mace; |
393 | unsigned long flags; | 392 | unsigned long flags; |
394 | 393 | ||
@@ -423,7 +422,7 @@ static inline void mace_clean_rings(struct mace_data *mp) | |||
423 | 422 | ||
424 | static int mace_open(struct net_device *dev) | 423 | static int mace_open(struct net_device *dev) |
425 | { | 424 | { |
426 | struct mace_data *mp = (struct mace_data *) dev->priv; | 425 | struct mace_data *mp = netdev_priv(dev); |
427 | volatile struct mace __iomem *mb = mp->mace; | 426 | volatile struct mace __iomem *mb = mp->mace; |
428 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; | 427 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; |
429 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; | 428 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; |
@@ -493,7 +492,7 @@ static int mace_open(struct net_device *dev) | |||
493 | 492 | ||
494 | static int mace_close(struct net_device *dev) | 493 | static int mace_close(struct net_device *dev) |
495 | { | 494 | { |
496 | struct mace_data *mp = (struct mace_data *) dev->priv; | 495 | struct mace_data *mp = netdev_priv(dev); |
497 | volatile struct mace __iomem *mb = mp->mace; | 496 | volatile struct mace __iomem *mb = mp->mace; |
498 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; | 497 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; |
499 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; | 498 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; |
@@ -513,7 +512,7 @@ static int mace_close(struct net_device *dev) | |||
513 | 512 | ||
514 | static inline void mace_set_timeout(struct net_device *dev) | 513 | static inline void mace_set_timeout(struct net_device *dev) |
515 | { | 514 | { |
516 | struct mace_data *mp = (struct mace_data *) dev->priv; | 515 | struct mace_data *mp = netdev_priv(dev); |
517 | 516 | ||
518 | if (mp->timeout_active) | 517 | if (mp->timeout_active) |
519 | del_timer(&mp->tx_timeout); | 518 | del_timer(&mp->tx_timeout); |
@@ -526,7 +525,7 @@ static inline void mace_set_timeout(struct net_device *dev) | |||
526 | 525 | ||
527 | static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) | 526 | static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) |
528 | { | 527 | { |
529 | struct mace_data *mp = (struct mace_data *) dev->priv; | 528 | struct mace_data *mp = netdev_priv(dev); |
530 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; | 529 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; |
531 | volatile struct dbdma_cmd *cp, *np; | 530 | volatile struct dbdma_cmd *cp, *np; |
532 | unsigned long flags; | 531 | unsigned long flags; |
@@ -581,7 +580,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) | |||
581 | 580 | ||
582 | static void mace_set_multicast(struct net_device *dev) | 581 | static void mace_set_multicast(struct net_device *dev) |
583 | { | 582 | { |
584 | struct mace_data *mp = (struct mace_data *) dev->priv; | 583 | struct mace_data *mp = netdev_priv(dev); |
585 | volatile struct mace __iomem *mb = mp->mace; | 584 | volatile struct mace __iomem *mb = mp->mace; |
586 | int i, j; | 585 | int i, j; |
587 | u32 crc; | 586 | u32 crc; |
@@ -656,7 +655,7 @@ static void mace_handle_misc_intrs(struct mace_data *mp, int intr, struct net_de | |||
656 | static irqreturn_t mace_interrupt(int irq, void *dev_id) | 655 | static irqreturn_t mace_interrupt(int irq, void *dev_id) |
657 | { | 656 | { |
658 | struct net_device *dev = (struct net_device *) dev_id; | 657 | struct net_device *dev = (struct net_device *) dev_id; |
659 | struct mace_data *mp = (struct mace_data *) dev->priv; | 658 | struct mace_data *mp = netdev_priv(dev); |
660 | volatile struct mace __iomem *mb = mp->mace; | 659 | volatile struct mace __iomem *mb = mp->mace; |
661 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; | 660 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; |
662 | volatile struct dbdma_cmd *cp; | 661 | volatile struct dbdma_cmd *cp; |
@@ -802,7 +801,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
802 | static void mace_tx_timeout(unsigned long data) | 801 | static void mace_tx_timeout(unsigned long data) |
803 | { | 802 | { |
804 | struct net_device *dev = (struct net_device *) data; | 803 | struct net_device *dev = (struct net_device *) data; |
805 | struct mace_data *mp = (struct mace_data *) dev->priv; | 804 | struct mace_data *mp = netdev_priv(dev); |
806 | volatile struct mace __iomem *mb = mp->mace; | 805 | volatile struct mace __iomem *mb = mp->mace; |
807 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; | 806 | volatile struct dbdma_regs __iomem *td = mp->tx_dma; |
808 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; | 807 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; |
@@ -873,7 +872,7 @@ static irqreturn_t mace_txdma_intr(int irq, void *dev_id) | |||
873 | static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) | 872 | static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) |
874 | { | 873 | { |
875 | struct net_device *dev = (struct net_device *) dev_id; | 874 | struct net_device *dev = (struct net_device *) dev_id; |
876 | struct mace_data *mp = (struct mace_data *) dev->priv; | 875 | struct mace_data *mp = netdev_priv(dev); |
877 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; | 876 | volatile struct dbdma_regs __iomem *rd = mp->rx_dma; |
878 | volatile struct dbdma_cmd *cp, *np; | 877 | volatile struct dbdma_cmd *cp, *np; |
879 | int i, nb, stat, next; | 878 | int i, nb, stat, next; |
@@ -929,7 +928,6 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) | |||
929 | skb->protocol = eth_type_trans(skb, dev); | 928 | skb->protocol = eth_type_trans(skb, dev); |
930 | dev->stats.rx_bytes += skb->len; | 929 | dev->stats.rx_bytes += skb->len; |
931 | netif_rx(skb); | 930 | netif_rx(skb); |
932 | dev->last_rx = jiffies; | ||
933 | mp->rx_bufs[i] = NULL; | 931 | mp->rx_bufs[i] = NULL; |
934 | ++dev->stats.rx_packets; | 932 | ++dev->stats.rx_packets; |
935 | } | 933 | } |