aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-02-16 07:52:17 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-17 15:30:47 -0500
commitdaeafdc360f91d286490105e67b13f094381e23f (patch)
tree79f8b74732b39fe386c16196cf4f493639e547cd /drivers/net
parent62ba7e6cfdf6a6e20c77bacdfa15e07859fced45 (diff)
Convert meth to netdev_priv
And while at it loose plenty of useless casts. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/meth.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index d38b7c723620..7e69ca6edd91 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -170,7 +170,7 @@ static int mdio_probe(struct meth_private *priv)
170 170
171static void meth_check_link(struct net_device *dev) 171static void meth_check_link(struct net_device *dev)
172{ 172{
173 struct meth_private *priv = (struct meth_private *) dev->priv; 173 struct meth_private *priv = netdev_priv(dev);
174 unsigned long mii_advertising = mdio_read(priv, 4); 174 unsigned long mii_advertising = mdio_read(priv, 4);
175 unsigned long mii_partner = mdio_read(priv, 5); 175 unsigned long mii_partner = mdio_read(priv, 5);
176 unsigned long negotiated = mii_advertising & mii_partner; 176 unsigned long negotiated = mii_advertising & mii_partner;
@@ -268,7 +268,7 @@ static void meth_free_rx_ring(struct meth_private *priv)
268 268
269int meth_reset(struct net_device *dev) 269int meth_reset(struct net_device *dev)
270{ 270{
271 struct meth_private *priv = (struct meth_private *) dev->priv; 271 struct meth_private *priv = netdev_priv(dev);
272 272
273 /* Reset card */ 273 /* Reset card */
274 mace->eth.mac_ctrl = SGI_MAC_RESET; 274 mace->eth.mac_ctrl = SGI_MAC_RESET;
@@ -310,7 +310,7 @@ int meth_reset(struct net_device *dev)
310 */ 310 */
311static int meth_open(struct net_device *dev) 311static int meth_open(struct net_device *dev)
312{ 312{
313 struct meth_private *priv = dev->priv; 313 struct meth_private *priv = netdev_priv(dev);
314 int ret; 314 int ret;
315 315
316 priv->phy_addr = -1; /* No PHY is known yet... */ 316 priv->phy_addr = -1; /* No PHY is known yet... */
@@ -354,7 +354,7 @@ out_free_tx_ring:
354 354
355static int meth_release(struct net_device *dev) 355static int meth_release(struct net_device *dev)
356{ 356{
357 struct meth_private *priv = dev->priv; 357 struct meth_private *priv = netdev_priv(dev);
358 358
359 DPRINTK("Stopping queue\n"); 359 DPRINTK("Stopping queue\n");
360 netif_stop_queue(dev); /* can't transmit any more */ 360 netif_stop_queue(dev); /* can't transmit any more */
@@ -376,7 +376,7 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
376{ 376{
377 struct sk_buff *skb; 377 struct sk_buff *skb;
378 unsigned long status; 378 unsigned long status;
379 struct meth_private *priv = (struct meth_private *) dev->priv; 379 struct meth_private *priv = netdev_priv(dev);
380 unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; 380 unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8;
381 381
382 spin_lock(&priv->meth_lock); 382 spin_lock(&priv->meth_lock);
@@ -466,14 +466,14 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
466 466
467static int meth_tx_full(struct net_device *dev) 467static int meth_tx_full(struct net_device *dev)
468{ 468{
469 struct meth_private *priv = (struct meth_private *) dev->priv; 469 struct meth_private *priv = netdev_priv(dev);
470 470
471 return (priv->tx_count >= TX_RING_ENTRIES - 1); 471 return (priv->tx_count >= TX_RING_ENTRIES - 1);
472} 472}
473 473
474static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) 474static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
475{ 475{
476 struct meth_private *priv = dev->priv; 476 struct meth_private *priv = netdev_priv(dev);
477 unsigned long status; 477 unsigned long status;
478 struct sk_buff *skb; 478 struct sk_buff *skb;
479 unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; 479 unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16;
@@ -536,7 +536,7 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
536 536
537static void meth_error(struct net_device* dev, unsigned status) 537static void meth_error(struct net_device* dev, unsigned status)
538{ 538{
539 struct meth_private *priv = (struct meth_private *) dev->priv; 539 struct meth_private *priv = netdev_priv(dev);
540 540
541 printk(KERN_WARNING "meth: error status: 0x%08x\n",status); 541 printk(KERN_WARNING "meth: error status: 0x%08x\n",status);
542 /* check for errors too... */ 542 /* check for errors too... */
@@ -570,7 +570,7 @@ static void meth_error(struct net_device* dev, unsigned status)
570static irqreturn_t meth_interrupt(int irq, void *dev_id) 570static irqreturn_t meth_interrupt(int irq, void *dev_id)
571{ 571{
572 struct net_device *dev = (struct net_device *)dev_id; 572 struct net_device *dev = (struct net_device *)dev_id;
573 struct meth_private *priv = (struct meth_private *) dev->priv; 573 struct meth_private *priv = netdev_priv(dev);
574 unsigned long status; 574 unsigned long status;
575 575
576 status = mace->eth.int_stat; 576 status = mace->eth.int_stat;
@@ -695,7 +695,7 @@ static void meth_add_to_tx_ring(struct meth_private *priv, struct sk_buff *skb)
695 */ 695 */
696static int meth_tx(struct sk_buff *skb, struct net_device *dev) 696static int meth_tx(struct sk_buff *skb, struct net_device *dev)
697{ 697{
698 struct meth_private *priv = (struct meth_private *) dev->priv; 698 struct meth_private *priv = netdev_priv(dev);
699 unsigned long flags; 699 unsigned long flags;
700 700
701 spin_lock_irqsave(&priv->meth_lock, flags); 701 spin_lock_irqsave(&priv->meth_lock, flags);
@@ -726,7 +726,7 @@ static int meth_tx(struct sk_buff *skb, struct net_device *dev)
726 */ 726 */
727static void meth_tx_timeout(struct net_device *dev) 727static void meth_tx_timeout(struct net_device *dev)
728{ 728{
729 struct meth_private *priv = (struct meth_private *) dev->priv; 729 struct meth_private *priv = netdev_priv(dev);
730 unsigned long flags; 730 unsigned long flags;
731 731
732 printk(KERN_WARNING "%s: transmit timed out\n", dev->name); 732 printk(KERN_WARNING "%s: transmit timed out\n", dev->name);
@@ -778,7 +778,7 @@ static int meth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
778 */ 778 */
779static struct net_device_stats *meth_stats(struct net_device *dev) 779static struct net_device_stats *meth_stats(struct net_device *dev)
780{ 780{
781 struct meth_private *priv = (struct meth_private *) dev->priv; 781 struct meth_private *priv = netdev_priv(dev);
782 return &priv->stats; 782 return &priv->stats;
783} 783}
784 784
@@ -807,7 +807,7 @@ static struct net_device *meth_init(void)
807 dev->irq = MACE_ETHERNET_IRQ; 807 dev->irq = MACE_ETHERNET_IRQ;
808 dev->base_addr = (unsigned long)&mace->eth; 808 dev->base_addr = (unsigned long)&mace->eth;
809 809
810 priv = (struct meth_private *) dev->priv; 810 priv = netdev_priv(dev);
811 spin_lock_init(&priv->meth_lock); 811 spin_lock_init(&priv->meth_lock);
812 812
813 ret = register_netdev(dev); 813 ret = register_netdev(dev);