From owner-p4-projects@FreeBSD.ORG Thu Apr 16 19:38:39 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD6BA1065672; Thu, 16 Apr 2009 19:38:38 +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 753261065670 for ; Thu, 16 Apr 2009 19:38:38 +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 626018FC08 for ; Thu, 16 Apr 2009 19:38:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GJccuQ064374 for ; Thu, 16 Apr 2009 19:38:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3GJccPW064372 for perforce@freebsd.org; Thu, 16 Apr 2009 19:38:38 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 16 Apr 2009 19:38:38 GMT Message-Id: <200904161938.n3GJccPW064372@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 160709 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: Thu, 16 Apr 2009 19:38:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=160709 Change 160709 by hselasky@hselasky_laptop001 on 2009/04/16 19:37:41 USB controller (ATMEGADCI): Re-do last patch. Use single buffering. Double buffering does not seem to be supported for 64-byte wMaxPacketSize. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.c#19 edit .. //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.h#7 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.c#19 (text+ko) ==== @@ -105,7 +105,6 @@ .max_in_frame_size = 64, .max_out_frame_size = 64, .is_simplex = 1, - .support_multi_buffer = 1, .support_bulk = 1, .support_interrupt = 1, .support_isochronous = 1, @@ -453,17 +452,13 @@ td->error = 1; return (0); /* complete */ } - if (!(temp & (ATMEGA_UEINTX_FIFOCON | - ATMEGA_UEINTX_TXINI))) { - /* cannot write any data */ + + temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); + if (temp & 3) { + /* cannot write any data - a bank is busy */ goto not_complete; } - if (!(temp & ATMEGA_UEINTX_RWAL)) { - if (!td->control_xfr) { - /* cannot write any data */ - goto not_complete; - } - } + count = td->max_packet_size; if (td->remainder < count) { /* we have a short packet */ @@ -537,9 +532,9 @@ * The control endpoint has only got one bank, so if that bank * is free the packet has been transferred! */ - if (!(temp & (ATMEGA_UEINTX_FIFOCON | - ATMEGA_UEINTX_TXINI))) { - /* cannot write any data */ + temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); + if (temp & 3) { + /* cannot write any data - a bank is busy */ goto not_complete; } if (sc->sc_dv_addr != 0xFF) { @@ -1174,7 +1169,7 @@ ATMEGA_WRITE_1(sc, ATMEGA_UECFG0X, temp); ATMEGA_WRITE_1(sc, ATMEGA_UECFG1X, ATMEGA_UECFG1X_ALLOC | - ATMEGA_UECFG1X_EPBK1 | + ATMEGA_UECFG1X_EPBK0 | /* one bank */ ATMEGA_UECFG1X_EPSIZE(3)); temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); @@ -1985,7 +1980,6 @@ uint32_t ntd; uint32_t n; uint8_t ep_no; - uint8_t is_control; sc = ATMEGA_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; @@ -2004,8 +1998,7 @@ /* * compute maximum number of TDs */ - is_control = ((xfer->pipe->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL); - if (is_control) { + if ((xfer->pipe->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; @@ -2049,8 +2042,6 @@ td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ - if (is_control) - td->control_xfr = 1; td->max_packet_size = xfer->max_packet_size; td->ep_no = ep_no; if (pf->support_multi_buffer) { ==== //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.h#7 (text+ko) ==== @@ -189,7 +189,6 @@ uint8_t short_pkt:1; uint8_t support_multi_buffer:1; uint8_t did_stall:1; - uint8_t control_xfr:1; uint8_t ep_no:3; };