src/dpdk/drivers/net/igc/base/igc_nvm.c
static u16 igc_shift_in_eec_bits(struct igc_hw *hw, u16 count)
{
	u32 eecd;
	u32 i;
	u16 data;

	DEBUGFUNC("igc_shift_in_eec_bits");

	eecd = IGC_READ_REG(hw, IGC_EECD);

	eecd &= ~(IGC_EECD_DO | IGC_EECD_DI);
	data = 0;

	for (i = 0; i < count; i++) {
		data <<= 1;
		igc_raise_eec_clk(hw, &eecd);

		eecd = IGC_READ_REG(hw, IGC_EECD);

		eecd &= ~IGC_EECD_DI;
		if (eecd & IGC_EECD_DO)
			data |= 1;

		igc_lower_eec_clk(hw, &eecd);
	}

	return data;
}
/**
 *  igc_shift_in_eec_bits - Shift data bits in from the EEPROM
 *  @hw: pointer to the HW structure
 *  @count: number of bits to shift in
 *
 *  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.
 **/
Shift data bits in from the EEPROM
@hw: pointer to the HW structure
@count: number of bits to shift in

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.
Shift data bits in from the EEPROM @hw : pointer to the HW structure @count : number of bits to shift in 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 igc_shift_in_eec_bits(struct igc_hw *hw, u16 count)
{
	u32 eecd;
	u32 i;
	u16 data;
	DEBUGFUNC("igc_shift_in_eec_bits");
	eecd = IGC_READ_REG(hw, IGC_EECD);
	eecd &= ~(IGC_EECD_DO | IGC_EECD_DI);
	data = 0;
	for (i = 0; i < count; i++) {
		data <<= 1;
		igc_raise_eec_clk(hw, &eecd);
		eecd = IGC_READ_REG(hw, IGC_EECD);
		eecd &= ~IGC_EECD_DI;
		if (eecd & IGC_EECD_DO)
			data |= 1;
		igc_lower_eec_clk(hw, &eecd);
	}
	return data;
}
static u16 igc_shift_in_eec_bits ( struct igc_hw * hw , u16 count ) { u32 eecd ; u32 i ; u16 data ; DEBUGFUNC ( " " ) ; eecd = IGC_READ_REG ( hw , IGC_EECD ) ; eecd &= ~ ( IGC_EECD_DO | IGC_EECD_DI ) ; data = 0 ; for ( i = 0 ; i < count ; i ++ ) { data <<= 1 ; igc_raise_eec_clk ( hw , & eecd ) ; eecd = IGC_READ_REG ( hw , IGC_EECD ) ; eecd &= ~ IGC_EECD_DI ; if ( eecd & IGC_EECD_DO ) data |= 1 ; igc_lower_eec_clk ( hw , & eecd ) ; } return data ; }
igc_shift_in_eec_bits - Shift data bits in from the EEPROM
  @hw: pointer to the HW structure
  @count: number of bits to shift in
igc_shift_in_eec_bits - Shift data bits in from the EEPROM @hw : pointer to the HW structure @count : number of bits to shift in