From owner-svn-src-all@FreeBSD.ORG Thu Mar 11 21:48:10 2010 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 ACC37106566C; Thu, 11 Mar 2010 21:48:10 +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 82CA18FC1A; Thu, 11 Mar 2010 21:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2BLmAhD062276; Thu, 11 Mar 2010 21:48:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BLmAqt062274; Thu, 11 Mar 2010 21:48:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201003112148.o2BLmAqt062274@svn.freebsd.org> From: Andrew Thompson Date: Thu, 11 Mar 2010 21:48:10 +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: r205033 - head/sys/dev/usb/template 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: Thu, 11 Mar 2010 21:48:10 -0000 Author: thompsa Date: Thu Mar 11 21:48:10 2010 New Revision: 205033 URL: http://svn.freebsd.org/changeset/base/205033 Log: isochronous endpoint descriptors should have two more bytes which are zero by default. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/template/usb_template.c Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu Mar 11 21:47:25 2010 (r205032) +++ head/sys/dev/usb/template/usb_template.c Thu Mar 11 21:48:10 2010 (r205033) @@ -162,15 +162,23 @@ usb_make_endpoint_desc(struct usb_temp_s const void **rd; uint16_t old_size; uint16_t mps; - uint8_t ea = 0; /* Endpoint Address */ - uint8_t et = 0; /* Endpiont Type */ + uint8_t ea; /* Endpoint Address */ + uint8_t et; /* Endpiont Type */ /* Reserve memory */ old_size = temp->size; - temp->size += sizeof(*ed); - /* Scan all Raw Descriptors first */ + ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT)); + et = (ted->bmAttributes & UE_XFERTYPE); + + if (et == UE_ISOCHRONOUS) { + /* account for extra byte fields */ + temp->size += sizeof(*ed) + 2; + } else { + temp->size += sizeof(*ed); + } + /* Scan all Raw Descriptors first */ rd = ted->ppRawDesc; if (rd) { while (*rd) { @@ -192,8 +200,6 @@ usb_make_endpoint_desc(struct usb_temp_s /* escape for Zero Max Packet Size */ mps = 0; } - ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT)); - et = (ted->bmAttributes & UE_XFERTYPE); /* * Fill out the real USB endpoint descriptor @@ -201,7 +207,10 @@ usb_make_endpoint_desc(struct usb_temp_s */ if (temp->buf) { ed = USB_ADD_BYTES(temp->buf, old_size); - ed->bLength = sizeof(*ed); + if (et == UE_ISOCHRONOUS) + ed->bLength = sizeof(*ed) + 2; + else + ed->bLength = sizeof(*ed); ed->bDescriptorType = UDESC_ENDPOINT; ed->bEndpointAddress = ea; ed->bmAttributes = ted->bmAttributes;