From owner-svn-src-all@FreeBSD.ORG Wed Apr 22 17:08:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20353106591A; Wed, 22 Apr 2009 17:08:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846DF8FC17; Wed, 22 Apr 2009 17:08:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3MH8DMm062803; Wed, 22 Apr 2009 17:08:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3MH8D68062802; Wed, 22 Apr 2009 17:08:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904221708.n3MH8D68062802@svn.freebsd.org> From: Andrew Thompson Date: Wed, 22 Apr 2009 17:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191401 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 17:08:14 -0000 Author: thompsa Date: Wed Apr 22 17:08:13 2009 New Revision: 191401 URL: http://svn.freebsd.org/changeset/base/191401 Log: MFp4 //depot/projects/usb@160708 Need to check Read/Write allowed before writing any data for non-control transfers. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Apr 22 17:08:10 2009 (r191400) +++ head/sys/dev/usb/controller/atmegadci.c Wed Apr 22 17:08:13 2009 (r191401) @@ -103,7 +103,6 @@ static const struct usb2_hw_ep_profile .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, @@ -451,11 +450,13 @@ repeat: 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; } + count = td->max_packet_size; if (td->remainder < count) { /* we have a short packet */ @@ -529,9 +530,9 @@ atmegadci_data_tx_sync(struct atmegadci_ * 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) { @@ -1166,7 +1167,7 @@ atmegadci_clear_stall_sub(struct atmegad 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);