src/dpdk/drivers/net/igc/base/igc_nvm.c
static void igc_shift_out_eec_bits(struct igc_hw *hw, u16 data, u16 count)
{
	struct igc_nvm_info *nvm = &hw->nvm;
	u32 eecd = IGC_READ_REG(hw, IGC_EECD);
	u32 mask;

	DEBUGFUNC("igc_shift_out_eec_bits");

	mask = 0x01 << (count - 1);
	if (nvm->type == igc_nvm_eeprom_microwire)
		eecd &= ~IGC_EECD_DO;
	else if (nvm->type == igc_nvm_eeprom_spi)
		eecd |= IGC_EECD_DO;

	do {
		eecd &= ~IGC_EECD_DI;

		if (data & mask)
			eecd |= IGC_EECD_DI;

		IGC_WRITE_REG(hw, IGC_EECD, eecd);
		IGC_WRITE_FLUSH(hw);

		usec_delay(nvm->delay_usec);

		igc_raise_eec_clk(hw, &eecd);
		igc_lower_eec_clk(hw, &eecd);

		mask >>= 1;
	} while (mask);

	eecd &= ~IGC_EECD_DI;
	IGC_WRITE_REG(hw, IGC_EECD, eecd);
}
/**
 *  igc_shift_out_eec_bits - Shift data bits our to the EEPROM
 *  @hw: pointer to the HW structure
 *  @data: data to send to the EEPROM
 *  @count: number of bits to shift out
 *
 *  We need to shift 'count' bits out to the EEPROM.  So, the value in the
 *  "data" parameter will be shifted out to the EEPROM one bit at a time.
 *  In order to do this, "data" must be broken down into bits.
 **/
Shift data bits our to the EEPROM
@hw: pointer to the HW structure
@data: data to send to the EEPROM
@count: number of bits to shift out

We need to shift 'count' bits out to the EEPROM.  So, the value in the
"data" parameter will be shifted out to the EEPROM one bit at a time.
In order to do this, "data" must be broken down into bits.
Shift data bits our to the EEPROM @hw : pointer to the HW structure @data : data to send to the EEPROM @count : number of bits to shift out We need to shift ' count ' bits out to the EEPROM . So the value in the " data " parameter will be shifted out to the EEPROM one bit at a time . In order to do this " data " must be broken down into bits .
static void igc_shift_out_eec_bits(struct igc_hw *hw, u16 data, u16 count)
{
	struct igc_nvm_info *nvm = &hw->nvm;
	u32 eecd = IGC_READ_REG(hw, IGC_EECD);
	u32 mask;
	DEBUGFUNC("igc_shift_out_eec_bits");
	mask = 0x01 << (count - 1);
	if (nvm->type == igc_nvm_eeprom_microwire)
		eecd &= ~IGC_EECD_DO;
	else if (nvm->type == igc_nvm_eeprom_spi)
		eecd |= IGC_EECD_DO;
	do {
		eecd &= ~IGC_EECD_DI;
		if (data & mask)
			eecd |= IGC_EECD_DI;
		IGC_WRITE_REG(hw, IGC_EECD, eecd);
		IGC_WRITE_FLUSH(hw);
		usec_delay(nvm->delay_usec);
		igc_raise_eec_clk(hw, &eecd);
		igc_lower_eec_clk(hw, &eecd);
		mask >>= 1;
	} while (mask);
	eecd &= ~IGC_EECD_DI;
	IGC_WRITE_REG(hw, IGC_EECD, eecd);
}
static void igc_shift_out_eec_bits ( struct igc_hw * hw , u16 data , u16 count ) { struct igc_nvm_info * nvm = & hw -> nvm ; u32 eecd = IGC_READ_REG ( hw , IGC_EECD ) ; u32 mask ; DEBUGFUNC ( " " ) ; mask = 0x01 << ( count - 1 ) ; if ( nvm -> type == igc_nvm_eeprom_microwire ) eecd &= ~ IGC_EECD_DO ; else if ( nvm -> type == igc_nvm_eeprom_spi ) eecd |= IGC_EECD_DO ; do { eecd &= ~ IGC_EECD_DI ; if ( data & mask ) eecd |= IGC_EECD_DI ; IGC_WRITE_REG ( hw , IGC_EECD , eecd ) ; IGC_WRITE_FLUSH ( hw ) ; usec_delay ( nvm -> delay_usec ) ; igc_raise_eec_clk ( hw , & eecd ) ; igc_lower_eec_clk ( hw , & eecd ) ; mask >>= 1 ; } while ( mask ) ; eecd &= ~ IGC_EECD_DI ; IGC_WRITE_REG ( hw , IGC_EECD , eecd ) ; }
igc_shift_out_eec_bits - Shift data bits our to the EEPROM
  @hw: pointer to the HW structure
  @data: data to send to the EEPROM
  @count: number of bits to shift out
igc_shift_out_eec_bits - Shift data bits our to the EEPROM @hw : pointer to the HW structure @data : data to send to the EEPROM @count : number of bits to shift out