#include #define ETHTOOL_MODE_FULL(_speed, _mode) { \ .speed = (_speed), \ .bit_half = -1, \ .bit_full = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Full_BIT, \ .name = #_speed "base" #_mode, \ } #define ETHTOOL_MODE_HALF(_speed, _mode) { \ .speed = (_speed), \ .bit_half = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Half_BIT, \ .bit_full = -1, \ .name = #_speed "base" #_mode, \ } #define ETHTOOL_MODE_BOTH(_speed, _mode) { \ .speed = (_speed), \ .bit_half = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Half_BIT, \ .bit_full = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Full_BIT, \ .name = #_speed "base" #_mode, \ } static const struct { unsigned int speed; int bit_half; int bit_full; const char *name; } ethtool_modes[] = { ETHTOOL_MODE_BOTH(10, T), ETHTOOL_MODE_BOTH(10, T1S), ETHTOOL_MODE_FULL(10, T1L), ETHTOOL_MODE_BOTH(100, FX), ETHTOOL_MODE_BOTH(100, T), ETHTOOL_MODE_FULL(100, T1), ETHTOOL_MODE_BOTH(1000, T), ETHTOOL_MODE_FULL(1000, KX), ETHTOOL_MODE_FULL(1000, T1), ETHTOOL_MODE_FULL(1000, X), ETHTOOL_MODE_FULL(2500, T), ETHTOOL_MODE_FULL(2500, X), ETHTOOL_MODE_FULL(5000, T), ETHTOOL_MODE_FULL(10000, CR), ETHTOOL_MODE_FULL(10000, ER), ETHTOOL_MODE_FULL(10000, KR), ETHTOOL_MODE_FULL(10000, KX4), ETHTOOL_MODE_FULL(10000, LR), ETHTOOL_MODE_FULL(10000, LRM), ETHTOOL_MODE_FULL(10000, SR), ETHTOOL_MODE_FULL(10000, T), ETHTOOL_MODE_FULL(20000, KR2), ETHTOOL_MODE_FULL(20000, MLD2), ETHTOOL_MODE_FULL(25000, CR), ETHTOOL_MODE_FULL(25000, KR), ETHTOOL_MODE_FULL(25000, SR), ETHTOOL_MODE_FULL(40000, CR4), ETHTOOL_MODE_FULL(40000, KR4), ETHTOOL_MODE_FULL(40000, LR4), ETHTOOL_MODE_FULL(40000, SR4), ETHTOOL_MODE_FULL(50000, CR), ETHTOOL_MODE_FULL(50000, CR2), ETHTOOL_MODE_FULL(50000, DR), ETHTOOL_MODE_FULL(50000, KR), ETHTOOL_MODE_FULL(50000, KR2), ETHTOOL_MODE_FULL(50000, SR), ETHTOOL_MODE_FULL(50000, SR2), ETHTOOL_MODE_FULL(56000, CR4), ETHTOOL_MODE_FULL(56000, KR4), ETHTOOL_MODE_FULL(56000, LR4), ETHTOOL_MODE_FULL(56000, SR4), ETHTOOL_MODE_FULL(100000, CR), ETHTOOL_MODE_FULL(100000, CR2), ETHTOOL_MODE_FULL(100000, CR4), ETHTOOL_MODE_FULL(100000, DR), ETHTOOL_MODE_FULL(100000, DR2), ETHTOOL_MODE_FULL(100000, KR), ETHTOOL_MODE_FULL(100000, KR2), ETHTOOL_MODE_FULL(100000, KR4), ETHTOOL_MODE_FULL(100000, SR), ETHTOOL_MODE_FULL(100000, SR2), ETHTOOL_MODE_FULL(100000, SR4), ETHTOOL_MODE_FULL(200000, CR2), ETHTOOL_MODE_FULL(200000, CR4), ETHTOOL_MODE_FULL(200000, DR2), ETHTOOL_MODE_FULL(200000, DR4), ETHTOOL_MODE_FULL(200000, KR2), ETHTOOL_MODE_FULL(200000, KR4), ETHTOOL_MODE_FULL(200000, SR2), ETHTOOL_MODE_FULL(200000, SR4), ETHTOOL_MODE_FULL(400000, CR4), ETHTOOL_MODE_FULL(400000, CR8), ETHTOOL_MODE_FULL(400000, DR4), ETHTOOL_MODE_FULL(400000, DR8), ETHTOOL_MODE_FULL(400000, KR4), ETHTOOL_MODE_FULL(400000, KR8), ETHTOOL_MODE_FULL(400000, SR4), ETHTOOL_MODE_FULL(400000, SR8), ETHTOOL_MODE_FULL(800000, CR8), ETHTOOL_MODE_FULL(800000, DR8), ETHTOOL_MODE_FULL(800000, KR8), ETHTOOL_MODE_FULL(800000, SR8), ETHTOOL_MODE_FULL(800000, VR8), };