aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h91
1 files changed, 90 insertions, 1 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 1908929204a9..aac3e2eeb4fd 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -251,6 +251,7 @@ enum ethtool_stringset {
251 ETH_SS_STATS, 251 ETH_SS_STATS,
252 ETH_SS_PRIV_FLAGS, 252 ETH_SS_PRIV_FLAGS,
253 ETH_SS_NTUPLE_FILTERS, 253 ETH_SS_NTUPLE_FILTERS,
254 ETH_SS_FEATURES,
254}; 255};
255 256
256/* for passing string sets for data tagging */ 257/* for passing string sets for data tagging */
@@ -523,6 +524,92 @@ struct ethtool_flash {
523 char data[ETHTOOL_FLASH_MAX_FILENAME]; 524 char data[ETHTOOL_FLASH_MAX_FILENAME];
524}; 525};
525 526
527/* for returning and changing feature sets */
528
529/**
530 * struct ethtool_get_features_block - block with state of 32 features
531 * @available: mask of changeable features
532 * @requested: mask of features requested to be enabled if possible
533 * @active: mask of currently enabled features
534 * @never_changed: mask of features not changeable for any device
535 */
536struct ethtool_get_features_block {
537 __u32 available;
538 __u32 requested;
539 __u32 active;
540 __u32 never_changed;
541};
542
543/**
544 * struct ethtool_gfeatures - command to get state of device's features
545 * @cmd: command number = %ETHTOOL_GFEATURES
546 * @size: in: number of elements in the features[] array;
547 * out: number of elements in features[] needed to hold all features
548 * @features: state of features
549 */
550struct ethtool_gfeatures {
551 __u32 cmd;
552 __u32 size;
553 struct ethtool_get_features_block features[0];
554};
555
556/**
557 * struct ethtool_set_features_block - block with request for 32 features
558 * @valid: mask of features to be changed
559 * @requested: values of features to be changed
560 */
561struct ethtool_set_features_block {
562 __u32 valid;
563 __u32 requested;
564};
565
566/**
567 * struct ethtool_sfeatures - command to request change in device's features
568 * @cmd: command number = %ETHTOOL_SFEATURES
569 * @size: array size of the features[] array
570 * @features: feature change masks
571 */
572struct ethtool_sfeatures {
573 __u32 cmd;
574 __u32 size;
575 struct ethtool_set_features_block features[0];
576};
577
578/*
579 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
580 * values of corresponding bits in features[].requested. Bits in .requested
581 * not set in .valid or not changeable are ignored.
582 *
583 * Returns %EINVAL when .valid contains undefined or never-changable bits
584 * or size is not equal to required number of features words (32-bit blocks).
585 * Returns >= 0 if request was completed; bits set in the value mean:
586 * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
587 * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
588 * those bits were ignored.
589 * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
590 * resulting state of bits masked by .valid is not equal to .requested.
591 * Probably there are other device-specific constraints on some features
592 * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
593 * here as though ignored bits were cleared.
594 * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
595 * compatibility functions. Requested offload state cannot be properly
596 * managed by kernel.
597 *
598 * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
599 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
600 * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
601 * significant bit in features[0] fields. Empty strings mark undefined features.
602 */
603enum ethtool_sfeatures_retval_bits {
604 ETHTOOL_F_UNSUPPORTED__BIT,
605 ETHTOOL_F_WISH__BIT,
606 ETHTOOL_F_COMPAT__BIT,
607};
608
609#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
610#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
611#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
612
526#ifdef __KERNEL__ 613#ifdef __KERNEL__
527 614
528#include <linux/rculist.h> 615#include <linux/rculist.h>
@@ -543,7 +630,6 @@ struct net_device;
543 630
544/* Some generic methods drivers may use in their ethtool_ops */ 631/* Some generic methods drivers may use in their ethtool_ops */
545u32 ethtool_op_get_link(struct net_device *dev); 632u32 ethtool_op_get_link(struct net_device *dev);
546u32 ethtool_op_get_rx_csum(struct net_device *dev);
547u32 ethtool_op_get_tx_csum(struct net_device *dev); 633u32 ethtool_op_get_tx_csum(struct net_device *dev);
548int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); 634int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
549int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); 635int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
@@ -744,6 +830,9 @@ struct ethtool_ops {
744#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ 830#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
745#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ 831#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
746 832
833#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
834#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
835
747/* compatibility with older code */ 836/* compatibility with older code */
748#define SPARC_ETH_GSET ETHTOOL_GSET 837#define SPARC_ETH_GSET ETHTOOL_GSET
749#define SPARC_ETH_SSET ETHTOOL_SSET 838#define SPARC_ETH_SSET ETHTOOL_SSET