Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2007 19:01:09 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 131885 for review
Message-ID:  <200712281901.lBSJ19VQ023528@repoman.freebsd.org>

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

Change 131885 by hselasky@hselasky_laptop001 on 2007/12/28 19:00:13

	
	Correctly initialise the "alt_next" field when
	receiving data using multi sub-framing.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/ehci.c#66 edit
.. //depot/projects/usb/src/sys/dev/usb/ohci.c#55 edit
.. //depot/projects/usb/src/sys/dev/usb/uhci.c#56 edit

Differences ...

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

@@ -122,6 +122,7 @@
 	uint8_t	shortpkt;
 	uint8_t	auto_data_toggle;
 	uint8_t	setup_alt_next;
+	uint8_t	short_frames_ok;
 };
 
 void
@@ -1692,12 +1693,16 @@
 		precompute = 0;
 
 		/* setup alt next pointer, if any */
-		if (td_next) {
-			td_alt_next = td_next;
+		if (temp->short_frames_ok) {
 			if (temp->setup_alt_next) {
-				qtd_altnext = td_alt_next->qtd_self;
+				td_alt_next = td_next;
+				qtd_altnext = td_next->qtd_self;
 			}
+		} else {
+			/* we use this field internally */
+			td_alt_next = td_next;
 		}
+
 		/* restore */
 		temp->shortpkt = shortpkt_old;
 		temp->len = len_old;
@@ -1740,6 +1745,7 @@
 	temp.td_next = td;
 	temp.qtd_status = 0;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
+	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	if (xfer->flags_int.control_xfr) {
 		if (xfer->pipe->toggle_next) {

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

@@ -138,6 +138,7 @@
 	uint16_t max_frame_size;
 	uint8_t	shortpkt;
 	uint8_t	setup_alt_next;
+	uint8_t	short_frames_ok;
 };
 
 static struct ohci_hcca *
@@ -1413,7 +1414,14 @@
 		precompute = 0;
 
 		/* setup alt next pointer, if any */
-		td_alt_next = td_next;
+		if (temp->short_frames_ok) {
+			if (temp->setup_alt_next) {
+				td_alt_next = td_next;
+			}
+		} else {
+			/* we use this field internally */
+			td_alt_next = td_next;
+		}
 
 		/* restore */
 		temp->shortpkt = shortpkt_old;
@@ -1455,6 +1463,7 @@
 	temp.td = NULL;
 	temp.td_next = td;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
+	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	methods = xfer->pipe->methods;
 

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

@@ -147,6 +147,7 @@
 	uint16_t max_frame_size;
 	uint8_t	shortpkt;
 	uint8_t	setup_alt_next;
+	uint8_t	short_frames_ok;
 };
 
 extern struct usbd_bus_methods uhci_bus_methods;
@@ -1664,8 +1665,15 @@
 	if (precompute) {
 		precompute = 0;
 
-		/* store alt next pointer */
-		td_alt_next = td_next;
+		/* setup alt next pointer, if any */
+		if (temp->short_frames_ok) {
+			if (temp->setup_alt_next) {
+				td_alt_next = td_next;
+			}
+		} else {
+			/* we use this field internally */
+			td_alt_next = td_next;
+		}
 
 		/* restore */
 		temp->shortpkt = shortpkt_old;
@@ -1703,6 +1711,7 @@
 	temp.td = NULL;
 	temp.td_next = td;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
+	temp.short_frames_ok = xfer->flags_int.short_frames_ok;
 
 	uhci_mem_layout_init(&(temp.ml), xfer);
 



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