Skip to content

Commit

Permalink
netdevice: 82596: Convert netdev->priv to netdev_priv
Browse files Browse the repository at this point in the history
1. When alloc_etherdev(), no memory be allocated to netdev->priv.
2. And it's need to get a whole page for priv.

For these reasons, use netdev->ml_priv to point to the page is the
best method to convert directly reference of netdev->priv.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wang Chen authored and David S. Miller committed Nov 20, 2008
1 parent d214c75 commit f3a216d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions drivers/net/82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static inline int wait_cfg(struct net_device *dev, struct i596_cmd *cmd, int del

static void i596_display_data(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
struct i596_cmd *cmd;
struct i596_rfd *rfd;
struct i596_rbd *rbd;
Expand Down Expand Up @@ -527,7 +527,7 @@ static irqreturn_t i596_error(int irq, void *dev_id)

static inline void init_rx_bufs(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
int i;
struct i596_rfd *rfd;
struct i596_rbd *rbd;
Expand Down Expand Up @@ -578,7 +578,7 @@ static inline void init_rx_bufs(struct net_device *dev)

static inline void remove_rx_bufs(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
struct i596_rbd *rbd;
int i;

Expand All @@ -592,7 +592,7 @@ static inline void remove_rx_bufs(struct net_device *dev)

static void rebuild_rx_bufs(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
int i;

/* Ensure rx frame/buffer descriptors are tidy */
Expand All @@ -611,7 +611,7 @@ static void rebuild_rx_bufs(struct net_device *dev)

static int init_i596_mem(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET) || defined(ENABLE_APRICOT)
short ioaddr = dev->base_addr;
#endif
Expand Down Expand Up @@ -764,7 +764,7 @@ static int init_i596_mem(struct net_device *dev)

static inline int i596_rx(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
struct i596_rfd *rfd;
struct i596_rbd *rbd;
int frames = 0;
Expand Down Expand Up @@ -958,7 +958,7 @@ static void i596_reset(struct net_device *dev, struct i596_private *lp,

static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
int ioaddr = dev->base_addr;
unsigned long flags;

Expand Down Expand Up @@ -1028,7 +1028,7 @@ static int i596_open(struct net_device *dev)

static void i596_tx_timeout (struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
int ioaddr = dev->base_addr;

/* Transmitter timeout, serious problems. */
Expand Down Expand Up @@ -1057,7 +1057,7 @@ static void i596_tx_timeout (struct net_device *dev)

static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
struct tx_cmd *tx_cmd;
struct i596_tbd *tbd;
short length = skb->len;
Expand Down Expand Up @@ -1239,9 +1239,9 @@ struct net_device * __init i82596_probe(int unit)
dev->tx_timeout = i596_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;

dev->priv = (void *)(dev->mem_start);
dev->ml_priv = (void *)(dev->mem_start);

lp = dev->priv;
lp = dev->ml_priv;
DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%zd bytes), "
"lp->scb at 0x%08lx\n",
dev->name, (unsigned long)lp,
Expand Down Expand Up @@ -1302,7 +1302,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)
}

ioaddr = dev->base_addr;
lp = dev->priv;
lp = dev->ml_priv;

spin_lock (&lp->lock);

Expand Down Expand Up @@ -1445,7 +1445,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)

static int i596_close(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
unsigned long flags;

netif_stop_queue(dev);
Expand Down Expand Up @@ -1495,7 +1495,7 @@ static int i596_close(struct net_device *dev)

static void set_multicast_list(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
struct i596_private *lp = dev->ml_priv;
int config = 0, cnt;

DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
Expand Down

0 comments on commit f3a216d

Please sign in to comment.