The way to define __ETHTOOL_LINK_MODE_MASK_NBITS seems to be overly complicated, go with a standard approach instead. Whilst we're at it, move the comment to the right place. v2: - rebased
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -1432,6 +1432,13 @@ enum ethtool_link_mode_bit_indices { · 1431 unmodified lines | ||
| 1432 | 1432 | ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, |
| 1433 | 1433 | ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, |
| 1434 | 1434 | ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, |
| 1435 | + | |
| 1436 | + /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit | |
| 1437 | + * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_* | |
| 1438 | + * macro for bits > 31. The only way to use indices > 31 is to | |
| 1439 | + * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. | |
| 1440 | + */ | |
| 1441 | + | |
| 1435 | 1442 | ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, |
| 1436 | 1443 | ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, |
| 1437 | 1444 | ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, |
| @@ -1469,14 +1476,8 @@ enum ethtool_link_mode_bit_indices { · 31 unmodified lines | ||
| 1469 | 1476 | ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65, |
| 1470 | 1477 | ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66, |
| 1471 | 1478 | |
| 1472 | − /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit | |
| 1473 | − * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_* | |
| 1474 | − * macro for bits > 31. The only way to use indices > 31 is to | |
| 1475 | − * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. | |
| 1476 | − */ | |
| 1477 | − | |
| 1478 | − __ETHTOOL_LINK_MODE_LAST | |
| 1479 | − = ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT, | |
| 1479 | + /* must be last entry */ | |
| 1480 | + __ETHTOOL_LINK_MODE_MASK_NBITS | |
| 1480 | 1481 | }; |
| 1481 | 1482 | |
| 1482 | 1483 | #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \ |