slave.c (f5db340f19f14a8df9dfd22d71fba1513e9f1f7e) slave.c (7b9cc73843e89ea1ac215511c13c259a70d1b4f7)
1/*
2 * net/dsa/slave.c - Slave device handling
3 * Copyright (c) 2008-2009 Marvell Semiconductor
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 634 unchanged lines hidden (view full) ---

643}
644
645static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
646{
647 struct dsa_slave_priv *p = netdev_priv(dev);
648 struct dsa_switch *ds = p->dp->ds;
649 int ret;
650
1/*
2 * net/dsa/slave.c - Slave device handling
3 * Copyright (c) 2008-2009 Marvell Semiconductor
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 634 unchanged lines hidden (view full) ---

643}
644
645static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
646{
647 struct dsa_slave_priv *p = netdev_priv(dev);
648 struct dsa_switch *ds = p->dp->ds;
649 int ret;
650
651 /* Port's PHY and MAC both need to be EEE capable */
652 if (!p->phy)
653 return -ENODEV;
654
651 if (!ds->ops->set_eee)
652 return -EOPNOTSUPP;
653
654 ret = ds->ops->set_eee(ds, p->dp->index, p->phy, e);
655 if (ret)
656 return ret;
657
655 if (!ds->ops->set_eee)
656 return -EOPNOTSUPP;
657
658 ret = ds->ops->set_eee(ds, p->dp->index, p->phy, e);
659 if (ret)
660 return ret;
661
658 if (p->phy)
659 ret = phy_ethtool_set_eee(p->phy, e);
660
661 return ret;
662 return phy_ethtool_set_eee(p->phy, e);
662}
663
664static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e)
665{
666 struct dsa_slave_priv *p = netdev_priv(dev);
667 struct dsa_switch *ds = p->dp->ds;
668 int ret;
669
663}
664
665static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e)
666{
667 struct dsa_slave_priv *p = netdev_priv(dev);
668 struct dsa_switch *ds = p->dp->ds;
669 int ret;
670
671 /* Port's PHY and MAC both need to be EEE capable */
672 if (!p->phy)
673 return -ENODEV;
674
670 if (!ds->ops->get_eee)
671 return -EOPNOTSUPP;
672
673 ret = ds->ops->get_eee(ds, p->dp->index, e);
674 if (ret)
675 return ret;
676
675 if (!ds->ops->get_eee)
676 return -EOPNOTSUPP;
677
678 ret = ds->ops->get_eee(ds, p->dp->index, e);
679 if (ret)
680 return ret;
681
677 if (p->phy)
678 ret = phy_ethtool_get_eee(p->phy, e);
679
680 return ret;
682 return phy_ethtool_get_eee(p->phy, e);
681}
682
683#ifdef CONFIG_NET_POLL_CONTROLLER
684static int dsa_slave_netpoll_setup(struct net_device *dev,
685 struct netpoll_info *ni)
686{
687 struct dsa_slave_priv *p = netdev_priv(dev);
688 struct net_device *master = dsa_master_netdev(p);

--- 590 unchanged lines hidden ---
683}
684
685#ifdef CONFIG_NET_POLL_CONTROLLER
686static int dsa_slave_netpoll_setup(struct net_device *dev,
687 struct netpoll_info *ni)
688{
689 struct dsa_slave_priv *p = netdev_priv(dev);
690 struct net_device *master = dsa_master_netdev(p);

--- 590 unchanged lines hidden ---