aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-20 07:05:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 07:05:56 -0500
commitc0103606b7e3db191dcbaf988f28fa26aa711230 (patch)
tree290c3bd41c59bb5b9b7b3ae33c0abdb286dac603
parent537715226408b83c36b0688a1fb718f572d4dbe6 (diff)
netdevice lance: Convert directly reference of netdev->priv
This patch is to kill directly reference of netdev->priv too. Because the private data should be allocated in DMA area, alloc_etherdev() can't satisfy this needs. Use netdev->ml_priv to point to lance_private. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/lance.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index f63789affb1a..e81b6113ed94 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -359,7 +359,7 @@ int __init init_module(void)
359 359
360static void cleanup_card(struct net_device *dev) 360static void cleanup_card(struct net_device *dev)
361{ 361{
362 struct lance_private *lp = dev->priv; 362 struct lance_private *lp = dev->ml_priv;
363 if (dev->dma != 4) 363 if (dev->dma != 4)
364 free_dma(dev->dma); 364 free_dma(dev->dma);
365 release_region(dev->base_addr, LANCE_TOTAL_SIZE); 365 release_region(dev->base_addr, LANCE_TOTAL_SIZE);
@@ -418,7 +418,7 @@ static int __init do_lance_probe(struct net_device *dev)
418 if (card < NUM_CARDS) { /*Signature OK*/ 418 if (card < NUM_CARDS) { /*Signature OK*/
419 result = lance_probe1(dev, ioaddr, 0, 0); 419 result = lance_probe1(dev, ioaddr, 0, 0);
420 if (!result) { 420 if (!result) {
421 struct lance_private *lp = dev->priv; 421 struct lance_private *lp = dev->ml_priv;
422 int ver = lp->chip_version; 422 int ver = lp->chip_version;
423 423
424 r->name = chip_table[ver].name; 424 r->name = chip_table[ver].name;
@@ -537,7 +537,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
537 if(lp==NULL) 537 if(lp==NULL)
538 return -ENODEV; 538 return -ENODEV;
539 if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp); 539 if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
540 dev->priv = lp; 540 dev->ml_priv = lp;
541 lp->name = chipname; 541 lp->name = chipname;
542 lp->rx_buffs = (unsigned long)kmalloc(PKT_BUF_SZ*RX_RING_SIZE, 542 lp->rx_buffs = (unsigned long)kmalloc(PKT_BUF_SZ*RX_RING_SIZE,
543 GFP_DMA | GFP_KERNEL); 543 GFP_DMA | GFP_KERNEL);
@@ -741,7 +741,7 @@ out_lp:
741static int 741static int
742lance_open(struct net_device *dev) 742lance_open(struct net_device *dev)
743{ 743{
744 struct lance_private *lp = dev->priv; 744 struct lance_private *lp = dev->ml_priv;
745 int ioaddr = dev->base_addr; 745 int ioaddr = dev->base_addr;
746 int i; 746 int i;
747 747
@@ -829,7 +829,7 @@ lance_open(struct net_device *dev)
829static void 829static void
830lance_purge_ring(struct net_device *dev) 830lance_purge_ring(struct net_device *dev)
831{ 831{
832 struct lance_private *lp = dev->priv; 832 struct lance_private *lp = dev->ml_priv;
833 int i; 833 int i;
834 834
835 /* Free all the skbuffs in the Rx and Tx queues. */ 835 /* Free all the skbuffs in the Rx and Tx queues. */
@@ -853,7 +853,7 @@ lance_purge_ring(struct net_device *dev)
853static void 853static void
854lance_init_ring(struct net_device *dev, gfp_t gfp) 854lance_init_ring(struct net_device *dev, gfp_t gfp)
855{ 855{
856 struct lance_private *lp = dev->priv; 856 struct lance_private *lp = dev->ml_priv;
857 int i; 857 int i;
858 858
859 lp->cur_rx = lp->cur_tx = 0; 859 lp->cur_rx = lp->cur_tx = 0;
@@ -895,7 +895,7 @@ lance_init_ring(struct net_device *dev, gfp_t gfp)
895static void 895static void
896lance_restart(struct net_device *dev, unsigned int csr0_bits, int must_reinit) 896lance_restart(struct net_device *dev, unsigned int csr0_bits, int must_reinit)
897{ 897{
898 struct lance_private *lp = dev->priv; 898 struct lance_private *lp = dev->ml_priv;
899 899
900 if (must_reinit || 900 if (must_reinit ||
901 (chip_table[lp->chip_version].flags & LANCE_MUST_REINIT_RING)) { 901 (chip_table[lp->chip_version].flags & LANCE_MUST_REINIT_RING)) {
@@ -909,7 +909,7 @@ lance_restart(struct net_device *dev, unsigned int csr0_bits, int must_reinit)
909 909
910static void lance_tx_timeout (struct net_device *dev) 910static void lance_tx_timeout (struct net_device *dev)
911{ 911{
912 struct lance_private *lp = (struct lance_private *) dev->priv; 912 struct lance_private *lp = (struct lance_private *) dev->ml_priv;
913 int ioaddr = dev->base_addr; 913 int ioaddr = dev->base_addr;
914 914
915 outw (0, ioaddr + LANCE_ADDR); 915 outw (0, ioaddr + LANCE_ADDR);
@@ -943,7 +943,7 @@ static void lance_tx_timeout (struct net_device *dev)
943 943
944static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) 944static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
945{ 945{
946 struct lance_private *lp = dev->priv; 946 struct lance_private *lp = dev->ml_priv;
947 int ioaddr = dev->base_addr; 947 int ioaddr = dev->base_addr;
948 int entry; 948 int entry;
949 unsigned long flags; 949 unsigned long flags;
@@ -1020,7 +1020,7 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
1020 int must_restart; 1020 int must_restart;
1021 1021
1022 ioaddr = dev->base_addr; 1022 ioaddr = dev->base_addr;
1023 lp = dev->priv; 1023 lp = dev->ml_priv;
1024 1024
1025 spin_lock (&lp->devlock); 1025 spin_lock (&lp->devlock);
1026 1026
@@ -1133,7 +1133,7 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
1133static int 1133static int
1134lance_rx(struct net_device *dev) 1134lance_rx(struct net_device *dev)
1135{ 1135{
1136 struct lance_private *lp = dev->priv; 1136 struct lance_private *lp = dev->ml_priv;
1137 int entry = lp->cur_rx & RX_RING_MOD_MASK; 1137 int entry = lp->cur_rx & RX_RING_MOD_MASK;
1138 int i; 1138 int i;
1139 1139
@@ -1211,7 +1211,7 @@ static int
1211lance_close(struct net_device *dev) 1211lance_close(struct net_device *dev)
1212{ 1212{
1213 int ioaddr = dev->base_addr; 1213 int ioaddr = dev->base_addr;
1214 struct lance_private *lp = dev->priv; 1214 struct lance_private *lp = dev->ml_priv;
1215 1215
1216 netif_stop_queue (dev); 1216 netif_stop_queue (dev);
1217 1217
@@ -1244,7 +1244,7 @@ lance_close(struct net_device *dev)
1244 1244
1245static struct net_device_stats *lance_get_stats(struct net_device *dev) 1245static struct net_device_stats *lance_get_stats(struct net_device *dev)
1246{ 1246{
1247 struct lance_private *lp = dev->priv; 1247 struct lance_private *lp = dev->ml_priv;
1248 1248
1249 if (chip_table[lp->chip_version].flags & LANCE_HAS_MISSED_FRAME) { 1249 if (chip_table[lp->chip_version].flags & LANCE_HAS_MISSED_FRAME) {
1250 short ioaddr = dev->base_addr; 1250 short ioaddr = dev->base_addr;