summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2013-09-25 17:16:21 +0000
committerscottl <scottl@FreeBSD.org>2013-09-25 17:16:21 +0000
commite9cc92746f45b2e0ad6e2997f3128b950e702770 (patch)
treeebaa28f9cc2c11e9c0022f0db7fff2cc3e92b88c /sys
parente2e8dc4dbba38724bc3ce5c338d23ab3c6bfada4 (diff)
downloadFreeBSD-src-e9cc92746f45b2e0ad6e2997f3128b950e702770.zip
FreeBSD-src-e9cc92746f45b2e0ad6e2997f3128b950e702770.tar.gz
Re-do r255853. Along with adding back the API/ABI changes from the
original, this hides the contents of cam_compat.h from ktrace/kdump/truss, avoiding problems there. There are no user-servicable parts in there, so no need for those tools to be groping around in there. Approved by: re
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/asr/asr.c33
-rw-r--r--sys/dev/firewire/sbp.c8
-rw-r--r--sys/dev/hpt27xx/hpt27xx_osm_bsd.c6
-rw-r--r--sys/dev/hpt27xx/os_bsd.h1
-rw-r--r--sys/dev/hptiop/hptiop.c5
-rw-r--r--sys/dev/hptiop/hptiop.h1
-rw-r--r--sys/dev/hptmv/entry.c5
-rw-r--r--sys/dev/hptmv/osbsd.h1
-rw-r--r--sys/dev/hptnr/hptnr_osm_bsd.c5
-rw-r--r--sys/dev/hptnr/os_bsd.h1
-rw-r--r--sys/dev/hptrr/hptrr_osm_bsd.c5
-rw-r--r--sys/dev/hptrr/os_bsd.h1
-rw-r--r--sys/dev/iir/iir.c5
-rw-r--r--sys/dev/iir/iir.h1
-rw-r--r--sys/dev/tws/tws.c1
-rw-r--r--sys/dev/tws/tws_cam.c10
16 files changed, 59 insertions, 30 deletions
diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c
index 8909d0c..1e4f1a6 100644
--- a/sys/dev/asr/asr.c
+++ b/sys/dev/asr/asr.c
@@ -385,6 +385,21 @@ typedef struct Asr_softc {
static STAILQ_HEAD(, Asr_softc) Asr_softc_list =
STAILQ_HEAD_INITIALIZER(Asr_softc_list);
+static __inline void
+set_ccb_timeout_ch(union asr_ccb *ccb, struct callout_handle ch)
+{
+ ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout;
+}
+
+static __inline struct callout_handle
+get_ccb_timeout_ch(union asr_ccb *ccb)
+{
+ struct callout_handle ch;
+
+ ch.callout = ccb->ccb_h.sim_priv.entries[0].ptr;
+ return ch;
+}
+
/*
* Prototypes of the routines we have in this object.
*/
@@ -797,8 +812,8 @@ ASR_ccbAdd(Asr_softc_t *sc, union asr_ccb *ccb)
*/
ccb->ccb_h.timeout = 6 * 60 * 1000;
}
- ccb->ccb_h.timeout_ch = timeout(asr_timeout, (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000);
+ set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb,
+ (ccb->ccb_h.timeout * hz) / 1000));
}
splx(s);
} /* ASR_ccbAdd */
@@ -812,7 +827,7 @@ ASR_ccbRemove(Asr_softc_t *sc, union asr_ccb *ccb)
int s;
s = splcam();
- untimeout(asr_timeout, (caddr_t)ccb, ccb->ccb_h.timeout_ch);
+ untimeout(asr_timeout, (caddr_t)ccb, get_ccb_timeout_ch(ccb));
LIST_REMOVE(&(ccb->ccb_h), sim_links.le);
splx(s);
} /* ASR_ccbRemove */
@@ -1322,9 +1337,9 @@ asr_timeout(void *arg)
cam_sim_unit(xpt_path_sim(ccb->ccb_h.path)), s);
if (ASR_reset (sc) == ENXIO) {
/* Try again later */
- ccb->ccb_h.timeout_ch = timeout(asr_timeout,
+ set_ccb_timeout_ch(ccb, timeout(asr_timeout,
(caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000);
+ (ccb->ccb_h.timeout * hz) / 1000));
}
return;
}
@@ -1338,9 +1353,9 @@ asr_timeout(void *arg)
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_CMD_TIMEOUT) {
debug_asr_printf (" AGAIN\nreinitializing adapter\n");
if (ASR_reset (sc) == ENXIO) {
- ccb->ccb_h.timeout_ch = timeout(asr_timeout,
+ set_ccb_timeout_ch(ccb, timeout(asr_timeout,
(caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000);
+ (ccb->ccb_h.timeout * hz) / 1000));
}
splx(s);
return;
@@ -1349,8 +1364,8 @@ asr_timeout(void *arg)
/* If the BUS reset does not take, then an adapter reset is next! */
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
ccb->ccb_h.status |= CAM_CMD_TIMEOUT;
- ccb->ccb_h.timeout_ch = timeout(asr_timeout, (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000);
+ set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb,
+ (ccb->ccb_h.timeout * hz) / 1000));
ASR_resetBus (sc, cam_sim_bus(xpt_path_sim(ccb->ccb_h.path)));
xpt_async (AC_BUS_RESET, ccb->ccb_h.path, NULL);
splx(s);
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 6b1b4a1..00e780e 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -177,6 +177,7 @@ struct sbp_ocb {
struct sbp_dev *sdev;
int flags; /* XXX should be removed */
bus_dmamap_t dmamap;
+ struct callout_handle timeout_ch;
};
#define OCB_ACT_MGM 0
@@ -591,6 +592,7 @@ END_DEBUG
/* XXX */
goto next;
}
+ callout_handle_init(&ocb->timeout_ch);
sbp_free_ocb(sdev, ocb);
}
next:
@@ -2763,7 +2765,7 @@ END_DEBUG
STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb);
if (ocb->ccb != NULL)
untimeout(sbp_timeout, (caddr_t)ocb,
- ocb->ccb->ccb_h.timeout_ch);
+ ocb->timeout_ch);
if (ntohl(ocb->orb[4]) & 0xffff) {
bus_dmamap_sync(sdev->target->sbp->dmat,
ocb->dmamap,
@@ -2836,7 +2838,7 @@ END_DEBUG
STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb);
if (ocb->ccb != NULL)
- ocb->ccb->ccb_h.timeout_ch = timeout(sbp_timeout, (caddr_t)ocb,
+ ocb->timeout_ch = timeout(sbp_timeout, (caddr_t)ocb,
(ocb->ccb->ccb_h.timeout * hz) / 1000);
if (use_doorbell && prev == NULL)
@@ -2930,7 +2932,7 @@ END_DEBUG
}
if (ocb->ccb != NULL) {
untimeout(sbp_timeout, (caddr_t)ocb,
- ocb->ccb->ccb_h.timeout_ch);
+ ocb->timeout_ch);
ocb->ccb->ccb_h.status = status;
SBP_LOCK(sdev->target->sbp);
xpt_done(ocb->ccb);
diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
index 3c9f0ac..d66db18 100644
--- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
@@ -432,7 +432,7 @@ static void os_cmddone(PCOMMAND pCmd)
KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result));
- untimeout(hpt_timeout, pCmd, ccb->ccb_h.timeout_ch);
+ untimeout(hpt_timeout, pCmd, ext->timeout_ch);
switch(pCmd->Result) {
case RETURN_SUCCESS:
@@ -510,8 +510,7 @@ static void hpt_io_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nsegs
BUS_DMASYNC_PREWRITE);
}
}
-
- ext->ccb->ccb_h.timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
+ ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
ldm_queue_cmd(pCmd);
}
@@ -1048,6 +1047,7 @@ static void hpt_final_init(void *dummy)
os_printk("Can't create dma map(%d)", i);
return ;
}
+ callout_handle_init(&ext->timeout_ch);
}
if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) {
diff --git a/sys/dev/hpt27xx/os_bsd.h b/sys/dev/hpt27xx/os_bsd.h
index e3f8e7d..6de4dbb 100644
--- a/sys/dev/hpt27xx/os_bsd.h
+++ b/sys/dev/hpt27xx/os_bsd.h
@@ -174,6 +174,7 @@ typedef struct _os_cmdext {
struct _os_cmdext *next;
union ccb *ccb;
bus_dmamap_t dma_map;
+ struct callout_handle timeout_ch;
SG psg[os_max_sg_descriptors];
}
OS_CMDEXT, *POS_CMDEXT;
diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c
index 50a9c43..6b83774 100644
--- a/sys/dev/hptiop/hptiop.c
+++ b/sys/dev/hptiop/hptiop.c
@@ -643,7 +643,7 @@ static void hptiop_request_callback_mvfrey(struct hpt_iop_hba * hba,
ccb = (union ccb *)srb->ccb;
- untimeout(hptiop_reset_adapter, hba, ccb->ccb_h.timeout_ch);
+ untimeout(hptiop_reset_adapter, hba, srb->timeout_ch);
if (ccb->ccb_h.flags & CAM_CDB_POINTER)
cdb = ccb->csio.cdb_io.cdb_ptr;
@@ -2629,7 +2629,7 @@ static void hptiop_post_req_mvfrey(struct hpt_iop_hba *hba,
BUS_SPACE_RD4_MVFREY2(inbound_write_ptr);
if (req->header.type == IOP_REQUEST_TYPE_SCSI_COMMAND) {
- ccb->ccb_h.timeout_ch = timeout(hptiop_reset_adapter, hba, 20*hz);
+ srb->timeout_ch = timeout(hptiop_reset_adapter, hba, 20*hz);
}
}
@@ -2741,6 +2741,7 @@ static void hptiop_map_srb(void *arg, bus_dma_segment_t *segs,
tmp_srb->phy_addr = phy_addr;
}
+ callout_handle_init(&tmp_srb->timeout_ch);
hptiop_free_srb(hba, tmp_srb);
hba->srb[i] = tmp_srb;
phy_addr += HPT_SRB_MAX_SIZE;
diff --git a/sys/dev/hptiop/hptiop.h b/sys/dev/hptiop/hptiop.h
index 8683620..67ff7fc 100644
--- a/sys/dev/hptiop/hptiop.h
+++ b/sys/dev/hptiop/hptiop.h
@@ -460,6 +460,7 @@ struct hpt_iop_srb {
u_int64_t phy_addr;
u_int32_t srb_flag;
int index;
+ struct callout_handle timeout_ch;
};
#define hptiop_lock_adapter(hba) mtx_lock(&(hba)->lock)
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index 80f5130..85d658e 100644
--- a/sys/dev/hptmv/entry.c
+++ b/sys/dev/hptmv/entry.c
@@ -1438,6 +1438,7 @@ unregister:
free(pAdapter->pbus_dmamap, M_DEVBUF);
goto unregister;
}
+ callout_handle_init(&pmap->timeout_ch);
}
/* setup PRD Tables */
KdPrint(("Allocate PRD Tables\n"));
@@ -2758,7 +2759,7 @@ hpt_io_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
}
}
- ccb->ccb_h.timeout_ch = timeout(hpt_timeout, (caddr_t)ccb, 20*hz);
+ pmap->timeout_ch = timeout(hpt_timeout, (caddr_t)ccb, 20*hz);
pVDev->pfnSendCommand(_VBUS_P pCmd);
CheckPendingCall(_VBUS_P0);
}
@@ -2980,7 +2981,7 @@ fOsCommandDone(_VBUS_ARG PCommand pCmd)
KdPrint(("fOsCommandDone(pcmd=%p, result=%d)\n", pCmd, pCmd->Result));
- untimeout(hpt_timeout, (caddr_t)ccb, ccb->ccb_h.timeout_ch);
+ untimeout(hpt_timeout, (caddr_t)ccb, pmap->timeout_ch);
switch(pCmd->Result) {
case RETURN_SUCCESS:
diff --git a/sys/dev/hptmv/osbsd.h b/sys/dev/hptmv/osbsd.h
index e71e3ed..a0232e5 100644
--- a/sys/dev/hptmv/osbsd.h
+++ b/sys/dev/hptmv/osbsd.h
@@ -153,6 +153,7 @@ typedef struct _BUS_DMAMAP
{ struct _BUS_DMAMAP *next;
struct IALAdapter *pAdapter;
bus_dmamap_t dma_map;
+ struct callout_handle timeout_ch;
SCAT_GATH psg[MAX_SG_DESCRIPTORS];
} BUS_DMAMAP, *PBUS_DMAMAP;
diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c
index 7021abe..87441be 100644
--- a/sys/dev/hptnr/hptnr_osm_bsd.c
+++ b/sys/dev/hptnr/hptnr_osm_bsd.c
@@ -432,7 +432,7 @@ static void os_cmddone(PCOMMAND pCmd)
KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result));
- untimeout(hpt_timeout, pCmd, ccb->ccb_h.timeout_ch);
+ untimeout(hpt_timeout, pCmd, ext->timeout_ch);
switch(pCmd->Result) {
case RETURN_SUCCESS:
@@ -511,7 +511,7 @@ static void hpt_io_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nsegs
}
}
- ext->ccb->ccb_h.timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
+ ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
ldm_queue_cmd(pCmd);
}
@@ -1048,6 +1048,7 @@ static void hpt_final_init(void *dummy)
os_printk("Can't create dma map(%d)", i);
return ;
}
+ callout_handle_init(&ext->timeout_ch);
}
if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) {
diff --git a/sys/dev/hptnr/os_bsd.h b/sys/dev/hptnr/os_bsd.h
index bdf9be7..8fda267 100644
--- a/sys/dev/hptnr/os_bsd.h
+++ b/sys/dev/hptnr/os_bsd.h
@@ -176,6 +176,7 @@ typedef struct _os_cmdext {
struct _os_cmdext *next;
union ccb *ccb;
bus_dmamap_t dma_map;
+ struct callout_handle timeout_ch;
SG psg[os_max_sg_descriptors];
}
OS_CMDEXT, *POS_CMDEXT;
diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c
index 9af256e..3d83de6 100644
--- a/sys/dev/hptrr/hptrr_osm_bsd.c
+++ b/sys/dev/hptrr/hptrr_osm_bsd.c
@@ -440,7 +440,7 @@ static void os_cmddone(PCOMMAND pCmd)
KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result));
- untimeout(hpt_timeout, pCmd, ccb->ccb_h.timeout_ch);
+ untimeout(hpt_timeout, pCmd, ext->timeout_ch);
switch(pCmd->Result) {
case RETURN_SUCCESS:
@@ -519,7 +519,7 @@ static void hpt_io_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nsegs
BUS_DMASYNC_PREWRITE);
}
}
- ext->ccb->ccb_h.timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
+ ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT);
ldm_queue_cmd(pCmd);
}
@@ -1058,6 +1058,7 @@ static void hpt_final_init(void *dummy)
os_printk("Can't create dma map(%d)", i);
return ;
}
+ callout_handle_init(&ext->timeout_ch);
}
if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) {
diff --git a/sys/dev/hptrr/os_bsd.h b/sys/dev/hptrr/os_bsd.h
index ec221f3..1c6760e 100644
--- a/sys/dev/hptrr/os_bsd.h
+++ b/sys/dev/hptrr/os_bsd.h
@@ -174,6 +174,7 @@ typedef struct _os_cmdext {
struct _os_cmdext *next;
union ccb *ccb;
bus_dmamap_t dma_map;
+ struct callout_handle timeout_ch;
SG psg[os_max_sg_descriptors];
}
OS_CMDEXT, *POS_CMDEXT;
diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c
index 684fce3..1090042 100644
--- a/sys/dev/iir/iir.c
+++ b/sys/dev/iir/iir.c
@@ -270,6 +270,7 @@ iir_init(struct gdt_softc *gdt)
gccb->gc_map_flag = TRUE;
gccb->gc_scratch = &gdt->sc_gcscratch[GDT_SCRATCH_SZ * i];
gccb->gc_scratch_busbase = gdt->sc_gcscratch_busbase + GDT_SCRATCH_SZ * i;
+ callout_handle_init(&gccb->gc_timeout_ch);
SLIST_INSERT_HEAD(&gdt->sc_free_gccb, gccb, sle);
}
gdt->sc_init_level++;
@@ -1239,7 +1240,7 @@ gdtexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
ccb->ccb_h.status |= CAM_SIM_QUEUED;
/* timeout handling */
- ccb->ccb_h.timeout_ch =
+ gccb->gc_timeout_ch =
timeout(iir_timeout, (caddr_t)gccb,
(ccb->ccb_h.timeout * hz) / 1000);
@@ -1747,7 +1748,7 @@ gdt_sync_event(struct gdt_softc *gdt, int service,
printf("\n");
return (0);
} else {
- untimeout(iir_timeout, gccb, ccb->ccb_h.timeout_ch);
+ untimeout(iir_timeout, gccb, gccb->gc_timeout_ch);
if (gdt->sc_status == GDT_S_BSY) {
GDT_DPRINTF(GDT_D_DEBUG, ("gdt_sync_event(%p) gccb %p busy\n",
gdt, gccb));
diff --git a/sys/dev/iir/iir.h b/sys/dev/iir/iir.h
index dbae7d2..de7b641 100644
--- a/sys/dev/iir/iir.h
+++ b/sys/dev/iir/iir.h
@@ -684,6 +684,7 @@ struct gdt_ccb {
union ccb *gc_ccb;
gdt_ucmd_t *gc_ucmd;
bus_dmamap_t gc_dmamap;
+ struct callout_handle gc_timeout_ch;
int gc_map_flag;
int gc_timeout;
u_int8_t gc_service;
diff --git a/sys/dev/tws/tws.c b/sys/dev/tws/tws.c
index 409631f..6ebde75 100644
--- a/sys/dev/tws/tws.c
+++ b/sys/dev/tws/tws.c
@@ -696,6 +696,7 @@ tws_init_reqs(struct tws_softc *sc, u_int32_t dma_mem_size)
sc->reqs[i].cmd_pkt->hdr.header_desc.size_header = 128;
+ callout_handle_init(&sc->reqs[i].thandle);
sc->reqs[i].state = TWS_REQ_STATE_FREE;
if ( i >= TWS_RESERVED_REQS )
tws_q_insert_tail(sc, &sc->reqs[i], TWS_FREE_Q);
diff --git a/sys/dev/tws/tws_cam.c b/sys/dev/tws/tws_cam.c
index 46b91f4..b134d76 100644
--- a/sys/dev/tws/tws_cam.c
+++ b/sys/dev/tws/tws_cam.c
@@ -341,7 +341,7 @@ tws_scsi_complete(struct tws_request *req)
tws_q_remove_request(sc, req, TWS_BUSY_Q);
mtx_unlock(&sc->q_lock);
- untimeout(tws_timeout, req, req->ccb_ptr->ccb_h.timeout_ch);
+ untimeout(tws_timeout, req, req->thandle);
tws_unmap_request(req->sc, req);
@@ -454,7 +454,7 @@ tws_cmd_complete(struct tws_request *req)
{
struct tws_softc *sc = req->sc;
- untimeout(tws_timeout, req, req->ccb_ptr->ccb_h.timeout_ch);
+ untimeout(tws_timeout, req, req->thandle);
tws_unmap_request(sc, req);
}
@@ -561,7 +561,7 @@ tws_scsi_err_complete(struct tws_request *req, struct tws_command_header *hdr)
xpt_done(ccb);
mtx_unlock(&sc->sim_lock);
- untimeout(tws_timeout, req, req->ccb_ptr->ccb_h.timeout_ch);
+ untimeout(tws_timeout, req, req->thandle);
tws_unmap_request(req->sc, req);
mtx_lock(&sc->q_lock);
tws_q_remove_request(sc, req, TWS_BUSY_Q);
@@ -591,7 +591,7 @@ tws_drain_busy_queue(struct tws_softc *sc)
mtx_unlock(&sc->q_lock);
while ( req ) {
TWS_TRACE_DEBUG(sc, "moved to TWS_COMPLETE_Q", 0, req->request_id);
- untimeout(tws_timeout, req, req->ccb_ptr->ccb_h.timeout_ch);
+ untimeout(tws_timeout, req, req->thandle);
req->error_code = TWS_REQ_RET_RESET;
ccb = (union ccb *)(req->ccb_ptr);
@@ -747,7 +747,7 @@ tws_execute_scsi(struct tws_softc *sc, union ccb *ccb)
* and submit the I/O.
*/
sc->stats.scsi_ios++;
- ccb_h->timeout_ch = timeout(tws_timeout, req, (ccb_h->timeout * hz)/1000);
+ req->thandle = timeout(tws_timeout, req, (ccb_h->timeout * hz)/1000);
error = tws_map_request(sc, req);
return(error);
}
OpenPOWER on IntegriCloud