* Set device link up: enable tx. */
| 2984 | * Set device link up: enable tx. |
| 2985 | */ |
| 2986 | static int |
| 2987 | ixgbe_dev_set_link_up(struct rte_eth_dev *dev) |
| 2988 | { |
| 2989 | struct ixgbe_hw *hw = |
| 2990 | IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 2991 | |
| 2992 | /* |
| 2993 | * This function calls into the base driver, which in turn will use |
| 2994 | * function pointers, which are not guaranteed to be valid in secondary |
| 2995 | * processes, so avoid using this function in secondary processes. |
| 2996 | */ |
| 2997 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 2998 | return -E_RTE_SECONDARY; |
| 2999 | |
| 3000 | if (hw->mac.type == ixgbe_mac_82599EB) { |
| 3001 | #ifdef RTE_LIBRTE_IXGBE_BYPASS |
| 3002 | if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) { |
| 3003 | /* Not supported in bypass mode */ |
| 3004 | PMD_INIT_LOG(ERR, "Set link up is not supported " |
| 3005 | "by device id 0x%x", hw->device_id); |
| 3006 | return -ENOTSUP; |
| 3007 | } |
| 3008 | #endif |
| 3009 | } |
| 3010 | |
| 3011 | if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) { |
| 3012 | /* Turn on the copper */ |
| 3013 | ixgbe_set_phy_power(hw, true); |
| 3014 | } else { |
| 3015 | /* Turn on the laser */ |
| 3016 | ixgbe_enable_tx_laser(hw); |
| 3017 | ixgbe_dev_link_update(dev, 0); |
| 3018 | } |
| 3019 | |
| 3020 | return 0; |
| 3021 | } |
| 3022 | |
| 3023 | /* |
| 3024 | * Set device link down: disable tx. |
nothing calls this directly
no test coverage detected