| 527 | } |
| 528 | |
| 529 | static int |
| 530 | eth_em_start(struct rte_eth_dev *dev) |
| 531 | { |
| 532 | struct e1000_adapter *adapter = |
| 533 | E1000_DEV_PRIVATE(dev->data->dev_private); |
| 534 | struct e1000_hw *hw = |
| 535 | E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 536 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 537 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 538 | int ret, mask; |
| 539 | uint32_t intr_vector = 0; |
| 540 | uint32_t *speeds; |
| 541 | int num_speeds; |
| 542 | bool autoneg; |
| 543 | |
| 544 | PMD_INIT_FUNC_TRACE(); |
| 545 | |
| 546 | /* |
| 547 | * This function calls into the base driver, which in turn will use |
| 548 | * function pointers, which are not guaranteed to be valid in secondary |
| 549 | * processes, so avoid using this function in secondary processes. |
| 550 | */ |
| 551 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 552 | return -E_RTE_SECONDARY; |
| 553 | |
| 554 | ret = eth_em_stop(dev); |
| 555 | if (ret != 0) |
| 556 | return ret; |
| 557 | |
| 558 | e1000_power_up_phy(hw); |
| 559 | |
| 560 | /* Set default PBA value */ |
| 561 | em_set_pba(hw); |
| 562 | |
| 563 | /* Put the address into the Receive Address Array */ |
| 564 | e1000_rar_set(hw, hw->mac.addr, 0); |
| 565 | |
| 566 | /* |
| 567 | * With the 82571 adapter, RAR[0] may be overwritten |
| 568 | * when the other port is reset, we make a duplicate |
| 569 | * in RAR[14] for that eventuality, this assures |
| 570 | * the interface continues to function. |
| 571 | */ |
| 572 | if (hw->mac.type == e1000_82571) { |
| 573 | e1000_set_laa_state_82571(hw, TRUE); |
| 574 | e1000_rar_set(hw, hw->mac.addr, E1000_RAR_ENTRIES - 1); |
| 575 | } |
| 576 | |
| 577 | /* Initialize the hardware */ |
| 578 | if (em_hardware_init(hw)) { |
| 579 | PMD_INIT_LOG(ERR, "Unable to initialize the hardware"); |
| 580 | return -EIO; |
| 581 | } |
| 582 | |
| 583 | E1000_WRITE_REG(hw, E1000_VET, RTE_ETHER_TYPE_VLAN); |
| 584 | |
| 585 | /* Configure for OS presence */ |
| 586 | em_init_manageability(hw); |
nothing calls this directly
no test coverage detected