diff options
author | Jay Cliburn <jacliburn@bellsouth.net> | 2008-02-02 20:50:11 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 07:49:25 -0400 |
commit | 0dde4ef99dcbf221bce6c0a5c3c3e4cdfea0b370 (patch) | |
tree | 4cd232fdec03b6988105c50e231c9f728e5fc27e /drivers/net/atlx | |
parent | 235ffa136c09c56db0c6c5fc5b5832749a72f557 (diff) |
atl1: make functions static
Make needlessly global functions static. In a couple of cases this
requires removing forward declarations and reordering functions.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Acked-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/atlx')
-rw-r--r-- | drivers/net/atlx/atl1.c | 101 | ||||
-rw-r--r-- | drivers/net/atlx/atl1.h | 3 |
2 files changed, 51 insertions, 53 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 4e4cb23c1836..6f4a1d5376bc 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -211,7 +211,7 @@ static int atl1_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
211 | * | 211 | * |
212 | * Return 0 on success, negative on failure | 212 | * Return 0 on success, negative on failure |
213 | */ | 213 | */ |
214 | s32 atl1_setup_ring_resources(struct atl1_adapter *adapter) | 214 | static s32 atl1_setup_ring_resources(struct atl1_adapter *adapter) |
215 | { | 215 | { |
216 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; | 216 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; |
217 | struct atl1_rfd_ring *rfd_ring = &adapter->rfd_ring; | 217 | struct atl1_rfd_ring *rfd_ring = &adapter->rfd_ring; |
@@ -402,7 +402,7 @@ static void atl1_clean_tx_ring(struct atl1_adapter *adapter) | |||
402 | * | 402 | * |
403 | * Free all transmit software resources | 403 | * Free all transmit software resources |
404 | */ | 404 | */ |
405 | void atl1_free_ring_resources(struct atl1_adapter *adapter) | 405 | static void atl1_free_ring_resources(struct atl1_adapter *adapter) |
406 | { | 406 | { |
407 | struct pci_dev *pdev = adapter->pdev; | 407 | struct pci_dev *pdev = adapter->pdev; |
408 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; | 408 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; |
@@ -580,40 +580,6 @@ static u32 atl1_check_link(struct atl1_adapter *adapter) | |||
580 | return 0; | 580 | return 0; |
581 | } | 581 | } |
582 | 582 | ||
583 | /* | ||
584 | * atl1_change_mtu - Change the Maximum Transfer Unit | ||
585 | * @netdev: network interface device structure | ||
586 | * @new_mtu: new value for maximum frame size | ||
587 | * | ||
588 | * Returns 0 on success, negative on failure | ||
589 | */ | ||
590 | static int atl1_change_mtu(struct net_device *netdev, int new_mtu) | ||
591 | { | ||
592 | struct atl1_adapter *adapter = netdev_priv(netdev); | ||
593 | int old_mtu = netdev->mtu; | ||
594 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; | ||
595 | |||
596 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || | ||
597 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { | ||
598 | if (netif_msg_link(adapter)) | ||
599 | dev_warn(&adapter->pdev->dev, "invalid MTU setting\n"); | ||
600 | return -EINVAL; | ||
601 | } | ||
602 | |||
603 | adapter->hw.max_frame_size = max_frame; | ||
604 | adapter->hw.tx_jumbo_task_th = (max_frame + 7) >> 3; | ||
605 | adapter->rx_buffer_len = (max_frame + 7) & ~7; | ||
606 | adapter->hw.rx_jumbo_th = adapter->rx_buffer_len / 8; | ||
607 | |||
608 | netdev->mtu = new_mtu; | ||
609 | if ((old_mtu != new_mtu) && netif_running(netdev)) { | ||
610 | atl1_down(adapter); | ||
611 | atl1_up(adapter); | ||
612 | } | ||
613 | |||
614 | return 0; | ||
615 | } | ||
616 | |||
617 | static void set_flow_ctrl_old(struct atl1_adapter *adapter) | 583 | static void set_flow_ctrl_old(struct atl1_adapter *adapter) |
618 | { | 584 | { |
619 | u32 hi, lo, value; | 585 | u32 hi, lo, value; |
@@ -1794,19 +1760,8 @@ static void atl1_phy_config(unsigned long data) | |||
1794 | * assert again and again. | 1760 | * assert again and again. |
1795 | * </vendor comment> | 1761 | * </vendor comment> |
1796 | */ | 1762 | */ |
1797 | static void atl1_tx_timeout_task(struct work_struct *work) | ||
1798 | { | ||
1799 | struct atl1_adapter *adapter = | ||
1800 | container_of(work, struct atl1_adapter, tx_timeout_task); | ||
1801 | struct net_device *netdev = adapter->netdev; | ||
1802 | 1763 | ||
1803 | netif_device_detach(netdev); | 1764 | static int atl1_reset(struct atl1_adapter *adapter) |
1804 | atl1_down(adapter); | ||
1805 | atl1_up(adapter); | ||
1806 | netif_device_attach(netdev); | ||
1807 | } | ||
1808 | |||
1809 | int atl1_reset(struct atl1_adapter *adapter) | ||
1810 | { | 1765 | { |
1811 | int ret; | 1766 | int ret; |
1812 | ret = atl1_reset_hw(&adapter->hw); | 1767 | ret = atl1_reset_hw(&adapter->hw); |
@@ -1815,7 +1770,7 @@ int atl1_reset(struct atl1_adapter *adapter) | |||
1815 | return atl1_init_hw(&adapter->hw); | 1770 | return atl1_init_hw(&adapter->hw); |
1816 | } | 1771 | } |
1817 | 1772 | ||
1818 | s32 atl1_up(struct atl1_adapter *adapter) | 1773 | static s32 atl1_up(struct atl1_adapter *adapter) |
1819 | { | 1774 | { |
1820 | struct net_device *netdev = adapter->netdev; | 1775 | struct net_device *netdev = adapter->netdev; |
1821 | int err; | 1776 | int err; |
@@ -1860,7 +1815,7 @@ err_up: | |||
1860 | return err; | 1815 | return err; |
1861 | } | 1816 | } |
1862 | 1817 | ||
1863 | void atl1_down(struct atl1_adapter *adapter) | 1818 | static void atl1_down(struct atl1_adapter *adapter) |
1864 | { | 1819 | { |
1865 | struct net_device *netdev = adapter->netdev; | 1820 | struct net_device *netdev = adapter->netdev; |
1866 | 1821 | ||
@@ -1883,6 +1838,52 @@ void atl1_down(struct atl1_adapter *adapter) | |||
1883 | atl1_clean_rx_ring(adapter); | 1838 | atl1_clean_rx_ring(adapter); |
1884 | } | 1839 | } |
1885 | 1840 | ||
1841 | static void atl1_tx_timeout_task(struct work_struct *work) | ||
1842 | { | ||
1843 | struct atl1_adapter *adapter = | ||
1844 | container_of(work, struct atl1_adapter, tx_timeout_task); | ||
1845 | struct net_device *netdev = adapter->netdev; | ||
1846 | |||
1847 | netif_device_detach(netdev); | ||
1848 | atl1_down(adapter); | ||
1849 | atl1_up(adapter); | ||
1850 | netif_device_attach(netdev); | ||
1851 | } | ||
1852 | |||
1853 | /* | ||
1854 | * atl1_change_mtu - Change the Maximum Transfer Unit | ||
1855 | * @netdev: network interface device structure | ||
1856 | * @new_mtu: new value for maximum frame size | ||
1857 | * | ||
1858 | * Returns 0 on success, negative on failure | ||
1859 | */ | ||
1860 | static int atl1_change_mtu(struct net_device *netdev, int new_mtu) | ||
1861 | { | ||
1862 | struct atl1_adapter *adapter = netdev_priv(netdev); | ||
1863 | int old_mtu = netdev->mtu; | ||
1864 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; | ||
1865 | |||
1866 | if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || | ||
1867 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { | ||
1868 | if (netif_msg_link(adapter)) | ||
1869 | dev_warn(&adapter->pdev->dev, "invalid MTU setting\n"); | ||
1870 | return -EINVAL; | ||
1871 | } | ||
1872 | |||
1873 | adapter->hw.max_frame_size = max_frame; | ||
1874 | adapter->hw.tx_jumbo_task_th = (max_frame + 7) >> 3; | ||
1875 | adapter->rx_buffer_len = (max_frame + 7) & ~7; | ||
1876 | adapter->hw.rx_jumbo_th = adapter->rx_buffer_len / 8; | ||
1877 | |||
1878 | netdev->mtu = new_mtu; | ||
1879 | if ((old_mtu != new_mtu) && netif_running(netdev)) { | ||
1880 | atl1_down(adapter); | ||
1881 | atl1_up(adapter); | ||
1882 | } | ||
1883 | |||
1884 | return 0; | ||
1885 | } | ||
1886 | |||
1886 | /* | 1887 | /* |
1887 | * atl1_open - Called when a network interface is made active | 1888 | * atl1_open - Called when a network interface is made active |
1888 | * @netdev: network interface device structure | 1889 | * @netdev: network interface device structure |
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h index 12ec916d4c3f..6220298908ba 100644 --- a/drivers/net/atlx/atl1.h +++ b/drivers/net/atlx/atl1.h | |||
@@ -73,9 +73,6 @@ void atl1_check_options(struct atl1_adapter *adapter); | |||
73 | static int atl1_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, | 73 | static int atl1_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, |
74 | int cmd); | 74 | int cmd); |
75 | static u32 atl1_check_link(struct atl1_adapter *adapter); | 75 | static u32 atl1_check_link(struct atl1_adapter *adapter); |
76 | s32 atl1_up(struct atl1_adapter *adapter); | ||
77 | void atl1_down(struct atl1_adapter *adapter); | ||
78 | int atl1_reset(struct atl1_adapter *adapter); | ||
79 | 76 | ||
80 | extern const struct ethtool_ops atl1_ethtool_ops; | 77 | extern const struct ethtool_ops atl1_ethtool_ops; |
81 | 78 | ||