Lines Matching refs:hw

34 static u16 ixgb_shift_in_bits(struct ixgb_hw *hw);
36 static void ixgb_shift_out_bits(struct ixgb_hw *hw,
39 static void ixgb_standby_eeprom(struct ixgb_hw *hw);
41 static bool ixgb_wait_eeprom_command(struct ixgb_hw *hw);
43 static void ixgb_cleanup_eeprom(struct ixgb_hw *hw);
48 * hw - Struct containing variables accessed by shared code
52 ixgb_raise_clock(struct ixgb_hw *hw,
59 IXGB_WRITE_REG(hw, EECD, *eecd_reg);
60 IXGB_WRITE_FLUSH(hw);
67 * hw - Struct containing variables accessed by shared code
71 ixgb_lower_clock(struct ixgb_hw *hw,
78 IXGB_WRITE_REG(hw, EECD, *eecd_reg);
79 IXGB_WRITE_FLUSH(hw);
86 * hw - Struct containing variables accessed by shared code
91 ixgb_shift_out_bits(struct ixgb_hw *hw,
103 eecd_reg = IXGB_READ_REG(hw, EECD);
116 IXGB_WRITE_REG(hw, EECD, eecd_reg);
117 IXGB_WRITE_FLUSH(hw);
121 ixgb_raise_clock(hw, &eecd_reg);
122 ixgb_lower_clock(hw, &eecd_reg);
130 IXGB_WRITE_REG(hw, EECD, eecd_reg);
136 * hw - Struct containing variables accessed by shared code
139 ixgb_shift_in_bits(struct ixgb_hw *hw)
152 eecd_reg = IXGB_READ_REG(hw, EECD);
159 ixgb_raise_clock(hw, &eecd_reg);
161 eecd_reg = IXGB_READ_REG(hw, EECD);
167 ixgb_lower_clock(hw, &eecd_reg);
176 * hw - Struct containing variables accessed by shared code
182 ixgb_setup_eeprom(struct ixgb_hw *hw)
186 eecd_reg = IXGB_READ_REG(hw, EECD);
190 IXGB_WRITE_REG(hw, EECD, eecd_reg);
194 IXGB_WRITE_REG(hw, EECD, eecd_reg);
200 * hw - Struct containing variables accessed by shared code
203 ixgb_standby_eeprom(struct ixgb_hw *hw)
207 eecd_reg = IXGB_READ_REG(hw, EECD);
211 IXGB_WRITE_REG(hw, EECD, eecd_reg);
212 IXGB_WRITE_FLUSH(hw);
217 IXGB_WRITE_REG(hw, EECD, eecd_reg);
218 IXGB_WRITE_FLUSH(hw);
223 IXGB_WRITE_REG(hw, EECD, eecd_reg);
224 IXGB_WRITE_FLUSH(hw);
229 IXGB_WRITE_REG(hw, EECD, eecd_reg);
230 IXGB_WRITE_FLUSH(hw);
237 * hw - Struct containing variables accessed by shared code
240 ixgb_clock_eeprom(struct ixgb_hw *hw)
244 eecd_reg = IXGB_READ_REG(hw, EECD);
248 IXGB_WRITE_REG(hw, EECD, eecd_reg);
249 IXGB_WRITE_FLUSH(hw);
254 IXGB_WRITE_REG(hw, EECD, eecd_reg);
255 IXGB_WRITE_FLUSH(hw);
262 * hw - Struct containing variables accessed by shared code
265 ixgb_cleanup_eeprom(struct ixgb_hw *hw)
269 eecd_reg = IXGB_READ_REG(hw, EECD);
273 IXGB_WRITE_REG(hw, EECD, eecd_reg);
275 ixgb_clock_eeprom(hw);
281 * hw - Struct containing variables accessed by shared code
290 ixgb_wait_eeprom_command(struct ixgb_hw *hw)
298 ixgb_standby_eeprom(hw);
305 eecd_reg = IXGB_READ_REG(hw, EECD);
319 * hw - Struct containing variables accessed by shared code
330 ixgb_validate_eeprom_checksum(struct ixgb_hw *hw)
336 checksum += ixgb_read_eeprom(hw, i);
347 * hw - Struct containing variables accessed by shared code
353 ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
359 checksum += ixgb_read_eeprom(hw, i);
363 ixgb_write_eeprom(hw, EEPROM_CHECKSUM_REG, checksum);
369 * hw - Struct containing variables accessed by shared code
378 ixgb_write_eeprom(struct ixgb_hw *hw, u16 offset, u16 data)
380 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
383 ixgb_setup_eeprom(hw);
388 ixgb_shift_out_bits(hw, EEPROM_EWEN_OPCODE, 5);
389 ixgb_shift_out_bits(hw, 0, 4);
392 ixgb_standby_eeprom(hw);
395 ixgb_shift_out_bits(hw, EEPROM_WRITE_OPCODE, 3);
396 ixgb_shift_out_bits(hw, offset, 6);
399 ixgb_shift_out_bits(hw, data, 16);
401 ixgb_wait_eeprom_command(hw);
404 ixgb_standby_eeprom(hw);
410 ixgb_shift_out_bits(hw, EEPROM_EWDS_OPCODE, 5);
411 ixgb_shift_out_bits(hw, 0, 4);
414 ixgb_cleanup_eeprom(hw);
423 * hw - Struct containing variables accessed by shared code
430 ixgb_read_eeprom(struct ixgb_hw *hw,
436 ixgb_setup_eeprom(hw);
439 ixgb_shift_out_bits(hw, EEPROM_READ_OPCODE, 3);
443 ixgb_shift_out_bits(hw, offset, 6);
446 data = ixgb_shift_in_bits(hw);
449 ixgb_standby_eeprom(hw);
458 * hw - Struct containing variables accessed by shared code
465 ixgb_get_eeprom_data(struct ixgb_hw *hw)
473 ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
478 ee_data = ixgb_read_eeprom(hw, i);
480 hw->eeprom[i] = cpu_to_le16(ee_data);
504 * hw - Struct containing variables accessed by shared code
511 ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw)
513 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
519 return ixgb_get_eeprom_data(hw);
526 * hw - Struct containing variables accessed by shared code
533 ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index)
536 if (index < IXGB_EEPROM_SIZE && ixgb_check_and_get_eeprom_data(hw))
537 return hw->eeprom[index];
545 * hw - Struct containing variables accessed by shared code
551 ixgb_get_ee_mac_addr(struct ixgb_hw *hw,
555 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
559 if (ixgb_check_and_get_eeprom_data(hw)) {
571 * hw - Struct containing variables accessed by shared code
577 ixgb_get_ee_pba_number(struct ixgb_hw *hw)
579 if (ixgb_check_and_get_eeprom_data(hw))
580 return le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG])
581 | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16);
590 * hw - Struct containing variables accessed by shared code
596 ixgb_get_ee_device_id(struct ixgb_hw *hw)
598 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
600 if (ixgb_check_and_get_eeprom_data(hw))