Deleted Added
sdiff udiff text old ( 291502 ) new ( 291503 )
full compact
1/*-
2 * Copyright (c) 1997-2009 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 33 unchanged lines hidden (view full) ---

42 */
43#ifdef __NetBSD__
44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD$");
46#include <dev/ic/isp_netbsd.h>
47#endif
48#ifdef __FreeBSD__
49#include <sys/cdefs.h>
50__FBSDID("$FreeBSD: stable/10/sys/dev/isp/isp.c 291503 2015-11-30 21:32:12Z mav $");
51#include <dev/isp/isp_freebsd.h>
52#endif
53#ifdef __OpenBSD__
54#include <dev/ic/isp_openbsd.h>
55#endif
56#ifdef __linux__
57#include "isp_linux.h"
58#endif

--- 2692 unchanged lines hidden (view full) ---

2751/*
2752 * Make sure we have good FC link.
2753 */
2754
2755static int
2756isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
2757{
2758 mbreg_t mbs;
2759 int check_for_fabric, r;
2760 uint8_t lwfs;
2761 int loopid;
2762 fcparam *fcp;
2763 fcportdb_t *lp;
2764 isp_pdb_t pdb;
2765 NANOTIME_T hra, hrb;
2766
2767 fcp = FCPARAM(isp, chan);
2768
2769 isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Link Test Entry", chan);
2770 ISP_MARK_PORTDB(isp, chan, 1);
2771
2772 /*
2773 * Wait up to N microseconds for F/W to go to a ready state.
2774 */
2775 lwfs = FW_CONFIG_WAIT;
2776 GET_NANOTIME(&hra);
2777 do {
2778 isp_fw_state(isp, chan);
2779 if (lwfs != fcp->isp_fwstate) {
2780 isp_prt(isp, ISP_LOGCONFIG|ISP_LOG_SANCFG, "Chan %d Firmware State <%s->%s>", chan, isp_fc_fw_statename((int)lwfs), isp_fc_fw_statename((int)fcp->isp_fwstate));
2781 lwfs = fcp->isp_fwstate;
2782 }
2783 if (fcp->isp_fwstate == FW_READY) {
2784 break;
2785 }
2786 ISP_SLEEP(isp, 1000);
2787 GET_NANOTIME(&hrb);
2788 } while (NANOTIME_SUB(&hrb, &hra) / 1000 < usdelay);
2789
2790 /*
2791 * If we haven't gone to 'ready' state, return.
2792 */
2793 if (fcp->isp_fwstate != FW_READY) {
2794 isp_prt(isp, ISP_LOG_SANCFG, "%s: chan %d not at FW_READY state", __func__, chan);
2795 return (-1);
2796 }
2797

--- 5750 unchanged lines hidden ---