4 [ -n "$TARGET_CC_NOCACHE" ] && CC
="$TARGET_CC_NOCACHE"
7 #include <linux/ethtool.h>
9 #define ETHTOOL_MODE_FULL(_speed, _mode) { \\
12 .bit_full = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Full_BIT, \\
13 .name = #_speed "base" #_mode, \\
16 #define ETHTOOL_MODE_HALF(_speed, _mode) { \\
18 .bit_half = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Half_BIT, \\
20 .name = #_speed "base" #_mode, \\
23 #define ETHTOOL_MODE_BOTH(_speed, _mode) { \\
25 .bit_half = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Half_BIT, \\
26 .bit_full = ETHTOOL_LINK_MODE_ ## _speed ## base ## _mode ## _Full_BIT, \\
27 .name = #_speed "base" #_mode, \\
38 echo "#include <linux/ethtool.h>" |
"$CC" -E - | \
39 grep "ETHTOOL_LINK_MODE_[0-9]*base[A-Za-z0-9]*_...._BIT.*" | \
40 sed -r 's/.*ETHTOOL_LINK_MODE_([0-9]*)base([A-Za-z0-9]*)_(....)_BIT.*/\1 \2 \3/' | \
41 sort -u | LC_ALL
=C
sort -r -g |
( gothalf
=0 ; while read speed mode duplex
; do
42 if [ "$duplex" = "Half" ]; then
43 if [ "$gothalf" = "1" ]; then
44 echo -e "$speed \tETHTOOL_MODE_HALF($p_speed, $p_mode),"
47 elif [ "$duplex" = "Full" ]; then
48 if [ "$gothalf" = "1" ]; then
49 if [ "$p_speed" = "$speed" ] && [ "$p_mode" = "$mode" ]; then
50 echo -e "$speed \tETHTOOL_MODE_BOTH($speed, $mode),"
52 echo -e "$p_speed \tETHTOOL_MODE_HALF($p_speed, $p_mode),"
53 echo -e "$speed \tETHTOOL_MODE_FULL($speed, $mode),"
57 echo -e "$speed \tETHTOOL_MODE_FULL($speed, $mode),"
65 done ; [ "$gothalf" = "1" ] && echo -e "$p_speed \tETHTOOL_MODE_HALF($p_speed, $p_mode)," ) | \
66 LC_ALL
=C
sort -g | cut
-d' ' -f2-