Lines Matching refs:hw

9 static u16 ixgb_shift_in_bits(struct ixgb_hw *hw);
11 static void ixgb_shift_out_bits(struct ixgb_hw *hw,
14 static void ixgb_standby_eeprom(struct ixgb_hw *hw);
16 static bool ixgb_wait_eeprom_command(struct ixgb_hw *hw);
18 static void ixgb_cleanup_eeprom(struct ixgb_hw *hw);
27 ixgb_raise_clock(struct ixgb_hw *hw, in ixgb_raise_clock() argument
34 IXGB_WRITE_REG(hw, EECD, *eecd_reg); in ixgb_raise_clock()
35 IXGB_WRITE_FLUSH(hw); in ixgb_raise_clock()
46 ixgb_lower_clock(struct ixgb_hw *hw, in ixgb_lower_clock() argument
53 IXGB_WRITE_REG(hw, EECD, *eecd_reg); in ixgb_lower_clock()
54 IXGB_WRITE_FLUSH(hw); in ixgb_lower_clock()
66 ixgb_shift_out_bits(struct ixgb_hw *hw, in ixgb_shift_out_bits() argument
78 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_shift_out_bits()
91 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_shift_out_bits()
92 IXGB_WRITE_FLUSH(hw); in ixgb_shift_out_bits()
96 ixgb_raise_clock(hw, &eecd_reg); in ixgb_shift_out_bits()
97 ixgb_lower_clock(hw, &eecd_reg); in ixgb_shift_out_bits()
105 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_shift_out_bits()
114 ixgb_shift_in_bits(struct ixgb_hw *hw) in ixgb_shift_in_bits() argument
127 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_shift_in_bits()
134 ixgb_raise_clock(hw, &eecd_reg); in ixgb_shift_in_bits()
136 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_shift_in_bits()
142 ixgb_lower_clock(hw, &eecd_reg); in ixgb_shift_in_bits()
157 ixgb_setup_eeprom(struct ixgb_hw *hw) in ixgb_setup_eeprom() argument
161 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_setup_eeprom()
165 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_setup_eeprom()
169 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_setup_eeprom()
178 ixgb_standby_eeprom(struct ixgb_hw *hw) in ixgb_standby_eeprom() argument
182 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_standby_eeprom()
186 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_standby_eeprom()
187 IXGB_WRITE_FLUSH(hw); in ixgb_standby_eeprom()
192 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_standby_eeprom()
193 IXGB_WRITE_FLUSH(hw); in ixgb_standby_eeprom()
198 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_standby_eeprom()
199 IXGB_WRITE_FLUSH(hw); in ixgb_standby_eeprom()
204 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_standby_eeprom()
205 IXGB_WRITE_FLUSH(hw); in ixgb_standby_eeprom()
215 ixgb_clock_eeprom(struct ixgb_hw *hw) in ixgb_clock_eeprom() argument
219 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_clock_eeprom()
223 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_clock_eeprom()
224 IXGB_WRITE_FLUSH(hw); in ixgb_clock_eeprom()
229 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_clock_eeprom()
230 IXGB_WRITE_FLUSH(hw); in ixgb_clock_eeprom()
240 ixgb_cleanup_eeprom(struct ixgb_hw *hw) in ixgb_cleanup_eeprom() argument
244 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_cleanup_eeprom()
248 IXGB_WRITE_REG(hw, EECD, eecd_reg); in ixgb_cleanup_eeprom()
250 ixgb_clock_eeprom(hw); in ixgb_cleanup_eeprom()
265 ixgb_wait_eeprom_command(struct ixgb_hw *hw) in ixgb_wait_eeprom_command() argument
273 ixgb_standby_eeprom(hw); in ixgb_wait_eeprom_command()
280 eecd_reg = IXGB_READ_REG(hw, EECD); in ixgb_wait_eeprom_command()
305 ixgb_validate_eeprom_checksum(struct ixgb_hw *hw) in ixgb_validate_eeprom_checksum() argument
311 checksum += ixgb_read_eeprom(hw, i); in ixgb_validate_eeprom_checksum()
328 ixgb_update_eeprom_checksum(struct ixgb_hw *hw) in ixgb_update_eeprom_checksum() argument
334 checksum += ixgb_read_eeprom(hw, i); in ixgb_update_eeprom_checksum()
338 ixgb_write_eeprom(hw, EEPROM_CHECKSUM_REG, checksum); in ixgb_update_eeprom_checksum()
353 ixgb_write_eeprom(struct ixgb_hw *hw, u16 offset, u16 data) in ixgb_write_eeprom() argument
355 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; in ixgb_write_eeprom()
358 ixgb_setup_eeprom(hw); in ixgb_write_eeprom()
363 ixgb_shift_out_bits(hw, EEPROM_EWEN_OPCODE, 5); in ixgb_write_eeprom()
364 ixgb_shift_out_bits(hw, 0, 4); in ixgb_write_eeprom()
367 ixgb_standby_eeprom(hw); in ixgb_write_eeprom()
370 ixgb_shift_out_bits(hw, EEPROM_WRITE_OPCODE, 3); in ixgb_write_eeprom()
371 ixgb_shift_out_bits(hw, offset, 6); in ixgb_write_eeprom()
374 ixgb_shift_out_bits(hw, data, 16); in ixgb_write_eeprom()
376 ixgb_wait_eeprom_command(hw); in ixgb_write_eeprom()
379 ixgb_standby_eeprom(hw); in ixgb_write_eeprom()
385 ixgb_shift_out_bits(hw, EEPROM_EWDS_OPCODE, 5); in ixgb_write_eeprom()
386 ixgb_shift_out_bits(hw, 0, 4); in ixgb_write_eeprom()
389 ixgb_cleanup_eeprom(hw); in ixgb_write_eeprom()
405 ixgb_read_eeprom(struct ixgb_hw *hw, in ixgb_read_eeprom() argument
411 ixgb_setup_eeprom(hw); in ixgb_read_eeprom()
414 ixgb_shift_out_bits(hw, EEPROM_READ_OPCODE, 3); in ixgb_read_eeprom()
418 ixgb_shift_out_bits(hw, offset, 6); in ixgb_read_eeprom()
421 data = ixgb_shift_in_bits(hw); in ixgb_read_eeprom()
424 ixgb_standby_eeprom(hw); in ixgb_read_eeprom()
440 ixgb_get_eeprom_data(struct ixgb_hw *hw) in ixgb_get_eeprom_data() argument
448 ee_map = (struct ixgb_ee_map_type *)hw->eeprom; in ixgb_get_eeprom_data()
453 ee_data = ixgb_read_eeprom(hw, i); in ixgb_get_eeprom_data()
455 hw->eeprom[i] = cpu_to_le16(ee_data); in ixgb_get_eeprom_data()
486 ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw) in ixgb_check_and_get_eeprom_data() argument
488 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; in ixgb_check_and_get_eeprom_data()
494 return ixgb_get_eeprom_data(hw); in ixgb_check_and_get_eeprom_data()
508 ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index) in ixgb_get_eeprom_word() argument
511 if (index < IXGB_EEPROM_SIZE && ixgb_check_and_get_eeprom_data(hw)) in ixgb_get_eeprom_word()
512 return hw->eeprom[index]; in ixgb_get_eeprom_word()
526 ixgb_get_ee_mac_addr(struct ixgb_hw *hw, in ixgb_get_ee_mac_addr() argument
530 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; in ixgb_get_ee_mac_addr()
534 if (ixgb_check_and_get_eeprom_data(hw)) { in ixgb_get_ee_mac_addr()
552 ixgb_get_ee_pba_number(struct ixgb_hw *hw) in ixgb_get_ee_pba_number() argument
554 if (ixgb_check_and_get_eeprom_data(hw)) in ixgb_get_ee_pba_number()
555 return le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) in ixgb_get_ee_pba_number()
556 | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16); in ixgb_get_ee_pba_number()
571 ixgb_get_ee_device_id(struct ixgb_hw *hw) in ixgb_get_ee_device_id() argument
573 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; in ixgb_get_ee_device_id()
575 if (ixgb_check_and_get_eeprom_data(hw)) in ixgb_get_ee_device_id()