hptnr_osm_bsd.c (281957) | hptnr_osm_bsd.c (284935) |
---|---|
1/* $Id: osm_bsd.c,v 1.36 2010/05/11 03:12:11 lcn Exp $ */ 2/*- 3 * HighPoint RAID Driver for FreeBSD 4 * Copyright (C) 2005-2011 HighPoint Technologies, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* $Id: osm_bsd.c,v 1.36 2010/05/11 03:12:11 lcn Exp $ */ 2/*- 3 * HighPoint RAID Driver for FreeBSD 4 * Copyright (C) 2005-2011 HighPoint Technologies, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: stable/10/sys/dev/hptnr/hptnr_osm_bsd.c 281957 2015-04-25 00:32:47Z delphij $ | 28 * $FreeBSD: stable/10/sys/dev/hptnr/hptnr_osm_bsd.c 284935 2015-06-29 18:34:30Z delphij $ |
29 */ 30#include <dev/hptnr/hptnr_config.h> 31#include <dev/hptnr/os_bsd.h> 32#include <dev/hptnr/hptintf.h> 33int msi = 0; 34int debug_flag = 0; 35static HIM *hpt_match(device_t dev) 36{ --- 579 unchanged lines hidden (view full) --- 616 case 0x85: /*ATA_16*/ 617 case 0xA1: /*ATA_12*/ 618 { 619 int error; 620 HPT_U8 prot; 621 PassthroughCmd *passthru; 622 623 if (mIsArray(vd->type)) { | 29 */ 30#include <dev/hptnr/hptnr_config.h> 31#include <dev/hptnr/os_bsd.h> 32#include <dev/hptnr/hptintf.h> 33int msi = 0; 34int debug_flag = 0; 35static HIM *hpt_match(device_t dev) 36{ --- 579 unchanged lines hidden (view full) --- 616 case 0x85: /*ATA_16*/ 617 case 0xA1: /*ATA_12*/ 618 { 619 int error; 620 HPT_U8 prot; 621 PassthroughCmd *passthru; 622 623 if (mIsArray(vd->type)) { |
624 ccb->ccb_h.status = CAM_PATH_INVALID; | 624 ccb->ccb_h.status = CAM_REQ_INVALID; |
625 break; 626 } 627 628 HPT_ASSERT(vd->type == VD_RAW && vd->u.raw.legacy_disk); 629 630 prot = (cdb[1] & 0x1e) >> 1; 631 632 --- 119 unchanged lines hidden (view full) --- 752 cmdext_put(ext); 753 ldm_free_cmds(pCmd); 754 ccb->ccb_h.status = CAM_REQ_CMP_ERR; 755 xpt_done(ccb); 756 } 757 return; 758error: 759 ldm_free_cmds(pCmd); | 625 break; 626 } 627 628 HPT_ASSERT(vd->type == VD_RAW && vd->u.raw.legacy_disk); 629 630 prot = (cdb[1] & 0x1e) >> 1; 631 632 --- 119 unchanged lines hidden (view full) --- 752 cmdext_put(ext); 753 ldm_free_cmds(pCmd); 754 ccb->ccb_h.status = CAM_REQ_CMP_ERR; 755 xpt_done(ccb); 756 } 757 return; 758error: 759 ldm_free_cmds(pCmd); |
760 ccb->ccb_h.status = CAM_PATH_INVALID; | 760 ccb->ccb_h.status = CAM_REQ_INVALID; |
761 break; 762 } 763 764 case INQUIRY: 765 { 766 PINQUIRYDATA inquiryData; 767 HIM_DEVICE_CONFIG devconf; 768 HPT_U8 *rbuf; --- 142 unchanged lines hidden (view full) --- 911 rbuf[5] = 0; 912 rbuf[6] = 2 << sector_size_shift; 913 rbuf[7] = 0; 914 915 ccb->ccb_h.status = CAM_REQ_CMP; 916 break; 917 } 918 | 761 break; 762 } 763 764 case INQUIRY: 765 { 766 PINQUIRYDATA inquiryData; 767 HIM_DEVICE_CONFIG devconf; 768 HPT_U8 *rbuf; --- 142 unchanged lines hidden (view full) --- 911 rbuf[5] = 0; 912 rbuf[6] = 2 << sector_size_shift; 913 rbuf[7] = 0; 914 915 ccb->ccb_h.status = CAM_REQ_CMP; 916 break; 917 } 918 |
919 case REPORT_LUNS: 920 { 921 HPT_U8 *rbuf = ccb->csio.data_ptr; 922 memset(rbuf, 0, 16); 923 rbuf[3] = 8; 924 ccb->ccb_h.status = CAM_REQ_CMP; 925 break; 926 } |
|
919 case SERVICE_ACTION_IN: 920 { 921 HPT_U8 *rbuf = ccb->csio.data_ptr; 922 HPT_U64 cap = 0; 923 HPT_U8 sector_size_shift = 0; 924 HPT_U32 sector_size = 0; 925 926 if(mIsArray(vd->type)) --- 22 unchanged lines hidden (view full) --- 949 rbuf[5] = (HPT_U8)(cap>>16); 950 rbuf[6] = (HPT_U8)(cap>>8); 951 rbuf[7] = (HPT_U8)cap; 952 rbuf[8] = 0; 953 rbuf[9] = 0; 954 rbuf[10] = 2 << sector_size_shift; 955 rbuf[11] = 0; 956 | 927 case SERVICE_ACTION_IN: 928 { 929 HPT_U8 *rbuf = ccb->csio.data_ptr; 930 HPT_U64 cap = 0; 931 HPT_U8 sector_size_shift = 0; 932 HPT_U32 sector_size = 0; 933 934 if(mIsArray(vd->type)) --- 22 unchanged lines hidden (view full) --- 957 rbuf[5] = (HPT_U8)(cap>>16); 958 rbuf[6] = (HPT_U8)(cap>>8); 959 rbuf[7] = (HPT_U8)cap; 960 rbuf[8] = 0; 961 rbuf[9] = 0; 962 rbuf[10] = 2 << sector_size_shift; 963 rbuf[11] = 0; 964 |
965 if(!mIsArray(vd->type)){ 966 rbuf[13] = vd->u.raw.logicalsectors_per_physicalsector; 967 rbuf[14] = (HPT_U8)((vd->u.raw.lowest_aligned >> 8) & 0x3f); 968 rbuf[15] = (HPT_U8)(vd->u.raw.lowest_aligned); 969 } 970 |
|
957 ccb->ccb_h.status = CAM_REQ_CMP; 958 break; 959 } 960 961 case READ_6: 962 case READ_10: 963 case READ_16: 964 case WRITE_6: --- 97 unchanged lines hidden (view full) --- 1062 ldm_free_cmds(pCmd); 1063 ccb->ccb_h.status = CAM_REQ_CMP_ERR; 1064 xpt_done(ccb); 1065 } 1066 return; 1067 } 1068 1069 default: | 971 ccb->ccb_h.status = CAM_REQ_CMP; 972 break; 973 } 974 975 case READ_6: 976 case READ_10: 977 case READ_16: 978 case WRITE_6: --- 97 unchanged lines hidden (view full) --- 1076 ldm_free_cmds(pCmd); 1077 ccb->ccb_h.status = CAM_REQ_CMP_ERR; 1078 xpt_done(ccb); 1079 } 1080 return; 1081 } 1082 1083 default: |
1070 ccb->ccb_h.status = CAM_SEL_TIMEOUT; | 1084 ccb->ccb_h.status = CAM_REQ_INVALID; |
1071 break; 1072 } 1073 1074 xpt_done(ccb); 1075 return; 1076} 1077 1078static void hpt_action(struct cam_sim *sim, union ccb *ccb) --- 586 unchanged lines hidden --- | 1085 break; 1086 } 1087 1088 xpt_done(ccb); 1089 return; 1090} 1091 1092static void hpt_action(struct cam_sim *sim, union ccb *ccb) --- 586 unchanged lines hidden --- |