src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_get_wwn_prefix(struct txgbe_hw *hw, u16 *wwnn_prefix,
				 u16 *wwpn_prefix)
{
	u16 offset, caps;
	u16 alt_san_mac_blk_offset;

	DEBUGFUNC("txgbe_get_wwn_prefix");

	/* clear output first */
	*wwnn_prefix = 0xFFFF;
	*wwpn_prefix = 0xFFFF;

	/* check if alternative SAN MAC is supported */
	offset = TXGBE_ALT_SAN_MAC_ADDR_BLK_PTR;
	if (hw->rom.readw_sw(hw, offset, &alt_san_mac_blk_offset))
		goto wwn_prefix_err;

	if (alt_san_mac_blk_offset == 0 || alt_san_mac_blk_offset == 0xFFFF)
		goto wwn_prefix_out;

	/* check capability in alternative san mac address block */
	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET;
	if (hw->rom.read16(hw, offset, &caps))
		goto wwn_prefix_err;
	if (!(caps & TXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN))
		goto wwn_prefix_out;

	/* get the corresponding prefix for WWNN/WWPN */
	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET;
	if (hw->rom.read16(hw, offset, wwnn_prefix))
		DEBUGOUT("eeprom read at offset %d failed", offset);

	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET;
	if (hw->rom.read16(hw, offset, wwpn_prefix))
		goto wwn_prefix_err;

wwn_prefix_out:
	return 0;

wwn_prefix_err:
	DEBUGOUT("eeprom read at offset %d failed", offset);
	return 0;
}
/**
 *  txgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from
 *  the EEPROM
 *  @hw: pointer to hardware structure
 *  @wwnn_prefix: the alternative WWNN prefix
 *  @wwpn_prefix: the alternative WWPN prefix
 *
 *  This function will read the EEPROM from the alternative SAN MAC address
 *  block to check the support for the alternative WWNN/WWPN prefix support.
 **/
Get alternative WWNN/WWPN prefix from
the EEPROM
@hw: pointer to hardware structure
@wwnn_prefix: the alternative WWNN prefix
@wwpn_prefix: the alternative WWPN prefix

This function will read the EEPROM from the alternative SAN MAC address
block to check the support for the alternative WWNN/WWPN prefix support.
Get alternative WWNN / WWPN prefix from the EEPROM @hw : pointer to hardware structure @wwnn_prefix : the alternative WWNN prefix @wwpn_prefix : the alternative WWPN prefix This function will read the EEPROM from the alternative SAN MAC address block to check the support for the alternative WWNN / WWPN prefix support .
s32 txgbe_get_wwn_prefix(struct txgbe_hw *hw, u16 *wwnn_prefix,
				 u16 *wwpn_prefix)
{
	u16 offset, caps;
	u16 alt_san_mac_blk_offset;
	DEBUGFUNC("txgbe_get_wwn_prefix");
	*wwnn_prefix = 0xFFFF;
	*wwpn_prefix = 0xFFFF;
	offset = TXGBE_ALT_SAN_MAC_ADDR_BLK_PTR;
	if (hw->rom.readw_sw(hw, offset, &alt_san_mac_blk_offset))
		goto wwn_prefix_err;
	if (alt_san_mac_blk_offset == 0 || alt_san_mac_blk_offset == 0xFFFF)
		goto wwn_prefix_out;
	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET;
	if (hw->rom.read16(hw, offset, &caps))
		goto wwn_prefix_err;
	if (!(caps & TXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN))
		goto wwn_prefix_out;
	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET;
	if (hw->rom.read16(hw, offset, wwnn_prefix))
		DEBUGOUT("eeprom read at offset %d failed", offset);
	offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET;
	if (hw->rom.read16(hw, offset, wwpn_prefix))
		goto wwn_prefix_err;
wwn_prefix_out:
	return 0;
wwn_prefix_err:
	DEBUGOUT("eeprom read at offset %d failed", offset);
	return 0;
}
s32 txgbe_get_wwn_prefix ( struct txgbe_hw * hw , u16 * wwnn_prefix , u16 * wwpn_prefix ) { u16 offset , caps ; u16 alt_san_mac_blk_offset ; DEBUGFUNC ( " " ) ; * wwnn_prefix = 0xFFFF ; * wwpn_prefix = 0xFFFF ; offset = TXGBE_ALT_SAN_MAC_ADDR_BLK_PTR ; if ( hw -> rom . readw_sw ( hw , offset , & alt_san_mac_blk_offset ) ) goto wwn_prefix_err ; if ( alt_san_mac_blk_offset == 0 || alt_san_mac_blk_offset == 0xFFFF ) goto wwn_prefix_out ; offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET ; if ( hw -> rom . read16 ( hw , offset , & caps ) ) goto wwn_prefix_err ; if ( ! ( caps & TXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN ) ) goto wwn_prefix_out ; offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET ; if ( hw -> rom . read16 ( hw , offset , wwnn_prefix ) ) DEBUGOUT ( " " , offset ) ; offset = alt_san_mac_blk_offset + TXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET ; if ( hw -> rom . read16 ( hw , offset , wwpn_prefix ) ) goto wwn_prefix_err ; wwn_prefix_out : return 0 ; wwn_prefix_err : DEBUGOUT ( " " , offset ) ; return 0 ; }
txgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from
  the EEPROM
  @hw: pointer to hardware structure
  @wwnn_prefix: the alternative WWNN prefix
  @wwpn_prefix: the alternative WWPN prefix
txgbe_get_wwn_prefix - Get alternative WWNN / WWPN prefix from the EEPROM @hw : pointer to hardware structure @wwnn_prefix : the alternative WWNN prefix @wwpn_prefix : the alternative WWPN prefix
/* clear output first */ /* check if alternative SAN MAC is supported */ /* check capability in alternative san mac address block */ /* get the corresponding prefix for WWNN/WWPN */