aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sym
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2013-02-25 14:06:24 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2013-02-25 14:06:24 +0000
commit9cdcf100c10c175ac4b8c1a0a711c27642fbaf8b (patch)
treee1db830009c9838ed222d8b70304708699d0bd3a /sys/dev/sym
parente70664bafc4e17b4c25809fc971f92ba5f7e16e7 (diff)
downloadsrc-9cdcf100c10c175ac4b8c1a0a711c27642fbaf8b.tar.gz
src-9cdcf100c10c175ac4b8c1a0a711c27642fbaf8b.zip
Notes
Diffstat (limited to 'sys/dev/sym')
-rw-r--r--sys/dev/sym/sym_hipd.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c
index 68ad77f68f93..7eebfd3ffc2a 100644
--- a/sys/dev/sym/sym_hipd.c
+++ b/sys/dev/sym/sym_hipd.c
@@ -8211,8 +8211,13 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
* Scale against driver configuration limits.
*/
if (tip->width > SYM_SETUP_MAX_WIDE) tip->width = SYM_SETUP_MAX_WIDE;
- if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS;
- if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC;
+ if (tip->period && tip->offset) {
+ if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS;
+ if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC;
+ } else {
+ tip->offset = 0;
+ tip->period = 0;
+ }
/*
* Scale against actual controller BUS width.
@@ -8231,21 +8236,23 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
/*
* Scale period factor and offset against controller limits.
*/
- if (tip->options & PPR_OPT_DT) {
- if (tip->period < np->minsync_dt)
- tip->period = np->minsync_dt;
- if (tip->period > np->maxsync_dt)
- tip->period = np->maxsync_dt;
- if (tip->offset > np->maxoffs_dt)
- tip->offset = np->maxoffs_dt;
- }
- else {
- if (tip->period < np->minsync)
- tip->period = np->minsync;
- if (tip->period > np->maxsync)
- tip->period = np->maxsync;
- if (tip->offset > np->maxoffs)
- tip->offset = np->maxoffs;
+ if (tip->offset && tip->period) {
+ if (tip->options & PPR_OPT_DT) {
+ if (tip->period < np->minsync_dt)
+ tip->period = np->minsync_dt;
+ if (tip->period > np->maxsync_dt)
+ tip->period = np->maxsync_dt;
+ if (tip->offset > np->maxoffs_dt)
+ tip->offset = np->maxoffs_dt;
+ }
+ else {
+ if (tip->period < np->minsync)
+ tip->period = np->minsync;
+ if (tip->period > np->maxsync)
+ tip->period = np->maxsync;
+ if (tip->offset > np->maxoffs)
+ tip->offset = np->maxoffs;
+ }
}
}