Commit a0e05a8c authored by Randy Dunlap's avatar Randy Dunlap Committed by Jeff Garzik

[PATCH] use netdev_priv() in net/arm drivers

parent 184915a8
...@@ -196,7 +196,7 @@ am79c961_ramtest(struct net_device *dev, unsigned int val) ...@@ -196,7 +196,7 @@ am79c961_ramtest(struct net_device *dev, unsigned int val)
static void static void
am79c961_init_for_open(struct net_device *dev) am79c961_init_for_open(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
unsigned char *p; unsigned char *p;
u_int hdr_addr, first_free_addr; u_int hdr_addr, first_free_addr;
...@@ -271,7 +271,7 @@ am79c961_init_for_open(struct net_device *dev) ...@@ -271,7 +271,7 @@ am79c961_init_for_open(struct net_device *dev)
static void am79c961_timer(unsigned long data) static void am79c961_timer(unsigned long data)
{ {
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned int lnkstat, carrier; unsigned int lnkstat, carrier;
lnkstat = read_ireg(dev->base_addr, ISALED0) & ISALED0_LNKST; lnkstat = read_ireg(dev->base_addr, ISALED0) & ISALED0_LNKST;
...@@ -291,7 +291,7 @@ static void am79c961_timer(unsigned long data) ...@@ -291,7 +291,7 @@ static void am79c961_timer(unsigned long data)
static int static int
am79c961_open(struct net_device *dev) am79c961_open(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
int ret; int ret;
memset (&priv->stats, 0, sizeof (priv->stats)); memset (&priv->stats, 0, sizeof (priv->stats));
...@@ -318,7 +318,7 @@ am79c961_open(struct net_device *dev) ...@@ -318,7 +318,7 @@ am79c961_open(struct net_device *dev)
static int static int
am79c961_close(struct net_device *dev) am79c961_close(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
del_timer_sync(&priv->timer); del_timer_sync(&priv->timer);
...@@ -341,7 +341,7 @@ am79c961_close(struct net_device *dev) ...@@ -341,7 +341,7 @@ am79c961_close(struct net_device *dev)
*/ */
static struct net_device_stats *am79c961_getstats (struct net_device *dev) static struct net_device_stats *am79c961_getstats (struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
return &priv->stats; return &priv->stats;
} }
...@@ -365,7 +365,7 @@ static void am79c961_mc_hash(struct dev_mc_list *dmi, unsigned short *hash) ...@@ -365,7 +365,7 @@ static void am79c961_mc_hash(struct dev_mc_list *dmi, unsigned short *hash)
*/ */
static void am79c961_setmulticastlist (struct net_device *dev) static void am79c961_setmulticastlist (struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
unsigned short multi_hash[4], mode; unsigned short multi_hash[4], mode;
int i, stopped; int i, stopped;
...@@ -444,7 +444,7 @@ static void am79c961_timeout(struct net_device *dev) ...@@ -444,7 +444,7 @@ static void am79c961_timeout(struct net_device *dev)
static int static int
am79c961_sendpacket(struct sk_buff *skb, struct net_device *dev) am79c961_sendpacket(struct sk_buff *skb, struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned int hdraddr, bufaddr; unsigned int hdraddr, bufaddr;
unsigned int head; unsigned int head;
unsigned long flags; unsigned long flags;
...@@ -593,7 +593,7 @@ static irqreturn_t ...@@ -593,7 +593,7 @@ static irqreturn_t
am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs) am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
u_int status, n = 100; u_int status, n = 100;
int handled = 0; int handled = 0;
...@@ -630,7 +630,7 @@ am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -630,7 +630,7 @@ am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static int static int
am79c961_hw_init(struct net_device *dev) am79c961_hw_init(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
spin_lock_irq(&priv->chip_lock); spin_lock_irq(&priv->chip_lock);
write_rreg (dev->base_addr, CSR0, CSR0_STOP); write_rreg (dev->base_addr, CSR0, CSR0_STOP);
...@@ -662,7 +662,7 @@ static int __init am79c961_init(void) ...@@ -662,7 +662,7 @@ static int __init am79c961_init(void)
if (!dev) if (!dev)
goto out; goto out;
priv = dev->priv; priv = netdev_priv(dev);
/* /*
* Fixed address and IRQ lines here. * Fixed address and IRQ lines here.
......
...@@ -447,7 +447,7 @@ static rbd_t init_rbd = { ...@@ -447,7 +447,7 @@ static rbd_t init_rbd = {
static int static int
ether1_init_for_open (struct net_device *dev) ether1_init_for_open (struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
int i, status, addr, next, next2; int i, status, addr, next, next2;
int failures = 0; int failures = 0;
unsigned long timeout; unsigned long timeout;
...@@ -616,7 +616,7 @@ ether1_init_for_open (struct net_device *dev) ...@@ -616,7 +616,7 @@ ether1_init_for_open (struct net_device *dev)
static int static int
ether1_txalloc (struct net_device *dev, int size) ether1_txalloc (struct net_device *dev, int size)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
int start, tail; int start, tail;
size = (size + 1) & ~1; size = (size + 1) & ~1;
...@@ -642,7 +642,7 @@ ether1_txalloc (struct net_device *dev, int size) ...@@ -642,7 +642,7 @@ ether1_txalloc (struct net_device *dev, int size)
static int static int
ether1_open (struct net_device *dev) ether1_open (struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
if (!is_valid_ether_addr(dev->dev_addr)) { if (!is_valid_ether_addr(dev->dev_addr)) {
printk(KERN_WARNING "%s: invalid ethernet MAC address\n", printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
...@@ -668,7 +668,7 @@ ether1_open (struct net_device *dev) ...@@ -668,7 +668,7 @@ ether1_open (struct net_device *dev)
static void static void
ether1_timeout(struct net_device *dev) ether1_timeout(struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
printk(KERN_WARNING "%s: transmit timeout, network cable problem?\n", printk(KERN_WARNING "%s: transmit timeout, network cable problem?\n",
dev->name); dev->name);
...@@ -686,7 +686,7 @@ ether1_timeout(struct net_device *dev) ...@@ -686,7 +686,7 @@ ether1_timeout(struct net_device *dev)
static int static int
ether1_sendpacket (struct sk_buff *skb, struct net_device *dev) ether1_sendpacket (struct sk_buff *skb, struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
int tmp, tst, nopaddr, txaddr, tbdaddr, dataddr; int tmp, tst, nopaddr, txaddr, tbdaddr, dataddr;
unsigned long flags; unsigned long flags;
tx_t tx; tx_t tx;
...@@ -762,7 +762,7 @@ ether1_sendpacket (struct sk_buff *skb, struct net_device *dev) ...@@ -762,7 +762,7 @@ ether1_sendpacket (struct sk_buff *skb, struct net_device *dev)
static void static void
ether1_xmit_done (struct net_device *dev) ether1_xmit_done (struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
nop_t nop; nop_t nop;
int caddr, tst; int caddr, tst;
...@@ -863,7 +863,7 @@ ether1_xmit_done (struct net_device *dev) ...@@ -863,7 +863,7 @@ ether1_xmit_done (struct net_device *dev)
static void static void
ether1_recv_done (struct net_device *dev) ether1_recv_done (struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
int status; int status;
int nexttail, rbdaddr; int nexttail, rbdaddr;
rbd_t rbd; rbd_t rbd;
...@@ -919,7 +919,7 @@ static irqreturn_t ...@@ -919,7 +919,7 @@ static irqreturn_t
ether1_interrupt (int irq, void *dev_id, struct pt_regs *regs) ether1_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
int status; int status;
status = ether1_inw (dev, SCB_ADDR, scb_t, scb_status, NORMALIRQS); status = ether1_inw (dev, SCB_ADDR, scb_t, scb_status, NORMALIRQS);
...@@ -978,7 +978,7 @@ ether1_close (struct net_device *dev) ...@@ -978,7 +978,7 @@ ether1_close (struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
ether1_getstats (struct net_device *dev) ether1_getstats (struct net_device *dev)
{ {
struct ether1_priv *priv = (struct ether1_priv *)dev->priv; struct ether1_priv *priv = netdev_priv(dev);
return &priv->stats; return &priv->stats;
} }
...@@ -1030,7 +1030,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -1030,7 +1030,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
request_region(dev->base_addr, 16, dev->name); request_region(dev->base_addr, 16, dev->name);
request_region(dev->base_addr + 0x800, 4096, dev->name); request_region(dev->base_addr + 0x800, 4096, dev->name);
priv = (struct ether1_priv *)dev->priv; priv = netdev_priv(dev);
if ((priv->bus_type = ether1_reset(dev)) == 0) { if ((priv->bus_type = ether1_reset(dev)) == 0) {
ret = -ENODEV; ret = -ENODEV;
goto release; goto release;
......
...@@ -121,7 +121,7 @@ static inline void ether3_outw(int v, const int r) ...@@ -121,7 +121,7 @@ static inline void ether3_outw(int v, const int r)
static int static int
ether3_setbuffer(struct net_device *dev, buffer_rw_t read, int start) ether3_setbuffer(struct net_device *dev, buffer_rw_t read, int start)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
int timeout = 1000; int timeout = 1000;
ether3_outw(priv->regs.config1 | CFG1_LOCBUFMEM, REG_CONFIG1); ether3_outw(priv->regs.config1 | CFG1_LOCBUFMEM, REG_CONFIG1);
...@@ -180,7 +180,7 @@ static void ...@@ -180,7 +180,7 @@ static void
ether3_ledoff(unsigned long data) ether3_ledoff(unsigned long data)
{ {
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
ether3_outw(priv->regs.config2 |= CFG2_CTRLO, REG_CONFIG2); ether3_outw(priv->regs.config2 |= CFG2_CTRLO, REG_CONFIG2);
} }
...@@ -280,7 +280,7 @@ ether3_ramtest(struct net_device *dev, unsigned char byte) ...@@ -280,7 +280,7 @@ ether3_ramtest(struct net_device *dev, unsigned char byte)
static int __init static int __init
ether3_init_2(struct net_device *dev) ether3_init_2(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
int i; int i;
priv->regs.config1 = CFG1_RECVCOMPSTAT0|CFG1_DMABURST8; priv->regs.config1 = CFG1_RECVCOMPSTAT0|CFG1_DMABURST8;
...@@ -330,7 +330,7 @@ ether3_init_2(struct net_device *dev) ...@@ -330,7 +330,7 @@ ether3_init_2(struct net_device *dev)
static void static void
ether3_init_for_open(struct net_device *dev) ether3_init_for_open(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
int i; int i;
memset(&priv->stats, 0, sizeof(struct net_device_stats)); memset(&priv->stats, 0, sizeof(struct net_device_stats));
...@@ -434,7 +434,7 @@ ether3_open(struct net_device *dev) ...@@ -434,7 +434,7 @@ ether3_open(struct net_device *dev)
static int static int
ether3_close(struct net_device *dev) ether3_close(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -457,7 +457,7 @@ ether3_close(struct net_device *dev) ...@@ -457,7 +457,7 @@ ether3_close(struct net_device *dev)
*/ */
static struct net_device_stats *ether3_getstats(struct net_device *dev) static struct net_device_stats *ether3_getstats(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
return &priv->stats; return &priv->stats;
} }
...@@ -469,7 +469,7 @@ static struct net_device_stats *ether3_getstats(struct net_device *dev) ...@@ -469,7 +469,7 @@ static struct net_device_stats *ether3_getstats(struct net_device *dev)
*/ */
static void ether3_setmulticastlist(struct net_device *dev) static void ether3_setmulticastlist(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
priv->regs.config1 &= ~CFG1_RECVPROMISC; priv->regs.config1 &= ~CFG1_RECVPROMISC;
...@@ -487,7 +487,7 @@ static void ether3_setmulticastlist(struct net_device *dev) ...@@ -487,7 +487,7 @@ static void ether3_setmulticastlist(struct net_device *dev)
static void static void
ether3_timeout(struct net_device *dev) ether3_timeout(struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
del_timer(&priv->timer); del_timer(&priv->timer);
...@@ -518,7 +518,7 @@ ether3_timeout(struct net_device *dev) ...@@ -518,7 +518,7 @@ ether3_timeout(struct net_device *dev)
static int static int
ether3_sendpacket(struct sk_buff *skb, struct net_device *dev) ether3_sendpacket(struct sk_buff *skb, struct net_device *dev)
{ {
struct dev_priv *priv = (struct dev_priv *)dev->priv; struct dev_priv *priv = netdev_priv(dev);
unsigned long flags; unsigned long flags;
unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
unsigned int ptr, next_ptr; unsigned int ptr, next_ptr;
...@@ -594,7 +594,7 @@ ether3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -594,7 +594,7 @@ ether3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("eth3irq: %d ", irq); printk("eth3irq: %d ", irq);
#endif #endif
priv = (struct dev_priv *)dev->priv; priv = netdev_priv(dev);
status = ether3_inw(REG_STATUS); status = ether3_inw(REG_STATUS);
...@@ -844,7 +844,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -844,7 +844,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
goto free; goto free;
} }
priv = (struct dev_priv *) dev->priv; priv = netdev_priv(dev);
init_timer(&priv->timer); init_timer(&priv->timer);
/* Reset card... /* Reset card...
......
...@@ -144,7 +144,7 @@ static expansioncard_ops_t etherh_ops = { ...@@ -144,7 +144,7 @@ static expansioncard_ops_t etherh_ops = {
static void static void
etherh_setif(struct net_device *dev) etherh_setif(struct net_device *dev)
{ {
struct etherh_priv *eh = (struct etherh_priv *)dev->priv; struct etherh_priv *eh = netdev_priv(dev);
struct ei_device *ei_local = &eh->eidev; struct ei_device *ei_local = &eh->eidev;
unsigned long addr, flags; unsigned long addr, flags;
...@@ -188,7 +188,7 @@ etherh_setif(struct net_device *dev) ...@@ -188,7 +188,7 @@ etherh_setif(struct net_device *dev)
static int static int
etherh_getifstat(struct net_device *dev) etherh_getifstat(struct net_device *dev)
{ {
struct etherh_priv *eh = (struct etherh_priv *)dev->priv; struct etherh_priv *eh = netdev_priv(dev);
struct ei_device *ei_local = &eh->eidev; struct ei_device *ei_local = &eh->eidev;
int stat = 0; int stat = 0;
...@@ -256,7 +256,7 @@ static int etherh_set_config(struct net_device *dev, struct ifmap *map) ...@@ -256,7 +256,7 @@ static int etherh_set_config(struct net_device *dev, struct ifmap *map)
static void static void
etherh_reset(struct net_device *dev) etherh_reset(struct net_device *dev)
{ {
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = netdev_priv(dev);
outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, dev->base_addr); outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, dev->base_addr);
...@@ -283,7 +283,7 @@ etherh_reset(struct net_device *dev) ...@@ -283,7 +283,7 @@ etherh_reset(struct net_device *dev)
static void static void
etherh_block_output (struct net_device *dev, int count, const unsigned char *buf, int start_page) etherh_block_output (struct net_device *dev, int count, const unsigned char *buf, int start_page)
{ {
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = netdev_priv(dev);
unsigned int addr, dma_addr; unsigned int addr, dma_addr;
unsigned long dma_start; unsigned long dma_start;
...@@ -349,7 +349,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf ...@@ -349,7 +349,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
static void static void
etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
{ {
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = netdev_priv(dev);
unsigned int addr, dma_addr; unsigned int addr, dma_addr;
unsigned char *buf; unsigned char *buf;
...@@ -390,7 +390,7 @@ etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int ...@@ -390,7 +390,7 @@ etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int
static void static void
etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
{ {
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = netdev_priv(dev);
unsigned int addr, dma_addr; unsigned int addr, dma_addr;
if (ei_local->dmaing) { if (ei_local->dmaing) {
...@@ -432,7 +432,7 @@ etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p ...@@ -432,7 +432,7 @@ etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p
static int static int
etherh_open(struct net_device *dev) etherh_open(struct net_device *dev)
{ {
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = netdev_priv(dev);
if (!is_valid_ether_addr(dev->dev_addr)) { if (!is_valid_ether_addr(dev->dev_addr)) {
printk(KERN_WARNING "%s: invalid ethernet MAC address\n", printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
...@@ -557,7 +557,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -557,7 +557,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
goto out; goto out;
} }
eh = dev->priv; eh = netdev_priv(dev);
spin_lock_init(&eh->eidev.page_lock); spin_lock_init(&eh->eidev.page_lock);
...@@ -653,7 +653,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -653,7 +653,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
break; break;
} }
ei_local = (struct ei_device *) dev->priv; ei_local = netdev_priv(dev);
if (ec->cid.product == PROD_ANT_ETHERM) { if (ec->cid.product == PROD_ANT_ETHERM) {
ei_local->tx_start_page = ETHERM_TX_START_PAGE; ei_local->tx_start_page = ETHERM_TX_START_PAGE;
ei_local->stop_page = ETHERM_STOP_PAGE; ei_local->stop_page = ETHERM_STOP_PAGE;
......
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