isp.c (208849) | isp.c (218691) |
---|---|
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 208849 2010-06-05 20:37:40Z mjacob $"); | 50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 218691 2011-02-14 21:50:51Z marius $"); |
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 --- 713 unchanged lines hidden (view full) --- 772 if (nw > wl) { 773 nw = wl; 774 } 775 cp = isp->isp_rquest; 776 for (i = 0; i < nw; i++) { 777 ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); 778 wl--; 779 } | 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 --- 713 unchanged lines hidden (view full) --- 772 if (nw > wl) { 773 nw = wl; 774 } 775 cp = isp->isp_rquest; 776 for (i = 0; i < nw; i++) { 777 ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); 778 wl--; 779 } |
780 MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); | 780 MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); |
781 ISP_MEMZERO(&mbs, sizeof (mbs)); 782 if (la < 0x10000 && nw < 0x10000) { 783 mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; 784 mbs.param[1] = la; 785 mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); 786 mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); 787 mbs.param[4] = nw; 788 mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); --- 52 unchanged lines hidden (view full) --- 841 if (nw > (1 << 15)) { 842 nw = 1 << 15; 843 } 844 cp = isp->isp_rquest; 845 for (i = 0; i < nw; i++) { 846 ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); 847 wl--; 848 } | 781 ISP_MEMZERO(&mbs, sizeof (mbs)); 782 if (la < 0x10000 && nw < 0x10000) { 783 mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; 784 mbs.param[1] = la; 785 mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); 786 mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); 787 mbs.param[4] = nw; 788 mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); --- 52 unchanged lines hidden (view full) --- 841 if (nw > (1 << 15)) { 842 nw = 1 << 15; 843 } 844 cp = isp->isp_rquest; 845 for (i = 0; i < nw; i++) { 846 ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); 847 wl--; 848 } |
849 MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); | 849 MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); |
850 ISP_MEMZERO(&mbs, sizeof (mbs)); 851 if (la < 0x10000) { 852 mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; 853 mbs.param[1] = la; 854 mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); 855 mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); 856 mbs.param[4] = nw; 857 mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); --- 853 unchanged lines hidden (view full) --- 1711 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 1712 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 1713 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 1714 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 1715 mbs.logval = MBLOGALL; 1716 isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)", 1717 fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32), 1718 (uint32_t) fcp->isp_scdma); | 850 ISP_MEMZERO(&mbs, sizeof (mbs)); 851 if (la < 0x10000) { 852 mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; 853 mbs.param[1] = la; 854 mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); 855 mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); 856 mbs.param[4] = nw; 857 mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); --- 853 unchanged lines hidden (view full) --- 1711 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 1712 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 1713 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 1714 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 1715 mbs.logval = MBLOGALL; 1716 isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)", 1717 fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32), 1718 (uint32_t) fcp->isp_scdma); |
1719 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); | 1719 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); |
1720 isp_mboxcmd(isp, &mbs); 1721 FC_SCRATCH_RELEASE(isp, 0); 1722 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 1723 isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); 1724 return; 1725 } 1726 isp->isp_reqidx = 0; 1727 isp->isp_reqodx = 0; --- 275 unchanged lines hidden (view full) --- 2003 } else { 2004 mbs.param[0] = MBOX_INIT_FIRMWARE; 2005 } 2006 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 2007 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 2008 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2009 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 2010 isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %04x%04x%04x%04x", DMA_WD3(fcp->isp_scdma), DMA_WD2(fcp->isp_scdma), DMA_WD1(fcp->isp_scdma), DMA_WD0(fcp->isp_scdma)); | 1720 isp_mboxcmd(isp, &mbs); 1721 FC_SCRATCH_RELEASE(isp, 0); 1722 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 1723 isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); 1724 return; 1725 } 1726 isp->isp_reqidx = 0; 1727 isp->isp_reqodx = 0; --- 275 unchanged lines hidden (view full) --- 2003 } else { 2004 mbs.param[0] = MBOX_INIT_FIRMWARE; 2005 } 2006 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 2007 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 2008 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2009 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 2010 isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %04x%04x%04x%04x", DMA_WD3(fcp->isp_scdma), DMA_WD2(fcp->isp_scdma), DMA_WD1(fcp->isp_scdma), DMA_WD0(fcp->isp_scdma)); |
2011 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); | 2011 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); |
2012 isp_mboxcmd(isp, &mbs); 2013 FC_SCRATCH_RELEASE(isp, 0); 2014 2015 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2016 return; 2017 } 2018 isp->isp_reqidx = 0; 2019 isp->isp_reqodx = 0; --- 100 unchanged lines hidden (view full) --- 2120 isp_put_plogx(isp, plp, (isp_plogx_t *) scp); 2121 2122 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); 2123 mbs.param[1] = QENTRY_LEN; 2124 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 2125 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 2126 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2127 mbs.param[7] = DMA_WD2(fcp->isp_scdma); | 2012 isp_mboxcmd(isp, &mbs); 2013 FC_SCRATCH_RELEASE(isp, 0); 2014 2015 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2016 return; 2017 } 2018 isp->isp_reqidx = 0; 2019 isp->isp_reqodx = 0; --- 100 unchanged lines hidden (view full) --- 2120 isp_put_plogx(isp, plp, (isp_plogx_t *) scp); 2121 2122 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); 2123 mbs.param[1] = QENTRY_LEN; 2124 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 2125 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 2126 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2127 mbs.param[7] = DMA_WD2(fcp->isp_scdma); |
2128 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); | 2128 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); |
2129 isp_mboxcmd(isp, &mbs); 2130 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2131 rval = mbs.param[0]; 2132 goto out; 2133 } | 2129 isp_mboxcmd(isp, &mbs); 2130 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2131 rval = mbs.param[0]; 2132 goto out; 2133 } |
2134 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); | 2134 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); |
2135 scp += QENTRY_LEN; 2136 isp_get_plogx(isp, (isp_plogx_t *) scp, plp); 2137 if (isp->isp_dblev & ISP_LOGDEBUG1) { 2138 isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, plp); 2139 } 2140 2141 if (plp->plogx_status == PLOGX_STATUS_OK) { 2142 rval = 0; --- 176 unchanged lines hidden (view full) --- 2319 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2320 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 2321 if (dolock) { 2322 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 2323 isp_prt(isp, ISP_LOGERR, sacq); 2324 return (-1); 2325 } 2326 } | 2135 scp += QENTRY_LEN; 2136 isp_get_plogx(isp, (isp_plogx_t *) scp, plp); 2137 if (isp->isp_dblev & ISP_LOGDEBUG1) { 2138 isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, plp); 2139 } 2140 2141 if (plp->plogx_status == PLOGX_STATUS_OK) { 2142 rval = 0; --- 176 unchanged lines hidden (view full) --- 2319 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 2320 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 2321 if (dolock) { 2322 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 2323 isp_prt(isp, ISP_LOGERR, sacq); 2324 return (-1); 2325 } 2326 } |
2327 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un)); | 2327 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); |
2328 isp_mboxcmd(isp, &mbs); 2329 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2330 if (dolock) { 2331 FC_SCRATCH_RELEASE(isp, chan); 2332 } 2333 return (mbs.param[0]); 2334 } 2335 if (IS_24XX(isp)) { --- 874 unchanged lines hidden (view full) --- 3210 rq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma + IGPOFF); 3211 rq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma + IGPOFF); 3212 rq->snscb_sblen = 6; 3213 rq->snscb_cmd = SNS_GID_FT; 3214 rq->snscb_mword_div_2 = NGENT; 3215 rq->snscb_fc4_type = FC4_SCSI; 3216 3217 isp_put_gid_ft_request(isp, rq, fcp->isp_scratch); | 2328 isp_mboxcmd(isp, &mbs); 2329 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 2330 if (dolock) { 2331 FC_SCRATCH_RELEASE(isp, chan); 2332 } 2333 return (mbs.param[0]); 2334 } 2335 if (IS_24XX(isp)) { --- 874 unchanged lines hidden (view full) --- 3210 rq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma + IGPOFF); 3211 rq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma + IGPOFF); 3212 rq->snscb_sblen = 6; 3213 rq->snscb_cmd = SNS_GID_FT; 3214 rq->snscb_mword_div_2 = NGENT; 3215 rq->snscb_fc4_type = FC4_SCSI; 3216 3217 isp_put_gid_ft_request(isp, rq, fcp->isp_scratch); |
3218 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE); | 3218 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); |
3219 3220 MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); 3221 mbs.param[0] = MBOX_SEND_SNS; 3222 mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; 3223 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 3224 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 3225 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 3226 mbs.param[7] = DMA_WD2(fcp->isp_scdma); --- 78 unchanged lines hidden (view full) --- 3305 } 3306 ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); 3307 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); 3308 mbs.param[1] = QENTRY_LEN; 3309 mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); 3310 mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); 3311 mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); 3312 mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); | 3219 3220 MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); 3221 mbs.param[0] = MBOX_SEND_SNS; 3222 mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; 3223 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 3224 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 3225 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 3226 mbs.param[7] = DMA_WD2(fcp->isp_scdma); --- 78 unchanged lines hidden (view full) --- 3305 } 3306 ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); 3307 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); 3308 mbs.param[1] = QENTRY_LEN; 3309 mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); 3310 mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); 3311 mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); 3312 mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); |
3313 MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); | 3313 MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); |
3314 isp_mboxcmd(isp, &mbs); 3315 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 3316 return (-1); 3317 } | 3314 isp_mboxcmd(isp, &mbs); 3315 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 3316 return (-1); 3317 } |
3318 MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); | 3318 MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); |
3319 pt = &un.plocal; 3320 isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); 3321 if (isp->isp_dblev & ISP_LOGDEBUG1) { 3322 isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); 3323 } 3324 3325 if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { 3326 isp_prt(isp, ISP_LOGWARN, 3327 "Chan %d ISP GID FT CT Passthrough returned 0x%x", 3328 chan, pt->ctp_status); 3329 return (-1); 3330 } | 3319 pt = &un.plocal; 3320 isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); 3321 if (isp->isp_dblev & ISP_LOGDEBUG1) { 3322 isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); 3323 } 3324 3325 if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) { 3326 isp_prt(isp, ISP_LOGWARN, 3327 "Chan %d ISP GID FT CT Passthrough returned 0x%x", 3328 chan, pt->ctp_status); 3329 return (-1); 3330 } |
3331 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16); | 3331 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16, chan); |
3332 if (isp->isp_dblev & ISP_LOGDEBUG1) { 3333 isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]); 3334 } 3335 return (0); 3336} 3337 3338static int 3339isp_scan_fabric(ispsoftc_t *isp, int chan) --- 69 unchanged lines hidden (view full) --- 3409 FC_SCRATCH_RELEASE(isp, chan); 3410 return (0); 3411 } else if (r < 0) { 3412 fcp->isp_loopstate = LOOP_PDB_RCVD; /* try again */ 3413 FC_SCRATCH_RELEASE(isp, chan); 3414 return (0); 3415 } 3416 | 3332 if (isp->isp_dblev & ISP_LOGDEBUG1) { 3333 isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]); 3334 } 3335 return (0); 3336} 3337 3338static int 3339isp_scan_fabric(ispsoftc_t *isp, int chan) --- 69 unchanged lines hidden (view full) --- 3409 FC_SCRATCH_RELEASE(isp, chan); 3410 return (0); 3411 } else if (r < 0) { 3412 fcp->isp_loopstate = LOOP_PDB_RCVD; /* try again */ 3413 FC_SCRATCH_RELEASE(isp, chan); 3414 return (0); 3415 } 3416 |
3417 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN); | 3417 MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN, chan); |
3418 rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); 3419 rs1 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+OGPOFF); 3420 isp_get_gid_ft_response(isp, rs0, rs1, NGENT); 3421 if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) { 3422 FC_SCRATCH_RELEASE(isp, chan); 3423 ISP_MARK_PORTDB(isp, chan, 1); 3424 return (-1); 3425 } --- 577 unchanged lines hidden (view full) --- 4003 } 4004 isp_put_sns_request(isp, reqp, (sns_screq_t *) fcp->isp_scratch); 4005 MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 1000000); 4006 mbs.param[1] = SNS_RFT_ID_REQ_SIZE >> 1; 4007 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 4008 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 4009 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 4010 mbs.param[7] = DMA_WD2(fcp->isp_scdma); | 3418 rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); 3419 rs1 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+OGPOFF); 3420 isp_get_gid_ft_response(isp, rs0, rs1, NGENT); 3421 if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) { 3422 FC_SCRATCH_RELEASE(isp, chan); 3423 ISP_MARK_PORTDB(isp, chan, 1); 3424 return (-1); 3425 } --- 577 unchanged lines hidden (view full) --- 4003 } 4004 isp_put_sns_request(isp, reqp, (sns_screq_t *) fcp->isp_scratch); 4005 MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 1000000); 4006 mbs.param[1] = SNS_RFT_ID_REQ_SIZE >> 1; 4007 mbs.param[2] = DMA_WD1(fcp->isp_scdma); 4008 mbs.param[3] = DMA_WD0(fcp->isp_scdma); 4009 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 4010 mbs.param[7] = DMA_WD2(fcp->isp_scdma); |
4011 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE); | 4011 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE, chan); |
4012 isp_mboxcmd(isp, &mbs); 4013 FC_SCRATCH_RELEASE(isp, chan); 4014 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 4015 return (0); 4016 } else { 4017 return (-1); 4018 } 4019} --- 69 unchanged lines hidden (view full) --- 4089 ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); 4090 4091 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 1000000); 4092 mbs.param[1] = QENTRY_LEN; 4093 mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); 4094 mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); 4095 mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); 4096 mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); | 4012 isp_mboxcmd(isp, &mbs); 4013 FC_SCRATCH_RELEASE(isp, chan); 4014 if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { 4015 return (0); 4016 } else { 4017 return (-1); 4018 } 4019} --- 69 unchanged lines hidden (view full) --- 4089 ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); 4090 4091 MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 1000000); 4092 mbs.param[1] = QENTRY_LEN; 4093 mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); 4094 mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); 4095 mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); 4096 mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); |
4097 MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); | 4097 MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); |
4098 isp_mboxcmd(isp, &mbs); 4099 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4100 FC_SCRATCH_RELEASE(isp, chan); 4101 return (-1); 4102 } | 4098 isp_mboxcmd(isp, &mbs); 4099 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4100 FC_SCRATCH_RELEASE(isp, chan); 4101 return (-1); 4102 } |
4103 MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); | 4103 MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); |
4104 pt = &un.plocal; 4105 isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); 4106 if (isp->isp_dblev & ISP_LOGDEBUG1) { 4107 isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); 4108 } 4109 if (pt->ctp_status) { 4110 FC_SCRATCH_RELEASE(isp, chan); 4111 isp_prt(isp, ISP_LOGWARN, --- 435 unchanged lines hidden (view full) --- 4547 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 4548 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 4549 4550 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 4551 isp_prt(isp, ISP_LOGERR, sacq); 4552 break; 4553 } 4554 isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); | 4104 pt = &un.plocal; 4105 isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); 4106 if (isp->isp_dblev & ISP_LOGDEBUG1) { 4107 isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); 4108 } 4109 if (pt->ctp_status) { 4110 FC_SCRATCH_RELEASE(isp, chan); 4111 isp_prt(isp, ISP_LOGWARN, --- 435 unchanged lines hidden (view full) --- 4547 mbs.param[6] = DMA_WD3(fcp->isp_scdma); 4548 mbs.param[7] = DMA_WD2(fcp->isp_scdma); 4549 4550 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 4551 isp_prt(isp, ISP_LOGERR, sacq); 4552 break; 4553 } 4554 isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); |
4555 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); | 4555 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); |
4556 fcp->sendmarker = 1; 4557 isp_mboxcmd(isp, &mbs); 4558 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4559 FC_SCRATCH_RELEASE(isp, chan); 4560 break; 4561 } 4562 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, | 4556 fcp->sendmarker = 1; 4557 isp_mboxcmd(isp, &mbs); 4558 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4559 FC_SCRATCH_RELEASE(isp, chan); 4560 break; 4561 } 4562 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, |
4563 QENTRY_LEN); | 4563 QENTRY_LEN, chan); |
4564 sp = (isp24xx_statusreq_t *) local; 4565 isp_get_24xx_response(isp, 4566 &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); 4567 FC_SCRATCH_RELEASE(isp, chan); 4568 if (sp->req_completion_status == 0) { 4569 return (0); 4570 } 4571 isp_prt(isp, ISP_LOGWARN, --- 79 unchanged lines hidden (view full) --- 4651 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 4652 isp_prt(isp, ISP_LOGERR, sacq); 4653 break; 4654 } 4655 isp_put_24xx_abrt(isp, ab, fcp->isp_scratch); 4656 ab2 = (isp24xx_abrt_t *) 4657 &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; 4658 ab2->abrt_nphdl = 0xdeaf; | 4564 sp = (isp24xx_statusreq_t *) local; 4565 isp_get_24xx_response(isp, 4566 &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); 4567 FC_SCRATCH_RELEASE(isp, chan); 4568 if (sp->req_completion_status == 0) { 4569 return (0); 4570 } 4571 isp_prt(isp, ISP_LOGWARN, --- 79 unchanged lines hidden (view full) --- 4651 if (FC_SCRATCH_ACQUIRE(isp, chan)) { 4652 isp_prt(isp, ISP_LOGERR, sacq); 4653 break; 4654 } 4655 isp_put_24xx_abrt(isp, ab, fcp->isp_scratch); 4656 ab2 = (isp24xx_abrt_t *) 4657 &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; 4658 ab2->abrt_nphdl = 0xdeaf; |
4659 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN); | 4659 MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); |
4660 isp_mboxcmd(isp, &mbs); 4661 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4662 FC_SCRATCH_RELEASE(isp, chan); 4663 break; 4664 } 4665 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, | 4660 isp_mboxcmd(isp, &mbs); 4661 if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { 4662 FC_SCRATCH_RELEASE(isp, chan); 4663 break; 4664 } 4665 MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, |
4666 QENTRY_LEN); | 4666 QENTRY_LEN, chan); |
4667 isp_get_24xx_abrt(isp, ab2, ab); 4668 FC_SCRATCH_RELEASE(isp, chan); 4669 if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { 4670 return (0); 4671 } 4672 isp_prt(isp, ISP_LOGWARN, 4673 "Chan %d handle %d abort returned 0x%x", chan, 4674 hdlidx, ab->abrt_nphdl); --- 256 unchanged lines hidden (view full) --- 4931 4932 while (optr != iptr) { 4933 uint8_t qe[QENTRY_LEN]; 4934 isphdr_t *hp; 4935 uint32_t oop; 4936 void *addr; 4937 4938 oop = optr; | 4667 isp_get_24xx_abrt(isp, ab2, ab); 4668 FC_SCRATCH_RELEASE(isp, chan); 4669 if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { 4670 return (0); 4671 } 4672 isp_prt(isp, ISP_LOGWARN, 4673 "Chan %d handle %d abort returned 0x%x", chan, 4674 hdlidx, ab->abrt_nphdl); --- 256 unchanged lines hidden (view full) --- 4931 4932 while (optr != iptr) { 4933 uint8_t qe[QENTRY_LEN]; 4934 isphdr_t *hp; 4935 uint32_t oop; 4936 void *addr; 4937 4938 oop = optr; |
4939 MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN); | 4939 MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); |
4940 addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); 4941 isp_get_hdr(isp, addr, (isphdr_t *)qe); 4942 hp = (isphdr_t *)qe; 4943 switch (hp->rqs_entry_type) { 4944 case RQSTYPE_NOTIFY: 4945 case RQSTYPE_ATIO: 4946 (void) isp_target_notify(isp, addr, &oop); 4947 break; --- 100 unchanged lines hidden (view full) --- 5048 nlooked++; 5049 read_again: 5050 buddaboom = req_status_flags = req_state_flags = 0; 5051 resid = 0L; 5052 5053 /* 5054 * Synchronize our view of this response queue entry. 5055 */ | 4940 addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); 4941 isp_get_hdr(isp, addr, (isphdr_t *)qe); 4942 hp = (isphdr_t *)qe; 4943 switch (hp->rqs_entry_type) { 4944 case RQSTYPE_NOTIFY: 4945 case RQSTYPE_ATIO: 4946 (void) isp_target_notify(isp, addr, &oop); 4947 break; --- 100 unchanged lines hidden (view full) --- 5048 nlooked++; 5049 read_again: 5050 buddaboom = req_status_flags = req_state_flags = 0; 5051 resid = 0L; 5052 5053 /* 5054 * Synchronize our view of this response queue entry. 5055 */ |
5056 MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN); | 5056 MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); |
5057 isp_get_hdr(isp, hp, &sp->req_header); 5058 etype = sp->req_header.rqs_entry_type; 5059 5060 if (IS_24XX(isp) && etype == RQSTYPE_RESPONSE) { 5061 isp24xx_statusreq_t *sp2 = (isp24xx_statusreq_t *)qe; 5062 isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp2); 5063 if (isp->isp_dblev & ISP_LOGDEBUG1) { 5064 isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp2); --- 3240 unchanged lines hidden --- | 5057 isp_get_hdr(isp, hp, &sp->req_header); 5058 etype = sp->req_header.rqs_entry_type; 5059 5060 if (IS_24XX(isp) && etype == RQSTYPE_RESPONSE) { 5061 isp24xx_statusreq_t *sp2 = (isp24xx_statusreq_t *)qe; 5062 isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp2); 5063 if (isp->isp_dblev & ISP_LOGDEBUG1) { 5064 isp_print_bytes(isp, "Response Queue Entry", QENTRY_LEN, sp2); --- 3240 unchanged lines hidden --- |