diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-27 17:04:53 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-27 22:59:40 -0700 |
commit | ec9436baedb689668c409cfc8b69eb9573b0d661 (patch) | |
tree | 928b1885d12a73c353a6a7f1047d3790a3ee5ad6 /net/dsa | |
parent | 5aed85cec29882d1c4b4b2a01cb75a99efdbe4ed (diff) | |
download | blackbird-op-linux-ec9436baedb689668c409cfc8b69eb9573b0d661.tar.gz blackbird-op-linux-ec9436baedb689668c409cfc8b69eb9573b0d661.zip |
net: dsa: allow drivers to do link adjustment
Whenever libphy determines that the link status of a given PHY/port has
changed, allow to call into the switch driver link adjustment callback
so proper actions can be taken care of by the switch driver upon link
notification.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 241c2a1684cb..398d0663d3dd 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -333,6 +333,7 @@ static const struct dsa_device_ops notag_netdev_ops = { static void dsa_slave_adjust_link(struct net_device *dev) { struct dsa_slave_priv *p = netdev_priv(dev); + struct dsa_switch *ds = p->parent; unsigned int status_changed = 0; if (p->old_link != p->phy->link) { @@ -350,6 +351,9 @@ static void dsa_slave_adjust_link(struct net_device *dev) p->old_pause = p->phy->pause; } + if (ds->drv->adjust_link && status_changed) + ds->drv->adjust_link(ds, p->port, p->phy); + if (status_changed) phy_print_status(p->phy); } |