MCPcopy Create free account
hub / github.com/F-Stack/f-stack / txgbe_reset_hw

Function txgbe_reset_hw

dpdk/drivers/net/txgbe/base/txgbe_hw.c:3457–3575  ·  view source on GitHub ↗

* txgbe_reset_hw - Perform hardware reset * @hw: pointer to hardware structure * * Resets the hardware by resetting the transmit and receive units, masks * and clears all interrupts, perform a PHY reset, and perform a link (MAC) * reset. **/

Source from the content-addressed store, hash-verified

3455 * reset.
3456 **/
3457s32 txgbe_reset_hw(struct txgbe_hw *hw)
3458{
3459 s32 status;
3460 u32 autoc;
3461
3462 /* Call adapter stop to disable tx/rx and clear interrupts */
3463 status = hw->mac.stop_hw(hw);
3464 if (status != 0)
3465 return status;
3466
3467 /* flush pending Tx transactions */
3468 txgbe_clear_tx_pending(hw);
3469
3470 /* Identify PHY and related function pointers */
3471 status = hw->phy.init(hw);
3472 if (status == TXGBE_ERR_SFP_NOT_SUPPORTED)
3473 return status;
3474
3475 /* Setup SFP module if there is one present. */
3476 if (hw->phy.sfp_setup_needed) {
3477 status = hw->mac.setup_sfp(hw);
3478 hw->phy.sfp_setup_needed = false;
3479 }
3480 if (status == TXGBE_ERR_SFP_NOT_SUPPORTED)
3481 return status;
3482
3483 /* Reset PHY */
3484 if (!hw->phy.reset_disable)
3485 hw->phy.reset(hw);
3486
3487 /* remember AUTOC from before we reset */
3488 autoc = hw->mac.autoc_read(hw);
3489
3490mac_reset_top:
3491 /* Do LAN reset, the MNG domain will not be reset. */
3492 wr32(hw, TXGBE_RST, TXGBE_RST_LAN(hw->bus.lan_id));
3493 txgbe_flush(hw);
3494 usec_delay(10);
3495
3496 txgbe_reset_misc(hw);
3497
3498 if (hw->bus.lan_id == 0) {
3499 status = txgbe_check_flash_load(hw,
3500 TXGBE_ILDRSTAT_SWRST_LAN0);
3501 } else {
3502 status = txgbe_check_flash_load(hw,
3503 TXGBE_ILDRSTAT_SWRST_LAN1);
3504 }
3505 if (status != 0)
3506 return status;
3507
3508 msec_delay(50);
3509
3510 /*
3511 * Double resets are required for recovery from certain error
3512 * conditions. Between resets, it is necessary to stall to
3513 * allow time for any pending HW events to complete.
3514 */

Callers

nothing calls this directly

Calls 8

txgbe_clear_tx_pendingFunction · 0.85
txgbe_flushFunction · 0.85
txgbe_reset_miscFunction · 0.85
txgbe_check_flash_loadFunction · 0.85
txgbe_set_phy_tempFunction · 0.85
txgbe_validate_mac_addrFunction · 0.85
wr32Function · 0.70
resetMethod · 0.45

Tested by

no test coverage detected