Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2008 14:44:41 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 134197 for review
Message-ID:  <200801271444.m0REifwu088416@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134197

Change 134197 by hselasky@hselasky_laptop001 on 2008/01/27 14:43:58

	Bugfix. When we load memory into DMA it is also multi segment.
	"usbd_get_page()" should compute the physical address based on
	the offset and the first "usbd_page" alone when "ismultiseg" is
	false.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#88 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#88 (text+ko) ====

@@ -2050,12 +2050,18 @@
 
 		page = pc->page_start;
 
+		if (pc->ismultiseg) {
+
 		page += (offset / USB_PAGE_SIZE);
 
 		offset %= USB_PAGE_SIZE;
 
 		res->length = USB_PAGE_SIZE - offset;
 		res->physaddr = page->physaddr + offset;
+		} else {
+			res->length = 0 - 1;
+			res->physaddr = page->physaddr + offset;
+		}
 		if (!pc->buffer) {
 
 			/* Case 1b - Non Kernel Virtual Address */
@@ -2440,6 +2446,7 @@
 	/* setup page cache */
 	pc->page_offset_buf = 0;
 	pc->page_offset_end = size;
+	pc->ismultiseg = 1;
 
 	if (size > 0) {
 
@@ -2792,6 +2799,7 @@
 	/* setup page cache */
 	pc->page_offset_buf = 0;
 	pc->page_offset_end = size;
+	pc->ismultiseg = 1;
 
 	if (size > 0) {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801271444.m0REifwu088416>