diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-12-08 04:14:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-08 04:14:16 -0500 |
commit | b74ca3a896b9ab5f952bc440154758e708c48884 (patch) | |
tree | cc67fc67ddd6ac20e25b1060ab633a4d5c4e6ee8 /drivers | |
parent | 5a001a070e032bea1be563b13ebf9819cd5e54d4 (diff) |
netdevice: Kill netdev->priv
This is the last shoot of this series.
After I removing all directly reference of netdev->priv, I am killing
"priv" of "struct net_device" and fixing relative comments/docs.
Anyone will not be allowed to reference netdev->priv directly.
If you want to reference the memory of private data, use netdev_priv()
instead.
If the private data is not allocted when alloc_netdev(), use
netdev->ml_priv to point that memory after you creating that private
data.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/3c501.h | 2 | ||||
-rw-r--r-- | drivers/net/atp.c | 2 | ||||
-rw-r--r-- | drivers/net/eexpress.c | 2 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 4 | ||||
-rw-r--r-- | drivers/net/lance.c | 2 | ||||
-rw-r--r-- | drivers/net/myri_sbus.c | 2 | ||||
-rw-r--r-- | drivers/net/pci-skeleton.c | 2 | ||||
-rw-r--r-- | drivers/net/sun3_82586.c | 2 | ||||
-rw-r--r-- | drivers/net/sunbmac.c | 2 | ||||
-rw-r--r-- | drivers/net/tokenring/3c359.c | 5 | ||||
-rw-r--r-- | drivers/net/via-rhine.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/strip.c | 2 |
12 files changed, 19 insertions, 17 deletions
diff --git a/drivers/net/3c501.h b/drivers/net/3c501.h index cfec64efff7..f40b0493337 100644 --- a/drivers/net/3c501.h +++ b/drivers/net/3c501.h | |||
@@ -23,7 +23,7 @@ static const struct ethtool_ops netdev_ethtool_ops; | |||
23 | static int el_debug = EL_DEBUG; | 23 | static int el_debug = EL_DEBUG; |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Board-specific info in dev->priv. | 26 | * Board-specific info in netdev_priv(dev). |
27 | */ | 27 | */ |
28 | 28 | ||
29 | struct net_local | 29 | struct net_local |
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 7028b276dfd..1d6b74c5d6c 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c | |||
@@ -420,7 +420,7 @@ static unsigned short __init eeprom_op(long ioaddr, u32 cmd) | |||
420 | registers that "should" only need to be set once at boot, so that | 420 | registers that "should" only need to be set once at boot, so that |
421 | there is non-reboot way to recover if something goes wrong. | 421 | there is non-reboot way to recover if something goes wrong. |
422 | 422 | ||
423 | This is an attachable device: if there is no dev->priv entry then it wasn't | 423 | This is an attachable device: if there is no private entry then it wasn't |
424 | probed for at boot-time, and we need to probe for it again. | 424 | probed for at boot-time, and we need to probe for it again. |
425 | */ | 425 | */ |
426 | static int net_open(struct net_device *dev) | 426 | static int net_open(struct net_device *dev) |
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index a125e41240f..9ff3f2f5e38 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c | |||
@@ -1046,7 +1046,7 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf, | |||
1046 | /* | 1046 | /* |
1047 | * Sanity check the suspected EtherExpress card | 1047 | * Sanity check the suspected EtherExpress card |
1048 | * Read hardware address, reset card, size memory and initialize buffer | 1048 | * Read hardware address, reset card, size memory and initialize buffer |
1049 | * memory pointers. These are held in dev->priv, in case someone has more | 1049 | * memory pointers. These are held in netdev_priv(), in case someone has more |
1050 | * than one card in a machine. | 1050 | * than one card in a machine. |
1051 | */ | 1051 | */ |
1052 | 1052 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 12384df8cb2..1f2b24743ee 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -712,12 +712,12 @@ struct nv_skb_map { | |||
712 | 712 | ||
713 | /* | 713 | /* |
714 | * SMP locking: | 714 | * SMP locking: |
715 | * All hardware access under dev->priv->lock, except the performance | 715 | * All hardware access under netdev_priv(dev)->lock, except the performance |
716 | * critical parts: | 716 | * critical parts: |
717 | * - rx is (pseudo-) lockless: it relies on the single-threading provided | 717 | * - rx is (pseudo-) lockless: it relies on the single-threading provided |
718 | * by the arch code for interrupts. | 718 | * by the arch code for interrupts. |
719 | * - tx setup is lockless: it relies on netif_tx_lock. Actual submission | 719 | * - tx setup is lockless: it relies on netif_tx_lock. Actual submission |
720 | * needs dev->priv->lock :-( | 720 | * needs netdev_priv(dev)->lock :-( |
721 | * - set_multicast_list: preparation lockless, relies on netif_tx_lock. | 721 | * - set_multicast_list: preparation lockless, relies on netif_tx_lock. |
722 | */ | 722 | */ |
723 | 723 | ||
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index e81b6113ed9..d7afb938ea6 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -519,7 +519,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int | |||
519 | } | 519 | } |
520 | } | 520 | } |
521 | 521 | ||
522 | /* We can't allocate dev->priv from alloc_etherdev() because it must | 522 | /* We can't allocate private data from alloc_etherdev() because it must |
523 | a ISA DMA-able region. */ | 523 | a ISA DMA-able region. */ |
524 | chipname = chip_table[lance_version].name; | 524 | chipname = chip_table[lance_version].name; |
525 | printk("%s: %s at %#3x, ", dev->name, chipname, ioaddr); | 525 | printk("%s: %s at %#3x, ", dev->name, chipname, ioaddr); |
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 6833f65f8ae..899ed065a14 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -1091,7 +1091,7 @@ static int __devinit myri_sbus_probe(struct of_device *op, const struct of_devic | |||
1091 | err_free_irq: | 1091 | err_free_irq: |
1092 | free_irq(dev->irq, dev); | 1092 | free_irq(dev->irq, dev); |
1093 | err: | 1093 | err: |
1094 | /* This will also free the co-allocated 'dev->priv' */ | 1094 | /* This will also free the co-allocated private data*/ |
1095 | free_netdev(dev); | 1095 | free_netdev(dev); |
1096 | return -ENODEV; | 1096 | return -ENODEV; |
1097 | } | 1097 | } |
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index b23b5c397b1..c95fd72c3bb 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
@@ -781,7 +781,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev, | |||
781 | dev->irq = pdev->irq; | 781 | dev->irq = pdev->irq; |
782 | dev->base_addr = (unsigned long) ioaddr; | 782 | dev->base_addr = (unsigned long) ioaddr; |
783 | 783 | ||
784 | /* dev->priv/tp zeroed and aligned in alloc_etherdev */ | 784 | /* netdev_priv()/tp zeroed and aligned in alloc_etherdev */ |
785 | tp = netdev_priv(dev); | 785 | tp = netdev_priv(dev); |
786 | 786 | ||
787 | /* note: tp->chipset set in netdrv_init_board */ | 787 | /* note: tp->chipset set in netdrv_init_board */ |
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c index e8f97d5c9c2..e0d84772771 100644 --- a/drivers/net/sun3_82586.c +++ b/drivers/net/sun3_82586.c | |||
@@ -209,7 +209,7 @@ static int sun3_82586_open(struct net_device *dev) | |||
209 | static int check586(struct net_device *dev,char *where,unsigned size) | 209 | static int check586(struct net_device *dev,char *where,unsigned size) |
210 | { | 210 | { |
211 | struct priv pb; | 211 | struct priv pb; |
212 | struct priv *p = /* (struct priv *) dev->priv*/ &pb; | 212 | struct priv *p = &pb; |
213 | char *iscp_addr; | 213 | char *iscp_addr; |
214 | int i; | 214 | int i; |
215 | 215 | ||
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c index 977b3e08bbf..7f69c7f176c 100644 --- a/drivers/net/sunbmac.c +++ b/drivers/net/sunbmac.c | |||
@@ -1233,7 +1233,7 @@ fail_and_cleanup: | |||
1233 | bp->bmac_block, | 1233 | bp->bmac_block, |
1234 | bp->bblock_dvma); | 1234 | bp->bblock_dvma); |
1235 | 1235 | ||
1236 | /* This also frees the co-located 'dev->priv' */ | 1236 | /* This also frees the co-located private data */ |
1237 | free_netdev(dev); | 1237 | free_netdev(dev); |
1238 | return -ENODEV; | 1238 | return -ENODEV; |
1239 | } | 1239 | } |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index e7a944657cf..43853e3b210 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -296,8 +296,9 @@ static int __devinit xl_probe(struct pci_dev *pdev, | |||
296 | } ; | 296 | } ; |
297 | 297 | ||
298 | /* | 298 | /* |
299 | * Allowing init_trdev to allocate the dev->priv structure will align xl_private | 299 | * Allowing init_trdev to allocate the private data will align |
300 | * on a 32 bytes boundary which we need for the rx/tx descriptors | 300 | * xl_private on a 32 bytes boundary which we need for the rx/tx |
301 | * descriptors | ||
301 | */ | 302 | */ |
302 | 303 | ||
303 | dev = alloc_trdev(sizeof(struct xl_private)) ; | 304 | dev = alloc_trdev(sizeof(struct xl_private)) ; |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index 93b74b7b707..8d405c83df8 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -191,12 +191,13 @@ IIId. Synchronization | |||
191 | 191 | ||
192 | The driver runs as two independent, single-threaded flows of control. One | 192 | The driver runs as two independent, single-threaded flows of control. One |
193 | is the send-packet routine, which enforces single-threaded use by the | 193 | is the send-packet routine, which enforces single-threaded use by the |
194 | dev->priv->lock spinlock. The other thread is the interrupt handler, which | 194 | netdev_priv(dev)->lock spinlock. The other thread is the interrupt handler, |
195 | is single threaded by the hardware and interrupt handling software. | 195 | which is single threaded by the hardware and interrupt handling software. |
196 | 196 | ||
197 | The send packet thread has partial control over the Tx ring. It locks the | 197 | The send packet thread has partial control over the Tx ring. It locks the |
198 | dev->priv->lock whenever it's queuing a Tx packet. If the next slot in the ring | 198 | netdev_priv(dev)->lock whenever it's queuing a Tx packet. If the next slot in |
199 | is not available it stops the transmit queue by calling netif_stop_queue. | 199 | the ring is not available it stops the transmit queue by |
200 | calling netif_stop_queue. | ||
200 | 201 | ||
201 | The interrupt handler has exclusive control over the Rx ring and records stats | 202 | The interrupt handler has exclusive control over the Rx ring and records stats |
202 | from the Tx ring. After reaping the stats, it marks the Tx queue entry as | 203 | from the Tx ring. After reaping the stats, it marks the Tx queue entry as |
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index 692e6c5e009..dd0de3a9ed4 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -2494,7 +2494,7 @@ static void strip_dev_setup(struct net_device *dev) | |||
2494 | dev->type = ARPHRD_METRICOM; /* dtang */ | 2494 | dev->type = ARPHRD_METRICOM; /* dtang */ |
2495 | dev->hard_header_len = sizeof(STRIP_Header); | 2495 | dev->hard_header_len = sizeof(STRIP_Header); |
2496 | /* | 2496 | /* |
2497 | * dev->priv Already holds a pointer to our struct strip | 2497 | * netdev_priv(dev) Already holds a pointer to our struct strip |
2498 | */ | 2498 | */ |
2499 | 2499 | ||
2500 | *(MetricomAddress *) & dev->broadcast = broadcast_address; | 2500 | *(MetricomAddress *) & dev->broadcast = broadcast_address; |