diff options
author | françois romieu <romieu@fr.zoreil.com> | 2011-08-03 22:39:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-08 01:00:38 -0400 |
commit | 5ae297b0126fe77ab8223f14d2cfcf187f3244c6 (patch) | |
tree | a5496e880751b55ecc62e1f317a4e9877fbdc17d /drivers/net | |
parent | ad66fa7a704f179fd3f88dece544e2d18078860f (diff) |
via-velocity : cleanups.
- empty lines
- tabs / spaces
- ETHTOOL_GWOL _is_ defined
- useless cast from void *
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/via-velocity.c | 71 |
1 files changed, 25 insertions, 46 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 27bcd3bea133..490ec5b2775a 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -42,7 +42,6 @@ | |||
42 | * | 42 | * |
43 | */ | 43 | */ |
44 | 44 | ||
45 | |||
46 | #include <linux/module.h> | 45 | #include <linux/module.h> |
47 | #include <linux/types.h> | 46 | #include <linux/types.h> |
48 | #include <linux/bitops.h> | 47 | #include <linux/bitops.h> |
@@ -112,7 +111,6 @@ static void mac_get_cam_mask(struct mac_regs __iomem *regs, u8 *mask) | |||
112 | BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR); | 111 | BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR); |
113 | } | 112 | } |
114 | 113 | ||
115 | |||
116 | /** | 114 | /** |
117 | * mac_set_cam_mask - Set a CAM mask | 115 | * mac_set_cam_mask - Set a CAM mask |
118 | * @regs: register block for this velocity | 116 | * @regs: register block for this velocity |
@@ -700,7 +698,6 @@ static int velocity_mii_read(struct mac_regs __iomem *regs, u8 index, u16 *data) | |||
700 | return 0; | 698 | return 0; |
701 | } | 699 | } |
702 | 700 | ||
703 | |||
704 | /** | 701 | /** |
705 | * mii_check_media_mode - check media state | 702 | * mii_check_media_mode - check media state |
706 | * @regs: velocity registers | 703 | * @regs: velocity registers |
@@ -866,8 +863,6 @@ static u32 check_connection_type(struct mac_regs __iomem *regs) | |||
866 | return status; | 863 | return status; |
867 | } | 864 | } |
868 | 865 | ||
869 | |||
870 | |||
871 | /** | 866 | /** |
872 | * velocity_set_media_mode - set media mode | 867 | * velocity_set_media_mode - set media mode |
873 | * @mii_status: old MII link state | 868 | * @mii_status: old MII link state |
@@ -1262,6 +1257,7 @@ static void setup_queue_timers(struct velocity_info *vptr) | |||
1262 | writeb(rxqueue_timer, &vptr->mac_regs->RQETMR); | 1257 | writeb(rxqueue_timer, &vptr->mac_regs->RQETMR); |
1263 | } | 1258 | } |
1264 | } | 1259 | } |
1260 | |||
1265 | /** | 1261 | /** |
1266 | * setup_adaptive_interrupts - Setup interrupt suppression | 1262 | * setup_adaptive_interrupts - Setup interrupt suppression |
1267 | * | 1263 | * |
@@ -1601,8 +1597,6 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1601 | vptr->rx.info = NULL; | 1597 | vptr->rx.info = NULL; |
1602 | } | 1598 | } |
1603 | 1599 | ||
1604 | |||
1605 | |||
1606 | /** | 1600 | /** |
1607 | * velocity_init_rd_ring - set up receive ring | 1601 | * velocity_init_rd_ring - set up receive ring |
1608 | * @vptr: velocity to configure | 1602 | * @vptr: velocity to configure |
@@ -1676,7 +1670,6 @@ static void velocity_free_dma_rings(struct velocity_info *vptr) | |||
1676 | pci_free_consistent(vptr->pdev, size, vptr->rx.ring, vptr->rx.pool_dma); | 1670 | pci_free_consistent(vptr->pdev, size, vptr->rx.ring, vptr->rx.pool_dma); |
1677 | } | 1671 | } |
1678 | 1672 | ||
1679 | |||
1680 | static int velocity_init_rings(struct velocity_info *vptr, int mtu) | 1673 | static int velocity_init_rings(struct velocity_info *vptr, int mtu) |
1681 | { | 1674 | { |
1682 | int ret; | 1675 | int ret; |
@@ -1739,7 +1732,6 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, | |||
1739 | tdinfo->skb = NULL; | 1732 | tdinfo->skb = NULL; |
1740 | } | 1733 | } |
1741 | 1734 | ||
1742 | |||
1743 | /* | 1735 | /* |
1744 | * FIXME: could we merge this with velocity_free_tx_buf ? | 1736 | * FIXME: could we merge this with velocity_free_tx_buf ? |
1745 | */ | 1737 | */ |
@@ -1787,7 +1779,6 @@ static void velocity_free_td_ring(struct velocity_info *vptr) | |||
1787 | } | 1779 | } |
1788 | } | 1780 | } |
1789 | 1781 | ||
1790 | |||
1791 | static void velocity_free_rings(struct velocity_info *vptr) | 1782 | static void velocity_free_rings(struct velocity_info *vptr) |
1792 | { | 1783 | { |
1793 | velocity_free_td_ring(vptr); | 1784 | velocity_free_td_ring(vptr); |
@@ -2025,7 +2016,6 @@ static inline void velocity_iph_realign(struct velocity_info *vptr, | |||
2025 | } | 2016 | } |
2026 | } | 2017 | } |
2027 | 2018 | ||
2028 | |||
2029 | /** | 2019 | /** |
2030 | * velocity_receive_frame - received packet processor | 2020 | * velocity_receive_frame - received packet processor |
2031 | * @vptr: velocity we are handling | 2021 | * @vptr: velocity we are handling |
@@ -2097,7 +2087,6 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) | |||
2097 | return 0; | 2087 | return 0; |
2098 | } | 2088 | } |
2099 | 2089 | ||
2100 | |||
2101 | /** | 2090 | /** |
2102 | * velocity_rx_srv - service RX interrupt | 2091 | * velocity_rx_srv - service RX interrupt |
2103 | * @vptr: velocity | 2092 | * @vptr: velocity |
@@ -2405,7 +2394,6 @@ static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd | |||
2405 | return 0; | 2394 | return 0; |
2406 | } | 2395 | } |
2407 | 2396 | ||
2408 | |||
2409 | /** | 2397 | /** |
2410 | * velocity_ioctl - ioctl entry point | 2398 | * velocity_ioctl - ioctl entry point |
2411 | * @dev: network device | 2399 | * @dev: network device |
@@ -2620,14 +2608,13 @@ out: | |||
2620 | return NETDEV_TX_OK; | 2608 | return NETDEV_TX_OK; |
2621 | } | 2609 | } |
2622 | 2610 | ||
2623 | |||
2624 | static const struct net_device_ops velocity_netdev_ops = { | 2611 | static const struct net_device_ops velocity_netdev_ops = { |
2625 | .ndo_open = velocity_open, | 2612 | .ndo_open = velocity_open, |
2626 | .ndo_stop = velocity_close, | 2613 | .ndo_stop = velocity_close, |
2627 | .ndo_start_xmit = velocity_xmit, | 2614 | .ndo_start_xmit = velocity_xmit, |
2628 | .ndo_get_stats = velocity_get_stats, | 2615 | .ndo_get_stats = velocity_get_stats, |
2629 | .ndo_validate_addr = eth_validate_addr, | 2616 | .ndo_validate_addr = eth_validate_addr, |
2630 | .ndo_set_mac_address = eth_mac_addr, | 2617 | .ndo_set_mac_address = eth_mac_addr, |
2631 | .ndo_set_multicast_list = velocity_set_multi, | 2618 | .ndo_set_multicast_list = velocity_set_multi, |
2632 | .ndo_change_mtu = velocity_change_mtu, | 2619 | .ndo_change_mtu = velocity_change_mtu, |
2633 | .ndo_do_ioctl = velocity_ioctl, | 2620 | .ndo_do_ioctl = velocity_ioctl, |
@@ -2718,7 +2705,6 @@ static u32 velocity_get_link(struct net_device *dev) | |||
2718 | return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, ®s->PHYSR0) ? 1 : 0; | 2705 | return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, ®s->PHYSR0) ? 1 : 0; |
2719 | } | 2706 | } |
2720 | 2707 | ||
2721 | |||
2722 | /** | 2708 | /** |
2723 | * velocity_found1 - set up discovered velocity card | 2709 | * velocity_found1 - set up discovered velocity card |
2724 | * @pdev: PCI device | 2710 | * @pdev: PCI device |
@@ -2865,7 +2851,6 @@ err_free_dev: | |||
2865 | goto out; | 2851 | goto out; |
2866 | } | 2852 | } |
2867 | 2853 | ||
2868 | |||
2869 | #ifdef CONFIG_PM | 2854 | #ifdef CONFIG_PM |
2870 | /** | 2855 | /** |
2871 | * wol_calc_crc - WOL CRC | 2856 | * wol_calc_crc - WOL CRC |
@@ -3036,7 +3021,7 @@ static int velocity_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3036 | 3021 | ||
3037 | spin_lock_irqsave(&vptr->lock, flags); | 3022 | spin_lock_irqsave(&vptr->lock, flags); |
3038 | pci_save_state(pdev); | 3023 | pci_save_state(pdev); |
3039 | #ifdef ETHTOOL_GWOL | 3024 | |
3040 | if (vptr->flags & VELOCITY_FLAGS_WOL_ENABLED) { | 3025 | if (vptr->flags & VELOCITY_FLAGS_WOL_ENABLED) { |
3041 | velocity_get_ip(vptr); | 3026 | velocity_get_ip(vptr); |
3042 | velocity_save_context(vptr, &vptr->context); | 3027 | velocity_save_context(vptr, &vptr->context); |
@@ -3050,9 +3035,7 @@ static int velocity_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3050 | pci_disable_device(pdev); | 3035 | pci_disable_device(pdev); |
3051 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 3036 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
3052 | } | 3037 | } |
3053 | #else | 3038 | |
3054 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
3055 | #endif | ||
3056 | spin_unlock_irqrestore(&vptr->lock, flags); | 3039 | spin_unlock_irqrestore(&vptr->lock, flags); |
3057 | return 0; | 3040 | return 0; |
3058 | } | 3041 | } |
@@ -3133,13 +3116,13 @@ static int velocity_resume(struct pci_dev *pdev) | |||
3133 | * uses this to handle all our card discover and plugging | 3116 | * uses this to handle all our card discover and plugging |
3134 | */ | 3117 | */ |
3135 | static struct pci_driver velocity_driver = { | 3118 | static struct pci_driver velocity_driver = { |
3136 | .name = VELOCITY_NAME, | 3119 | .name = VELOCITY_NAME, |
3137 | .id_table = velocity_id_table, | 3120 | .id_table = velocity_id_table, |
3138 | .probe = velocity_found1, | 3121 | .probe = velocity_found1, |
3139 | .remove = __devexit_p(velocity_remove1), | 3122 | .remove = __devexit_p(velocity_remove1), |
3140 | #ifdef CONFIG_PM | 3123 | #ifdef CONFIG_PM |
3141 | .suspend = velocity_suspend, | 3124 | .suspend = velocity_suspend, |
3142 | .resume = velocity_resume, | 3125 | .resume = velocity_resume, |
3143 | #endif | 3126 | #endif |
3144 | }; | 3127 | }; |
3145 | 3128 | ||
@@ -3521,28 +3504,27 @@ static void velocity_get_ethtool_stats(struct net_device *dev, | |||
3521 | } | 3504 | } |
3522 | 3505 | ||
3523 | static const struct ethtool_ops velocity_ethtool_ops = { | 3506 | static const struct ethtool_ops velocity_ethtool_ops = { |
3524 | .get_settings = velocity_get_settings, | 3507 | .get_settings = velocity_get_settings, |
3525 | .set_settings = velocity_set_settings, | 3508 | .set_settings = velocity_set_settings, |
3526 | .get_drvinfo = velocity_get_drvinfo, | 3509 | .get_drvinfo = velocity_get_drvinfo, |
3527 | .get_wol = velocity_ethtool_get_wol, | 3510 | .get_wol = velocity_ethtool_get_wol, |
3528 | .set_wol = velocity_ethtool_set_wol, | 3511 | .set_wol = velocity_ethtool_set_wol, |
3529 | .get_msglevel = velocity_get_msglevel, | 3512 | .get_msglevel = velocity_get_msglevel, |
3530 | .set_msglevel = velocity_set_msglevel, | 3513 | .set_msglevel = velocity_set_msglevel, |
3531 | .get_link = velocity_get_link, | 3514 | .get_link = velocity_get_link, |
3532 | .get_strings = velocity_get_strings, | 3515 | .get_strings = velocity_get_strings, |
3533 | .get_sset_count = velocity_get_sset_count, | 3516 | .get_sset_count = velocity_get_sset_count, |
3534 | .get_ethtool_stats = velocity_get_ethtool_stats, | 3517 | .get_ethtool_stats = velocity_get_ethtool_stats, |
3535 | .get_coalesce = velocity_get_coalesce, | 3518 | .get_coalesce = velocity_get_coalesce, |
3536 | .set_coalesce = velocity_set_coalesce, | 3519 | .set_coalesce = velocity_set_coalesce, |
3537 | .begin = velocity_ethtool_up, | 3520 | .begin = velocity_ethtool_up, |
3538 | .complete = velocity_ethtool_down | 3521 | .complete = velocity_ethtool_down |
3539 | }; | 3522 | }; |
3540 | 3523 | ||
3541 | #ifdef CONFIG_PM | 3524 | #if defined(CONFIG_PM) && defined(CONFIG_INET) |
3542 | #ifdef CONFIG_INET | ||
3543 | static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr) | 3525 | static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr) |
3544 | { | 3526 | { |
3545 | struct in_ifaddr *ifa = (struct in_ifaddr *) ptr; | 3527 | struct in_ifaddr *ifa = ptr; |
3546 | struct net_device *dev = ifa->ifa_dev->dev; | 3528 | struct net_device *dev = ifa->ifa_dev->dev; |
3547 | 3529 | ||
3548 | if (dev_net(dev) == &init_net && | 3530 | if (dev_net(dev) == &init_net && |
@@ -3551,12 +3533,9 @@ static int velocity_netdev_event(struct notifier_block *nb, unsigned long notifi | |||
3551 | 3533 | ||
3552 | return NOTIFY_DONE; | 3534 | return NOTIFY_DONE; |
3553 | } | 3535 | } |
3554 | #endif /* CONFIG_INET */ | ||
3555 | #endif /* CONFIG_PM */ | ||
3556 | 3536 | ||
3557 | #if defined(CONFIG_PM) && defined(CONFIG_INET) | ||
3558 | static struct notifier_block velocity_inetaddr_notifier = { | 3537 | static struct notifier_block velocity_inetaddr_notifier = { |
3559 | .notifier_call = velocity_netdev_event, | 3538 | .notifier_call = velocity_netdev_event, |
3560 | }; | 3539 | }; |
3561 | 3540 | ||
3562 | static void velocity_register_notifier(void) | 3541 | static void velocity_register_notifier(void) |