diff options
author | scottl <scottl@FreeBSD.org> | 2013-09-25 17:16:21 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-09-25 17:16:21 +0000 |
commit | e9cc92746f45b2e0ad6e2997f3128b950e702770 (patch) | |
tree | ebaa28f9cc2c11e9c0022f0db7fff2cc3e92b88c /sys/dev/asr | |
parent | e2e8dc4dbba38724bc3ce5c338d23ab3c6bfada4 (diff) | |
download | FreeBSD-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/dev/asr')
-rw-r--r-- | sys/dev/asr/asr.c | 33 |
1 files changed, 24 insertions, 9 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); |