src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_set_san_mac_addr(struct txgbe_hw *hw, u8 *san_mac_addr)
{
	s32 err;
	u16 san_mac_data, san_mac_offset;
	u8 i;

	DEBUGFUNC("txgbe_set_san_mac_addr");

	/* Look for SAN mac address pointer.  If not defined, return */
	err = txgbe_get_san_mac_addr_offset(hw, &san_mac_offset);
	if (err || san_mac_offset == 0 || san_mac_offset == 0xFFFF)
		return TXGBE_ERR_NO_SAN_ADDR_PTR;

	/* Apply the port offset to the address offset */
	(hw->bus.func) ? (san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT1_OFFSET) :
			 (san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT0_OFFSET);

	for (i = 0; i < 3; i++) {
		san_mac_data = (u16)((u16)(san_mac_addr[i * 2 + 1]) << 8);
		san_mac_data |= (u16)(san_mac_addr[i * 2]);
		hw->rom.write16(hw, san_mac_offset, san_mac_data);
		san_mac_offset++;
	}

	return 0;
}
/**
 *  txgbe_set_san_mac_addr - Write the SAN MAC address to the EEPROM
 *  @hw: pointer to hardware structure
 *  @san_mac_addr: SAN MAC address
 *
 *  Write a SAN MAC address to the EEPROM.
 **/
Write the SAN MAC address to the EEPROM
@hw: pointer to hardware structure
@san_mac_addr: SAN MAC address

Write a SAN MAC address to the EEPROM.
Write the SAN MAC address to the EEPROM @hw : pointer to hardware structure @san_mac_addr : SAN MAC address Write a SAN MAC address to the EEPROM .
s32 txgbe_set_san_mac_addr(struct txgbe_hw *hw, u8 *san_mac_addr)
{
	s32 err;
	u16 san_mac_data, san_mac_offset;
	u8 i;
	DEBUGFUNC("txgbe_set_san_mac_addr");
	err = txgbe_get_san_mac_addr_offset(hw, &san_mac_offset);
	if (err || san_mac_offset == 0 || san_mac_offset == 0xFFFF)
		return TXGBE_ERR_NO_SAN_ADDR_PTR;
	(hw->bus.func) ? (san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT1_OFFSET) :
			 (san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT0_OFFSET);
	for (i = 0; i < 3; i++) {
		san_mac_data = (u16)((u16)(san_mac_addr[i * 2 + 1]) << 8);
		san_mac_data |= (u16)(san_mac_addr[i * 2]);
		hw->rom.write16(hw, san_mac_offset, san_mac_data);
		san_mac_offset++;
	}
	return 0;
}
s32 txgbe_set_san_mac_addr ( struct txgbe_hw * hw , u8 * san_mac_addr ) { s32 err ; u16 san_mac_data , san_mac_offset ; u8 i ; DEBUGFUNC ( " " ) ; err = txgbe_get_san_mac_addr_offset ( hw , & san_mac_offset ) ; if ( err || san_mac_offset == 0 || san_mac_offset == 0xFFFF ) return TXGBE_ERR_NO_SAN_ADDR_PTR ; ( hw -> bus . func ) ? ( san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT1_OFFSET ) : ( san_mac_offset += TXGBE_SAN_MAC_ADDR_PORT0_OFFSET ) ; for ( i = 0 ; i < 3 ; i ++ ) { san_mac_data = ( u16 ) ( ( u16 ) ( san_mac_addr [ i * 2 + 1 ] ) << 8 ) ; san_mac_data |= ( u16 ) ( san_mac_addr [ i * 2 ] ) ; hw -> rom . write16 ( hw , san_mac_offset , san_mac_data ) ; san_mac_offset ++ ; } return 0 ; }
txgbe_set_san_mac_addr - Write the SAN MAC address to the EEPROM
  @hw: pointer to hardware structure
  @san_mac_addr: SAN MAC address
txgbe_set_san_mac_addr - Write the SAN MAC address to the EEPROM @hw : pointer to hardware structure @san_mac_addr : SAN MAC address
/* Look for SAN mac address pointer.  If not defined, return */ /* Apply the port offset to the address offset */