Lines Matching +full:write +full:- +full:data
1 // SPDX-License-Identifier: GPL-2.0
35 static bool reg_pattern_test(struct igc_adapter *adapter, u64 *data, int reg, in reg_pattern_test() argument
36 u32 mask, u32 write) in reg_pattern_test() argument
38 struct igc_hw *hw = &adapter->hw; in reg_pattern_test()
46 wr32(reg, test_pattern[pat] & write); in reg_pattern_test()
48 if (val != (test_pattern[pat] & write & mask)) { in reg_pattern_test()
49 netdev_err(adapter->netdev, in reg_pattern_test()
51 reg, val, test_pattern[pat] & write & mask); in reg_pattern_test()
52 *data = reg; in reg_pattern_test()
61 static bool reg_set_and_check(struct igc_adapter *adapter, u64 *data, int reg, in reg_set_and_check() argument
62 u32 mask, u32 write) in reg_set_and_check() argument
64 struct igc_hw *hw = &adapter->hw; in reg_set_and_check()
68 wr32(reg, write & mask); in reg_set_and_check()
70 if ((write & mask) != (val & mask)) { in reg_set_and_check()
71 netdev_err(adapter->netdev, in reg_set_and_check()
73 reg, (val & mask), (write & mask)); in reg_set_and_check()
74 *data = reg; in reg_set_and_check()
82 bool igc_reg_test(struct igc_adapter *adapter, u64 *data) in igc_reg_test() argument
85 struct igc_hw *hw = &adapter->hw; in igc_reg_test()
91 * tests. Some bits are read-only, some toggle, and some in igc_reg_test()
100 netdev_err(adapter->netdev, in igc_reg_test()
103 *data = 1; in igc_reg_test()
112 while (test->reg) { in igc_reg_test()
113 for (i = 0; i < test->array_len; i++) { in igc_reg_test()
114 switch (test->test_type) { in igc_reg_test()
116 b = reg_pattern_test(adapter, data, in igc_reg_test()
117 test->reg + (i * 0x40), in igc_reg_test()
118 test->mask, in igc_reg_test()
119 test->write); in igc_reg_test()
122 b = reg_set_and_check(adapter, data, in igc_reg_test()
123 test->reg + (i * 0x40), in igc_reg_test()
124 test->mask, in igc_reg_test()
125 test->write); in igc_reg_test()
128 b = reg_pattern_test(adapter, data, in igc_reg_test()
129 test->reg + (i * 8), in igc_reg_test()
130 test->mask, in igc_reg_test()
131 test->write); in igc_reg_test()
134 b = reg_pattern_test(adapter, data, in igc_reg_test()
135 test->reg + 4 + (i * 8), in igc_reg_test()
136 test->mask, in igc_reg_test()
137 test->write); in igc_reg_test()
140 b = reg_pattern_test(adapter, data, in igc_reg_test()
141 test->reg + (i * 4), in igc_reg_test()
142 test->mask, in igc_reg_test()
143 test->write); in igc_reg_test()
151 *data = 0; in igc_reg_test()
155 bool igc_eeprom_test(struct igc_adapter *adapter, u64 *data) in igc_eeprom_test() argument
157 struct igc_hw *hw = &adapter->hw; in igc_eeprom_test()
159 *data = 0; in igc_eeprom_test()
161 if (hw->nvm.ops.validate(hw) != IGC_SUCCESS) { in igc_eeprom_test()
162 *data = 1; in igc_eeprom_test()
169 bool igc_link_test(struct igc_adapter *adapter, u64 *data) in igc_link_test() argument
173 *data = 0; in igc_link_test()
176 if (adapter->hw.mac.autoneg) in igc_link_test()
181 *data = 1; in igc_link_test()