PERFORCE change 134197 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sun Jan 27 06:44:42 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=134197

Change 134197 by hselasky at 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) {
 


More information about the p4-projects mailing list