diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:37:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:37:49 -0500 |
commit | 454d7c9b14e20fd1949e2686e9de4a2926e01476 (patch) | |
tree | fae8bd1bfb5fd496977a0639ad71c54a2ee278ae /drivers/net/arcnet | |
parent | 7a12122c7a00347da9669cfcde82954c9e3d6f5e (diff) |
netdevice: safe convert to netdev_priv() #part-1
We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it
directly.
This patch is a safe convert for netdev->priv to netdev_priv(netdev).
Since all of the netdev->priv is only for read.
But it is too big to be sent in one mail.
I split it to 4 parts and make every part smaller than 100,000 bytes,
which is max size allowed by vger.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 4 | ||||
-rw-r--r-- | drivers/net/arcnet/arc-rimi.c | 16 | ||||
-rw-r--r-- | drivers/net/arcnet/arcnet.c | 32 | ||||
-rw-r--r-- | drivers/net/arcnet/capmode.c | 6 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020-isa.c | 4 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020-pci.c | 2 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020.c | 10 | ||||
-rw-r--r-- | drivers/net/arcnet/com90io.c | 4 | ||||
-rw-r--r-- | drivers/net/arcnet/com90xx.c | 10 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1051.c | 8 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1201.c | 12 |
11 files changed, 54 insertions, 54 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index 60088b3b61c4..3ff9affb1a91 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
@@ -87,7 +87,7 @@ MODULE_LICENSE("GPL"); | |||
87 | static void rx(struct net_device *dev, int bufnum, | 87 | static void rx(struct net_device *dev, int bufnum, |
88 | struct archdr *pkthdr, int length) | 88 | struct archdr *pkthdr, int length) |
89 | { | 89 | { |
90 | struct arcnet_local *lp = dev->priv; | 90 | struct arcnet_local *lp = netdev_priv(dev); |
91 | struct sk_buff *skb; | 91 | struct sk_buff *skb; |
92 | struct archdr *pkt = pkthdr; | 92 | struct archdr *pkt = pkthdr; |
93 | int ofs; | 93 | int ofs; |
@@ -167,7 +167,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
167 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 167 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
168 | int bufnum) | 168 | int bufnum) |
169 | { | 169 | { |
170 | struct arcnet_local *lp = dev->priv; | 170 | struct arcnet_local *lp = netdev_priv(dev); |
171 | struct arc_hardware *hard = &pkt->hard; | 171 | struct arc_hardware *hard = &pkt->hard; |
172 | int ofs; | 172 | int ofs; |
173 | 173 | ||
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 8c8d6c453c45..e3082a9350fc 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -194,7 +194,7 @@ static int __init arcrimi_found(struct net_device *dev) | |||
194 | 194 | ||
195 | /* initialize the rest of the device structure. */ | 195 | /* initialize the rest of the device structure. */ |
196 | 196 | ||
197 | lp = dev->priv; | 197 | lp = netdev_priv(dev); |
198 | lp->card_name = "RIM I"; | 198 | lp->card_name = "RIM I"; |
199 | lp->hw.command = arcrimi_command; | 199 | lp->hw.command = arcrimi_command; |
200 | lp->hw.status = arcrimi_status; | 200 | lp->hw.status = arcrimi_status; |
@@ -260,7 +260,7 @@ err_free_irq: | |||
260 | */ | 260 | */ |
261 | static int arcrimi_reset(struct net_device *dev, int really_reset) | 261 | static int arcrimi_reset(struct net_device *dev, int really_reset) |
262 | { | 262 | { |
263 | struct arcnet_local *lp = dev->priv; | 263 | struct arcnet_local *lp = netdev_priv(dev); |
264 | void __iomem *ioaddr = lp->mem_start + 0x800; | 264 | void __iomem *ioaddr = lp->mem_start + 0x800; |
265 | 265 | ||
266 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); | 266 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); |
@@ -281,7 +281,7 @@ static int arcrimi_reset(struct net_device *dev, int really_reset) | |||
281 | 281 | ||
282 | static void arcrimi_setmask(struct net_device *dev, int mask) | 282 | static void arcrimi_setmask(struct net_device *dev, int mask) |
283 | { | 283 | { |
284 | struct arcnet_local *lp = dev->priv; | 284 | struct arcnet_local *lp = netdev_priv(dev); |
285 | void __iomem *ioaddr = lp->mem_start + 0x800; | 285 | void __iomem *ioaddr = lp->mem_start + 0x800; |
286 | 286 | ||
287 | AINTMASK(mask); | 287 | AINTMASK(mask); |
@@ -289,7 +289,7 @@ static void arcrimi_setmask(struct net_device *dev, int mask) | |||
289 | 289 | ||
290 | static int arcrimi_status(struct net_device *dev) | 290 | static int arcrimi_status(struct net_device *dev) |
291 | { | 291 | { |
292 | struct arcnet_local *lp = dev->priv; | 292 | struct arcnet_local *lp = netdev_priv(dev); |
293 | void __iomem *ioaddr = lp->mem_start + 0x800; | 293 | void __iomem *ioaddr = lp->mem_start + 0x800; |
294 | 294 | ||
295 | return ASTATUS(); | 295 | return ASTATUS(); |
@@ -297,7 +297,7 @@ static int arcrimi_status(struct net_device *dev) | |||
297 | 297 | ||
298 | static void arcrimi_command(struct net_device *dev, int cmd) | 298 | static void arcrimi_command(struct net_device *dev, int cmd) |
299 | { | 299 | { |
300 | struct arcnet_local *lp = dev->priv; | 300 | struct arcnet_local *lp = netdev_priv(dev); |
301 | void __iomem *ioaddr = lp->mem_start + 0x800; | 301 | void __iomem *ioaddr = lp->mem_start + 0x800; |
302 | 302 | ||
303 | ACOMMAND(cmd); | 303 | ACOMMAND(cmd); |
@@ -306,7 +306,7 @@ static void arcrimi_command(struct net_device *dev, int cmd) | |||
306 | static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, | 306 | static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, |
307 | void *buf, int count) | 307 | void *buf, int count) |
308 | { | 308 | { |
309 | struct arcnet_local *lp = dev->priv; | 309 | struct arcnet_local *lp = netdev_priv(dev); |
310 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; | 310 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; |
311 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); | 311 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); |
312 | } | 312 | } |
@@ -315,7 +315,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, | |||
315 | static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, | 315 | static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, |
316 | void *buf, int count) | 316 | void *buf, int count) |
317 | { | 317 | { |
318 | struct arcnet_local *lp = dev->priv; | 318 | struct arcnet_local *lp = netdev_priv(dev); |
319 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; | 319 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; |
320 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); | 320 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); |
321 | } | 321 | } |
@@ -361,7 +361,7 @@ static int __init arc_rimi_init(void) | |||
361 | static void __exit arc_rimi_exit(void) | 361 | static void __exit arc_rimi_exit(void) |
362 | { | 362 | { |
363 | struct net_device *dev = my_dev; | 363 | struct net_device *dev = my_dev; |
364 | struct arcnet_local *lp = dev->priv; | 364 | struct arcnet_local *lp = netdev_priv(dev); |
365 | 365 | ||
366 | unregister_netdev(dev); | 366 | unregister_netdev(dev); |
367 | iounmap(lp->mem_start); | 367 | iounmap(lp->mem_start); |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index a5b07691e466..6b53e5ed125c 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -181,7 +181,7 @@ EXPORT_SYMBOL(arcnet_dump_skb); | |||
181 | static void arcnet_dump_packet(struct net_device *dev, int bufnum, | 181 | static void arcnet_dump_packet(struct net_device *dev, int bufnum, |
182 | char *desc, int take_arcnet_lock) | 182 | char *desc, int take_arcnet_lock) |
183 | { | 183 | { |
184 | struct arcnet_local *lp = dev->priv; | 184 | struct arcnet_local *lp = netdev_priv(dev); |
185 | int i, length; | 185 | int i, length; |
186 | unsigned long flags = 0; | 186 | unsigned long flags = 0; |
187 | static uint8_t buf[512]; | 187 | static uint8_t buf[512]; |
@@ -247,7 +247,7 @@ void arcnet_unregister_proto(struct ArcProto *proto) | |||
247 | */ | 247 | */ |
248 | static void release_arcbuf(struct net_device *dev, int bufnum) | 248 | static void release_arcbuf(struct net_device *dev, int bufnum) |
249 | { | 249 | { |
250 | struct arcnet_local *lp = dev->priv; | 250 | struct arcnet_local *lp = netdev_priv(dev); |
251 | int i; | 251 | int i; |
252 | 252 | ||
253 | lp->buf_queue[lp->first_free_buf++] = bufnum; | 253 | lp->buf_queue[lp->first_free_buf++] = bufnum; |
@@ -269,7 +269,7 @@ static void release_arcbuf(struct net_device *dev, int bufnum) | |||
269 | */ | 269 | */ |
270 | static int get_arcbuf(struct net_device *dev) | 270 | static int get_arcbuf(struct net_device *dev) |
271 | { | 271 | { |
272 | struct arcnet_local *lp = dev->priv; | 272 | struct arcnet_local *lp = netdev_priv(dev); |
273 | int buf = -1, i; | 273 | int buf = -1, i; |
274 | 274 | ||
275 | if (!atomic_dec_and_test(&lp->buf_lock)) { | 275 | if (!atomic_dec_and_test(&lp->buf_lock)) { |
@@ -357,7 +357,7 @@ struct net_device *alloc_arcdev(char *name) | |||
357 | dev = alloc_netdev(sizeof(struct arcnet_local), | 357 | dev = alloc_netdev(sizeof(struct arcnet_local), |
358 | name && *name ? name : "arc%d", arcdev_setup); | 358 | name && *name ? name : "arc%d", arcdev_setup); |
359 | if(dev) { | 359 | if(dev) { |
360 | struct arcnet_local *lp = (struct arcnet_local *) dev->priv; | 360 | struct arcnet_local *lp = netdev_priv(dev); |
361 | spin_lock_init(&lp->lock); | 361 | spin_lock_init(&lp->lock); |
362 | } | 362 | } |
363 | 363 | ||
@@ -374,7 +374,7 @@ struct net_device *alloc_arcdev(char *name) | |||
374 | */ | 374 | */ |
375 | static int arcnet_open(struct net_device *dev) | 375 | static int arcnet_open(struct net_device *dev) |
376 | { | 376 | { |
377 | struct arcnet_local *lp = dev->priv; | 377 | struct arcnet_local *lp = netdev_priv(dev); |
378 | int count, newmtu, error; | 378 | int count, newmtu, error; |
379 | 379 | ||
380 | BUGMSG(D_INIT,"opened."); | 380 | BUGMSG(D_INIT,"opened."); |
@@ -474,7 +474,7 @@ static int arcnet_open(struct net_device *dev) | |||
474 | /* The inverse routine to arcnet_open - shuts down the card. */ | 474 | /* The inverse routine to arcnet_open - shuts down the card. */ |
475 | static int arcnet_close(struct net_device *dev) | 475 | static int arcnet_close(struct net_device *dev) |
476 | { | 476 | { |
477 | struct arcnet_local *lp = dev->priv; | 477 | struct arcnet_local *lp = netdev_priv(dev); |
478 | 478 | ||
479 | netif_stop_queue(dev); | 479 | netif_stop_queue(dev); |
480 | 480 | ||
@@ -556,7 +556,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, | |||
556 | static int arcnet_rebuild_header(struct sk_buff *skb) | 556 | static int arcnet_rebuild_header(struct sk_buff *skb) |
557 | { | 557 | { |
558 | struct net_device *dev = skb->dev; | 558 | struct net_device *dev = skb->dev; |
559 | struct arcnet_local *lp = dev->priv; | 559 | struct arcnet_local *lp = netdev_priv(dev); |
560 | int status = 0; /* default is failure */ | 560 | int status = 0; /* default is failure */ |
561 | unsigned short type; | 561 | unsigned short type; |
562 | uint8_t daddr=0; | 562 | uint8_t daddr=0; |
@@ -603,7 +603,7 @@ static int arcnet_rebuild_header(struct sk_buff *skb) | |||
603 | /* Called by the kernel in order to transmit a packet. */ | 603 | /* Called by the kernel in order to transmit a packet. */ |
604 | static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) | 604 | static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) |
605 | { | 605 | { |
606 | struct arcnet_local *lp = dev->priv; | 606 | struct arcnet_local *lp = netdev_priv(dev); |
607 | struct archdr *pkt; | 607 | struct archdr *pkt; |
608 | struct arc_rfc1201 *soft; | 608 | struct arc_rfc1201 *soft; |
609 | struct ArcProto *proto; | 609 | struct ArcProto *proto; |
@@ -693,7 +693,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
693 | */ | 693 | */ |
694 | static int go_tx(struct net_device *dev) | 694 | static int go_tx(struct net_device *dev) |
695 | { | 695 | { |
696 | struct arcnet_local *lp = dev->priv; | 696 | struct arcnet_local *lp = netdev_priv(dev); |
697 | 697 | ||
698 | BUGMSG(D_DURING, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n", | 698 | BUGMSG(D_DURING, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n", |
699 | ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx); | 699 | ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx); |
@@ -723,7 +723,7 @@ static int go_tx(struct net_device *dev) | |||
723 | static void arcnet_timeout(struct net_device *dev) | 723 | static void arcnet_timeout(struct net_device *dev) |
724 | { | 724 | { |
725 | unsigned long flags; | 725 | unsigned long flags; |
726 | struct arcnet_local *lp = dev->priv; | 726 | struct arcnet_local *lp = netdev_priv(dev); |
727 | int status = ASTATUS(); | 727 | int status = ASTATUS(); |
728 | char *msg; | 728 | char *msg; |
729 | 729 | ||
@@ -771,8 +771,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
771 | BUGMSG(D_DURING, "\n"); | 771 | BUGMSG(D_DURING, "\n"); |
772 | 772 | ||
773 | BUGMSG(D_DURING, "in arcnet_interrupt\n"); | 773 | BUGMSG(D_DURING, "in arcnet_interrupt\n"); |
774 | 774 | ||
775 | lp = dev->priv; | 775 | lp = netdev_priv(dev); |
776 | BUG_ON(!lp); | 776 | BUG_ON(!lp); |
777 | 777 | ||
778 | spin_lock(&lp->lock); | 778 | spin_lock(&lp->lock); |
@@ -1010,7 +1010,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
1010 | */ | 1010 | */ |
1011 | static void arcnet_rx(struct net_device *dev, int bufnum) | 1011 | static void arcnet_rx(struct net_device *dev, int bufnum) |
1012 | { | 1012 | { |
1013 | struct arcnet_local *lp = dev->priv; | 1013 | struct arcnet_local *lp = netdev_priv(dev); |
1014 | struct archdr pkt; | 1014 | struct archdr pkt; |
1015 | struct arc_rfc1201 *soft; | 1015 | struct arc_rfc1201 *soft; |
1016 | int length, ofs; | 1016 | int length, ofs; |
@@ -1074,7 +1074,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum) | |||
1074 | */ | 1074 | */ |
1075 | static struct net_device_stats *arcnet_get_stats(struct net_device *dev) | 1075 | static struct net_device_stats *arcnet_get_stats(struct net_device *dev) |
1076 | { | 1076 | { |
1077 | struct arcnet_local *lp = dev->priv; | 1077 | struct arcnet_local *lp = netdev_priv(dev); |
1078 | return &lp->stats; | 1078 | return &lp->stats; |
1079 | } | 1079 | } |
1080 | 1080 | ||
@@ -1091,7 +1091,7 @@ static void null_rx(struct net_device *dev, int bufnum, | |||
1091 | static int null_build_header(struct sk_buff *skb, struct net_device *dev, | 1091 | static int null_build_header(struct sk_buff *skb, struct net_device *dev, |
1092 | unsigned short type, uint8_t daddr) | 1092 | unsigned short type, uint8_t daddr) |
1093 | { | 1093 | { |
1094 | struct arcnet_local *lp = dev->priv; | 1094 | struct arcnet_local *lp = netdev_priv(dev); |
1095 | 1095 | ||
1096 | BUGMSG(D_PROTO, | 1096 | BUGMSG(D_PROTO, |
1097 | "tx: can't build header for encap %02Xh; load a protocol driver.\n", | 1097 | "tx: can't build header for encap %02Xh; load a protocol driver.\n", |
@@ -1106,7 +1106,7 @@ static int null_build_header(struct sk_buff *skb, struct net_device *dev, | |||
1106 | static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, | 1106 | static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, |
1107 | int length, int bufnum) | 1107 | int length, int bufnum) |
1108 | { | 1108 | { |
1109 | struct arcnet_local *lp = dev->priv; | 1109 | struct arcnet_local *lp = netdev_priv(dev); |
1110 | struct arc_hardware newpkt; | 1110 | struct arc_hardware newpkt; |
1111 | 1111 | ||
1112 | BUGMSG(D_PROTO, "tx: no encap for this host; load a protocol driver.\n"); | 1112 | BUGMSG(D_PROTO, "tx: no encap for this host; load a protocol driver.\n"); |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 67bc47aa6904..e544953d8e9a 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -103,7 +103,7 @@ MODULE_LICENSE("GPL"); | |||
103 | static void rx(struct net_device *dev, int bufnum, | 103 | static void rx(struct net_device *dev, int bufnum, |
104 | struct archdr *pkthdr, int length) | 104 | struct archdr *pkthdr, int length) |
105 | { | 105 | { |
106 | struct arcnet_local *lp = (struct arcnet_local *) dev->priv; | 106 | struct arcnet_local *lp = netdev_priv(dev); |
107 | struct sk_buff *skb; | 107 | struct sk_buff *skb; |
108 | struct archdr *pkt = pkthdr; | 108 | struct archdr *pkt = pkthdr; |
109 | char *pktbuf, *pkthdrbuf; | 109 | char *pktbuf, *pkthdrbuf; |
@@ -197,7 +197,7 @@ static int build_header(struct sk_buff *skb, | |||
197 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 197 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
198 | int bufnum) | 198 | int bufnum) |
199 | { | 199 | { |
200 | struct arcnet_local *lp = (struct arcnet_local *) dev->priv; | 200 | struct arcnet_local *lp = netdev_priv(dev); |
201 | struct arc_hardware *hard = &pkt->hard; | 201 | struct arc_hardware *hard = &pkt->hard; |
202 | int ofs; | 202 | int ofs; |
203 | 203 | ||
@@ -249,7 +249,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
249 | 249 | ||
250 | static int ack_tx(struct net_device *dev, int acked) | 250 | static int ack_tx(struct net_device *dev, int acked) |
251 | { | 251 | { |
252 | struct arcnet_local *lp = (struct arcnet_local *) dev->priv; | 252 | struct arcnet_local *lp = netdev_priv(dev); |
253 | struct sk_buff *ackskb; | 253 | struct sk_buff *ackskb; |
254 | struct archdr *ackpkt; | 254 | struct archdr *ackpkt; |
255 | int length=sizeof(struct arc_cap); | 255 | int length=sizeof(struct arc_cap); |
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c index 9289e6103de5..ea53a940272f 100644 --- a/drivers/net/arcnet/com20020-isa.c +++ b/drivers/net/arcnet/com20020-isa.c | |||
@@ -52,7 +52,7 @@ static int __init com20020isa_probe(struct net_device *dev) | |||
52 | { | 52 | { |
53 | int ioaddr; | 53 | int ioaddr; |
54 | unsigned long airqmask; | 54 | unsigned long airqmask; |
55 | struct arcnet_local *lp = dev->priv; | 55 | struct arcnet_local *lp = netdev_priv(dev); |
56 | int err; | 56 | int err; |
57 | 57 | ||
58 | BUGLVL(D_NORMAL) printk(VERSION); | 58 | BUGLVL(D_NORMAL) printk(VERSION); |
@@ -151,7 +151,7 @@ static int __init com20020_init(void) | |||
151 | if (node && node != 0xff) | 151 | if (node && node != 0xff) |
152 | dev->dev_addr[0] = node; | 152 | dev->dev_addr[0] = node; |
153 | 153 | ||
154 | lp = dev->priv; | 154 | lp = netdev_priv(dev); |
155 | lp->backplane = backplane; | 155 | lp->backplane = backplane; |
156 | lp->clockp = clockp & 7; | 156 | lp->clockp = clockp & 7; |
157 | lp->clockm = clockm & 3; | 157 | lp->clockm = clockm & 3; |
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index b8c0fa6d401d..8b51f632581d 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c | |||
@@ -72,7 +72,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de | |||
72 | dev = alloc_arcdev(device); | 72 | dev = alloc_arcdev(device); |
73 | if (!dev) | 73 | if (!dev) |
74 | return -ENOMEM; | 74 | return -ENOMEM; |
75 | lp = dev->priv; | 75 | lp = netdev_priv(dev); |
76 | 76 | ||
77 | pci_set_drvdata(pdev, dev); | 77 | pci_set_drvdata(pdev, dev); |
78 | 78 | ||
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index 70124a944e7d..103688358fb8 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
@@ -89,7 +89,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum, | |||
89 | int com20020_check(struct net_device *dev) | 89 | int com20020_check(struct net_device *dev) |
90 | { | 90 | { |
91 | int ioaddr = dev->base_addr, status; | 91 | int ioaddr = dev->base_addr, status; |
92 | struct arcnet_local *lp = dev->priv; | 92 | struct arcnet_local *lp = netdev_priv(dev); |
93 | 93 | ||
94 | ARCRESET0; | 94 | ARCRESET0; |
95 | mdelay(RESETtime); | 95 | mdelay(RESETtime); |
@@ -159,7 +159,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
159 | 159 | ||
160 | /* Initialize the rest of the device structure. */ | 160 | /* Initialize the rest of the device structure. */ |
161 | 161 | ||
162 | lp = dev->priv; | 162 | lp = netdev_priv(dev); |
163 | 163 | ||
164 | lp->hw.owner = THIS_MODULE; | 164 | lp->hw.owner = THIS_MODULE; |
165 | lp->hw.command = com20020_command; | 165 | lp->hw.command = com20020_command; |
@@ -233,7 +233,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
233 | */ | 233 | */ |
234 | static int com20020_reset(struct net_device *dev, int really_reset) | 234 | static int com20020_reset(struct net_device *dev, int really_reset) |
235 | { | 235 | { |
236 | struct arcnet_local *lp = dev->priv; | 236 | struct arcnet_local *lp = netdev_priv(dev); |
237 | u_int ioaddr = dev->base_addr; | 237 | u_int ioaddr = dev->base_addr; |
238 | u_char inbyte; | 238 | u_char inbyte; |
239 | 239 | ||
@@ -300,7 +300,7 @@ static int com20020_status(struct net_device *dev) | |||
300 | 300 | ||
301 | static void com20020_close(struct net_device *dev) | 301 | static void com20020_close(struct net_device *dev) |
302 | { | 302 | { |
303 | struct arcnet_local *lp = dev->priv; | 303 | struct arcnet_local *lp = netdev_priv(dev); |
304 | int ioaddr = dev->base_addr; | 304 | int ioaddr = dev->base_addr; |
305 | 305 | ||
306 | /* disable transmitter */ | 306 | /* disable transmitter */ |
@@ -317,7 +317,7 @@ static void com20020_close(struct net_device *dev) | |||
317 | */ | 317 | */ |
318 | static void com20020_set_mc_list(struct net_device *dev) | 318 | static void com20020_set_mc_list(struct net_device *dev) |
319 | { | 319 | { |
320 | struct arcnet_local *lp = dev->priv; | 320 | struct arcnet_local *lp = netdev_priv(dev); |
321 | int ioaddr = dev->base_addr; | 321 | int ioaddr = dev->base_addr; |
322 | 322 | ||
323 | if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ | 323 | if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ |
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c index 6599f1046c7b..89de29b3b1dc 100644 --- a/drivers/net/arcnet/com90io.c +++ b/drivers/net/arcnet/com90io.c | |||
@@ -248,7 +248,7 @@ static int __init com90io_found(struct net_device *dev) | |||
248 | return -EBUSY; | 248 | return -EBUSY; |
249 | } | 249 | } |
250 | 250 | ||
251 | lp = dev->priv; | 251 | lp = netdev_priv(dev); |
252 | lp->card_name = "COM90xx I/O"; | 252 | lp->card_name = "COM90xx I/O"; |
253 | lp->hw.command = com90io_command; | 253 | lp->hw.command = com90io_command; |
254 | lp->hw.status = com90io_status; | 254 | lp->hw.status = com90io_status; |
@@ -290,7 +290,7 @@ static int __init com90io_found(struct net_device *dev) | |||
290 | */ | 290 | */ |
291 | static int com90io_reset(struct net_device *dev, int really_reset) | 291 | static int com90io_reset(struct net_device *dev, int really_reset) |
292 | { | 292 | { |
293 | struct arcnet_local *lp = dev->priv; | 293 | struct arcnet_local *lp = netdev_priv(dev); |
294 | short ioaddr = dev->base_addr; | 294 | short ioaddr = dev->base_addr; |
295 | 295 | ||
296 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); | 296 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); |
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c index 0d45553ff75c..f4113d26587a 100644 --- a/drivers/net/arcnet/com90xx.c +++ b/drivers/net/arcnet/com90xx.c | |||
@@ -468,7 +468,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem | |||
468 | release_mem_region(shmem, MIRROR_SIZE); | 468 | release_mem_region(shmem, MIRROR_SIZE); |
469 | return -ENOMEM; | 469 | return -ENOMEM; |
470 | } | 470 | } |
471 | lp = dev->priv; | 471 | lp = netdev_priv(dev); |
472 | /* find the real shared memory start/end points, including mirrors */ | 472 | /* find the real shared memory start/end points, including mirrors */ |
473 | 473 | ||
474 | /* guess the actual size of one "memory mirror" - the number of | 474 | /* guess the actual size of one "memory mirror" - the number of |
@@ -585,7 +585,7 @@ static void com90xx_setmask(struct net_device *dev, int mask) | |||
585 | */ | 585 | */ |
586 | int com90xx_reset(struct net_device *dev, int really_reset) | 586 | int com90xx_reset(struct net_device *dev, int really_reset) |
587 | { | 587 | { |
588 | struct arcnet_local *lp = dev->priv; | 588 | struct arcnet_local *lp = netdev_priv(dev); |
589 | short ioaddr = dev->base_addr; | 589 | short ioaddr = dev->base_addr; |
590 | 590 | ||
591 | BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS()); | 591 | BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS()); |
@@ -621,7 +621,7 @@ int com90xx_reset(struct net_device *dev, int really_reset) | |||
621 | static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, | 621 | static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, |
622 | void *buf, int count) | 622 | void *buf, int count) |
623 | { | 623 | { |
624 | struct arcnet_local *lp = dev->priv; | 624 | struct arcnet_local *lp = netdev_priv(dev); |
625 | void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; | 625 | void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; |
626 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); | 626 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); |
627 | } | 627 | } |
@@ -630,7 +630,7 @@ static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, | |||
630 | static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, | 630 | static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, |
631 | void *buf, int count) | 631 | void *buf, int count) |
632 | { | 632 | { |
633 | struct arcnet_local *lp = dev->priv; | 633 | struct arcnet_local *lp = netdev_priv(dev); |
634 | void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; | 634 | void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; |
635 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); | 635 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); |
636 | } | 636 | } |
@@ -656,7 +656,7 @@ static void __exit com90xx_exit(void) | |||
656 | 656 | ||
657 | for (count = 0; count < numcards; count++) { | 657 | for (count = 0; count < numcards; count++) { |
658 | dev = cards[count]; | 658 | dev = cards[count]; |
659 | lp = dev->priv; | 659 | lp = netdev_priv(dev); |
660 | 660 | ||
661 | unregister_netdev(dev); | 661 | unregister_netdev(dev); |
662 | free_irq(dev->irq, dev); | 662 | free_irq(dev->irq, dev); |
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index 994be4970a57..49d39a9cb696 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c | |||
@@ -88,7 +88,7 @@ MODULE_LICENSE("GPL"); | |||
88 | */ | 88 | */ |
89 | static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | 89 | static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) |
90 | { | 90 | { |
91 | struct arcnet_local *lp = dev->priv; | 91 | struct arcnet_local *lp = netdev_priv(dev); |
92 | struct archdr *pkt = (struct archdr *) skb->data; | 92 | struct archdr *pkt = (struct archdr *) skb->data; |
93 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; | 93 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; |
94 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; | 94 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; |
@@ -125,7 +125,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | |||
125 | static void rx(struct net_device *dev, int bufnum, | 125 | static void rx(struct net_device *dev, int bufnum, |
126 | struct archdr *pkthdr, int length) | 126 | struct archdr *pkthdr, int length) |
127 | { | 127 | { |
128 | struct arcnet_local *lp = dev->priv; | 128 | struct arcnet_local *lp = netdev_priv(dev); |
129 | struct sk_buff *skb; | 129 | struct sk_buff *skb; |
130 | struct archdr *pkt = pkthdr; | 130 | struct archdr *pkt = pkthdr; |
131 | int ofs; | 131 | int ofs; |
@@ -168,7 +168,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
168 | static int build_header(struct sk_buff *skb, struct net_device *dev, | 168 | static int build_header(struct sk_buff *skb, struct net_device *dev, |
169 | unsigned short type, uint8_t daddr) | 169 | unsigned short type, uint8_t daddr) |
170 | { | 170 | { |
171 | struct arcnet_local *lp = dev->priv; | 171 | struct arcnet_local *lp = netdev_priv(dev); |
172 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; | 172 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; |
173 | struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); | 173 | struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); |
174 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; | 174 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; |
@@ -219,7 +219,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
219 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 219 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
220 | int bufnum) | 220 | int bufnum) |
221 | { | 221 | { |
222 | struct arcnet_local *lp = dev->priv; | 222 | struct arcnet_local *lp = netdev_priv(dev); |
223 | struct arc_hardware *hard = &pkt->hard; | 223 | struct arc_hardware *hard = &pkt->hard; |
224 | int ofs; | 224 | int ofs; |
225 | 225 | ||
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index 962641e96450..2303d3a1f4b6 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c | |||
@@ -92,7 +92,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | |||
92 | { | 92 | { |
93 | struct archdr *pkt = (struct archdr *) skb->data; | 93 | struct archdr *pkt = (struct archdr *) skb->data; |
94 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; | 94 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; |
95 | struct arcnet_local *lp = dev->priv; | 95 | struct arcnet_local *lp = netdev_priv(dev); |
96 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; | 96 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; |
97 | 97 | ||
98 | /* Pull off the arcnet header. */ | 98 | /* Pull off the arcnet header. */ |
@@ -134,7 +134,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | |||
134 | static void rx(struct net_device *dev, int bufnum, | 134 | static void rx(struct net_device *dev, int bufnum, |
135 | struct archdr *pkthdr, int length) | 135 | struct archdr *pkthdr, int length) |
136 | { | 136 | { |
137 | struct arcnet_local *lp = dev->priv; | 137 | struct arcnet_local *lp = netdev_priv(dev); |
138 | struct sk_buff *skb; | 138 | struct sk_buff *skb; |
139 | struct archdr *pkt = pkthdr; | 139 | struct archdr *pkt = pkthdr; |
140 | struct arc_rfc1201 *soft = &pkthdr->soft.rfc1201; | 140 | struct arc_rfc1201 *soft = &pkthdr->soft.rfc1201; |
@@ -374,7 +374,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
374 | static int build_header(struct sk_buff *skb, struct net_device *dev, | 374 | static int build_header(struct sk_buff *skb, struct net_device *dev, |
375 | unsigned short type, uint8_t daddr) | 375 | unsigned short type, uint8_t daddr) |
376 | { | 376 | { |
377 | struct arcnet_local *lp = dev->priv; | 377 | struct arcnet_local *lp = netdev_priv(dev); |
378 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; | 378 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; |
379 | struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); | 379 | struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); |
380 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; | 380 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; |
@@ -441,7 +441,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
441 | static void load_pkt(struct net_device *dev, struct arc_hardware *hard, | 441 | static void load_pkt(struct net_device *dev, struct arc_hardware *hard, |
442 | struct arc_rfc1201 *soft, int softlen, int bufnum) | 442 | struct arc_rfc1201 *soft, int softlen, int bufnum) |
443 | { | 443 | { |
444 | struct arcnet_local *lp = dev->priv; | 444 | struct arcnet_local *lp = netdev_priv(dev); |
445 | int ofs; | 445 | int ofs; |
446 | 446 | ||
447 | /* assume length <= XMTU: someone should have handled that by now. */ | 447 | /* assume length <= XMTU: someone should have handled that by now. */ |
@@ -474,7 +474,7 @@ static void load_pkt(struct net_device *dev, struct arc_hardware *hard, | |||
474 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 474 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
475 | int bufnum) | 475 | int bufnum) |
476 | { | 476 | { |
477 | struct arcnet_local *lp = dev->priv; | 477 | struct arcnet_local *lp = netdev_priv(dev); |
478 | const int maxsegsize = XMTU - RFC1201_HDR_SIZE; | 478 | const int maxsegsize = XMTU - RFC1201_HDR_SIZE; |
479 | struct Outgoing *out; | 479 | struct Outgoing *out; |
480 | 480 | ||
@@ -509,7 +509,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
509 | 509 | ||
510 | static int continue_tx(struct net_device *dev, int bufnum) | 510 | static int continue_tx(struct net_device *dev, int bufnum) |
511 | { | 511 | { |
512 | struct arcnet_local *lp = dev->priv; | 512 | struct arcnet_local *lp = netdev_priv(dev); |
513 | struct Outgoing *out = &lp->outgoing; | 513 | struct Outgoing *out = &lp->outgoing; |
514 | struct arc_hardware *hard = &out->pkt->hard; | 514 | struct arc_hardware *hard = &out->pkt->hard; |
515 | struct arc_rfc1201 *soft = &out->pkt->soft.rfc1201, *newsoft; | 515 | struct arc_rfc1201 *soft = &out->pkt->soft.rfc1201, *newsoft; |