aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-05-29 17:13:47 -0400
committerDavid S. Miller <davem@davemloft.net>2005-05-29 17:13:47 -0400
commitd8a33ac435c43a1a404b2ec560ef1d1536710c36 (patch)
tree04359c09e0731e9c33a8c2dd80cc69404e0dde60 /net
parent45b30105e7231b70bb855923dbca443ee3ba44c3 (diff)
[BRIDGE]: features change notification
Resend of earlier patch (no changes) from Catalin used to provide device feature change notification. Signed-off-by: Catalin BOIE <catab at umbrella.ro> Acked-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c12
-rw-r--r--net/core/ethtool.c8
2 files changed, 19 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d4d9e2680ad..f15a3ffff63 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -761,6 +761,18 @@ int dev_change_name(struct net_device *dev, char *newname)
761} 761}
762 762
763/** 763/**
764 * netdev_features_change - device changes fatures
765 * @dev: device to cause notification
766 *
767 * Called to indicate a device has changed features.
768 */
769void netdev_features_change(struct net_device *dev)
770{
771 notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev);
772}
773EXPORT_SYMBOL(netdev_features_change);
774
775/**
764 * netdev_state_change - device changes state 776 * netdev_state_change - device changes state
765 * @dev: device to cause notification 777 * @dev: device to cause notification
766 * 778 *
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index f05fde97c43..252bfc6f03f 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -682,6 +682,7 @@ int dev_ethtool(struct ifreq *ifr)
682 void __user *useraddr = ifr->ifr_data; 682 void __user *useraddr = ifr->ifr_data;
683 u32 ethcmd; 683 u32 ethcmd;
684 int rc; 684 int rc;
685 int old_features;
685 686
686 /* 687 /*
687 * XXX: This can be pushed down into the ethtool_* handlers that 688 * XXX: This can be pushed down into the ethtool_* handlers that
@@ -703,6 +704,8 @@ int dev_ethtool(struct ifreq *ifr)
703 if ((rc = dev->ethtool_ops->begin(dev)) < 0) 704 if ((rc = dev->ethtool_ops->begin(dev)) < 0)
704 return rc; 705 return rc;
705 706
707 old_features = dev->features;
708
706 switch (ethcmd) { 709 switch (ethcmd) {
707 case ETHTOOL_GSET: 710 case ETHTOOL_GSET:
708 rc = ethtool_get_settings(dev, useraddr); 711 rc = ethtool_get_settings(dev, useraddr);
@@ -712,7 +715,6 @@ int dev_ethtool(struct ifreq *ifr)
712 break; 715 break;
713 case ETHTOOL_GDRVINFO: 716 case ETHTOOL_GDRVINFO:
714 rc = ethtool_get_drvinfo(dev, useraddr); 717 rc = ethtool_get_drvinfo(dev, useraddr);
715
716 break; 718 break;
717 case ETHTOOL_GREGS: 719 case ETHTOOL_GREGS:
718 rc = ethtool_get_regs(dev, useraddr); 720 rc = ethtool_get_regs(dev, useraddr);
@@ -801,6 +803,10 @@ int dev_ethtool(struct ifreq *ifr)
801 803
802 if(dev->ethtool_ops->complete) 804 if(dev->ethtool_ops->complete)
803 dev->ethtool_ops->complete(dev); 805 dev->ethtool_ops->complete(dev);
806
807 if (old_features != dev->features)
808 netdev_features_change(dev);
809
804 return rc; 810 return rc;
805 811
806 ioctl: 812 ioctl: