isp_freebsd.c (317358) | isp_freebsd.c (317360) |
---|---|
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 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. 29 */ 30#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 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. 29 */ 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: stable/11/sys/dev/isp/isp_freebsd.c 317358 2017-04-24 10:19:59Z mav $"); | 31__FBSDID("$FreeBSD: stable/11/sys/dev/isp/isp_freebsd.c 317360 2017-04-24 10:21:13Z mav $"); |
32 33#include <dev/isp/isp_freebsd.h> 34#include <sys/unistd.h> 35#include <sys/kthread.h> 36#include <sys/conf.h> 37#include <sys/module.h> 38#include <sys/ioccom.h> 39#include <dev/isp/isp_ioctl.h> --- 1327 unchanged lines hidden (view full) --- 1367 atp->state = ATPD_STATE_CTIO; 1368 } 1369 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO7[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x xfrlen=%u off=%u", __func__, 1370 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cto->ct_scsi_status, cto->ct_flags, xfrlen, atp->bytes_xfered); 1371 } 1372 } else { 1373 ct2_entry_t *cto = (ct2_entry_t *) local; 1374 | 32 33#include <dev/isp/isp_freebsd.h> 34#include <sys/unistd.h> 35#include <sys/kthread.h> 36#include <sys/conf.h> 37#include <sys/module.h> 38#include <sys/ioccom.h> 39#include <dev/isp/isp_ioctl.h> --- 1327 unchanged lines hidden (view full) --- 1367 atp->state = ATPD_STATE_CTIO; 1368 } 1369 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO7[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x xfrlen=%u off=%u", __func__, 1370 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cto->ct_scsi_status, cto->ct_flags, xfrlen, atp->bytes_xfered); 1371 } 1372 } else { 1373 ct2_entry_t *cto = (ct2_entry_t *) local; 1374 |
1375 if (isp->isp_osinfo.sixtyfourbit) 1376 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO3; 1377 else 1378 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2; | 1375 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2; |
1379 cto->ct_header.rqs_entry_count = 1; 1380 cto->ct_header.rqs_seqno |= ATPD_SEQ_NOTIFY_CAM; 1381 ATPD_SET_SEQNO(cto, atp); 1382 if (ISP_CAP_2KLOGIN(isp)) { 1383 ((ct2e_entry_t *)cto)->ct_iid = atp->nphdl; 1384 } else { 1385 cto->ct_iid = atp->nphdl; 1386 if (ISP_CAP_SCCFW(isp) == 0) { --- 76 unchanged lines hidden (view full) --- 1463 if (isp->isp_dblev & ISP_LOGTDEBUG1) { 1464 isp_print_bytes(isp, "FCP Response Frame After Swizzling", MIN_FCP_RESPONSE_SIZE + sense_length, atp->ests); 1465 } 1466 addr = isp->isp_osinfo.ecmd_dma; 1467 addr += ((((isp_ecmd_t *)atp->ests) - isp->isp_osinfo.ecmd_base) * XCMD_SIZE); 1468 isp_prt(isp, ISP_LOGTDEBUG0, "%s: ests base %p vaddr %p ecmd_dma %jx addr %jx len %u", __func__, isp->isp_osinfo.ecmd_base, atp->ests, 1469 (uintmax_t) isp->isp_osinfo.ecmd_dma, (uintmax_t)addr, MIN_FCP_RESPONSE_SIZE + sense_length); 1470 cto->rsp.m2.ct_datalen = MIN_FCP_RESPONSE_SIZE + sense_length; | 1376 cto->ct_header.rqs_entry_count = 1; 1377 cto->ct_header.rqs_seqno |= ATPD_SEQ_NOTIFY_CAM; 1378 ATPD_SET_SEQNO(cto, atp); 1379 if (ISP_CAP_2KLOGIN(isp)) { 1380 ((ct2e_entry_t *)cto)->ct_iid = atp->nphdl; 1381 } else { 1382 cto->ct_iid = atp->nphdl; 1383 if (ISP_CAP_SCCFW(isp) == 0) { --- 76 unchanged lines hidden (view full) --- 1460 if (isp->isp_dblev & ISP_LOGTDEBUG1) { 1461 isp_print_bytes(isp, "FCP Response Frame After Swizzling", MIN_FCP_RESPONSE_SIZE + sense_length, atp->ests); 1462 } 1463 addr = isp->isp_osinfo.ecmd_dma; 1464 addr += ((((isp_ecmd_t *)atp->ests) - isp->isp_osinfo.ecmd_base) * XCMD_SIZE); 1465 isp_prt(isp, ISP_LOGTDEBUG0, "%s: ests base %p vaddr %p ecmd_dma %jx addr %jx len %u", __func__, isp->isp_osinfo.ecmd_base, atp->ests, 1466 (uintmax_t) isp->isp_osinfo.ecmd_dma, (uintmax_t)addr, MIN_FCP_RESPONSE_SIZE + sense_length); 1467 cto->rsp.m2.ct_datalen = MIN_FCP_RESPONSE_SIZE + sense_length; |
1471 if (cto->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { 1472 cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_base = DMA_LO32(addr); 1473 cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_basehi = DMA_HI32(addr); 1474 cto->rsp.m2.u.ct_fcp_rsp_iudata_64.ds_count = MIN_FCP_RESPONSE_SIZE + sense_length; 1475 } else { 1476 cto->rsp.m2.u.ct_fcp_rsp_iudata_32.ds_base = DMA_LO32(addr); 1477 cto->rsp.m2.u.ct_fcp_rsp_iudata_32.ds_count = MIN_FCP_RESPONSE_SIZE + sense_length; 1478 } | 1468 cto->rsp.m2.u.ct_fcp_rsp_iudata_32.ds_base = DMA_LO32(addr); 1469 cto->rsp.m2.u.ct_fcp_rsp_iudata_32.ds_count = MIN_FCP_RESPONSE_SIZE + sense_length; |
1479 } 1480 if (sense_length) { 1481 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO2[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x resid=%d sense: %x %x/%x/%x", __func__, 1482 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cso->scsi_status, cto->ct_flags, cto->ct_resid, 1483 cso->sense_data.error_code, cso->sense_data.sense_buf[1], cso->sense_data.sense_buf[11], cso->sense_data.sense_buf[12]); 1484 } else { 1485 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO2[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x resid=%d", __func__, cto->ct_rxid, 1486 ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cso->scsi_status, cto->ct_flags, cto->ct_resid); --- 1976 unchanged lines hidden (view full) --- 3463 else 3464#endif 3465 cpi->target_sprt = 0; 3466 cpi->hba_eng_cnt = 0; 3467 cpi->max_target = ISP_MAX_TARGETS(isp) - 1; 3468 cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ? 3469 255 : ISP_MAX_LUNS(isp) - 1; 3470 cpi->bus_id = cam_sim_bus(sim); | 1470 } 1471 if (sense_length) { 1472 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO2[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x resid=%d sense: %x %x/%x/%x", __func__, 1473 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cso->scsi_status, cto->ct_flags, cto->ct_resid, 1474 cso->sense_data.error_code, cso->sense_data.sense_buf[1], cso->sense_data.sense_buf[11], cso->sense_data.sense_buf[12]); 1475 } else { 1476 isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO2[0x%x] seq %u nc %d CDB0=%x sstatus=0x%x flags=0x%x resid=%d", __func__, cto->ct_rxid, 1477 ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cso->scsi_status, cto->ct_flags, cto->ct_resid); --- 1976 unchanged lines hidden (view full) --- 3454 else 3455#endif 3456 cpi->target_sprt = 0; 3457 cpi->hba_eng_cnt = 0; 3458 cpi->max_target = ISP_MAX_TARGETS(isp) - 1; 3459 cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ? 3460 255 : ISP_MAX_LUNS(isp) - 1; 3461 cpi->bus_id = cam_sim_bus(sim); |
3471 if (isp->isp_osinfo.sixtyfourbit) | 3462 if (sizeof (bus_size_t) > 4) |
3472 cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE; 3473 else 3474 cpi->maxio = (ISP_NSEG_MAX - 1) * PAGE_SIZE; 3475 3476 if (IS_FC(isp)) { 3477 fcparam *fcp = FCPARAM(isp, bus); 3478 3479 cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; --- 763 unchanged lines hidden --- | 3463 cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE; 3464 else 3465 cpi->maxio = (ISP_NSEG_MAX - 1) * PAGE_SIZE; 3466 3467 if (IS_FC(isp)) { 3468 fcparam *fcp = FCPARAM(isp, bus); 3469 3470 cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; --- 763 unchanged lines hidden --- |