From patchwork Fri Feb 11 15:18:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuzmichev X-Patchwork-Id: 82771 X-Patchwork-Delegate: linux@bohmer.net 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 744D8B7162 for ; Sat, 12 Feb 2011 02:25:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2938280C4; Fri, 11 Feb 2011 16:24:59 +0100 (CET) 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 3IwvOKwQS4WP; Fri, 11 Feb 2011 16:24:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6025B280DC; Fri, 11 Feb 2011 16:24:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0AEBC280BE for ; Fri, 11 Feb 2011 16:24:32 +0100 (CET) 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 ebnvtOCQc5eM for ; Fri, 11 Feb 2011 16:24:29 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 88CB4280C0 for ; Fri, 11 Feb 2011 16:24:27 +0100 (CET) Received: by bwz12 with SMTP id 12so3551307bwz.3 for ; Fri, 11 Feb 2011 07:24:27 -0800 (PST) Received: by 10.204.114.148 with SMTP id e20mr9439719bkq.168.1297437866908; Fri, 11 Feb 2011 07:24:26 -0800 (PST) Received: from localhost.localdomain (mail.dev.rtsoft.ru [213.79.90.226]) by mx.google.com with ESMTPS id z18sm544843bkf.8.2011.02.11.07.24.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Feb 2011 07:24:26 -0800 (PST) From: Vitaly Kuzmichev To: u-boot@lists.denx.de Date: Fri, 11 Feb 2011 18:18:33 +0300 Message-Id: <1297437515-4069-4-git-send-email-vkuzmichev@mvista.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1297437515-4069-1-git-send-email-vkuzmichev@mvista.com> References: <1297437515-4069-1-git-send-email-vkuzmichev@mvista.com> Subject: [U-Boot] [PATCH 3/5] USB-CDC: Move struct declaration before its use X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 Signed-off-by: Vitaly Kuzmichev --- drivers/usb/gadget/ether.c | 70 ++++++++++++++++++++++--------------------- 1 files changed, 36 insertions(+), 34 deletions(-) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 8aa6240..c070f63 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -104,6 +104,42 @@ static const char driver_desc[] = DRIVER_DESC; #define USB_CONNECT_TIMEOUT (3 * CONFIG_SYS_HZ) /*-------------------------------------------------------------------------*/ + +struct eth_dev { + struct usb_gadget *gadget; + struct usb_request *req; /* for control responses */ + struct usb_request *stat_req; /* for cdc status */ + + u8 config; + struct usb_ep *in_ep, *out_ep, *status_ep; + const struct usb_endpoint_descriptor + *in, *out, *status; + + struct usb_request *tx_req, *rx_req; + + struct eth_device *net; + struct net_device_stats stats; + unsigned int tx_qlen; + + unsigned zlp:1; + unsigned cdc:1; + unsigned suspended:1; + unsigned network_started:1; + u16 cdc_filter; + unsigned long todo; + int mtu; +#define WORK_RX_MEMORY 0 + u8 host_mac[ETH_ALEN]; +}; + +/* + * This version autoconfigures as much as possible at run-time. + * + * It also ASSUMES a self-powered device, without remote wakeup, + * although remote wakeup support would make sense. + */ + +/*-------------------------------------------------------------------------*/ static struct eth_dev l_ethdev; static struct eth_device l_netdev; static struct usb_gadget_driver eth_driver; @@ -163,40 +199,6 @@ static inline int BITRATE(struct usb_gadget *g) } #endif -struct eth_dev { - struct usb_gadget *gadget; - struct usb_request *req; /* for control responses */ - struct usb_request *stat_req; /* for cdc status */ - - u8 config; - struct usb_ep *in_ep, *out_ep, *status_ep; - const struct usb_endpoint_descriptor - *in, *out, *status; - - struct usb_request *tx_req, *rx_req; - - struct eth_device *net; - struct net_device_stats stats; - unsigned int tx_qlen; - - unsigned zlp:1; - unsigned cdc:1; - unsigned suspended:1; - unsigned network_started:1; - u16 cdc_filter; - unsigned long todo; - int mtu; -#define WORK_RX_MEMORY 0 - u8 host_mac[ETH_ALEN]; -}; - -/* - * This version autoconfigures as much as possible at run-time. - * - * It also ASSUMES a self-powered device, without remote wakeup, - * although remote wakeup support would make sense. - */ - /*-------------------------------------------------------------------------*/ /*