1966 } else {
1967 emlxs_linkdown(hba);
1968 }
1969
1970 #ifdef SFCT_SUPPORT
1971 if (port->flag & EMLXS_TGT_ENABLED) {
1972 (void) emlxs_fct_port_shutdown(port);
1973 }
1974 #endif /* SFCT_SUPPORT */
1975
1976 /* Check if adapter was shutdown */
1977 if (hba->flag & FC_HARDWARE_ERROR) {
1978 /*
1979 * Force mailbox cleanup
1980 * This will wake any sleeping or polling threads
1981 */
1982 emlxs_mb_fini(hba, NULL, MBX_HARDWARE_ERROR);
1983 }
1984
1985 /* Pause here for the IO to settle */
1986 delay(drv_usectohz(1000000)); /* 1 sec */
1987
1988 /* Unregister all nodes */
1989 emlxs_ffcleanup(hba);
1990
1991 if (hba->bus_type == SBUS_FC) {
1992 WRITE_SBUS_CSR_REG(hba, FC_SHS_REG(hba), 0x9A);
1993 #ifdef FMA_SUPPORT
1994 /* Access handle validation */
1995 EMLXS_CHK_ACC_HANDLE(hba, hba->sli.sli3.sbus_csr_handle);
1996 #endif /* FMA_SUPPORT */
1997 }
1998
1999 /* Stop the timer */
2000 emlxs_timer_stop(hba);
2001
2002 /* For safety flush every iotag list */
2003 if (emlxs_iotag_flush(hba)) {
2004 /* Pause here for the IO to flush */
2005 delay(drv_usectohz(1000));
2006 }
|
1966 } else {
1967 emlxs_linkdown(hba);
1968 }
1969
1970 #ifdef SFCT_SUPPORT
1971 if (port->flag & EMLXS_TGT_ENABLED) {
1972 (void) emlxs_fct_port_shutdown(port);
1973 }
1974 #endif /* SFCT_SUPPORT */
1975
1976 /* Check if adapter was shutdown */
1977 if (hba->flag & FC_HARDWARE_ERROR) {
1978 /*
1979 * Force mailbox cleanup
1980 * This will wake any sleeping or polling threads
1981 */
1982 emlxs_mb_fini(hba, NULL, MBX_HARDWARE_ERROR);
1983 }
1984
1985 /* Pause here for the IO to settle */
1986 delay(drv_sectohz(1));
1987
1988 /* Unregister all nodes */
1989 emlxs_ffcleanup(hba);
1990
1991 if (hba->bus_type == SBUS_FC) {
1992 WRITE_SBUS_CSR_REG(hba, FC_SHS_REG(hba), 0x9A);
1993 #ifdef FMA_SUPPORT
1994 /* Access handle validation */
1995 EMLXS_CHK_ACC_HANDLE(hba, hba->sli.sli3.sbus_csr_handle);
1996 #endif /* FMA_SUPPORT */
1997 }
1998
1999 /* Stop the timer */
2000 emlxs_timer_stop(hba);
2001
2002 /* For safety flush every iotag list */
2003 if (emlxs_iotag_flush(hba)) {
2004 /* Pause here for the IO to flush */
2005 delay(drv_usectohz(1000));
2006 }
|