src/dpdk/drivers/net/igc/base/igc_nvm.c
s32 igc_read_mac_addr_generic(struct igc_hw *hw)
{
	u32 rar_high;
	u32 rar_low;
	u16 i;

	rar_high = IGC_READ_REG(hw, IGC_RAH(0));
	rar_low = IGC_READ_REG(hw, IGC_RAL(0));

	for (i = 0; i < IGC_RAL_MAC_ADDR_LEN; i++)
		hw->mac.perm_addr[i] = (u8)(rar_low >> (i * 8));

	for (i = 0; i < IGC_RAH_MAC_ADDR_LEN; i++)
		hw->mac.perm_addr[i + 4] = (u8)(rar_high >> (i * 8));

	for (i = 0; i < ETH_ADDR_LEN; i++)
		hw->mac.addr[i] = hw->mac.perm_addr[i];

	return IGC_SUCCESS;
}
/**
 *  igc_read_mac_addr_generic - Read device MAC address
 *  @hw: pointer to the HW structure
 *
 *  Reads the device MAC address from the EEPROM and stores the value.
 *  Since devices with two ports use the same EEPROM, we increment the
 *  last bit in the MAC address for the second port.
 **/
Read device MAC address
@hw: pointer to the HW structure

Reads the device MAC address from the EEPROM and stores the value.
Since devices with two ports use the same EEPROM, we increment the
last bit in the MAC address for the second port.
Read device MAC address @hw : pointer to the HW structure Reads the device MAC address from the EEPROM and stores the value . Since devices with two ports use the same EEPROM we increment the last bit in the MAC address for the second port .
s32 igc_read_mac_addr_generic(struct igc_hw *hw)
{
	u32 rar_high;
	u32 rar_low;
	u16 i;
	rar_high = IGC_READ_REG(hw, IGC_RAH(0));
	rar_low = IGC_READ_REG(hw, IGC_RAL(0));
	for (i = 0; i < IGC_RAL_MAC_ADDR_LEN; i++)
		hw->mac.perm_addr[i] = (u8)(rar_low >> (i * 8));
	for (i = 0; i < IGC_RAH_MAC_ADDR_LEN; i++)
		hw->mac.perm_addr[i + 4] = (u8)(rar_high >> (i * 8));
	for (i = 0; i < ETH_ADDR_LEN; i++)
		hw->mac.addr[i] = hw->mac.perm_addr[i];
	return IGC_SUCCESS;
}
s32 igc_read_mac_addr_generic ( struct igc_hw * hw ) { u32 rar_high ; u32 rar_low ; u16 i ; rar_high = IGC_READ_REG ( hw , IGC_RAH ( 0 ) ) ; rar_low = IGC_READ_REG ( hw , IGC_RAL ( 0 ) ) ; for ( i = 0 ; i < IGC_RAL_MAC_ADDR_LEN ; i ++ ) hw -> mac . perm_addr [ i ] = ( u8 ) ( rar_low >> ( i * 8 ) ) ; for ( i = 0 ; i < IGC_RAH_MAC_ADDR_LEN ; i ++ ) hw -> mac . perm_addr [ i + 4 ] = ( u8 ) ( rar_high >> ( i * 8 ) ) ; for ( i = 0 ; i < ETH_ADDR_LEN ; i ++ ) hw -> mac . addr [ i ] = hw -> mac . perm_addr [ i ] ; return IGC_SUCCESS ; }
igc_read_mac_addr_generic - Read device MAC address
  @hw: pointer to the HW structure
igc_read_mac_addr_generic - Read device MAC address @hw : pointer to the HW structure