Module Name: src
Committed By: skrll
Date: Sun Feb 1 08:45:04 UTC 2015
Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c ehcireg.h
Log Message:
Define and use EHCI_QTD_MAXTRANSFER. No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.234.2.29 -r1.234.2.30 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.34.14.3 -r1.34.14.4 src/sys/dev/usb/ehcireg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.29 src/sys/dev/usb/ehci.c:1.234.2.30
--- src/sys/dev/usb/ehci.c:1.234.2.29 Sun Feb 1 06:15:41 2015
+++ src/sys/dev/usb/ehci.c Sun Feb 1 08:45:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.234.2.29 2015/02/01 06:15:41 skrll Exp $ */
+/* $NetBSD: ehci.c,v 1.234.2.30 2015/02/01 08:45:04 skrll Exp $ */
/*
* Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.29 2015/02/01 06:15:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.30 2015/02/01 08:45:04 skrll Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -2786,12 +2786,12 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
/* The EHCI hardware can handle at most 5 pages. */
va_offs = (vaddr_t)KERNADDR(dma, curoffs);
va_offs = EHCI_PAGE_OFFSET(va_offs);
- if (len-curoffs < EHCI_QTD_NBUFFERS*EHCI_PAGE_SIZE - va_offs) {
+ if (len-curoffs < EHCI_QTD_MAXTRANSFER - va_offs) {
/* we can handle it in this QTD */
curlen = len - curoffs;
} else {
/* must use multiple TDs, fill as much as possible. */
- curlen = EHCI_QTD_NBUFFERS * EHCI_PAGE_SIZE - va_offs;
+ curlen = EHCI_QTD_MAXTRANSFER - va_offs;
/* the length must be a multiple of the max size */
curlen -= curlen % mps;
Index: src/sys/dev/usb/ehcireg.h
diff -u src/sys/dev/usb/ehcireg.h:1.34.14.3 src/sys/dev/usb/ehcireg.h:1.34.14.4
--- src/sys/dev/usb/ehcireg.h:1.34.14.3 Sun Feb 1 08:39:43 2015
+++ src/sys/dev/usb/ehcireg.h Sun Feb 1 08:45:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ehcireg.h,v 1.34.14.3 2015/02/01 08:39:43 skrll Exp $ */
+/* $NetBSD: ehcireg.h,v 1.34.14.4 2015/02/01 08:45:04 skrll Exp $ */
/*
* Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -281,7 +281,8 @@ typedef struct {
#define EHCI_SITD_ALIGN 32
/* Queue Element Transfer Descriptor */
-#define EHCI_QTD_NBUFFERS 5
+#define EHCI_QTD_NBUFFERS 5
+#define EHCI_QTD_MAXTRANSFER (EHCI_QTD_NBUFFERS * EHCI_PAGE_SIZE)
typedef struct {
volatile ehci_link_t qtd_next;
volatile ehci_link_t qtd_altnext;