aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/ethtool.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 44e571111d3a..4c12ddb5f5ee 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -898,6 +898,19 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr,
898 return actor(dev, edata.data); 898 return actor(dev, edata.data);
899} 899}
900 900
901static int ethtool_flash_device(struct net_device *dev, char __user *useraddr)
902{
903 struct ethtool_flash efl;
904
905 if (copy_from_user(&efl, useraddr, sizeof(efl)))
906 return -EFAULT;
907
908 if (!dev->ethtool_ops->flash_device)
909 return -EOPNOTSUPP;
910
911 return dev->ethtool_ops->flash_device(dev, &efl);
912}
913
901/* The main entry point in this file. Called from net/core/dev.c */ 914/* The main entry point in this file. Called from net/core/dev.c */
902 915
903int dev_ethtool(struct net *net, struct ifreq *ifr) 916int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -1111,6 +1124,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
1111 case ETHTOOL_SGRO: 1124 case ETHTOOL_SGRO:
1112 rc = ethtool_set_gro(dev, useraddr); 1125 rc = ethtool_set_gro(dev, useraddr);
1113 break; 1126 break;
1127 case ETHTOOL_FLASHDEV:
1128 rc = ethtool_flash_device(dev, useraddr);
1129 break;
1114 default: 1130 default:
1115 rc = -EOPNOTSUPP; 1131 rc = -EOPNOTSUPP;
1116 } 1132 }