aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/gianfar.c31
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);
140void gfar_start(struct net_device *dev); 140void gfar_start(struct net_device *dev);
141static void gfar_clear_exact_match(struct net_device *dev); 141static void gfar_clear_exact_match(struct net_device *dev);
142static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); 142static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr);
143static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
143 144
144MODULE_AUTHOR("Freescale Semiconductor, Inc"); 145MODULE_AUTHOR("Freescale Semiconductor, Inc");
145MODULE_DESCRIPTION("Gianfar Ethernet Driver"); 146MODULE_DESCRIPTION("Gianfar Ethernet Driver");
146MODULE_LICENSE("GPL"); 147MODULE_LICENSE("GPL");
147 148
149static 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 */
149static inline int gfar_uses_fcb(struct gfar_private *priv) 164static 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;