diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | amd8111e.c | 2 | ||||
-rw-r--r-- | at76c50x-usb.c | 2 | ||||
-rw-r--r-- | de2104x.c | 2 | ||||
-rw-r--r-- | e100.c | 2 | ||||
-rw-r--r-- | e1000.c | 2 | ||||
-rw-r--r-- | ethtool-bitops.h | 25 | ||||
-rw-r--r-- | ethtool.c | 2 | ||||
-rw-r--r-- | fec_8xx.c | 2 | ||||
-rw-r--r-- | ibm_emac.c | 2 | ||||
-rw-r--r-- | igb.c | 2 | ||||
-rw-r--r-- | internal.h (renamed from ethtool-util.h) | 27 | ||||
-rw-r--r-- | ixgb.c | 2 | ||||
-rw-r--r-- | ixgbe.c | 2 | ||||
-rw-r--r-- | marvell.c | 2 | ||||
-rw-r--r-- | natsemi.c | 2 | ||||
-rw-r--r-- | pcnet32.c | 2 | ||||
-rw-r--r-- | realtek.c | 2 | ||||
-rw-r--r-- | rxclass.c | 3 | ||||
-rw-r--r-- | sfc.c | 2 | ||||
-rw-r--r-- | smsc911x.c | 2 | ||||
-rw-r--r-- | stmmac.c | 2 | ||||
-rw-r--r-- | tg3.c | 2 | ||||
-rw-r--r-- | vioc.c | 2 |
24 files changed, 46 insertions, 51 deletions
diff --git a/Makefile.am b/Makefile.am index c87fb39..1e05640 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ man_MANS = ethtool.8 EXTRA_DIST = LICENSE ethtool.8 ethtool.spec.in aclocal.m4 ChangeLog autogen.sh sbin_PROGRAMS = ethtool -ethtool_SOURCES = ethtool.c ethtool-bitops.h ethtool-copy.h ethtool-util.h \ +ethtool_SOURCES = ethtool.c ethtool-copy.h internal.h \ amd8111e.c de2104x.c e100.c e1000.c igb.c \ fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \ pcnet32.c realtek.c tg3.c marvell.c vioc.c \ @@ -1,7 +1,7 @@ /* Copyright (C) 2003 Advanced Micro Devices Inc. */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" typedef enum { /* VAL2 */ diff --git a/at76c50x-usb.c b/at76c50x-usb.c index 4c2a1a8..39e24a4 100644 --- a/at76c50x-usb.c +++ b/at76c50x-usb.c @@ -1,5 +1,5 @@ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" static char *hw_versions[] = { "503_ISL3861", @@ -1,6 +1,6 @@ /* Copyright 2001 Sun Microsystems (thockin@sun.com) */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" static const char * const csr0_tap[4] = { "No transmit automatic polling", @@ -1,6 +1,6 @@ /* Copyright (c) 2002 Intel Corporation */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" #define D102_REV_ID 12 @@ -1,6 +1,6 @@ /* Copyright (c) 2002 Intel Corporation */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" /* Register Bit Masks */ /* Device Control */ diff --git a/ethtool-bitops.h b/ethtool-bitops.h deleted file mode 100644 index b1eb426..0000000 --- a/ethtool-bitops.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ETHTOOL_BITOPS_H__ -#define ETHTOOL_BITOPS_H__ - -#define BITS_PER_BYTE 8 -#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) - -static inline void set_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); -} - -static inline void clear_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG)); -} - -static inline int test_bit(unsigned int nr, const unsigned long *addr) -{ - return !!((1UL << (nr % BITS_PER_LONG)) & - (((unsigned long *)addr)[nr / BITS_PER_LONG])); -} - -#endif @@ -23,7 +23,7 @@ * * show settings for all devices */ -#include "ethtool-util.h" +#include "internal.h" #include <string.h> #include <stdlib.h> #include <sys/stat.h> @@ -7,7 +7,7 @@ #include <stdint.h> #include <stddef.h> -#include "ethtool-util.h" +#include "internal.h" struct fec { uint32_t addr_low; /* lower 32 bits of station address */ @@ -6,7 +6,7 @@ #include <stdint.h> #include <stddef.h> -#include "ethtool-util.h" +#include "internal.h" /* Ethtool get_regs complex data. * we want to get not just EMAC registers, but also MAL, ZMII, RGMII, TAH @@ -1,6 +1,6 @@ /* Copyright (c) 2007 Intel Corporation */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" /* Register Bit Masks */ /* Device Control */ diff --git a/ethtool-util.h b/internal.h index 79be7f2..693b091 100644 --- a/ethtool-util.h +++ b/internal.h @@ -1,7 +1,7 @@ /* Portions Copyright 2001 Sun Microsystems (thockin@sun.com) */ /* Portions Copyright 2002 Intel (scott.feldman@intel.com) */ -#ifndef ETHTOOL_UTIL_H__ -#define ETHTOOL_UTIL_H__ +#ifndef ETHTOOL_INTERNAL_H__ +#define ETHTOOL_INTERNAL_H__ #ifdef HAVE_CONFIG_H #include "ethtool-config.h" @@ -57,6 +57,27 @@ static inline u64 cpu_to_be64(u64 value) #define ntohll cpu_to_be64 #define htonll cpu_to_be64 +#define BITS_PER_BYTE 8 +#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) + +static inline void set_bit(int nr, unsigned long *addr) +{ + addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); +} + +static inline void clear_bit(int nr, unsigned long *addr) +{ + addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG)); +} + +static inline int test_bit(unsigned int nr, const unsigned long *addr) +{ + return !!((1UL << (nr % BITS_PER_LONG)) & + (((unsigned long *)addr)[nr / BITS_PER_LONG])); +} + #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif @@ -140,4 +161,4 @@ int rxclass_rule_ins(int fd, struct ifreq *ifr, struct ethtool_rx_flow_spec *fsp); int rxclass_rule_del(int fd, struct ifreq *ifr, __u32 loc); -#endif /* ETHTOOL_UTIL_H__ */ +#endif /* ETHTOOL_INTERNAL_H__ */ @@ -1,6 +1,6 @@ /* Copyright (c) 2006 Intel Corporation */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" /* CTRL0 Bit Masks */ #define IXGB_CTRL0_LRST 0x00000008 @@ -1,6 +1,6 @@ /* Copyright (c) 2007 Intel Corporation */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" /* Register Bit Masks */ #define IXGBE_FCTRL_SBP 0x00000002 @@ -7,7 +7,7 @@ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" static void dump_addr(int n, const u8 *a) { @@ -1,6 +1,6 @@ /* Copyright 2001 Sun Microsystems (thockin@sun.com) */ #include <stdio.h> -#include "ethtool-util.h" +#include "internal.h" #define PCI_VENDOR_NATSEMI 0x100b #define PCI_DEVICE_DP83815 0x0020 @@ -2,7 +2,7 @@ #include <stdio.h> #include <stdlib.h> -#include "ethtool-util.h" +#include "internal.h" #define BIT0 0x0001 #define BIT1 0x0002 @@ -1,7 +1,7 @@ /* Copyright 2001 Sun Microsystems (thockin@sun.com) */ #include <stdio.h> #include <stdlib.h> -#include "ethtool-util.h" +#include "internal.h" #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -10,8 +10,7 @@ #include <linux/sockios.h> #include <arpa/inet.h> -#include "ethtool-util.h" -#include "ethtool-bitops.h" +#include "internal.h" static void invert_flow_mask(struct ethtool_rx_flow_spec *fsp) { @@ -9,7 +9,7 @@ #include <stdio.h> #include <string.h> -#include "ethtool-util.h" +#include "internal.h" #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -1,6 +1,6 @@ #include <stdio.h> #include <string.h> -#include "ethtool-util.h" +#include "internal.h" int smsc911x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs) { @@ -12,7 +12,7 @@ #include <stdio.h> #include <string.h> -#include "ethtool-util.h" +#include "internal.h" int st_mac100_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs) @@ -1,6 +1,6 @@ #include <stdio.h> #include <string.h> -#include "ethtool-util.h" +#include "internal.h" #define TG3_MAGIC 0x669955aa @@ -2,7 +2,7 @@ #include <stdio.h> #include <stdlib.h> -#include "ethtool-util.h" +#include "internal.h" struct regs_line { u32 addr; |