summaryrefslogtreecommitdiffstats
path: root/sys/dev/sym/sym_hipd.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-26 18:11:43 +0000
committerattilio <attilio@FreeBSD.org>2013-02-26 18:11:43 +0000
commit134623836d0dcb10f5bc79c883bd239098952cca (patch)
tree53b8f81bf2dd71d981f19cb4460f54d0cd525234 /sys/dev/sym/sym_hipd.c
parentcff31deb1a197b29ab976c135fdd01dfb6951a6a (diff)
parent49f99b72515864c7f48e1d57295de7c122876049 (diff)
downloadFreeBSD-src-134623836d0dcb10f5bc79c883bd239098952cca.zip
FreeBSD-src-134623836d0dcb10f5bc79c883bd239098952cca.tar.gz
MFC
Diffstat (limited to 'sys/dev/sym/sym_hipd.c')
-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 68ad77f..7eebfd3 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;
+ }
}
}
OpenPOWER on IntegriCloud