summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-01-29 16:44:12 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-01-29 16:44:12 +0000
commit60c82e0d872a60b0774de92638c132d0e557fa7c (patch)
treebb3713c8c2f0e5366d1385c87dc317964e4d753d /sys/dev
parent49c1bc08d5bc3ed6c4f9eda3711531f078b16ee9 (diff)
In dwctwo(4), fix an off-by-one in frame interval calculation.
Fix stolen from Linux commit 9ed04d976146cf10dfa4c71171434af7c0348747 ok visa@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/dwc2/dwc2_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/dwc2/dwc2_core.c b/sys/dev/usb/dwc2/dwc2_core.c
index d1912d02791..3071ec35614 100644
--- a/sys/dev/usb/dwc2/dwc2_core.c
+++ b/sys/dev/usb/dwc2/dwc2_core.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_core.c,v 1.6 2015/06/28 11:48:18 jmatthew Exp $ */
+/* $OpenBSD: dwc2_core.c,v 1.7 2017/01/29 16:44:11 stsp Exp $ */
/* $NetBSD: dwc2_core.c,v 1.6 2014/04/03 06:34:58 skrll Exp $ */
/*
@@ -1701,10 +1701,10 @@ u32 dwc2_calc_frame_interval(struct dwc2_hsotg *hsotg)
if ((hprt0 & HPRT0_SPD_MASK) >> HPRT0_SPD_SHIFT == HPRT0_SPD_HIGH_SPEED)
/* High speed case */
- return 125 * clock;
+ return 125 * clock - 1;
else
/* FS/LS case */
- return 1000 * clock;
+ return 1000 * clock - 1;
}
/**