From e5c984ac501788d668e8aed1f7b1fd79ce1d93c5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 13 May 2011 23:25:26 +0100 Subject: 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 --- internal.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'internal.h') 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 */ -- cgit v1.2.1