From patchwork Tue May 7 05:17:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 241974 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9BD582C0112 for ; Tue, 7 May 2013 15:18:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757888Ab3EGFSZ (ORCPT ); Tue, 7 May 2013 01:18:25 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:49208 "EHLO mail-da0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015Ab3EGFSV (ORCPT ); Tue, 7 May 2013 01:18:21 -0400 Received: by mail-da0-f45.google.com with SMTP id w3so116518dad.32 for ; Mon, 06 May 2013 22:18:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=eRblTpKXXWgwkZcUmzaVTTisz8p+I4WsxFs+WlU2iF0=; b=ayCZEELFQC0ggU1x0rzjKN60tmLgdz/YEG3HN6DTcvecTPvckzmoZ8nXnjsPxCTD2y RQIHeju4BKQ1jg4hg8BZC374sSh0D/oYVgty7QZ40PA7qaKzjGItqexeAX7tGa+cd3GD JMS4KC4MThqNxiP079F8D6CD1ckdb568j+NOyyI1k+le+FEn91L3iAHFgTa5OUXWV/nP AcRHJULwiiYkU5pT3xO0mHjC1UYxCXCmQsToU0gPTloMtGM+M3pwtJDpru/ssNm7AEMb FYyJgEz/LyiN3wVdYe3KhDpkSx4fzh16bRwyUf36xcQ1KgHTYgrq0C7R6gtU9rxBJVoR 4+MA== X-Received: by 10.68.184.100 with SMTP id et4mr642202pbc.48.1367903900722; Mon, 06 May 2013 22:18:20 -0700 (PDT) Received: from xps-iwamatsu.renesas.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id em2sm26775526pbb.0.2013.05.06.22.18.18 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 22:18:19 -0700 (PDT) From: Nobuhiro Iwamatsu To: netdev@vger.kernel.org Cc: yoshihiro.shimoda.uh@renesas.com, sergei.shtylyov@cogentembedded.com, Nobuhiro Iwamatsu Subject: [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead Date: Tue, 7 May 2013 14:17:51 +0900 Message-Id: <1367903875-32606-5-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367903875-32606-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> References: <1367903875-32606-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Gm-Message-State: ALoCoQmVaJuqLOV/YuoXbrQ1p0ETtSUhY5CULFLUrRvzZaWUfdvE65YsYDX+EAsmbp7uVM100Dhr Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Nobuhiro Iwamatsu --- V3: no change. V2: no change. drivers/net/ethernet/renesas/sh_eth.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 944b2df..667c908 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -431,7 +431,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { }; #elif defined(CONFIG_CPU_SUBTYPE_SH7757) #define SH_ETH_HAS_BOTH_MODULES 1 -#define SH_ETH_HAS_TSU 1 static int sh_eth_check_reset(struct net_device *ndev); static void sh_eth_set_rate(struct net_device *ndev) @@ -593,7 +592,6 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp) } #elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) -#define SH_ETH_HAS_TSU 1 static int sh_eth_check_reset(struct net_device *ndev); static void sh_eth_reset_hw_crc(struct net_device *ndev); @@ -696,7 +694,6 @@ static void sh_eth_reset_hw_crc(struct net_device *ndev) } #elif defined(CONFIG_ARCH_R8A7740) -#define SH_ETH_HAS_TSU 1 static int sh_eth_check_reset(struct net_device *ndev); static void sh_eth_chip_reset(struct net_device *ndev) @@ -794,7 +791,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { }; #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) #define SH_ETH_RESET_DEFAULT 1 -#define SH_ETH_HAS_TSU 1 static struct sh_eth_cpu_data sh_eth_my_cpu_data = { .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff, .tsu = 1, @@ -2109,7 +2105,6 @@ static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq, return phy_mii_ioctl(phydev, rq, cmd); } -#if defined(SH_ETH_HAS_TSU) /* For TSU_POSTn. Please refer to the manual about this (strange) bitfields */ static void *sh_eth_tsu_get_post_reg_offset(struct sh_eth_private *mdp, int entry) @@ -2452,7 +2447,6 @@ static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev, return 0; } -#endif /* SH_ETH_HAS_TSU */ /* SuperH's TSU register init function */ static void sh_eth_tsu_init(struct sh_eth_private *mdp) @@ -2591,16 +2585,11 @@ static const u16 *sh_eth_get_register_offset(int register_type) return reg_offset; } -static const struct net_device_ops sh_eth_netdev_ops = { +static struct net_device_ops sh_eth_netdev_ops = { .ndo_open = sh_eth_open, .ndo_stop = sh_eth_close, .ndo_start_xmit = sh_eth_start_xmit, .ndo_get_stats = sh_eth_get_stats, -#if defined(SH_ETH_HAS_TSU) - .ndo_set_rx_mode = sh_eth_set_multicast_list, - .ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid, - .ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid, -#endif .ndo_tx_timeout = sh_eth_tx_timeout, .ndo_do_ioctl = sh_eth_do_ioctl, .ndo_validate_addr = eth_validate_addr, @@ -2681,6 +2670,15 @@ static int sh_eth_drv_probe(struct platform_device *pdev) sh_eth_set_default_cpu_data(mdp->cd); /* set function */ + if (mdp->cd->tsu) { + sh_eth_netdev_ops.ndo_set_rx_mode + = sh_eth_set_multicast_list; + sh_eth_netdev_ops.ndo_vlan_rx_add_vid + = sh_eth_vlan_rx_add_vid; + sh_eth_netdev_ops.ndo_vlan_rx_kill_vid + = sh_eth_vlan_rx_kill_vid; + } + ndev->netdev_ops = &sh_eth_netdev_ops; SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops); ndev->watchdog_timeo = TX_TIMEOUT;