/* In order to read a register from the EEPROM, we need to shift 'count' bits in from the EEPROM. Bits are "shifted in" by raising the clock input to the EEPROM (setting the SK bit), and then reading the value of the data out "DO" bit. During this "shifting in" process the data in "DI" bit should always be clear.  */
static u16 igb_shift_in_eec_bits(struct e1000_hw *hw, u16 count)
/* In order to read a register from the EEPROM, we need to shift 'count' bits in from the EEPROM. Bits are "shifted in" by raising the clock input to the EEPROM (setting the SK bit), and then reading the value of the data out "DO" bit. During this "shifting in" process the data in "DI" bit should always be clear.  */
static u16 igb_shift_in_eec_bits(struct e1000_hw *hw, u16 count)
{
	u32 eecd;
	u32 i;
	u16 data;
	eecd = rd32(E1000_EECD);
	eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);
	data = 0;
	for (i = 0; i < count; i++) {
		data <<= 1;
		igb_raise_eec_clk(hw, &eecd);
		eecd = rd32(E1000_EECD);
		eecd &= ~E1000_EECD_DI;
		if (eecd & E1000_EECD_DO)
			data |= 1;
		igb_lower_eec_clk(hw, &eecd);
	}
	return data;
}