[Midnightbsd-cvs] src [9013] trunk/sys/dev/sym/sym_hipd.c: dont negotiate sync mode if either period of offset are zero.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Thu Sep 29 21:51:27 EDT 2016
Revision: 9013
http://svnweb.midnightbsd.org/src/?rev=9013
Author: laffer1
Date: 2016-09-29 21:51:27 -0400 (Thu, 29 Sep 2016)
Log Message:
-----------
dont negotiate sync mode if either period of offset are zero.
Modified Paths:
--------------
trunk/sys/dev/sym/sym_hipd.c
Modified: trunk/sys/dev/sym/sym_hipd.c
===================================================================
--- trunk/sys/dev/sym/sym_hipd.c 2016-09-30 01:50:11 UTC (rev 9012)
+++ trunk/sys/dev/sym/sym_hipd.c 2016-09-30 01:51:27 UTC (rev 9013)
@@ -8242,8 +8242,13 @@
* 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.
@@ -8262,22 +8267,24 @@
/*
* 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;
+ 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;
+ }
}
- 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;
- }
}
/*
More information about the Midnightbsd-cvs
mailing list