/* This function is called in the SLI initialization code path to restart a SLI4 HBA. The caller is not required to hold any lock. At the end of the function, it calls lpfc_hba_down_post function to free any pending commands.  */
static int lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
/* This function is called in the SLI initialization code path to restart a SLI4 HBA. The caller is not required to hold any lock. At the end of the function, it calls lpfc_hba_down_post function to free any pending commands.  */
static int lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
{
	struct lpfc_sli *psli = &phba->sli;
	lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
			"0296 Restart HBA Data: x%x x%x\n",
			phba->pport->port_state, psli->sli_flag);
	lpfc_sli4_brdreset(phba);
	spin_lock_irq(&phba->hbalock);
	phba->pport->stopped = 0;
	phba->link_state = LPFC_INIT_START;
	phba->hba_flag = 0;
	spin_unlock_irq(&phba->hbalock);
	memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets));
	psli->stats_start = get_seconds();
	lpfc_hba_down_post(phba);
	return 0;
}