aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 6c9a643426f5..667f18bcc172 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -32,9 +32,6 @@
32 32
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34 34
35extern char e1000_driver_name[];
36extern char e1000_driver_version[];
37
38extern int e1000_up(struct e1000_adapter *adapter); 35extern int e1000_up(struct e1000_adapter *adapter);
39extern void e1000_down(struct e1000_adapter *adapter); 36extern void e1000_down(struct e1000_adapter *adapter);
40extern void e1000_reinit_locked(struct e1000_adapter *adapter); 37extern void e1000_reinit_locked(struct e1000_adapter *adapter);
@@ -733,16 +730,16 @@ err_setup:
733 730
734#define REG_PATTERN_TEST(R, M, W) \ 731#define REG_PATTERN_TEST(R, M, W) \
735{ \ 732{ \
736 uint32_t pat, value; \ 733 uint32_t pat, val; \
737 uint32_t test[] = \ 734 const uint32_t test[] = \
738 {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; \ 735 {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; \
739 for (pat = 0; pat < ARRAY_SIZE(test); pat++) { \ 736 for (pat = 0; pat < ARRAY_SIZE(test); pat++) { \
740 E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \ 737 E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \
741 value = E1000_READ_REG(&adapter->hw, R); \ 738 val = E1000_READ_REG(&adapter->hw, R); \
742 if (value != (test[pat] & W & M)) { \ 739 if (val != (test[pat] & W & M)) { \
743 DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \ 740 DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \
744 "0x%08X expected 0x%08X\n", \ 741 "0x%08X expected 0x%08X\n", \
745 E1000_##R, value, (test[pat] & W & M)); \ 742 E1000_##R, val, (test[pat] & W & M)); \
746 *data = (adapter->hw.mac_type < e1000_82543) ? \ 743 *data = (adapter->hw.mac_type < e1000_82543) ? \
747 E1000_82542_##R : E1000_##R; \ 744 E1000_82542_##R : E1000_##R; \
748 return 1; \ 745 return 1; \
@@ -752,12 +749,12 @@ err_setup:
752 749
753#define REG_SET_AND_CHECK(R, M, W) \ 750#define REG_SET_AND_CHECK(R, M, W) \
754{ \ 751{ \
755 uint32_t value; \ 752 uint32_t val; \
756 E1000_WRITE_REG(&adapter->hw, R, W & M); \ 753 E1000_WRITE_REG(&adapter->hw, R, W & M); \
757 value = E1000_READ_REG(&adapter->hw, R); \ 754 val = E1000_READ_REG(&adapter->hw, R); \
758 if ((W & M) != (value & M)) { \ 755 if ((W & M) != (val & M)) { \
759 DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\ 756 DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\
760 "expected 0x%08X\n", E1000_##R, (value & M), (W & M)); \ 757 "expected 0x%08X\n", E1000_##R, (val & M), (W & M)); \
761 *data = (adapter->hw.mac_type < e1000_82543) ? \ 758 *data = (adapter->hw.mac_type < e1000_82543) ? \
762 E1000_82542_##R : E1000_##R; \ 759 E1000_82542_##R : E1000_##R; \
763 return 1; \ 760 return 1; \
@@ -1621,8 +1618,6 @@ e1000_get_sset_count(struct net_device *netdev, int sset)
1621 } 1618 }
1622} 1619}
1623 1620
1624extern void e1000_power_up_phy(struct e1000_adapter *);
1625
1626static void 1621static void
1627e1000_diag_test(struct net_device *netdev, 1622e1000_diag_test(struct net_device *netdev,
1628 struct ethtool_test *eth_test, uint64_t *data) 1623 struct ethtool_test *eth_test, uint64_t *data)
@@ -1859,8 +1854,8 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
1859{ 1854{
1860 struct e1000_adapter *adapter = netdev_priv(netdev); 1855 struct e1000_adapter *adapter = netdev_priv(netdev);
1861 1856
1862 if (!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) 1857 if (!data)
1863 data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); 1858 data = INT_MAX;
1864 1859
1865 if (adapter->hw.mac_type < e1000_82571) { 1860 if (adapter->hw.mac_type < e1000_82571) {
1866 if (!adapter->blink_timer.function) { 1861 if (!adapter->blink_timer.function) {