aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index ef3f9105a05d..90a740d77e5d 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1157,7 +1157,7 @@ struct ixgbe_reg_test {
1157#define TABLE64_TEST_HI 6 1157#define TABLE64_TEST_HI 6
1158 1158
1159/* default 82599 register test */ 1159/* default 82599 register test */
1160static struct ixgbe_reg_test reg_test_82599[] = { 1160static const struct ixgbe_reg_test reg_test_82599[] = {
1161 { IXGBE_FCRTL_82599(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 }, 1161 { IXGBE_FCRTL_82599(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 },
1162 { IXGBE_FCRTH_82599(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 }, 1162 { IXGBE_FCRTH_82599(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 },
1163 { IXGBE_PFCTOP, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, 1163 { IXGBE_PFCTOP, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
@@ -1181,7 +1181,7 @@ static struct ixgbe_reg_test reg_test_82599[] = {
1181}; 1181};
1182 1182
1183/* default 82598 register test */ 1183/* default 82598 register test */
1184static struct ixgbe_reg_test reg_test_82598[] = { 1184static const struct ixgbe_reg_test reg_test_82598[] = {
1185 { IXGBE_FCRTL(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 }, 1185 { IXGBE_FCRTL(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 },
1186 { IXGBE_FCRTH(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 }, 1186 { IXGBE_FCRTH(0), 1, PATTERN_TEST, 0x8007FFF0, 0x8007FFF0 },
1187 { IXGBE_PFCTOP, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, 1187 { IXGBE_PFCTOP, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
@@ -1208,18 +1208,22 @@ static struct ixgbe_reg_test reg_test_82598[] = {
1208 { 0, 0, 0, 0 } 1208 { 0, 0, 0, 0 }
1209}; 1209};
1210 1210
1211static const u32 register_test_patterns[] = {
1212 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF
1213};
1214
1211#define REG_PATTERN_TEST(R, M, W) \ 1215#define REG_PATTERN_TEST(R, M, W) \
1212{ \ 1216{ \
1213 u32 pat, val, before; \ 1217 u32 pat, val, before; \
1214 const u32 _test[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; \ 1218 for (pat = 0; pat < ARRAY_SIZE(register_test_patterns); pat++) { \
1215 for (pat = 0; pat < ARRAY_SIZE(_test); pat++) { \
1216 before = readl(adapter->hw.hw_addr + R); \ 1219 before = readl(adapter->hw.hw_addr + R); \
1217 writel((_test[pat] & W), (adapter->hw.hw_addr + R)); \ 1220 writel((register_test_patterns[pat] & W), \
1221 (adapter->hw.hw_addr + R)); \
1218 val = readl(adapter->hw.hw_addr + R); \ 1222 val = readl(adapter->hw.hw_addr + R); \
1219 if (val != (_test[pat] & W & M)) { \ 1223 if (val != (register_test_patterns[pat] & W & M)) { \
1220 e_err(drv, "pattern test reg %04X failed: got " \ 1224 e_err(drv, "pattern test reg %04X failed: got " \
1221 "0x%08X expected 0x%08X\n", \ 1225 "0x%08X expected 0x%08X\n", \
1222 R, val, (_test[pat] & W & M)); \ 1226 R, val, (register_test_patterns[pat] & W & M)); \
1223 *data = R; \ 1227 *data = R; \
1224 writel(before, adapter->hw.hw_addr + R); \ 1228 writel(before, adapter->hw.hw_addr + R); \
1225 return 1; \ 1229 return 1; \
@@ -1246,7 +1250,7 @@ static struct ixgbe_reg_test reg_test_82598[] = {
1246 1250
1247static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data) 1251static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data)
1248{ 1252{
1249 struct ixgbe_reg_test *test; 1253 const struct ixgbe_reg_test *test;
1250 u32 value, before, after; 1254 u32 value, before, after;
1251 u32 i, toggle; 1255 u32 i, toggle;
1252 1256