Commit 9f861341 authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by David S. Miller

sh_eth: remove SH_ETH_HAS_TSU

Remove SH_ETH_HAS_TSU #define's and #ifdef's. Set three 'struct net_device_ops'
methods that depend on the presence of TSU basing on the 'tsu' field of 'struct
sh_eth_cpu_data'.
Signed-off-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: made two method assignments one-liners, added the changelog, reworded
the subject, changing the prefix.]
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04b0ed2a
...@@ -431,7 +431,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { ...@@ -431,7 +431,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
}; };
#elif defined(CONFIG_CPU_SUBTYPE_SH7757) #elif defined(CONFIG_CPU_SUBTYPE_SH7757)
#define SH_ETH_HAS_BOTH_MODULES 1 #define SH_ETH_HAS_BOTH_MODULES 1
#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev); static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_set_rate(struct net_device *ndev) static void sh_eth_set_rate(struct net_device *ndev)
...@@ -592,7 +591,6 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp) ...@@ -592,7 +591,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) #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 int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_reset_hw_crc(struct net_device *ndev); static void sh_eth_reset_hw_crc(struct net_device *ndev);
...@@ -693,7 +691,6 @@ static void sh_eth_reset_hw_crc(struct net_device *ndev) ...@@ -693,7 +691,6 @@ static void sh_eth_reset_hw_crc(struct net_device *ndev)
} }
#elif defined(CONFIG_ARCH_R8A7740) #elif defined(CONFIG_ARCH_R8A7740)
#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev); static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_chip_reset(struct net_device *ndev) static void sh_eth_chip_reset(struct net_device *ndev)
...@@ -791,7 +788,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { ...@@ -791,7 +788,6 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
}; };
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
#define SH_ETH_RESET_DEFAULT 1 #define SH_ETH_RESET_DEFAULT 1
#define SH_ETH_HAS_TSU 1
static struct sh_eth_cpu_data sh_eth_my_cpu_data = { static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
.eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff, .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
.tsu = 1, .tsu = 1,
...@@ -2105,7 +2101,6 @@ static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq, ...@@ -2105,7 +2101,6 @@ static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq,
return phy_mii_ioctl(phydev, rq, cmd); 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 */ /* 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, static void *sh_eth_tsu_get_post_reg_offset(struct sh_eth_private *mdp,
int entry) int entry)
...@@ -2448,7 +2443,6 @@ static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev, ...@@ -2448,7 +2443,6 @@ static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev,
return 0; return 0;
} }
#endif /* SH_ETH_HAS_TSU */
/* SuperH's TSU register init function */ /* SuperH's TSU register init function */
static void sh_eth_tsu_init(struct sh_eth_private *mdp) static void sh_eth_tsu_init(struct sh_eth_private *mdp)
...@@ -2587,16 +2581,11 @@ static const u16 *sh_eth_get_register_offset(int register_type) ...@@ -2587,16 +2581,11 @@ static const u16 *sh_eth_get_register_offset(int register_type)
return reg_offset; 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_open = sh_eth_open,
.ndo_stop = sh_eth_close, .ndo_stop = sh_eth_close,
.ndo_start_xmit = sh_eth_start_xmit, .ndo_start_xmit = sh_eth_start_xmit,
.ndo_get_stats = sh_eth_get_stats, .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_tx_timeout = sh_eth_tx_timeout,
.ndo_do_ioctl = sh_eth_do_ioctl, .ndo_do_ioctl = sh_eth_do_ioctl,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
...@@ -2677,6 +2666,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -2677,6 +2666,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
sh_eth_set_default_cpu_data(mdp->cd); sh_eth_set_default_cpu_data(mdp->cd);
/* set function */ /* 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; ndev->netdev_ops = &sh_eth_netdev_ops;
SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops); SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops);
ndev->watchdog_timeo = TX_TIMEOUT; ndev->watchdog_timeo = TX_TIMEOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment