From owner-svn-src-all@FreeBSD.ORG Sat Jun 14 00:44:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4626082E; Sat, 14 Jun 2014 00:44:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2770527C9; Sat, 14 Jun 2014 00:44:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E0ixax025143; Sat, 14 Jun 2014 00:44:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E0iw6M025138; Sat, 14 Jun 2014 00:44:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406140044.s5E0iw6M025138@svn.freebsd.org> From: Xin LI Date: Sat, 14 Jun 2014 00:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267457 - in stable/10/sys/dev: hpt27xx hptmv hptrr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 00:44:59 -0000 Author: delphij Date: Sat Jun 14 00:44:57 2014 New Revision: 267457 URL: http://svnweb.freebsd.org/changeset/base/267457 Log: MFC r267368: Apply vendor fixes to the High Point drivers: - Don't call xpt_free_path() in os_query_remove_device() and always return TRUE. - Update os_buildsgl() to support build logical SG table which will be used by lower RAID module. - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target missing. Many thanks to HighPoint for providing this driver update. Submitted by: Steve Chang Reviewed by: mav Modified: stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c stable/10/sys/dev/hptmv/entry.c stable/10/sys/dev/hptrr/hptrr_os_bsd.c stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -324,21 +324,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -474,6 +474,16 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } + /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; @@ -546,7 +556,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } Modified: stable/10/sys/dev/hptmv/entry.c ============================================================================== --- stable/10/sys/dev/hptmv/entry.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptmv/entry.c Sat Jun 14 00:44:57 2014 (r267457) @@ -2016,7 +2016,7 @@ hpt_probe(device_t dev) { KdPrintI((CONTROLLER_NAME " found\n")); device_set_desc(dev, CONTROLLER_NAME); - return 0; + return (BUS_PROBE_DEFAULT); } else return(ENXIO); @@ -2623,7 +2623,14 @@ launch_worker_thread(void) int HPTLIBAPI fOsBuildSgl(_VBUS_ARG PCommand pCmd, FPSCAT_GATH pSg, int logical) { - + union ccb *ccb = (union ccb *)pCmd->pOrgCommand; + + if (logical) { + pSg->dSgAddress = (ULONG_PTR)(UCHAR *)ccb->csio.data_ptr; + pSg->wSgSize = ccb->csio.dxfer_len; + pSg->wSgFlag = SG_FLAG_EOT; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; Modified: stable/10/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_os_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptrr/hptrr_os_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -256,21 +256,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: stable/10/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -61,7 +61,7 @@ static int hpt_probe(device_t dev) memset(hba, 0, sizeof(HBA)); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; - return 0; + return (BUS_PROBE_DEFAULT); } } } @@ -482,6 +482,15 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); @@ -555,7 +564,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; }