/* Description: Searches the settings array for the setting which matches the desired speed and duplex, and returns the index of that setting. Returns the index of the last setting if none of the others match.  */
static int phy_find_setting(int speed, int duplex)
/* Description: Searches the settings array for the setting which matches the desired speed and duplex, and returns the index of that setting. Returns the index of the last setting if none of the others match.  */
static int phy_find_setting(int speed, int duplex)
{
	int idx = 0;
	while (idx < ARRAY_SIZE(settings) &&
			(settings[idx].speed != speed ||
			settings[idx].duplex != duplex))
		idx++;
	return idx < MAX_NUM_SETTINGS ? idx : MAX_NUM_SETTINGS - 1;
}