isp.c (297912) | isp.c (297915) |
---|---|
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> | 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: head/sys/dev/isp/isp.c 297912 2016-04-13 07:04:04Z mav $"); | 50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 297915 2016-04-13 10:35:17Z 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 --- 2566 unchanged lines hidden (view full) --- 2625 isp_prt(isp, ISP_LOGERR, 2626 "%s: PLOGX of Chan %d out of rqent", __func__, chan); 2627 isp_destroy_handle(isp, pl.plogx_handle); 2628 return (-1); 2629 } 2630 isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); 2631 if (isp->isp_dblev & ISP_LOGDEBUG1) 2632 isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); | 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 --- 2566 unchanged lines hidden (view full) --- 2625 isp_prt(isp, ISP_LOGERR, 2626 "%s: PLOGX of Chan %d out of rqent", __func__, chan); 2627 isp_destroy_handle(isp, pl.plogx_handle); 2628 return (-1); 2629 } 2630 isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); 2631 if (isp->isp_dblev & ISP_LOGDEBUG1) 2632 isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); |
2633 FCPARAM(isp, chan)->isp_login_hdl = handle; |
|
2633 ISP_SYNC_REQUEST(isp); 2634 if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) 2635 == EWOULDBLOCK) { 2636 isp_prt(isp, ISP_LOGERR, 2637 "%s: PLOGX of Chan %d timed out", __func__, chan); 2638 isp_destroy_handle(isp, pl.plogx_handle); 2639 return (-1); 2640 } | 2634 ISP_SYNC_REQUEST(isp); 2635 if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) 2636 == EWOULDBLOCK) { 2637 isp_prt(isp, ISP_LOGERR, 2638 "%s: PLOGX of Chan %d timed out", __func__, chan); 2639 isp_destroy_handle(isp, pl.plogx_handle); 2640 return (-1); 2641 } |
2642 FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE; |
|
2641 if (isp->isp_dblev & ISP_LOGDEBUG1) 2642 isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); 2643 isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); 2644 2645 if (pl.plogx_status == PLOGX_STATUS_OK) { 2646 return (0); 2647 } else if (pl.plogx_status != PLOGX_STATUS_IOCBERR) { 2648 isp_prt(isp, ISP_LOGWARN, --- 3346 unchanged lines hidden (view full) --- 5995 } 5996 } else { 5997 chan = echan = 0; 5998 } 5999 for (; chan <= echan; chan++) { 6000 fcp = FCPARAM(isp, chan); 6001 if (fcp->role == ISP_ROLE_NONE) 6002 continue; | 2643 if (isp->isp_dblev & ISP_LOGDEBUG1) 2644 isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); 2645 isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); 2646 2647 if (pl.plogx_status == PLOGX_STATUS_OK) { 2648 return (0); 2649 } else if (pl.plogx_status != PLOGX_STATUS_IOCBERR) { 2650 isp_prt(isp, ISP_LOGWARN, --- 3346 unchanged lines hidden (view full) --- 5997 } 5998 } else { 5999 chan = echan = 0; 6000 } 6001 for (; chan <= echan; chan++) { 6002 fcp = FCPARAM(isp, chan); 6003 if (fcp->role == ISP_ROLE_NONE) 6004 continue; |
6003 if (fcp->isp_loopstate > LOOP_LTEST_DONE) | 6005 if (fcp->isp_loopstate > LOOP_LTEST_DONE) { 6006 if (nphdl != NIL_HANDLE && 6007 nphdl == fcp->isp_login_hdl && 6008 reason == PDB24XX_AE_OPN_2) 6009 continue; |
6004 fcp->isp_loopstate = LOOP_LTEST_DONE; | 6010 fcp->isp_loopstate = LOOP_LTEST_DONE; |
6005 else if (fcp->isp_loopstate < LOOP_HAVE_LINK) | 6011 } else if (fcp->isp_loopstate < LOOP_HAVE_LINK) |
6006 fcp->isp_loopstate = LOOP_HAVE_LINK; 6007 isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, 6008 ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); 6009 } 6010 break; 6011 } 6012 case ASYNC_CHANGE_NOTIFY: 6013 { --- 1799 unchanged lines hidden (view full) --- 7813 fcp->isp_retry_count = ICB_DFLT_RCOUNT; 7814 fcp->isp_loopid = DEFAULT_LOOPID(isp, chan); 7815 fcp->isp_wwnn_nvram = DEFAULT_NODEWWN(isp, chan); 7816 fcp->isp_wwpn_nvram = DEFAULT_PORTWWN(isp, chan); 7817 fcp->isp_fwoptions = 0; 7818 fcp->isp_xfwoptions = 0; 7819 fcp->isp_zfwoptions = 0; 7820 fcp->isp_lasthdl = NIL_HANDLE; | 6012 fcp->isp_loopstate = LOOP_HAVE_LINK; 6013 isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, 6014 ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason); 6015 } 6016 break; 6017 } 6018 case ASYNC_CHANGE_NOTIFY: 6019 { --- 1799 unchanged lines hidden (view full) --- 7819 fcp->isp_retry_count = ICB_DFLT_RCOUNT; 7820 fcp->isp_loopid = DEFAULT_LOOPID(isp, chan); 7821 fcp->isp_wwnn_nvram = DEFAULT_NODEWWN(isp, chan); 7822 fcp->isp_wwpn_nvram = DEFAULT_PORTWWN(isp, chan); 7823 fcp->isp_fwoptions = 0; 7824 fcp->isp_xfwoptions = 0; 7825 fcp->isp_zfwoptions = 0; 7826 fcp->isp_lasthdl = NIL_HANDLE; |
7827 fcp->isp_login_hdl = NIL_HANDLE; |
|
7821 7822 if (IS_24XX(isp)) { 7823 fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; 7824 fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS; 7825 if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) 7826 fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; 7827 fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; 7828 fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP; --- 706 unchanged lines hidden --- | 7828 7829 if (IS_24XX(isp)) { 7830 fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; 7831 fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS; 7832 if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) 7833 fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; 7834 fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; 7835 fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP; --- 706 unchanged lines hidden --- |