src/dpdk/drivers/net/igc/base/igc_nvm.c
s32 igc_read_pba_num_generic(struct igc_hw *hw, u32 *pba_num)
{
	s32 ret_val;
	u16 nvm_data;

	DEBUGFUNC("igc_read_pba_num_generic");

	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
	if (ret_val) {
		DEBUGOUT("NVM Read Error\n");
		return ret_val;
	} else if (nvm_data == NVM_PBA_PTR_GUARD) {
		DEBUGOUT("NVM Not Supported\n");
		return -IGC_NOT_IMPLEMENTED;
	}
	*pba_num = (u32)(nvm_data << 16);

	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
	if (ret_val) {
		DEBUGOUT("NVM Read Error\n");
		return ret_val;
	}
	*pba_num |= nvm_data;

	return IGC_SUCCESS;
}
/**
 *  igc_read_pba_num_generic - Read device part number
 *  @hw: pointer to the HW structure
 *  @pba_num: pointer to device part number
 *
 *  Reads the product board assembly (PBA) number from the EEPROM and stores
 *  the value in pba_num.
 **/
Read device part number
@hw: pointer to the HW structure
@pba_num: pointer to device part number

Reads the product board assembly (PBA) number from the EEPROM and stores
the value in pba_num.
Read device part number @hw : pointer to the HW structure @pba_num : pointer to device part number Reads the product board assembly ( PBA ) number from the EEPROM and stores the value in pba_num .
s32 igc_read_pba_num_generic(struct igc_hw *hw, u32 *pba_num)
{
	s32 ret_val;
	u16 nvm_data;
	DEBUGFUNC("igc_read_pba_num_generic");
	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
	if (ret_val) {
		DEBUGOUT("NVM Read Error\n");
		return ret_val;
	} else if (nvm_data == NVM_PBA_PTR_GUARD) {
		DEBUGOUT("NVM Not Supported\n");
		return -IGC_NOT_IMPLEMENTED;
	}
	*pba_num = (u32)(nvm_data << 16);
	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
	if (ret_val) {
		DEBUGOUT("NVM Read Error\n");
		return ret_val;
	}
	*pba_num |= nvm_data;
	return IGC_SUCCESS;
}
s32 igc_read_pba_num_generic ( struct igc_hw * hw , u32 * pba_num ) { s32 ret_val ; u16 nvm_data ; DEBUGFUNC ( " " ) ; ret_val = hw -> nvm . ops . read ( hw , NVM_PBA_OFFSET_0 , 1 , & nvm_data ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; return ret_val ; } else if ( nvm_data == NVM_PBA_PTR_GUARD ) { DEBUGOUT ( " \n " ) ; return - IGC_NOT_IMPLEMENTED ; } * pba_num = ( u32 ) ( nvm_data << 16 ) ; ret_val = hw -> nvm . ops . read ( hw , NVM_PBA_OFFSET_1 , 1 , & nvm_data ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; return ret_val ; } * pba_num |= nvm_data ; return IGC_SUCCESS ; }
igc_read_pba_num_generic - Read device part number
  @hw: pointer to the HW structure
  @pba_num: pointer to device part number
igc_read_pba_num_generic - Read device part number @hw : pointer to the HW structure @pba_num : pointer to device part number