diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2010-06-03 12:53:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-03 23:02:41 -0400 |
commit | 849c45423c0c108e08d67644728cc9b0ed225fa1 (patch) | |
tree | ab1589c91e817ad246caaf3b75e14e7711c31ad8 /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | faa9dcf793beba05f7178b63a59eaa3ca5175b6a (diff) |
ixgbe: Use netdev_<level>, dev_<level>, pr_<level>
This patch is alternative to a previous patch submitted by Joe Perches.
Create common macros e_<level> and e_dev_<level> that use netdev_<level> and
dev_<level> similar to e1000e.
Redefined pr_fmt for driver messages.
Use %pM to display MAC address.
Aligned text to better match the new format.
CC: Joe Perches <joe@perches.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index c50a7541ffec..644e3d21b751 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -294,8 +294,7 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
294 | hw->mac.autotry_restart = true; | 294 | hw->mac.autotry_restart = true; |
295 | err = hw->mac.ops.setup_link(hw, advertised, true, true); | 295 | err = hw->mac.ops.setup_link(hw, advertised, true, true); |
296 | if (err) { | 296 | if (err) { |
297 | DPRINTK(PROBE, INFO, | 297 | e_info("setup link failed with code %d\n", err); |
298 | "setup link failed with code %d\n", err); | ||
299 | hw->mac.ops.setup_link(hw, old, true, true); | 298 | hw->mac.ops.setup_link(hw, old, true, true); |
300 | } | 299 | } |
301 | } else { | 300 | } else { |
@@ -1188,9 +1187,9 @@ static struct ixgbe_reg_test reg_test_82598[] = { | |||
1188 | writel((_test[pat] & W), (adapter->hw.hw_addr + R)); \ | 1187 | writel((_test[pat] & W), (adapter->hw.hw_addr + R)); \ |
1189 | val = readl(adapter->hw.hw_addr + R); \ | 1188 | val = readl(adapter->hw.hw_addr + R); \ |
1190 | if (val != (_test[pat] & W & M)) { \ | 1189 | if (val != (_test[pat] & W & M)) { \ |
1191 | DPRINTK(DRV, ERR, "pattern test reg %04X failed: got "\ | 1190 | e_err("pattern test reg %04X failed: got " \ |
1192 | "0x%08X expected 0x%08X\n", \ | 1191 | "0x%08X expected 0x%08X\n", \ |
1193 | R, val, (_test[pat] & W & M)); \ | 1192 | R, val, (_test[pat] & W & M)); \ |
1194 | *data = R; \ | 1193 | *data = R; \ |
1195 | writel(before, adapter->hw.hw_addr + R); \ | 1194 | writel(before, adapter->hw.hw_addr + R); \ |
1196 | return 1; \ | 1195 | return 1; \ |
@@ -1206,8 +1205,8 @@ static struct ixgbe_reg_test reg_test_82598[] = { | |||
1206 | writel((W & M), (adapter->hw.hw_addr + R)); \ | 1205 | writel((W & M), (adapter->hw.hw_addr + R)); \ |
1207 | val = readl(adapter->hw.hw_addr + R); \ | 1206 | val = readl(adapter->hw.hw_addr + R); \ |
1208 | if ((W & M) != (val & M)) { \ | 1207 | if ((W & M) != (val & M)) { \ |
1209 | DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\ | 1208 | e_err("set/check reg %04X test failed: got 0x%08X " \ |
1210 | "expected 0x%08X\n", R, (val & M), (W & M)); \ | 1209 | "expected 0x%08X\n", R, (val & M), (W & M)); \ |
1211 | *data = R; \ | 1210 | *data = R; \ |
1212 | writel(before, (adapter->hw.hw_addr + R)); \ | 1211 | writel(before, (adapter->hw.hw_addr + R)); \ |
1213 | return 1; \ | 1212 | return 1; \ |
@@ -1240,8 +1239,8 @@ static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data) | |||
1240 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_STATUS, toggle); | 1239 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_STATUS, toggle); |
1241 | after = IXGBE_READ_REG(&adapter->hw, IXGBE_STATUS) & toggle; | 1240 | after = IXGBE_READ_REG(&adapter->hw, IXGBE_STATUS) & toggle; |
1242 | if (value != after) { | 1241 | if (value != after) { |
1243 | DPRINTK(DRV, ERR, "failed STATUS register test got: " | 1242 | e_err("failed STATUS register test got: 0x%08X expected: " |
1244 | "0x%08X expected: 0x%08X\n", after, value); | 1243 | "0x%08X\n", after, value); |
1245 | *data = 1; | 1244 | *data = 1; |
1246 | return 1; | 1245 | return 1; |
1247 | } | 1246 | } |
@@ -1341,8 +1340,8 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data) | |||
1341 | *data = 1; | 1340 | *data = 1; |
1342 | return -1; | 1341 | return -1; |
1343 | } | 1342 | } |
1344 | DPRINTK(HW, INFO, "testing %s interrupt\n", | 1343 | e_info("testing %s interrupt\n", shared_int ? |
1345 | (shared_int ? "shared" : "unshared")); | 1344 | "shared" : "unshared"); |
1346 | 1345 | ||
1347 | /* Disable all the interrupts */ | 1346 | /* Disable all the interrupts */ |
1348 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFFFFFF); | 1347 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFFFFFF); |
@@ -1847,7 +1846,7 @@ static void ixgbe_diag_test(struct net_device *netdev, | |||
1847 | if (eth_test->flags == ETH_TEST_FL_OFFLINE) { | 1846 | if (eth_test->flags == ETH_TEST_FL_OFFLINE) { |
1848 | /* Offline tests */ | 1847 | /* Offline tests */ |
1849 | 1848 | ||
1850 | DPRINTK(HW, INFO, "offline testing starting\n"); | 1849 | e_info("offline testing starting\n"); |
1851 | 1850 | ||
1852 | /* Link test performed before hardware reset so autoneg doesn't | 1851 | /* Link test performed before hardware reset so autoneg doesn't |
1853 | * interfere with test result */ | 1852 | * interfere with test result */ |
@@ -1880,17 +1879,17 @@ static void ixgbe_diag_test(struct net_device *netdev, | |||
1880 | else | 1879 | else |
1881 | ixgbe_reset(adapter); | 1880 | ixgbe_reset(adapter); |
1882 | 1881 | ||
1883 | DPRINTK(HW, INFO, "register testing starting\n"); | 1882 | e_info("register testing starting\n"); |
1884 | if (ixgbe_reg_test(adapter, &data[0])) | 1883 | if (ixgbe_reg_test(adapter, &data[0])) |
1885 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1884 | eth_test->flags |= ETH_TEST_FL_FAILED; |
1886 | 1885 | ||
1887 | ixgbe_reset(adapter); | 1886 | ixgbe_reset(adapter); |
1888 | DPRINTK(HW, INFO, "eeprom testing starting\n"); | 1887 | e_info("eeprom testing starting\n"); |
1889 | if (ixgbe_eeprom_test(adapter, &data[1])) | 1888 | if (ixgbe_eeprom_test(adapter, &data[1])) |
1890 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1889 | eth_test->flags |= ETH_TEST_FL_FAILED; |
1891 | 1890 | ||
1892 | ixgbe_reset(adapter); | 1891 | ixgbe_reset(adapter); |
1893 | DPRINTK(HW, INFO, "interrupt testing starting\n"); | 1892 | e_info("interrupt testing starting\n"); |
1894 | if (ixgbe_intr_test(adapter, &data[2])) | 1893 | if (ixgbe_intr_test(adapter, &data[2])) |
1895 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1894 | eth_test->flags |= ETH_TEST_FL_FAILED; |
1896 | 1895 | ||
@@ -1898,14 +1897,13 @@ static void ixgbe_diag_test(struct net_device *netdev, | |||
1898 | * loopback diagnostic. */ | 1897 | * loopback diagnostic. */ |
1899 | if (adapter->flags & (IXGBE_FLAG_SRIOV_ENABLED | | 1898 | if (adapter->flags & (IXGBE_FLAG_SRIOV_ENABLED | |
1900 | IXGBE_FLAG_VMDQ_ENABLED)) { | 1899 | IXGBE_FLAG_VMDQ_ENABLED)) { |
1901 | DPRINTK(HW, INFO, "Skip MAC loopback diagnostic in VT " | 1900 | e_info("Skip MAC loopback diagnostic in VT mode\n"); |
1902 | "mode\n"); | ||
1903 | data[3] = 0; | 1901 | data[3] = 0; |
1904 | goto skip_loopback; | 1902 | goto skip_loopback; |
1905 | } | 1903 | } |
1906 | 1904 | ||
1907 | ixgbe_reset(adapter); | 1905 | ixgbe_reset(adapter); |
1908 | DPRINTK(HW, INFO, "loopback testing starting\n"); | 1906 | e_info("loopback testing starting\n"); |
1909 | if (ixgbe_loopback_test(adapter, &data[3])) | 1907 | if (ixgbe_loopback_test(adapter, &data[3])) |
1910 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1908 | eth_test->flags |= ETH_TEST_FL_FAILED; |
1911 | 1909 | ||
@@ -1916,7 +1914,7 @@ skip_loopback: | |||
1916 | if (if_running) | 1914 | if (if_running) |
1917 | dev_open(netdev); | 1915 | dev_open(netdev); |
1918 | } else { | 1916 | } else { |
1919 | DPRINTK(HW, INFO, "online testing starting\n"); | 1917 | e_info("online testing starting\n"); |
1920 | /* Online tests */ | 1918 | /* Online tests */ |
1921 | if (ixgbe_link_test(adapter, &data[4])) | 1919 | if (ixgbe_link_test(adapter, &data[4])) |
1922 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1920 | eth_test->flags |= ETH_TEST_FL_FAILED; |
@@ -2089,8 +2087,8 @@ static bool ixgbe_reenable_rsc(struct ixgbe_adapter *adapter, | |||
2089 | (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) { | 2087 | (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) { |
2090 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; | 2088 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; |
2091 | adapter->netdev->features |= NETIF_F_LRO; | 2089 | adapter->netdev->features |= NETIF_F_LRO; |
2092 | DPRINTK(PROBE, INFO, "rx-usecs set to %d, re-enabling RSC\n", | 2090 | e_info("rx-usecs set to %d, re-enabling RSC\n", |
2093 | ec->rx_coalesce_usecs); | 2091 | ec->rx_coalesce_usecs); |
2094 | return true; | 2092 | return true; |
2095 | } | 2093 | } |
2096 | return false; | 2094 | return false; |
@@ -2158,8 +2156,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
2158 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | 2156 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
2159 | adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED; | 2157 | adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED; |
2160 | netdev->features &= ~NETIF_F_LRO; | 2158 | netdev->features &= ~NETIF_F_LRO; |
2161 | DPRINTK(PROBE, INFO, | 2159 | e_info("rx-usecs set to 0, disabling RSC\n"); |
2162 | "rx-usecs set to 0, disabling RSC\n"); | ||
2163 | 2160 | ||
2164 | need_reset = true; | 2161 | need_reset = true; |
2165 | } | 2162 | } |