]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
linux: pull up-to-date ethtool.h
authorVincent Bernat <vincent@bernat.im>
Sun, 20 Nov 2016 18:32:32 +0000 (19:32 +0100)
committerVincent Bernat <vincent@bernat.im>
Sun, 20 Nov 2016 18:32:32 +0000 (19:32 +0100)
include/linux/ethtool.h

index 21e4384d785be5f6b9e4593c92aac2bd93ec1fc1..f0db7788f887b9947e0e1aa78d48a9980e80bddf 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef _UAPI_LINUX_ETHTOOL_H
 #define _UAPI_LINUX_ETHTOOL_H
 
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/if_ether.h>
 
@@ -118,8 +119,7 @@ struct ethtool_cmd {
 static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
                                         __u32 speed)
 {
-
-       ep->speed = (__u16)speed;
+       ep->speed = (__u16)(speed & 0xFFFF);
        ep->speed_hi = (__u16)(speed >> 16);
 }
 
@@ -248,6 +248,19 @@ struct ethtool_tunable {
        void    *data[0];
 };
 
+#define DOWNSHIFT_DEV_DEFAULT_COUNT    0xff
+#define DOWNSHIFT_DEV_DISABLE          0
+
+enum phy_tunable_id {
+       ETHTOOL_PHY_ID_UNSPEC,
+       ETHTOOL_PHY_DOWNSHIFT,
+       /*
+        * Add your fresh new phy tunable attribute above and remember to update
+        * phy_tunable_strings[] in net/core/ethtool.c
+        */
+       __ETHTOOL_PHY_TUNABLE_COUNT,
+};
+
 /**
  * struct ethtool_regs - hardware register dump
  * @cmd: Command number = %ETHTOOL_GREGS
@@ -548,6 +561,7 @@ struct ethtool_pauseparam {
  * @ETH_SS_FEATURES: Device feature names
  * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
  * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
+ * @ETH_SS_PHY_TUNABLES: PHY tunable names
  */
 enum ethtool_stringset {
        ETH_SS_TEST             = 0,
@@ -558,6 +572,7 @@ enum ethtool_stringset {
        ETH_SS_RSS_HASH_FUNCS,
        ETH_SS_TUNABLES,
        ETH_SS_PHY_STATS,
+       ETH_SS_PHY_TUNABLES,
 };
 
 /**
@@ -1209,7 +1224,6 @@ enum ethtool_sfeatures_retval_bits {
 
 #define MAX_NUM_QUEUE          4096
 
-#if 0
 /**
  * struct ethtool_per_queue_op - apply sub command to the queues in mask.
  * @cmd: ETHTOOL_PERQUEUE
@@ -1223,7 +1237,6 @@ struct ethtool_per_queue_op {
        __u32   queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
        char    data[];
 };
-#endif
 
 /* CMDs currently supported */
 #define ETHTOOL_GSET           0x00000001 /* DEPRECATED, Get settings.
@@ -1315,7 +1328,8 @@ struct ethtool_per_queue_op {
 
 #define ETHTOOL_GLINKSETTINGS  0x0000004c /* Get ethtool_link_settings */
 #define ETHTOOL_SLINKSETTINGS  0x0000004d /* Set ethtool_link_settings */
-
+#define ETHTOOL_PHY_GTUNABLE   0x0000004e /* Get PHY tunable configuration */
+#define ETHTOOL_PHY_STUNABLE   0x0000004f /* Set PHY tunable configuration */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET         ETHTOOL_GSET
@@ -1363,6 +1377,14 @@ enum ethtool_link_mode_bit_indices {
        ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT        = 37,
        ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT        = 38,
        ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT    = 39,
+       ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT         = 40,
+       ETHTOOL_LINK_MODE_1000baseX_Full_BIT    = 41,
+       ETHTOOL_LINK_MODE_10000baseCR_Full_BIT  = 42,
+       ETHTOOL_LINK_MODE_10000baseSR_Full_BIT  = 43,
+       ETHTOOL_LINK_MODE_10000baseLR_Full_BIT  = 44,
+       ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45,
+       ETHTOOL_LINK_MODE_10000baseER_Full_BIT  = 46,
+
 
        /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
         * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
@@ -1371,7 +1393,7 @@ enum ethtool_link_mode_bit_indices {
         */
 
        __ETHTOOL_LINK_MODE_LAST
-         = ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT,
+         = ETHTOOL_LINK_MODE_10000baseER_Full_BIT,
 };
 
 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name)     \