示例#1
0
/**
 *  ixgbe_init_shared_code - Initialize the shared code
 *  @hw: pointer to hardware structure
 *
 *  This will assign function pointers and assign the MAC type and PHY code.
 *  Does not touch the hardware. This function must be called prior to any
 *  other function in the shared code. The ixgbe_hw structure should be
 *  memset to 0 prior to calling this function.  The following fields in
 *  hw structure should be filled in prior to calling this function:
 *  hw_addr, back, device_id, vendor_id, subsystem_device_id,
 *  subsystem_vendor_id, and revision_id
 **/
s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
{
	s32 status;

	DEBUGFUNC("ixgbe_init_shared_code");

	/*
	 * Set the mac type
	 */
	ixgbe_set_mac_type(hw);

	switch (hw->mac.type) {
	case ixgbe_mac_82598EB:
		status = ixgbe_init_ops_82598(hw);
		break;
	case ixgbe_mac_82599EB:
		status = ixgbe_init_ops_82599(hw);
		break;
	case ixgbe_mac_82599_vf:
	case ixgbe_mac_X540_vf:
		status = ixgbe_init_ops_vf(hw);
		break;
	case ixgbe_mac_X540:
		status = ixgbe_init_ops_X540(hw);
		break;
	default:
		status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
		break;
	}

	return status;
}
示例#2
0
/**
 *  ixgbevf_hv_init_ops_vf - Initialize the pointers for vf
 *  @hw: pointer to hardware structure
 *
 *  This will assign function pointers, adapter-specific functions can
 *  override the assignment of generic function pointers by assigning
 *  their own adapter-specific function pointers.
 *  Does not touch the hardware.
 **/
s32 ixgbevf_hv_init_ops_vf(struct ixgbe_hw *hw)
{
	/* Set defaults for VF then override applicable Hyper-V
	 * specific functions
	 */
	ixgbe_init_ops_vf(hw);

	hw->mac.ops.reset_hw = ixgbevf_hv_reset_hw_vf;
	hw->mac.ops.check_link = ixgbevf_hv_check_mac_link_vf;
	hw->mac.ops.negotiate_api_version = ixgbevf_hv_negotiate_api_version_vf;
	hw->mac.ops.set_rar = ixgbevf_hv_set_rar_vf;
	hw->mac.ops.update_mc_addr_list = ixgbevf_hv_update_mc_addr_list_vf;
	hw->mac.ops.update_xcast_mode = ixgbevf_hv_update_xcast_mode;
	hw->mac.ops.set_uc_addr = ixgbevf_hv_set_uc_addr_vf;
	hw->mac.ops.set_vfta = ixgbevf_hv_set_vfta_vf;
	hw->mac.ops.set_rlpml = ixgbevf_hv_set_rlpml_vf;

	return IXGBE_SUCCESS;
}