From owner-p4-projects@FreeBSD.ORG Fri Dec 28 19:01:10 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 594F216A468; Fri, 28 Dec 2007 19:01:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F17C16A41B for ; Fri, 28 Dec 2007 19:01:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E807C13C442 for ; Fri, 28 Dec 2007 19:01:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBSJ19El023531 for ; Fri, 28 Dec 2007 19:01:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBSJ19VQ023528 for perforce@freebsd.org; Fri, 28 Dec 2007 19:01:09 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 28 Dec 2007 19:01:09 GMT Message-Id: <200712281901.lBSJ19VQ023528@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 131885 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2007 19:01:10 -0000 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);