src/dpdk/drivers/net/e1000/base/e1000_api.c
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
{
	s32 ret_val;

	/* Can't do much good without knowing the MAC type. */
	ret_val = e1000_set_mac_type(hw);
	if (ret_val) {
		DEBUGOUT("ERROR: MAC type could not be set properly.\n");
		goto out;
	}

	if (!hw->hw_addr) {
		DEBUGOUT("ERROR: Registers not mapped\n");
		ret_val = -E1000_ERR_CONFIG;
		goto out;
	}

	/*
	 * Init function pointers to generic implementations. We do this first
	 * allowing a driver module to override it afterward.
	 */
	e1000_init_mac_ops_generic(hw);
	e1000_init_phy_ops_generic(hw);
	e1000_init_nvm_ops_generic(hw);
	e1000_init_mbx_ops_generic(hw);

	/*
	 * Set up the init function pointers. These are functions within the
	 * adapter family file that sets up function pointers for the rest of
	 * the functions in that family.
	 */
	switch (hw->mac.type) {
	case e1000_82542:
		e1000_init_function_pointers_82542(hw);
		break;
	case e1000_82543:
	case e1000_82544:
		e1000_init_function_pointers_82543(hw);
		break;
	case e1000_82540:
	case e1000_82545:
	case e1000_82545_rev_3:
	case e1000_82546:
	case e1000_82546_rev_3:
		e1000_init_function_pointers_82540(hw);
		break;
	case e1000_82541:
	case e1000_82541_rev_2:
	case e1000_82547:
	case e1000_82547_rev_2:
		e1000_init_function_pointers_82541(hw);
		break;
	case e1000_82571:
	case e1000_82572:
	case e1000_82573:
	case e1000_82574:
	case e1000_82583:
		e1000_init_function_pointers_82571(hw);
		break;
	case e1000_80003es2lan:
		e1000_init_function_pointers_80003es2lan(hw);
		break;
	case e1000_ich8lan:
	case e1000_ich9lan:
	case e1000_ich10lan:
	case e1000_pchlan:
	case e1000_pch2lan:
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_adp:
		e1000_init_function_pointers_ich8lan(hw);
		break;
	case e1000_82575:
	case e1000_82576:
	case e1000_82580:
	case e1000_i350:
	case e1000_i354:
		e1000_init_function_pointers_82575(hw);
		break;
	case e1000_i210:
	case e1000_i211:
		e1000_init_function_pointers_i210(hw);
		break;
	case e1000_vfadapt:
		e1000_init_function_pointers_vf(hw);
		break;
	case e1000_vfadapt_i350:
		e1000_init_function_pointers_vf(hw);
		break;
	default:
		DEBUGOUT("Hardware not supported\n");
		ret_val = -E1000_ERR_CONFIG;
		break;
	}

	/*
	 * Initialize the rest of the function pointers. These require some
	 * register reads/writes in some cases.
	 */
	if (!(ret_val) && init_device) {
		ret_val = e1000_init_mac_params(hw);
		if (ret_val)
			goto out;

		ret_val = e1000_init_nvm_params(hw);
		if (ret_val)
			goto out;

		ret_val = e1000_init_phy_params(hw);
		if (ret_val)
			goto out;

		ret_val = e1000_init_mbx_params(hw);
		if (ret_val)
			goto out;
	}

out:
	return ret_val;
}
/**
 *  e1000_setup_init_funcs - Initializes function pointers
 *  @hw: pointer to the HW structure
 *  @init_device: true will initialize the rest of the function pointers
 *		  getting the device ready for use.  false will only set
 *		  MAC type and the function pointers for the other init
 *		  functions.  Passing false will not generate any hardware
 *		  reads or writes.
 *
 *  This function must be called by a driver in order to use the rest
 *  of the 'shared' code files. Called by drivers only.
 **/
Initializes function pointers
@hw: pointer to the HW structure
@init_device: true will initialize the rest of the function pointers
getting the device ready for use.  false will only set
MAC type and the function pointers for the other init
functions.  Passing false will not generate any hardware
reads or writes.

This function must be called by a driver in order to use the rest
of the 'shared' code files. Called by drivers only.
Initializes function pointers @hw : pointer to the HW structure @init_device : true will initialize the rest of the function pointers getting the device ready for use . false will only set MAC type and the function pointers for the other init functions . Passing false will not generate any hardware reads or writes . This function must be called by a driver in order to use the rest of the ' shared ' code files . Called by drivers only .
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
{
	s32 ret_val;
	ret_val = e1000_set_mac_type(hw);
	if (ret_val) {
		DEBUGOUT("ERROR: MAC type could not be set properly.\n");
		goto out;
	}
	if (!hw->hw_addr) {
		DEBUGOUT("ERROR: Registers not mapped\n");
		ret_val = -E1000_ERR_CONFIG;
		goto out;
	}
	e1000_init_mac_ops_generic(hw);
	e1000_init_phy_ops_generic(hw);
	e1000_init_nvm_ops_generic(hw);
	e1000_init_mbx_ops_generic(hw);
	switch (hw->mac.type) {
	case e1000_82542:
		e1000_init_function_pointers_82542(hw);
		break;
	case e1000_82543:
	case e1000_82544:
		e1000_init_function_pointers_82543(hw);
		break;
	case e1000_82540:
	case e1000_82545:
	case e1000_82545_rev_3:
	case e1000_82546:
	case e1000_82546_rev_3:
		e1000_init_function_pointers_82540(hw);
		break;
	case e1000_82541:
	case e1000_82541_rev_2:
	case e1000_82547:
	case e1000_82547_rev_2:
		e1000_init_function_pointers_82541(hw);
		break;
	case e1000_82571:
	case e1000_82572:
	case e1000_82573:
	case e1000_82574:
	case e1000_82583:
		e1000_init_function_pointers_82571(hw);
		break;
	case e1000_80003es2lan:
		e1000_init_function_pointers_80003es2lan(hw);
		break;
	case e1000_ich8lan:
	case e1000_ich9lan:
	case e1000_ich10lan:
	case e1000_pchlan:
	case e1000_pch2lan:
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_adp:
		e1000_init_function_pointers_ich8lan(hw);
		break;
	case e1000_82575:
	case e1000_82576:
	case e1000_82580:
	case e1000_i350:
	case e1000_i354:
		e1000_init_function_pointers_82575(hw);
		break;
	case e1000_i210:
	case e1000_i211:
		e1000_init_function_pointers_i210(hw);
		break;
	case e1000_vfadapt:
		e1000_init_function_pointers_vf(hw);
		break;
	case e1000_vfadapt_i350:
		e1000_init_function_pointers_vf(hw);
		break;
	default:
		DEBUGOUT("Hardware not supported\n");
		ret_val = -E1000_ERR_CONFIG;
		break;
	}
	if (!(ret_val) && init_device) {
		ret_val = e1000_init_mac_params(hw);
		if (ret_val)
			goto out;
		ret_val = e1000_init_nvm_params(hw);
		if (ret_val)
			goto out;
		ret_val = e1000_init_phy_params(hw);
		if (ret_val)
			goto out;
		ret_val = e1000_init_mbx_params(hw);
		if (ret_val)
			goto out;
	}
out:
	return ret_val;
}
s32 e1000_setup_init_funcs ( struct e1000_hw * hw , bool init_device ) { s32 ret_val ; ret_val = e1000_set_mac_type ( hw ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; goto out ; } if ( ! hw -> hw_addr ) { DEBUGOUT ( " \n " ) ; ret_val = - E1000_ERR_CONFIG ; goto out ; } e1000_init_mac_ops_generic ( hw ) ; e1000_init_phy_ops_generic ( hw ) ; e1000_init_nvm_ops_generic ( hw ) ; e1000_init_mbx_ops_generic ( hw ) ; switch ( hw -> mac . type ) { case e1000_82542 : e1000_init_function_pointers_82542 ( hw ) ; break ; case e1000_82543 : case e1000_82544 : e1000_init_function_pointers_82543 ( hw ) ; break ; case e1000_82540 : case e1000_82545 : case e1000_82545_rev_3 : case e1000_82546 : case e1000_82546_rev_3 : e1000_init_function_pointers_82540 ( hw ) ; break ; case e1000_82541 : case e1000_82541_rev_2 : case e1000_82547 : case e1000_82547_rev_2 : e1000_init_function_pointers_82541 ( hw ) ; break ; case e1000_82571 : case e1000_82572 : case e1000_82573 : case e1000_82574 : case e1000_82583 : e1000_init_function_pointers_82571 ( hw ) ; break ; case e1000_80003es2lan : e1000_init_function_pointers_80003es2lan ( hw ) ; break ; case e1000_ich8lan : case e1000_ich9lan : case e1000_ich10lan : case e1000_pchlan : case e1000_pch2lan : case e1000_pch_lpt : case e1000_pch_spt : case e1000_pch_cnp : case e1000_pch_adp : e1000_init_function_pointers_ich8lan ( hw ) ; break ; case e1000_82575 : case e1000_82576 : case e1000_82580 : case e1000_i350 : case e1000_i354 : e1000_init_function_pointers_82575 ( hw ) ; break ; case e1000_i210 : case e1000_i211 : e1000_init_function_pointers_i210 ( hw ) ; break ; case e1000_vfadapt : e1000_init_function_pointers_vf ( hw ) ; break ; case e1000_vfadapt_i350 : e1000_init_function_pointers_vf ( hw ) ; break ; default : DEBUGOUT ( " \n " ) ; ret_val = - E1000_ERR_CONFIG ; break ; } if ( ! ( ret_val ) && init_device ) { ret_val = e1000_init_mac_params ( hw ) ; if ( ret_val ) goto out ; ret_val = e1000_init_nvm_params ( hw ) ; if ( ret_val ) goto out ; ret_val = e1000_init_phy_params ( hw ) ; if ( ret_val ) goto out ; ret_val = e1000_init_mbx_params ( hw ) ; if ( ret_val ) goto out ; } out : return ret_val ; }
e1000_setup_init_funcs - Initializes function pointers
  @hw: pointer to the HW structure
  @init_device: true will initialize the rest of the function pointers
                getting the device ready for use.
e1000_setup_init_funcs - Initializes function pointers @hw : pointer to the HW structure @init_device : true will initialize the rest of the function pointers getting the device ready for use .
/* Can't do much good without knowing the MAC type. */ /*
	 * Init function pointers to generic implementations. We do this first
	 * allowing a driver module to override it afterward.
	 */ /*
	 * Set up the init function pointers. These are functions within the
	 * adapter family file that sets up function pointers for the rest of
	 * the functions in that family.
	 */ /*
	 * Initialize the rest of the function pointers. These require some
	 * register reads/writes in some cases.
	 */