From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AE42C43217 for ; Sun, 27 Nov 2022 15:32:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 359E9852AD; Sun, 27 Nov 2022 16:27:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="BRhecYEK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 59C6B8519A; Sun, 27 Nov 2022 16:26:26 +0100 (CET) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A8F6485172 for ; Sun, 27 Nov 2022 16:26:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ej1-x62a.google.com with SMTP id n21so20315136ejb.9 for ; Sun, 27 Nov 2022 07:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GvLZHO0I7aJ/kPPSrK9uxU30XWBgCn0CRtoa5I3RQ/Q=; b=BRhecYEKXFVNqt1SBcmicCJOlEj0NqCAasdkrgMiBeXBjK2ntWXwQM4364jpfYFegR IsOyGkBOaA4ftME6vs6LOerO39KF+yrw4iFAuGSxkgiTUCBu3fwj2UfGb+odq6BOo5un 4BSj2NhZ5JJmq7m0BoDk7KemWm+S4tDwxoDEk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GvLZHO0I7aJ/kPPSrK9uxU30XWBgCn0CRtoa5I3RQ/Q=; b=ZTKHoMsA0hUttnQMzrnH7I/+ADZw2oYazkz7OHXMsQ0Bn0yA0NRSSWRlk6k31JONdB jtfVDsHY3lJkrMu51XEizTc7SbPT3G7aLuRF4Vv+XmsMWy/y5gz8j5ViMoLkgpoGiwNV 5giQ0ccw5M/jv3jC0RqWHLh+1q096iXeloWSGn33GEeuY0AoYkgkOCOM+GKPvls6QlwX VMiHphhD8HyfhlfrRRuOmqBjMO1i48FawlVYMVVRiFwWxgkklqWzwfw3R4fqWV0rxCyJ 7RPMNqLpG2u+AWgYgwHQWZbfZiype8WvTe+tB3C/fZZD1bZZ1ZVnXl9Wlq9H2kOM25c0 V+Iw== X-Gm-Message-State: ANoB5pnbF2o8XYBKgDLajXa8u0vp6RwHjy852VxTjkxsCYRrMrvi+XiA UlSrLDbDhgTRtIswVU9AmURja0SSHQsyLA== X-Google-Smtp-Source: AA0mqf6irKmVprna8+JH+huX70gusO+qG+Z4+cVx4Qx0ki719Kc3dtlS8KjJSx8jOhv5HEqUt3WN8Q== X-Received: by 2002:a17:907:a50c:b0:7bc:98f6:35c4 with SMTP id vr12-20020a170907a50c00b007bc98f635c4mr10871935ejc.123.1669562781071; Sun, 27 Nov 2022 07:26:21 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-dc2c-1c0a-ea3e-04dc.res6.spectrum.com. [2603:6081:7b00:6400:dc2c:1c0a:ea3e:4dc]) by smtp.gmail.com with ESMTPSA id tb6-20020a1709078b8600b007b47749838asm3853036ejc.45.2022.11.27.07.26.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 07:26:20 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 39/41] usb: gadget: Remove non-DM_ETH code Date: Sun, 27 Nov 2022 10:25:34 -0500 Message-Id: <20221127152536.1556469-39-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221127152536.1556469-1-trini@konsulko.com> References: <20221119234545.404563-38-trini@konsulko.com> <20221127152536.1556469-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean As DM_ETH is required for all network drivers, it's now safe to remove the non-DM_ETH support code. Signed-off-by: Tom Rini --- drivers/usb/gadget/ether.c | 97 -------------------------------------- drivers/usb/gadget/rndis.c | 9 ---- drivers/usb/gadget/rndis.h | 11 ----- 3 files changed, 117 deletions(-) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 43aec7ffa702..85c971e4c43e 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -109,11 +109,7 @@ struct eth_dev { struct usb_request *tx_req, *rx_req; -#ifndef CONFIG_DM_ETH - struct eth_device *net; -#else struct udevice *net; -#endif struct net_device_stats stats; unsigned int tx_qlen; @@ -140,11 +136,7 @@ struct eth_dev { /*-------------------------------------------------------------------------*/ struct ether_priv { struct eth_dev ethdev; -#ifndef CONFIG_DM_ETH - struct eth_device netdev; -#else struct udevice *netdev; -#endif struct usb_gadget_driver eth_driver; }; @@ -1827,22 +1819,14 @@ static void rndis_control_ack_complete(struct usb_ep *ep, static char rndis_resp_buf[8] __attribute__((aligned(sizeof(__le32)))); -#ifndef CONFIG_DM_ETH -static int rndis_control_ack(struct eth_device *net) -#else static int rndis_control_ack(struct udevice *net) -#endif { struct ether_priv *priv; struct eth_dev *dev; int length; struct usb_request *resp; -#ifndef CONFIG_DM_ETH - priv = (struct ether_priv *)net->priv; -#else priv = dev_get_priv(net); -#endif dev = &priv->ethdev; resp = dev->stat_req; @@ -1989,9 +1973,7 @@ static int eth_bind(struct usb_gadget *gadget) int status = -ENOMEM; int gcnum; u8 tmp[7]; -#ifdef CONFIG_DM_ETH struct eth_pdata *pdata = dev_get_plat(l_priv->netdev); -#endif /* these flags are only ever cleared; compiler take note */ #ifndef CONFIG_USB_ETH_CDC @@ -2168,11 +2150,7 @@ autoconf_fail: /* network device setup */ -#ifndef CONFIG_DM_ETH - dev->net = &l_priv->netdev; -#else dev->net = l_priv->netdev; -#endif dev->cdc = cdc; dev->zlp = zlp; @@ -2189,13 +2167,8 @@ autoconf_fail: * host side code for the SAFE thing cares -- its original BLAN * thing didn't, Sharp never assigned those addresses on Zaurii. */ -#ifndef CONFIG_DM_ETH - get_ether_addr(dev_addr, dev->net->enetaddr); - memcpy(tmp, dev->net->enetaddr, sizeof(dev->net->enetaddr)); -#else get_ether_addr(dev_addr, pdata->enetaddr); memcpy(tmp, pdata->enetaddr, sizeof(pdata->enetaddr)); -#endif get_ether_addr(host_addr, dev->host_mac); @@ -2256,11 +2229,7 @@ autoconf_fail: status_ep ? " STATUS " : "", status_ep ? status_ep->name : "" ); -#ifndef CONFIG_DM_ETH - printf("MAC %pM\n", dev->net->enetaddr); -#else printf("MAC %pM\n", pdata->enetaddr); -#endif if (cdc || rndis) printf("HOST MAC %02x:%02x:%02x:%02x:%02x:%02x\n", @@ -2490,71 +2459,6 @@ static void _usb_eth_halt(struct ether_priv *priv) usb_gadget_release(0); } -#ifndef CONFIG_DM_ETH -static int usb_eth_init(struct eth_device *netdev, struct bd_info *bd) -{ - struct ether_priv *priv = (struct ether_priv *)netdev->priv; - - return _usb_eth_init(priv); -} - -static int usb_eth_send(struct eth_device *netdev, void *packet, int length) -{ - struct ether_priv *priv = (struct ether_priv *)netdev->priv; - - return _usb_eth_send(priv, packet, length); -} - -static int usb_eth_recv(struct eth_device *netdev) -{ - struct ether_priv *priv = (struct ether_priv *)netdev->priv; - struct eth_dev *dev = &priv->ethdev; - int ret; - - ret = _usb_eth_recv(priv); - if (ret) { - pr_err("error packet receive\n"); - return ret; - } - - if (!packet_received) - return 0; - - if (dev->rx_req) { - net_process_received_packet(net_rx_packets[0], - dev->rx_req->length); - } else { - pr_err("dev->rx_req invalid"); - } - packet_received = 0; - rx_submit(dev, dev->rx_req, 0); - - return 0; -} - -void usb_eth_halt(struct eth_device *netdev) -{ - struct ether_priv *priv = (struct ether_priv *)netdev->priv; - - _usb_eth_halt(priv); -} - -int usb_eth_initialize(struct bd_info *bi) -{ - struct eth_device *netdev = &l_priv->netdev; - - strlcpy(netdev->name, USB_NET_NAME, sizeof(netdev->name)); - - netdev->init = usb_eth_init; - netdev->send = usb_eth_send; - netdev->recv = usb_eth_recv; - netdev->halt = usb_eth_halt; - netdev->priv = l_priv; - - eth_register(netdev); - return 0; -} -#else static int usb_eth_start(struct udevice *dev) { struct ether_priv *priv = dev_get_priv(dev); @@ -2663,4 +2567,3 @@ U_BOOT_DRIVER(eth_usb) = { .plat_auto = sizeof(struct eth_pdata), .flags = DM_FLAG_ALLOC_PRIV_DMA, }; -#endif /* CONFIG_DM_ETH */ diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 13c327ea38ad..d2a51829f96f 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c @@ -1115,11 +1115,7 @@ int rndis_msg_parser(u8 configNr, u8 *buf) return -ENOTSUPP; } -#ifndef CONFIG_DM_ETH -int rndis_register(int (*rndis_control_ack)(struct eth_device *)) -#else int rndis_register(int (*rndis_control_ack)(struct udevice *)) -#endif { u8 i; @@ -1147,13 +1143,8 @@ void rndis_deregister(int configNr) return; } -#ifndef CONFIG_DM_ETH -int rndis_set_param_dev(u8 configNr, struct eth_device *dev, int mtu, - struct net_device_stats *stats, u16 *cdc_filter) -#else int rndis_set_param_dev(u8 configNr, struct udevice *dev, int mtu, struct net_device_stats *stats, u16 *cdc_filter) -#endif { debug("%s: configNr = %d\n", __func__, configNr); if (!dev || !stats) diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h index e827af0be4aa..77db55a563ff 100644 --- a/drivers/usb/gadget/rndis.h +++ b/drivers/usb/gadget/rndis.h @@ -226,13 +226,8 @@ typedef struct rndis_params { u32 vendorID; const char *vendorDescr; -#ifndef CONFIG_DM_ETH - struct eth_device *dev; - int (*ack)(struct eth_device *); -#else struct udevice *dev; int (*ack)(struct udevice *); -#endif struct list_head resp_queue; } rndis_params; @@ -240,15 +235,9 @@ typedef struct rndis_params { int rndis_msg_parser(u8 configNr, u8 *buf); enum rndis_state rndis_get_state(int configNr); void rndis_deregister(int configNr); -#ifndef CONFIG_DM_ETH -int rndis_register(int (*rndis_control_ack)(struct eth_device *)); -int rndis_set_param_dev(u8 configNr, struct eth_device *dev, int mtu, - struct net_device_stats *stats, u16 *cdc_filter); -#else int rndis_register(int (*rndis_control_ack)(struct udevice *)); int rndis_set_param_dev(u8 configNr, struct udevice *dev, int mtu, struct net_device_stats *stats, u16 *cdc_filter); -#endif int rndis_set_param_vendor(u8 configNr, u32 vendorID, const char *vendorDescr); int rndis_set_param_medium(u8 configNr, u32 medium, u32 speed); -- 2.25.1