diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:38:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:38:36 -0500 |
commit | 8f15ea42b64941001a401cf855a0869e24f3a845 (patch) | |
tree | 27c7534ad70ebda6986491daeac0ebe0f1ca54ed /drivers/net/sonic.h | |
parent | 4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff) |
netdevice: safe convert to netdev_priv() #part-3
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/sonic.h')
-rw-r--r-- | drivers/net/sonic.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/sonic.h b/drivers/net/sonic.h index 7db13e4a7ea5..07091dd27e5d 100644 --- a/drivers/net/sonic.h +++ b/drivers/net/sonic.h | |||
@@ -371,7 +371,7 @@ static inline __u16 sonic_buf_get(void* base, int bitmode, | |||
371 | static inline void sonic_cda_put(struct net_device* dev, int entry, | 371 | static inline void sonic_cda_put(struct net_device* dev, int entry, |
372 | int offset, __u16 val) | 372 | int offset, __u16 val) |
373 | { | 373 | { |
374 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 374 | struct sonic_local *lp = netdev_priv(dev); |
375 | sonic_buf_put(lp->cda, lp->dma_bitmode, | 375 | sonic_buf_put(lp->cda, lp->dma_bitmode, |
376 | (entry * SIZEOF_SONIC_CD) + offset, val); | 376 | (entry * SIZEOF_SONIC_CD) + offset, val); |
377 | } | 377 | } |
@@ -379,27 +379,27 @@ static inline void sonic_cda_put(struct net_device* dev, int entry, | |||
379 | static inline __u16 sonic_cda_get(struct net_device* dev, int entry, | 379 | static inline __u16 sonic_cda_get(struct net_device* dev, int entry, |
380 | int offset) | 380 | int offset) |
381 | { | 381 | { |
382 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 382 | struct sonic_local *lp = netdev_priv(dev); |
383 | return sonic_buf_get(lp->cda, lp->dma_bitmode, | 383 | return sonic_buf_get(lp->cda, lp->dma_bitmode, |
384 | (entry * SIZEOF_SONIC_CD) + offset); | 384 | (entry * SIZEOF_SONIC_CD) + offset); |
385 | } | 385 | } |
386 | 386 | ||
387 | static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val) | 387 | static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val) |
388 | { | 388 | { |
389 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 389 | struct sonic_local *lp = netdev_priv(dev); |
390 | sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val); | 390 | sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val); |
391 | } | 391 | } |
392 | 392 | ||
393 | static inline __u16 sonic_get_cam_enable(struct net_device* dev) | 393 | static inline __u16 sonic_get_cam_enable(struct net_device* dev) |
394 | { | 394 | { |
395 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 395 | struct sonic_local *lp = netdev_priv(dev); |
396 | return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE); | 396 | return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE); |
397 | } | 397 | } |
398 | 398 | ||
399 | static inline void sonic_tda_put(struct net_device* dev, int entry, | 399 | static inline void sonic_tda_put(struct net_device* dev, int entry, |
400 | int offset, __u16 val) | 400 | int offset, __u16 val) |
401 | { | 401 | { |
402 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 402 | struct sonic_local *lp = netdev_priv(dev); |
403 | sonic_buf_put(lp->tda, lp->dma_bitmode, | 403 | sonic_buf_put(lp->tda, lp->dma_bitmode, |
404 | (entry * SIZEOF_SONIC_TD) + offset, val); | 404 | (entry * SIZEOF_SONIC_TD) + offset, val); |
405 | } | 405 | } |
@@ -407,7 +407,7 @@ static inline void sonic_tda_put(struct net_device* dev, int entry, | |||
407 | static inline __u16 sonic_tda_get(struct net_device* dev, int entry, | 407 | static inline __u16 sonic_tda_get(struct net_device* dev, int entry, |
408 | int offset) | 408 | int offset) |
409 | { | 409 | { |
410 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 410 | struct sonic_local *lp = netdev_priv(dev); |
411 | return sonic_buf_get(lp->tda, lp->dma_bitmode, | 411 | return sonic_buf_get(lp->tda, lp->dma_bitmode, |
412 | (entry * SIZEOF_SONIC_TD) + offset); | 412 | (entry * SIZEOF_SONIC_TD) + offset); |
413 | } | 413 | } |
@@ -415,7 +415,7 @@ static inline __u16 sonic_tda_get(struct net_device* dev, int entry, | |||
415 | static inline void sonic_rda_put(struct net_device* dev, int entry, | 415 | static inline void sonic_rda_put(struct net_device* dev, int entry, |
416 | int offset, __u16 val) | 416 | int offset, __u16 val) |
417 | { | 417 | { |
418 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 418 | struct sonic_local *lp = netdev_priv(dev); |
419 | sonic_buf_put(lp->rda, lp->dma_bitmode, | 419 | sonic_buf_put(lp->rda, lp->dma_bitmode, |
420 | (entry * SIZEOF_SONIC_RD) + offset, val); | 420 | (entry * SIZEOF_SONIC_RD) + offset, val); |
421 | } | 421 | } |
@@ -423,7 +423,7 @@ static inline void sonic_rda_put(struct net_device* dev, int entry, | |||
423 | static inline __u16 sonic_rda_get(struct net_device* dev, int entry, | 423 | static inline __u16 sonic_rda_get(struct net_device* dev, int entry, |
424 | int offset) | 424 | int offset) |
425 | { | 425 | { |
426 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 426 | struct sonic_local *lp = netdev_priv(dev); |
427 | return sonic_buf_get(lp->rda, lp->dma_bitmode, | 427 | return sonic_buf_get(lp->rda, lp->dma_bitmode, |
428 | (entry * SIZEOF_SONIC_RD) + offset); | 428 | (entry * SIZEOF_SONIC_RD) + offset); |
429 | } | 429 | } |
@@ -431,7 +431,7 @@ static inline __u16 sonic_rda_get(struct net_device* dev, int entry, | |||
431 | static inline void sonic_rra_put(struct net_device* dev, int entry, | 431 | static inline void sonic_rra_put(struct net_device* dev, int entry, |
432 | int offset, __u16 val) | 432 | int offset, __u16 val) |
433 | { | 433 | { |
434 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 434 | struct sonic_local *lp = netdev_priv(dev); |
435 | sonic_buf_put(lp->rra, lp->dma_bitmode, | 435 | sonic_buf_put(lp->rra, lp->dma_bitmode, |
436 | (entry * SIZEOF_SONIC_RR) + offset, val); | 436 | (entry * SIZEOF_SONIC_RR) + offset, val); |
437 | } | 437 | } |
@@ -439,7 +439,7 @@ static inline void sonic_rra_put(struct net_device* dev, int entry, | |||
439 | static inline __u16 sonic_rra_get(struct net_device* dev, int entry, | 439 | static inline __u16 sonic_rra_get(struct net_device* dev, int entry, |
440 | int offset) | 440 | int offset) |
441 | { | 441 | { |
442 | struct sonic_local* lp = (struct sonic_local *) dev->priv; | 442 | struct sonic_local *lp = netdev_priv(dev); |
443 | return sonic_buf_get(lp->rra, lp->dma_bitmode, | 443 | return sonic_buf_get(lp->rra, lp->dma_bitmode, |
444 | (entry * SIZEOF_SONIC_RR) + offset); | 444 | (entry * SIZEOF_SONIC_RR) + offset); |
445 | } | 445 | } |