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