diff options
author | scottl <scottl@FreeBSD.org> | 2013-09-24 16:50:53 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-09-24 16:50:53 +0000 |
commit | 108b7070e7a17abc52f44f333ba095f8f0eafc3a (patch) | |
tree | ccab290b4cfbac27db6123e5df329c2ca4e9a641 /sys/dev/asr/asr.c | |
parent | 6633bf70ed24c304037f64ca2f28e6ea8d2a0b47 (diff) | |
download | FreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.zip FreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.tar.gz |
Update the CAM API for FreeBSD 10:
- Remove the timeout_ch field. It's been deprecated since FreeBSD 7.0;
MPSAFE drivers should be managing their own timeout storage. The
remaining non-MPSAFE drivers have been modified to also manage their own
storage, and should be considered for updating to MPSAFE (or removal)
during the FreeBSD 10.x lifecycle.
- Add fields related to soft timeouts and quality of service, to be used
in upcoming work.
- Add room for more flags in the CCB header and path_inq structures.
- Begin support for extended 64-bit LUNs.
- Bump the CAM version number to 0x18, but add compat shims. Tested with
camcontrol and smartctl.
Reviewed by: nathanw, ken, kib
Approved by: re
Obtained from: Netflix
Diffstat (limited to 'sys/dev/asr/asr.c')
-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); |