All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR
@ 2013-05-07  5:17 Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757 Nobuhiro Iwamatsu
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  Fix comment.
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.h |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 26cb8a0..7ccf58c 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -166,19 +166,16 @@ enum {
 /*
  * Register's bits
  */
-#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) ||\
-    defined(CONFIG_ARCH_R8A7740)
-/* EDSR */
+/* EDSR : sh7734, sh7763 and r8a7740 only */
 enum EDSR_BIT {
 	EDSR_ENT = 0x01, EDSR_ENR = 0x02,
 };
 #define EDSR_ENALL (EDSR_ENT|EDSR_ENR)
 
-/* GECMR */
+/* GECMR : sh7734, sh7763 and r8a7740 only */
 enum GECMR_BIT {
 	GECMR_10 = 0x0, GECMR_100 = 0x04, GECMR_1000 = 0x01,
 };
-#endif
 
 /* EDMR */
 enum DMAC_M_BIT {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07 14:48   ` Sergei Shtylyov
  2013-05-07  5:17 ` [PATCH v3 3/9] net: sh-eth: Set EDSR_ENALL instead of 0x03 is set to EDSR Nobuhiro Iwamatsu
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

SH7757 uses EDSR register. This adds about SH7757.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/net/ethernet/renesas/sh_eth.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 7ccf58c..71c5559 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -166,7 +166,7 @@ enum {
 /*
  * Register's bits
  */
-/* EDSR : sh7734, sh7763 and r8a7740 only */
+/* EDSR : sh7734, sh7763, sh7757 and r8a7740 only */
 enum EDSR_BIT {
 	EDSR_ENT = 0x01, EDSR_ENR = 0x02,
 };
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 3/9] net: sh-eth: Set EDSR_ENALL instead of 0x03 is set to EDSR
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757 Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex() Nobuhiro Iwamatsu
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  no changes.
V2:
  no changes.
 drivers/net/ethernet/renesas/sh_eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 489be0e..334fa13 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -523,7 +523,7 @@ static int sh_eth_reset(struct net_device *ndev)
 	int ret = 0;
 
 	if (sh_eth_is_gether(mdp)) {
-		sh_eth_write(ndev, 0x03, EDSR);
+		sh_eth_write(ndev, EDSR_ENALL, EDSR);
 		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
 				EDMR);
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex()
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757 Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 3/9] net: sh-eth: Set EDSR_ENALL instead of 0x03 is set to EDSR Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07 14:52   ` Sergei Shtylyov
  2013-05-07  5:17 ` [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead Nobuhiro Iwamatsu
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  Remove sh_eth_set_duplex from SH7619, SH7710 and SH7712.
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.c |   57 +++------------------------------
 1 file changed, 4 insertions(+), 53 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 334fa13..944b2df 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -341,9 +341,6 @@ static void sh_eth_select_mii(struct net_device *ndev)
 }
 #endif
 
-/* There is CPU dependent code */
-#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
-#define SH_ETH_RESET_DEFAULT	1
 static void sh_eth_set_duplex(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -354,6 +351,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
 		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
 }
 
+/* There is CPU dependent code */
+#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
+#define SH_ETH_RESET_DEFAULT	1
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -391,15 +391,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 };
 #elif defined(CONFIG_CPU_SUBTYPE_SH7724)
 #define SH_ETH_RESET_DEFAULT	1
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-
-	if (mdp->duplex) /* Full */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-	else		/* Half */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
 
 static void sh_eth_set_rate(struct net_device *ndev)
 {
@@ -443,16 +434,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 #define SH_ETH_HAS_TSU	1
 static int sh_eth_check_reset(struct net_device *ndev);
 
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-
-	if (mdp->duplex) /* Full */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-	else		/* Half */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -552,16 +533,6 @@ out:
 	return ret;
 }
 
-static void sh_eth_set_duplex_giga(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-
-	if (mdp->duplex) /* Full */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-	else		/* Half */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
 static void sh_eth_set_rate_giga(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -584,7 +555,7 @@ static void sh_eth_set_rate_giga(struct net_device *ndev)
 /* SH7757(GETHERC) */
 static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
 	.chip_reset	= sh_eth_chip_reset_giga,
-	.set_duplex	= sh_eth_set_duplex_giga,
+	.set_duplex	= sh_eth_set_duplex,
 	.set_rate	= sh_eth_set_rate_giga,
 
 	.ecsr_value	= ECSR_ICD | ECSR_MPD,
@@ -635,16 +606,6 @@ static void sh_eth_chip_reset(struct net_device *ndev)
 	mdelay(1);
 }
 
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-
-	if (mdp->duplex) /* Full */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-	else		/* Half */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -774,16 +735,6 @@ out:
 	return ret;
 }
 
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-
-	if (mdp->duplex) /* Full */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
-	else		/* Half */
-		sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
                   ` (2 preceding siblings ...)
  2013-05-07  5:17 ` [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex() Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07 14:59   ` Sergei Shtylyov
  2013-05-07  5:17 ` [PATCH v3 6/9] net: sh-eth: Add CONFIG_PM to definition of dev_pm_ops Nobuhiro Iwamatsu
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
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;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 6/9] net: sh-eth: Add CONFIG_PM to definition of dev_pm_ops
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
                   ` (3 preceding siblings ...)
  2013-05-07  5:17 ` [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data Nobuhiro Iwamatsu
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  Fix "ERROR: Macros with complex values should be enclosed in parenthesis" by SH_ETH_PM_OPS.
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 667c908..fe9ff35 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2771,6 +2771,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int sh_eth_runtime_nop(struct device *dev)
 {
 	/*
@@ -2784,17 +2785,21 @@ static int sh_eth_runtime_nop(struct device *dev)
 	return 0;
 }
 
-static struct dev_pm_ops sh_eth_dev_pm_ops = {
+static const struct dev_pm_ops sh_eth_dev_pm_ops = {
 	.runtime_suspend = sh_eth_runtime_nop,
 	.runtime_resume = sh_eth_runtime_nop,
 };
+#define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops)
+#else
+#define SH_ETH_PM_OPS NULL
+#endif
 
 static struct platform_driver sh_eth_driver = {
 	.probe = sh_eth_drv_probe,
 	.remove = sh_eth_drv_remove,
 	.driver = {
 		   .name = CARDNAME,
-		   .pm = &sh_eth_dev_pm_ops,
+		   .pm = SH_ETH_PM_OPS,
 	},
 };
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
                   ` (4 preceding siblings ...)
  2013-05-07  5:17 ` [PATCH v3 6/9] net: sh-eth: Add CONFIG_PM to definition of dev_pm_ops Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07 15:02   ` Sergei Shtylyov
  2013-05-07  5:17 ` [PATCH v3 8/9] net: sh-eth: Remove ifdef for sh_eth_select_mii Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 9/9] net: sh-eth: Rewrite sh_eth_reset function Nobuhiro Iwamatsu
  7 siblings, 1 reply; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

sh-eth is supporting some SH and shmobile CPU. CPU with two or more network
devices is in these, these specify IRQF_SHARED as IRQ configureation flags.
This changes to set IRQ configureation flags using in sh_eth_cpu_data.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  - Fix indent.
  - Remove irq_flags from struct sh_eth_private.
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.c |   12 ++++--------
 drivers/net/ethernet/renesas/sh_eth.h |    1 +
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index fe9ff35..880f0ca 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -462,6 +462,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 			  EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,
 	.tx_error_check	= EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE,
 
+	.irq_flags	= IRQF_SHARED,
 	.apr		= 1,
 	.mpr		= 1,
 	.tpauser	= 1,
@@ -570,6 +571,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
 	.fdr_value	= 0x0000072f,
 	.rmcr_value	= 0x00000001,
 
+	.irq_flags	= IRQF_SHARED,
 	.apr		= 1,
 	.mpr		= 1,
 	.tpauser	= 1,
@@ -652,6 +654,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 	.hw_crc     = 1,
 	.select_mii = 1,
 #else
+	.irq_flags	= IRQF_SHARED,
 	.tsu_shared_reg	= 1,
 #endif
 };
@@ -1912,14 +1915,7 @@ static int sh_eth_open(struct net_device *ndev)
 	pm_runtime_get_sync(&mdp->pdev->dev);
 
 	ret = request_irq(ndev->irq, sh_eth_interrupt,
-#if defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7764) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7757)
-				IRQF_SHARED,
-#else
-				0,
-#endif
-				ndev->name, ndev);
+				mdp->cd->irq_flags, ndev->name, ndev);
 	if (ret) {
 		dev_err(&ndev->dev, "Can not assign IRQ number\n");
 		return ret;
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 71c5559..2a62505 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -463,6 +463,7 @@ struct sh_eth_cpu_data {
 	unsigned long tx_error_check;
 
 	/* hardware features */
+	unsigned long irq_flags;	/* IRQ configuration flags */
 	unsigned no_psr:1;		/* EtherC DO NOT have PSR */
 	unsigned apr:1;			/* EtherC have APR */
 	unsigned mpr:1;			/* EtherC have MPR */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 8/9] net: sh-eth: Remove ifdef for sh_eth_select_mii
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
                   ` (5 preceding siblings ...)
  2013-05-07  5:17 ` [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  2013-05-07  5:17 ` [PATCH v3 9/9] net: sh-eth: Rewrite sh_eth_reset function Nobuhiro Iwamatsu
  7 siblings, 0 replies; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  Add __maybe_unused to sh_eth_select_mii().
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 880f0ca..664a236 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -313,10 +313,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
 	[TSU_ADRL31]	= 0x01fc,
 };
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7734) || \
-	defined(CONFIG_CPU_SUBTYPE_SH7763) || \
-	defined(CONFIG_ARCH_R8A7740)
-static void sh_eth_select_mii(struct net_device *ndev)
+static void __maybe_unused sh_eth_select_mii(struct net_device *ndev)
 {
 	u32 value = 0x0;
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -339,7 +336,6 @@ static void sh_eth_select_mii(struct net_device *ndev)
 
 	sh_eth_write(ndev, value, RMII_MII);
 }
-#endif
 
 static void sh_eth_set_duplex(struct net_device *ndev)
 {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 9/9] net: sh-eth: Rewrite sh_eth_reset function
  2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
                   ` (6 preceding siblings ...)
  2013-05-07  5:17 ` [PATCH v3 8/9] net: sh-eth: Remove ifdef for sh_eth_select_mii Nobuhiro Iwamatsu
@ 2013-05-07  5:17 ` Nobuhiro Iwamatsu
  7 siblings, 0 replies; 13+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-05-07  5:17 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, sergei.shtylyov, Nobuhiro Iwamatsu

This driver has sh_eth_reset function each CPU.
And this function is almost the same. This is summarized in
single function.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V3:
  no change.
V2:
  no change.
 drivers/net/ethernet/renesas/sh_eth.c |  194 +++++++++++----------------------
 1 file changed, 61 insertions(+), 133 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 664a236..ee600f0 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -349,7 +349,6 @@ static void sh_eth_set_duplex(struct net_device *ndev)
 
 /* There is CPU dependent code */
 #if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
-#define SH_ETH_RESET_DEFAULT	1
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -386,7 +385,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 	.hw_swap	= 1,
 };
 #elif defined(CONFIG_CPU_SUBTYPE_SH7724)
-#define SH_ETH_RESET_DEFAULT	1
 
 static void sh_eth_set_rate(struct net_device *ndev)
 {
@@ -427,7 +425,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
-static int sh_eth_check_reset(struct net_device *ndev);
 
 static void sh_eth_set_rate(struct net_device *ndev)
 {
@@ -494,40 +491,6 @@ static void sh_eth_chip_reset_giga(struct net_device *ndev)
 }
 
 static int sh_eth_is_gether(struct sh_eth_private *mdp);
-static int sh_eth_reset(struct net_device *ndev)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-	int ret = 0;
-
-	if (sh_eth_is_gether(mdp)) {
-		sh_eth_write(ndev, EDSR_ENALL, EDSR);
-		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
-				EDMR);
-
-		ret = sh_eth_check_reset(ndev);
-		if (ret)
-			goto out;
-
-		/* Table Init */
-		sh_eth_write(ndev, 0x0, TDLAR);
-		sh_eth_write(ndev, 0x0, TDFAR);
-		sh_eth_write(ndev, 0x0, TDFXR);
-		sh_eth_write(ndev, 0x0, TDFFR);
-		sh_eth_write(ndev, 0x0, RDLAR);
-		sh_eth_write(ndev, 0x0, RDFAR);
-		sh_eth_write(ndev, 0x0, RDFXR);
-		sh_eth_write(ndev, 0x0, RDFFR);
-	} else {
-		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER,
-				EDMR);
-		mdelay(3);
-		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER,
-				EDMR);
-	}
-
-out:
-	return ret;
-}
 
 static void sh_eth_set_rate_giga(struct net_device *ndev)
 {
@@ -590,8 +553,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)
-static int sh_eth_check_reset(struct net_device *ndev);
-static void sh_eth_reset_hw_crc(struct net_device *ndev);
 
 static void sh_eth_chip_reset(struct net_device *ndev)
 {
@@ -655,45 +616,8 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 #endif
 };
 
-static int sh_eth_reset(struct net_device *ndev)
-{
-	int ret = 0;
-
-	sh_eth_write(ndev, EDSR_ENALL, EDSR);
-	sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER, EDMR);
-
-	ret = sh_eth_check_reset(ndev);
-	if (ret)
-		goto out;
-
-	/* Table Init */
-	sh_eth_write(ndev, 0x0, TDLAR);
-	sh_eth_write(ndev, 0x0, TDFAR);
-	sh_eth_write(ndev, 0x0, TDFXR);
-	sh_eth_write(ndev, 0x0, TDFFR);
-	sh_eth_write(ndev, 0x0, RDLAR);
-	sh_eth_write(ndev, 0x0, RDFAR);
-	sh_eth_write(ndev, 0x0, RDFXR);
-	sh_eth_write(ndev, 0x0, RDFFR);
-
-	/* Reset HW CRC register */
-	sh_eth_reset_hw_crc(ndev);
-
-	/* Select MII mode */
-	if (sh_eth_my_cpu_data.select_mii)
-		sh_eth_select_mii(ndev);
-out:
-	return ret;
-}
-
-static void sh_eth_reset_hw_crc(struct net_device *ndev)
-{
-	if (sh_eth_my_cpu_data.hw_crc)
-		sh_eth_write(ndev, 0x0, CSMR);
-}
 
 #elif defined(CONFIG_ARCH_R8A7740)
-static int sh_eth_check_reset(struct net_device *ndev);
 
 static void sh_eth_chip_reset(struct net_device *ndev)
 {
@@ -706,31 +630,6 @@ static void sh_eth_chip_reset(struct net_device *ndev)
 	sh_eth_select_mii(ndev);
 }
 
-static int sh_eth_reset(struct net_device *ndev)
-{
-	int ret = 0;
-
-	sh_eth_write(ndev, EDSR_ENALL, EDSR);
-	sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER, EDMR);
-
-	ret = sh_eth_check_reset(ndev);
-	if (ret)
-		goto out;
-
-	/* Table Init */
-	sh_eth_write(ndev, 0x0, TDLAR);
-	sh_eth_write(ndev, 0x0, TDFAR);
-	sh_eth_write(ndev, 0x0, TDFXR);
-	sh_eth_write(ndev, 0x0, TDFFR);
-	sh_eth_write(ndev, 0x0, RDLAR);
-	sh_eth_write(ndev, 0x0, RDFAR);
-	sh_eth_write(ndev, 0x0, RDFXR);
-	sh_eth_write(ndev, 0x0, RDFFR);
-
-out:
-	return ret;
-}
-
 static void sh_eth_set_rate(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -779,7 +678,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 };
 
 #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
-#define SH_ETH_RESET_DEFAULT	1
 static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 	.eesipr_value	= DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
 
@@ -789,7 +687,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 	.hw_swap	= 1,
 };
 #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-#define SH_ETH_RESET_DEFAULT	1
 static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 	.eesipr_value	= DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
 	.tsu		= 1,
@@ -825,36 +722,6 @@ static void sh_eth_set_default_cpu_data(struct sh_eth_cpu_data *cd)
 		cd->tx_error_check = DEFAULT_TX_ERROR_CHECK;
 }
 
-#if defined(SH_ETH_RESET_DEFAULT)
-/* Chip Reset */
-static int  sh_eth_reset(struct net_device *ndev)
-{
-	sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER, EDMR);
-	mdelay(3);
-	sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER, EDMR);
-
-	return 0;
-}
-#else
-static int sh_eth_check_reset(struct net_device *ndev)
-{
-	int ret = 0;
-	int cnt = 100;
-
-	while (cnt > 0) {
-		if (!(sh_eth_read(ndev, EDMR) & 0x3))
-			break;
-		mdelay(1);
-		cnt--;
-	}
-	if (cnt < 0) {
-		pr_err("Device reset fail\n");
-		ret = -ETIMEDOUT;
-	}
-	return ret;
-}
-#endif
-
 #if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
 static void sh_eth_set_receive_align(struct sk_buff *skb)
 {
@@ -945,6 +812,67 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp)
 		return EDTRR_TRNS_ETHER;
 }
 
+static int sh_eth_check_reset(struct net_device *ndev)
+{
+	int ret = 0;
+	int cnt = 100;
+
+	while (cnt > 0) {
+		if (!(sh_eth_read(ndev, EDMR) & 0x3))
+			break;
+		mdelay(1);
+		cnt--;
+	}
+	if (cnt < 0) {
+		pr_err("Device reset fail\n");
+		ret = -ETIMEDOUT;
+	}
+	return ret;
+}
+
+static int sh_eth_reset(struct net_device *ndev)
+{
+	struct sh_eth_private *mdp = netdev_priv(ndev);
+	int ret = 0;
+
+	if (sh_eth_is_gether(mdp)) {
+		sh_eth_write(ndev, EDSR_ENALL, EDSR);
+		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
+				EDMR);
+
+		ret = sh_eth_check_reset(ndev);
+		if (ret)
+			goto out;
+
+		/* Table Init */
+		sh_eth_write(ndev, 0x0, TDLAR);
+		sh_eth_write(ndev, 0x0, TDFAR);
+		sh_eth_write(ndev, 0x0, TDFXR);
+		sh_eth_write(ndev, 0x0, TDFFR);
+		sh_eth_write(ndev, 0x0, RDLAR);
+		sh_eth_write(ndev, 0x0, RDFAR);
+		sh_eth_write(ndev, 0x0, RDFXR);
+		sh_eth_write(ndev, 0x0, RDFFR);
+
+		/* Reset HW CRC register */
+		if (mdp->cd->hw_crc)
+			sh_eth_write(ndev, 0x0, CSMR);
+
+		/* Select MII mode */
+		if (mdp->cd->select_mii)
+			sh_eth_select_mii(ndev);
+	} else {
+		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER,
+				EDMR);
+		mdelay(3);
+		sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER,
+				EDMR);
+	}
+
+out:
+	return ret;
+}
+
 struct bb_info {
 	void (*set_gate)(void *addr);
 	struct mdiobb_ctrl ctrl;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757
  2013-05-07  5:17 ` [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757 Nobuhiro Iwamatsu
@ 2013-05-07 14:48   ` Sergei Shtylyov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2013-05-07 14:48 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu; +Cc: netdev, yoshihiro.shimoda.uh

On 07-05-2013 9:17, Nobuhiro Iwamatsu wrote:

> SH7757 uses EDSR register. This adds about SH7757.

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> ---
>   drivers/net/ethernet/renesas/sh_eth.h |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
> index 7ccf58c..71c5559 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.h
> +++ b/drivers/net/ethernet/renesas/sh_eth.h
> @@ -166,7 +166,7 @@ enum {
>   /*
>    * Register's bits
>    */
> -/* EDSR : sh7734, sh7763 and r8a7740 only */
> +/* EDSR : sh7734, sh7763, sh7757 and r8a7740 only */

     Shouldn't SH7763 come after SH7757?

>   enum EDSR_BIT {
>   	EDSR_ENT = 0x01, EDSR_ENR = 0x02,
>   };

    I think you can merge it to patch #1 with a corresponding comment in 
the changelog. This is hardly worth separate patch.

WBR, Sergei

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex()
  2013-05-07  5:17 ` [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex() Nobuhiro Iwamatsu
@ 2013-05-07 14:52   ` Sergei Shtylyov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2013-05-07 14:52 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu; +Cc: netdev, yoshihiro.shimoda.uh

On 07-05-2013 9:17, Nobuhiro Iwamatsu wrote:

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> ---
> V3:
>    Remove sh_eth_set_duplex from SH7619, SH7710 and SH7712.
> V2:
>    no change.
>   drivers/net/ethernet/renesas/sh_eth.c |   57 +++------------------------------
>   1 file changed, 4 insertions(+), 53 deletions(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 334fa13..944b2df 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -341,9 +341,6 @@ static void sh_eth_select_mii(struct net_device *ndev)
>   }
>   #endif
>
> -/* There is CPU dependent code */
> -#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
> -#define SH_ETH_RESET_DEFAULT	1
>   static void sh_eth_set_duplex(struct net_device *ndev)

     I think you need to annotate this function with __maybe_unused as 
well since some SoC don't use it.

WBR, Sergei

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead
  2013-05-07  5:17 ` [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead Nobuhiro Iwamatsu
@ 2013-05-07 14:59   ` Sergei Shtylyov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2013-05-07 14:59 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu; +Cc: netdev, yoshihiro.shimoda.uh

On 07-05-2013 9:17, Nobuhiro Iwamatsu wrote:

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> ---
> 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

[...]

> @@ -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;
> +	}
> +

     Alternatively, you could use two 'struct net_device_ops' instances, 
one with TSU-specific methods installed and one without. That would work 
with any combination of Ether devices having and not having TSU (though 
such combinations don't seem to exist in practice).

>   	ndev->netdev_ops = &sh_eth_netdev_ops;
>   	SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops);
>   	ndev->watchdog_timeo = TX_TIMEOUT

WBR, Sergei

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data
  2013-05-07  5:17 ` [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data Nobuhiro Iwamatsu
@ 2013-05-07 15:02   ` Sergei Shtylyov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2013-05-07 15:02 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu; +Cc: netdev, yoshihiro.shimoda.uh

On 07-05-2013 9:17, Nobuhiro Iwamatsu wrote:

> sh-eth is supporting some SH and shmobile CPU. CPU with two or more network
> devices is in these, these specify IRQF_SHARED as IRQ configureation flags.
> This changes to set IRQ configureation flags using in sh_eth_cpu_data.

    Only "configuration" (and the same typo in the subject).

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

WBR, Sergei

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-05-07 15:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  5:17 [PATCH v3 1/9] net: sh-eth: Remove ifdef from definition of bit of EDSR and GECMR Nobuhiro Iwamatsu
2013-05-07  5:17 ` [PATCH v3 2/9] net: sh-eth: Add comment to bit of EDSR about SH7757 Nobuhiro Iwamatsu
2013-05-07 14:48   ` Sergei Shtylyov
2013-05-07  5:17 ` [PATCH v3 3/9] net: sh-eth: Set EDSR_ENALL instead of 0x03 is set to EDSR Nobuhiro Iwamatsu
2013-05-07  5:17 ` [PATCH v3 4/9] net: sh-eth: Remove duplicate sh_eth_set_duplex() Nobuhiro Iwamatsu
2013-05-07 14:52   ` Sergei Shtylyov
2013-05-07  5:17 ` [PATCH v3 5/9] net: sh-eth: Remove SH_ETH_HAS_TSU and use tsu of sh_eth_cpu_data instead Nobuhiro Iwamatsu
2013-05-07 14:59   ` Sergei Shtylyov
2013-05-07  5:17 ` [PATCH v3 6/9] net: sh-eth: Add CONFIG_PM to definition of dev_pm_ops Nobuhiro Iwamatsu
2013-05-07  5:17 ` [PATCH v3 7/9] net: sh-eth: Add irq configureation flags in sh_eth_cpu_data Nobuhiro Iwamatsu
2013-05-07 15:02   ` Sergei Shtylyov
2013-05-07  5:17 ` [PATCH v3 8/9] net: sh-eth: Remove ifdef for sh_eth_select_mii Nobuhiro Iwamatsu
2013-05-07  5:17 ` [PATCH v3 9/9] net: sh-eth: Rewrite sh_eth_reset function Nobuhiro Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.