From patchwork Thu Sep 26 01:41:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 278070 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B7A782C03D2 for ; Thu, 26 Sep 2013 11:44:54 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A66794A09E; Thu, 26 Sep 2013 03:44:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BCm4j9WZAaXS; Thu, 26 Sep 2013 03:44:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8032B4A0E3; Thu, 26 Sep 2013 03:42:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C92E4A098 for ; Thu, 26 Sep 2013 03:42:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IDsxGrRCrWCs for ; Thu, 26 Sep 2013 03:41:57 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by theia.denx.de (Postfix) with ESMTPS id 45D3F4A080 for ; Thu, 26 Sep 2013 03:41:17 +0200 (CEST) Received: by mail-pb0-f46.google.com with SMTP id rq2so429251pbb.19 for ; Wed, 25 Sep 2013 18:41:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VMbyFRneeZfDfIn0kgW7LBLsEspZkC4uRFl1sF1T26g=; b=cHQEQ1IXQEyZ5Te0RUTYWkgWQvPseMrwyNCbBqjqtPwp/ZouAyKf6d86kyTKJALm9d MQw1N29yy15s0vMVsVKEsYSZcqKe28KWtc4UjeQv+lf24pt0Bzf8apxn/f/4yh8eHXc+ drqoA7VN2KX5m/6gL3oT60gbzNPl//8IdOfTfPGxyhGIWRzJejEIF4iwCXbU2a+5fpUB x58yvKTSYuzgQxzsmV9wJe9ytOO3wPdegtDuIW8PdQJ5PT/0N4oi9UkyEqUSz8rJuTrA IZ9WnM/4pXizGb+gR60BwZHdiueJvvR88mdlWCwsXNqRI/cas35tlFhI91dyhSz0bjlu xUVA== X-Gm-Message-State: ALoCoQmqgpqkFziJv2zlPcCOMzxDQC/Q1RXOK3NFFodCNvTNVsTnTWU5VcbiJ5qDEnlzZal6/oXJ X-Received: by 10.68.134.133 with SMTP id pk5mr36435245pbb.89.1380159671198; Wed, 25 Sep 2013 18:41:11 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id or6sm16942897pbb.36.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 18:41:09 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1VP0a3-0006tB-7W; Wed, 25 Sep 2013 18:41:23 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Wed, 25 Sep 2013 18:41:04 -0700 Message-Id: <1380159678-26416-5-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380159678-26416-1-git-send-email-troy.kisky@boundarydevices.com> References: <1380159678-26416-1-git-send-email-troy.kisky@boundarydevices.com> Cc: fabio.estevam@freescale.com, otavio@ossystems.com.br, leiwen@marvell.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V5 04/18] usb: gadget: ether set wMaxPacketSize X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de set wMaxPacketSize for full speed descriptors fs_source_desc, fs_sink_desc to 64. Full-speed bulk endpoint can have a maximum packet size of 8, 16, 32, or 64 bytes, so choice 64. The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize set to 512. That is the only legal value for high speed bulk endpoints. Strictly speaking, this patch is not needed because usb_ep_autoconfig will call ep_matches which will override wMaxPacketSize for BULK endpoints only with the size associated with the endpoint setup by the udc driver. But if you want to rely on this, you may as well combine the full speed descriptor with the high speed descriptor to minimize confusion. Signed-off-by: Troy Kisky --- v4: expanded commit message v5: expanded commit message --- drivers/usb/gadget/ether.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 700d5fb..988cffb 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -635,6 +635,7 @@ fs_source_desc = { .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), }; static struct usb_endpoint_descriptor @@ -644,6 +645,7 @@ fs_sink_desc = { .bEndpointAddress = USB_DIR_OUT, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), }; static const struct usb_descriptor_header *fs_eth_function[11] = {