aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec_mpc52xx.c
diff options
context:
space:
mode:
authorHenk Stegeman <henk.stegeman@gmail.com>2009-03-31 16:16:57 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-02 03:57:00 -0400
commitd360009c100766c6f14ea349e8f984a3ad17e140 (patch)
treed2863a3728760d67e3aec683a14f3f714b645ea4 /drivers/net/fec_mpc52xx.c
parent461cadbc62b098b49b55de10605d330c8b494889 (diff)
net/fec_mpc52xx: Migrate to net_device_ops.
Since not using net_device_ops gets you shunned out the cool crowd, this patch modifies the fec_mpc52xx Ethernet driver to provide the management hooks via a struct net_device_ops. Reported-by: Henk Stegeman <henk.stegeman@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec_mpc52xx.c')
-rw-r--r--drivers/net/fec_mpc52xx.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 024b10a0bec8..a67f29017a4e 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -371,7 +371,7 @@ static int mpc52xx_fec_close(struct net_device *dev)
371 * invariant will hold if you make sure that the netif_*_queue() 371 * invariant will hold if you make sure that the netif_*_queue()
372 * calls are done at the proper times. 372 * calls are done at the proper times.
373 */ 373 */
374static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 374static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
375{ 375{
376 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 376 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
377 struct bcom_fec_bd *bd; 377 struct bcom_fec_bd *bd;
@@ -379,7 +379,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
379 if (bcom_queue_full(priv->tx_dmatsk)) { 379 if (bcom_queue_full(priv->tx_dmatsk)) {
380 if (net_ratelimit()) 380 if (net_ratelimit())
381 dev_err(&dev->dev, "transmit queue overrun\n"); 381 dev_err(&dev->dev, "transmit queue overrun\n");
382 return 1; 382 return NETDEV_TX_BUSY;
383 } 383 }
384 384
385 spin_lock_irq(&priv->lock); 385 spin_lock_irq(&priv->lock);
@@ -400,7 +400,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
400 400
401 spin_unlock_irq(&priv->lock); 401 spin_unlock_irq(&priv->lock);
402 402
403 return 0; 403 return NETDEV_TX_OK;
404} 404}
405 405
406#ifdef CONFIG_NET_POLL_CONTROLLER 406#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -890,6 +890,22 @@ static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
890 return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd); 890 return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
891} 891}
892 892
893static const struct net_device_ops mpc52xx_fec_netdev_ops = {
894 .ndo_open = mpc52xx_fec_open,
895 .ndo_stop = mpc52xx_fec_close,
896 .ndo_start_xmit = mpc52xx_fec_start_xmit,
897 .ndo_set_multicast_list = mpc52xx_fec_set_multicast_list,
898 .ndo_set_mac_address = mpc52xx_fec_set_mac_address,
899 .ndo_validate_addr = eth_validate_addr,
900 .ndo_do_ioctl = mpc52xx_fec_ioctl,
901 .ndo_change_mtu = eth_change_mtu,
902 .ndo_tx_timeout = mpc52xx_fec_tx_timeout,
903 .ndo_get_stats = mpc52xx_fec_get_stats,
904#ifdef CONFIG_NET_POLL_CONTROLLER
905 .ndo_poll_controller = mpc52xx_fec_poll_controller,
906#endif
907};
908
893/* ======================================================================== */ 909/* ======================================================================== */
894/* OF Driver */ 910/* OF Driver */
895/* ======================================================================== */ 911/* ======================================================================== */
@@ -934,22 +950,10 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
934 return -EBUSY; 950 return -EBUSY;
935 951
936 /* Init ether ndev with what we have */ 952 /* Init ether ndev with what we have */
937 ndev->open = mpc52xx_fec_open; 953 ndev->netdev_ops = &mpc52xx_fec_netdev_ops;
938 ndev->stop = mpc52xx_fec_close;
939 ndev->hard_start_xmit = mpc52xx_fec_hard_start_xmit;
940 ndev->do_ioctl = mpc52xx_fec_ioctl;
941 ndev->ethtool_ops = &mpc52xx_fec_ethtool_ops; 954 ndev->ethtool_ops = &mpc52xx_fec_ethtool_ops;
942 ndev->get_stats = mpc52xx_fec_get_stats;
943 ndev->set_mac_address = mpc52xx_fec_set_mac_address;
944 ndev->set_multicast_list = mpc52xx_fec_set_multicast_list;
945 ndev->tx_timeout = mpc52xx_fec_tx_timeout;
946 ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT; 955 ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT;
947 ndev->base_addr = mem.start; 956 ndev->base_addr = mem.start;
948#ifdef CONFIG_NET_POLL_CONTROLLER
949 ndev->poll_controller = mpc52xx_fec_poll_controller;
950#endif
951
952 priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */
953 957
954 spin_lock_init(&priv->lock); 958 spin_lock_init(&priv->lock);
955 959