diff options
author | Andy Fleming <afleming@freescale.com> | 2009-03-10 08:58:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-13 15:05:23 -0400 |
commit | 26ccfc37da21e6f02d5e805c38ca7551c16b2fe0 (patch) | |
tree | 0e4a942149b983600e0867a101144642a2693ba3 /drivers/net/gianfar.c | |
parent | db46db157746e57fb1ca59223bf0f72d9f875d89 (diff) |
gianfar: Convert to use netdev_ops
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index bd42502b85cf..bed30ef43797 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -140,11 +140,26 @@ static void gfar_halt_nodisable(struct net_device *dev); | |||
140 | void gfar_start(struct net_device *dev); | 140 | void gfar_start(struct net_device *dev); |
141 | static void gfar_clear_exact_match(struct net_device *dev); | 141 | static void gfar_clear_exact_match(struct net_device *dev); |
142 | static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); | 142 | static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); |
143 | static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | ||
143 | 144 | ||
144 | MODULE_AUTHOR("Freescale Semiconductor, Inc"); | 145 | MODULE_AUTHOR("Freescale Semiconductor, Inc"); |
145 | MODULE_DESCRIPTION("Gianfar Ethernet Driver"); | 146 | MODULE_DESCRIPTION("Gianfar Ethernet Driver"); |
146 | MODULE_LICENSE("GPL"); | 147 | MODULE_LICENSE("GPL"); |
147 | 148 | ||
149 | static const struct net_device_ops gfar_netdev_ops = { | ||
150 | .ndo_open = gfar_enet_open, | ||
151 | .ndo_start_xmit = gfar_start_xmit, | ||
152 | .ndo_stop = gfar_close, | ||
153 | .ndo_change_mtu = gfar_change_mtu, | ||
154 | .ndo_set_multicast_list = gfar_set_multi, | ||
155 | .ndo_tx_timeout = gfar_timeout, | ||
156 | .ndo_do_ioctl = gfar_ioctl, | ||
157 | .ndo_vlan_rx_register = gfar_vlan_rx_register, | ||
158 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
159 | .ndo_poll_controller = gfar_netpoll, | ||
160 | #endif | ||
161 | }; | ||
162 | |||
148 | /* Returns 1 if incoming frames use an FCB */ | 163 | /* Returns 1 if incoming frames use an FCB */ |
149 | static inline int gfar_uses_fcb(struct gfar_private *priv) | 164 | static inline int gfar_uses_fcb(struct gfar_private *priv) |
150 | { | 165 | { |
@@ -390,21 +405,12 @@ static int gfar_probe(struct of_device *ofdev, | |||
390 | SET_NETDEV_DEV(dev, &ofdev->dev); | 405 | SET_NETDEV_DEV(dev, &ofdev->dev); |
391 | 406 | ||
392 | /* Fill in the dev structure */ | 407 | /* Fill in the dev structure */ |
393 | dev->open = gfar_enet_open; | ||
394 | dev->hard_start_xmit = gfar_start_xmit; | ||
395 | dev->tx_timeout = gfar_timeout; | ||
396 | dev->watchdog_timeo = TX_TIMEOUT; | 408 | dev->watchdog_timeo = TX_TIMEOUT; |
397 | netif_napi_add(dev, &priv->napi, gfar_poll, GFAR_DEV_WEIGHT); | 409 | netif_napi_add(dev, &priv->napi, gfar_poll, GFAR_DEV_WEIGHT); |
398 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
399 | dev->poll_controller = gfar_netpoll; | ||
400 | #endif | ||
401 | dev->stop = gfar_close; | ||
402 | dev->change_mtu = gfar_change_mtu; | ||
403 | dev->mtu = 1500; | 410 | dev->mtu = 1500; |
404 | dev->set_multicast_list = gfar_set_multi; | ||
405 | 411 | ||
412 | dev->netdev_ops = &gfar_netdev_ops; | ||
406 | dev->ethtool_ops = &gfar_ethtool_ops; | 413 | dev->ethtool_ops = &gfar_ethtool_ops; |
407 | dev->do_ioctl = gfar_ioctl; | ||
408 | 414 | ||
409 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { | 415 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { |
410 | priv->rx_csum_enable = 1; | 416 | priv->rx_csum_enable = 1; |
@@ -414,11 +420,8 @@ static int gfar_probe(struct of_device *ofdev, | |||
414 | 420 | ||
415 | priv->vlgrp = NULL; | 421 | priv->vlgrp = NULL; |
416 | 422 | ||
417 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { | 423 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) |
418 | dev->vlan_rx_register = gfar_vlan_rx_register; | ||
419 | |||
420 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 424 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
421 | } | ||
422 | 425 | ||
423 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) { | 426 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) { |
424 | priv->extended_hash = 1; | 427 | priv->extended_hash = 1; |