Add a helper function that will return the index in the array for the passed in internal delay value. The helper requires the array, size and delay value. The helper will then return the index for the exact match or return the index for the index to the closest smaller value.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -1443,6 +1443,10 @@ void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx); · 1442 unmodified lines | |||
| 1443 | bool phy_validate_pause(struct phy_device *phydev, | 1443 | bool phy_validate_pause(struct phy_device *phydev, |
| 1444 | struct ethtool_pauseparam *pp); | 1444 | struct ethtool_pauseparam *pp); |
| 1445 | void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause); | 1445 | void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause); |
| 1446 | |||
| 1447 | s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev, | ||
| 1448 | const int *delay_values, int size, bool is_rx); | ||
| 1449 | |||
| 1446 | void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv, | 1450 | void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv, |
| 1447 | bool *tx_pause, bool *rx_pause); | 1451 | bool *tx_pause, bool *rx_pause); |
| 1448 | 1452 | ||