summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-06-14 00:54:57 +0000
committerXin LI <delphij@FreeBSD.org>2014-06-14 00:54:57 +0000
commit5cf8daa456eb7f757eb19f860bc19c2bae61a7f4 (patch)
tree25fea264df1355e1241ce5a420efd238a44d5665 /sys
parent34cbdf177c04d04220da63f9cfe7f0874e971592 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/hpt27xx/hpt27xx_os_bsd.c16
-rw-r--r--sys/dev/hpt27xx/hpt27xx_osm_bsd.c12
-rw-r--r--sys/dev/hptmv/entry.c11
-rw-r--r--sys/dev/hptrr/hptrr_os_bsd.c16
-rw-r--r--sys/dev/hptrr/hptrr_osm_bsd.c13
5 files changed, 33 insertions, 35 deletions
diff --git a/sys/dev/hpt27xx/hpt27xx_os_bsd.c b/sys/dev/hpt27xx/hpt27xx_os_bsd.c
index 12f832bae5de..1d22fbbf2512 100644
--- a/sys/dev/hpt27xx/hpt27xx_os_bsd.c
+++ b/sys/dev/hpt27xx/hpt27xx_os_bsd.c
@@ -324,21 +324,7 @@ int os_revalidate_device(void *osext, int id)
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)
diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
index 3c9f0ace838b..0d30d5b5e8a1 100644
--- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
@@ -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;
@@ -547,7 +557,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
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;
}
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index 80f513036a2b..7c324f88cfce 100644
--- a/sys/dev/hptmv/entry.c
+++ b/sys/dev/hptmv/entry.c
@@ -2015,7 +2015,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);
@@ -2622,7 +2622,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;
diff --git a/sys/dev/hptrr/hptrr_os_bsd.c b/sys/dev/hptrr/hptrr_os_bsd.c
index 81a38295b003..5cb81dab0b5d 100644
--- a/sys/dev/hptrr/hptrr_os_bsd.c
+++ b/sys/dev/hptrr/hptrr_os_bsd.c
@@ -256,21 +256,7 @@ int os_revalidate_device(void *osext, int id)
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)
diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c
index 798c2dd2262a..3091be19a3f2 100644
--- a/sys/dev/hptrr/hptrr_osm_bsd.c
+++ b/sys/dev/hptrr/hptrr_osm_bsd.c
@@ -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);
}
}
}
@@ -481,6 +481,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);
@@ -554,7 +563,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_ext, union ccb *ccb)
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;
}