summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-05-13 23:25:26 +0100
committerBen Hutchings <bhutchings@solarflare.com>2012-06-02 01:31:09 +0100
commite5c984ac501788d668e8aed1f7b1fd79ce1d93c5 (patch)
treeca1a9c90ca55cb4b0c3df0490d170ef5921d484b /internal.h
parentf2686c1e2b988af68e0bf14cacde254b487fd4f2 (diff)
downloadethtool-e5c984ac501788d668e8aed1f7b1fd79ce1d93c5.tar.gz
Regularise offload feature settings
This is partly preparation for use of the new net device features API, but is useful in its own right. Replace repetitive code for getting/setting offload flags with data- driven loops. This changes error messages to use the same long names for offload flags as in dump_offload(), and changes various exit codes to 1. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 0fff2a5..deb7868 100644
--- a/internal.h
+++ b/internal.h
@@ -91,6 +91,24 @@ static inline int test_bit(unsigned int nr, const unsigned long *addr)
#define SIOCETHTOOL 0x8946
#endif
+/* Internal values for old-style offload flags. Values and names
+ * must not clash with the flags defined for ETHTOOL_{G,S}FLAGS.
+ */
+#define ETH_FLAG_RXCSUM (1 << 0)
+#define ETH_FLAG_TXCSUM (1 << 1)
+#define ETH_FLAG_SG (1 << 2)
+#define ETH_FLAG_TSO (1 << 3)
+#define ETH_FLAG_UFO (1 << 4)
+#define ETH_FLAG_GSO (1 << 5)
+#define ETH_FLAG_GRO (1 << 6)
+#define ETH_FLAG_INT_MASK (ETH_FLAG_RXCSUM | ETH_FLAG_TXCSUM | \
+ ETH_FLAG_SG | ETH_FLAG_TSO | ETH_FLAG_UFO | \
+ ETH_FLAG_GSO | ETH_FLAG_GRO),
+/* Mask of all flags defined for ETHTOOL_{G,S}FLAGS. */
+#define ETH_FLAG_EXT_MASK (ETH_FLAG_LRO | ETH_FLAG_RXVLAN | \
+ ETH_FLAG_TXVLAN | ETH_FLAG_NTUPLE | \
+ ETH_FLAG_RXHASH)
+
/* Context for sub-commands */
struct cmd_context {
const char *devname; /* net device name */