hptiop.c (298931) | hptiop.c (299033) |
---|---|
1/* 2 * HighPoint RR3xxx/4xxx RAID Driver for FreeBSD 3 * Copyright (C) 2007-2012 HighPoint Technologies, Inc. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * HighPoint RR3xxx/4xxx RAID Driver for FreeBSD 3 * Copyright (C) 2007-2012 HighPoint Technologies, Inc. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/hptiop/hptiop.c 298931 2016-05-02 16:47:28Z pfg $"); | 28__FBSDID("$FreeBSD: head/sys/dev/hptiop/hptiop.c 299033 2016-05-04 01:43:07Z araujo $"); |
29 30#include <sys/param.h> 31#include <sys/types.h> 32#include <sys/cons.h> 33#include <sys/time.h> 34#include <sys/systm.h> 35 36#include <sys/stat.h> --- 1199 unchanged lines hidden (view full) --- 1236 req->outbuf_size = pParams->nOutBufferSize; 1237 req->header.size = offsetof(struct hpt_iop_request_ioctl_command, buf) 1238 + pParams->nInBufferSize; 1239 req->header.context = (u_int64_t)MVIOP_CMD_TYPE_IOCTL; 1240 req->header.type = IOP_REQUEST_TYPE_IOCTL_COMMAND; 1241 req->header.result = IOP_RESULT_PENDING; 1242 req->header.flags = IOP_REQUEST_FLAG_OUTPUT_CONTEXT; 1243 size = req->header.size >> 8; | 29 30#include <sys/param.h> 31#include <sys/types.h> 32#include <sys/cons.h> 33#include <sys/time.h> 34#include <sys/systm.h> 35 36#include <sys/stat.h> --- 1199 unchanged lines hidden (view full) --- 1236 req->outbuf_size = pParams->nOutBufferSize; 1237 req->header.size = offsetof(struct hpt_iop_request_ioctl_command, buf) 1238 + pParams->nInBufferSize; 1239 req->header.context = (u_int64_t)MVIOP_CMD_TYPE_IOCTL; 1240 req->header.type = IOP_REQUEST_TYPE_IOCTL_COMMAND; 1241 req->header.result = IOP_RESULT_PENDING; 1242 req->header.flags = IOP_REQUEST_FLAG_OUTPUT_CONTEXT; 1243 size = req->header.size >> 8; |
1244 size = size > 3 ? 3 : size; | 1244 size = imin(3, size); |
1245 req_phy = hba->ctlcfgcmd_phy | MVIOP_MU_QUEUE_ADDR_HOST_BIT | size; 1246 hptiop_mv_inbound_write(req_phy, hba); 1247 1248 BUS_SPACE_RD4_MV0(outbound_intmask); 1249 1250 while (hba->config_done == 0) { 1251 if (hptiop_sleep(hba, req, PPAUSE, 1252 "hptctl", HPT_OSM_TIMEOUT)==0) --- 1303 unchanged lines hidden (view full) --- 2556 srb->dma_map, BUS_DMASYNC_PREWRITE); 2557 req->header.context = (u_int64_t)srb->index 2558 << MVIOP_REQUEST_NUMBER_START_BIT 2559 | MVIOP_CMD_TYPE_SCSI; 2560 req->header.flags = IOP_REQUEST_FLAG_OUTPUT_CONTEXT; 2561 size = req->header.size >> 8; 2562 hptiop_mv_inbound_write(req_phy 2563 | MVIOP_MU_QUEUE_ADDR_HOST_BIT | 1245 req_phy = hba->ctlcfgcmd_phy | MVIOP_MU_QUEUE_ADDR_HOST_BIT | size; 1246 hptiop_mv_inbound_write(req_phy, hba); 1247 1248 BUS_SPACE_RD4_MV0(outbound_intmask); 1249 1250 while (hba->config_done == 0) { 1251 if (hptiop_sleep(hba, req, PPAUSE, 1252 "hptctl", HPT_OSM_TIMEOUT)==0) --- 1303 unchanged lines hidden (view full) --- 2556 srb->dma_map, BUS_DMASYNC_PREWRITE); 2557 req->header.context = (u_int64_t)srb->index 2558 << MVIOP_REQUEST_NUMBER_START_BIT 2559 | MVIOP_CMD_TYPE_SCSI; 2560 req->header.flags = IOP_REQUEST_FLAG_OUTPUT_CONTEXT; 2561 size = req->header.size >> 8; 2562 hptiop_mv_inbound_write(req_phy 2563 | MVIOP_MU_QUEUE_ADDR_HOST_BIT |
2564 | (size > 3 ? 3 : size), hba); | 2564 | imin(3, size), hba); |
2565} 2566 2567static void hptiop_post_req_mvfrey(struct hpt_iop_hba *hba, 2568 struct hpt_iop_srb *srb, 2569 bus_dma_segment_t *segs, int nsegs) 2570{ 2571 int idx, index; 2572 union ccb *ccb = srb->ccb; --- 282 unchanged lines hidden --- | 2565} 2566 2567static void hptiop_post_req_mvfrey(struct hpt_iop_hba *hba, 2568 struct hpt_iop_srb *srb, 2569 bus_dma_segment_t *segs, int nsegs) 2570{ 2571 int idx, index; 2572 union ccb *ccb = srb->ccb; --- 282 unchanged lines hidden --- |