Commit daeafdc3 authored by Ralf Baechle's avatar Ralf Baechle Committed by Jeff Garzik

Convert meth to netdev_priv

And while at it loose plenty of useless casts.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 62ba7e6c
...@@ -170,7 +170,7 @@ static int mdio_probe(struct meth_private *priv) ...@@ -170,7 +170,7 @@ static int mdio_probe(struct meth_private *priv)
static void meth_check_link(struct net_device *dev) static void meth_check_link(struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long mii_advertising = mdio_read(priv, 4); unsigned long mii_advertising = mdio_read(priv, 4);
unsigned long mii_partner = mdio_read(priv, 5); unsigned long mii_partner = mdio_read(priv, 5);
unsigned long negotiated = mii_advertising & mii_partner; unsigned long negotiated = mii_advertising & mii_partner;
...@@ -268,7 +268,7 @@ static void meth_free_rx_ring(struct meth_private *priv) ...@@ -268,7 +268,7 @@ static void meth_free_rx_ring(struct meth_private *priv)
int meth_reset(struct net_device *dev) int meth_reset(struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
/* Reset card */ /* Reset card */
mace->eth.mac_ctrl = SGI_MAC_RESET; mace->eth.mac_ctrl = SGI_MAC_RESET;
...@@ -310,7 +310,7 @@ int meth_reset(struct net_device *dev) ...@@ -310,7 +310,7 @@ int meth_reset(struct net_device *dev)
*/ */
static int meth_open(struct net_device *dev) static int meth_open(struct net_device *dev)
{ {
struct meth_private *priv = dev->priv; struct meth_private *priv = netdev_priv(dev);
int ret; int ret;
priv->phy_addr = -1; /* No PHY is known yet... */ priv->phy_addr = -1; /* No PHY is known yet... */
...@@ -354,7 +354,7 @@ static int meth_open(struct net_device *dev) ...@@ -354,7 +354,7 @@ static int meth_open(struct net_device *dev)
static int meth_release(struct net_device *dev) static int meth_release(struct net_device *dev)
{ {
struct meth_private *priv = dev->priv; struct meth_private *priv = netdev_priv(dev);
DPRINTK("Stopping queue\n"); DPRINTK("Stopping queue\n");
netif_stop_queue(dev); /* can't transmit any more */ 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,7 +376,7 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
{ {
struct sk_buff *skb; struct sk_buff *skb;
unsigned long status; unsigned long status;
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8;
spin_lock(&priv->meth_lock); spin_lock(&priv->meth_lock);
...@@ -466,14 +466,14 @@ static void meth_rx(struct net_device* dev, unsigned long int_status) ...@@ -466,14 +466,14 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
static int meth_tx_full(struct net_device *dev) static int meth_tx_full(struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
return (priv->tx_count >= TX_RING_ENTRIES - 1); return (priv->tx_count >= TX_RING_ENTRIES - 1);
} }
static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
{ {
struct meth_private *priv = dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long status; unsigned long status;
struct sk_buff *skb; struct sk_buff *skb;
unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; 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,7 +536,7 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
static void meth_error(struct net_device* dev, unsigned status) static void meth_error(struct net_device* dev, unsigned status)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
printk(KERN_WARNING "meth: error status: 0x%08x\n",status); printk(KERN_WARNING "meth: error status: 0x%08x\n",status);
/* check for errors too... */ /* check for errors too... */
...@@ -570,7 +570,7 @@ static void meth_error(struct net_device* dev, unsigned status) ...@@ -570,7 +570,7 @@ static void meth_error(struct net_device* dev, unsigned status)
static irqreturn_t meth_interrupt(int irq, void *dev_id) static irqreturn_t meth_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long status; unsigned long status;
status = mace->eth.int_stat; 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,7 +695,7 @@ static void meth_add_to_tx_ring(struct meth_private *priv, struct sk_buff *skb)
*/ */
static int meth_tx(struct sk_buff *skb, struct net_device *dev) static int meth_tx(struct sk_buff *skb, struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&priv->meth_lock, flags); spin_lock_irqsave(&priv->meth_lock, flags);
...@@ -726,7 +726,7 @@ static int meth_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -726,7 +726,7 @@ static int meth_tx(struct sk_buff *skb, struct net_device *dev)
*/ */
static void meth_tx_timeout(struct net_device *dev) static void meth_tx_timeout(struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
printk(KERN_WARNING "%s: transmit timed out\n", dev->name); 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,7 +778,7 @@ static int meth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
*/ */
static struct net_device_stats *meth_stats(struct net_device *dev) static struct net_device_stats *meth_stats(struct net_device *dev)
{ {
struct meth_private *priv = (struct meth_private *) dev->priv; struct meth_private *priv = netdev_priv(dev);
return &priv->stats; return &priv->stats;
} }
...@@ -807,7 +807,7 @@ static struct net_device *meth_init(void) ...@@ -807,7 +807,7 @@ static struct net_device *meth_init(void)
dev->irq = MACE_ETHERNET_IRQ; dev->irq = MACE_ETHERNET_IRQ;
dev->base_addr = (unsigned long)&mace->eth; dev->base_addr = (unsigned long)&mace->eth;
priv = (struct meth_private *) dev->priv; priv = netdev_priv(dev);
spin_lock_init(&priv->meth_lock); spin_lock_init(&priv->meth_lock);
ret = register_netdev(dev); ret = register_netdev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment