struct ethtool_fecparam::active_fec is a GET-only field, all in-tree drivers correctly ignore it on SET. Clear the field on SET to avoid any confusion. Again, we can't reject non-zero now since ethtool user space does not zero-init the param correctly.
Unified · Split
| @@ -1378,7 +1378,7 @@ struct ethtool_per_queue_op { · 1377 unmodified lines | |||
| 1378 | /** | 1378 | /** |
| 1379 | * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters | 1379 | * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters |
| 1380 | * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM | 1380 | * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM |
| 1381 | * @active_fec: FEC mode which is active on the port | 1381 | * @active_fec: FEC mode which is active on the port, GET only. |
| 1382 | * @fec: Bitmask of supported/configured FEC modes | 1382 | * @fec: Bitmask of supported/configured FEC modes |
| 1383 | * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET. | 1383 | * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET. |
| 1384 | */ | 1384 | */ |
| @@ -2586,6 +2586,7 @@ static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr) · 2585 unmodified lines | |||
| 2586 | if (copy_from_user(&fecparam, useraddr, sizeof(fecparam))) | 2586 | if (copy_from_user(&fecparam, useraddr, sizeof(fecparam))) |
| 2587 | return -EFAULT; | 2587 | return -EFAULT; |
| 2588 | 2588 | ||
| 2589 | fecparam.active_fec = 0; | ||
| 2589 | fecparam.reserved = 0; | 2590 | fecparam.reserved = 0; |
| 2590 | 2591 | ||
| 2591 | return dev->ethtool_ops->set_fecparam(dev, &fecparam); | 2592 | return dev->ethtool_ops->set_fecparam(dev, &fecparam); |