diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2018-07-17 18:05:39 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-07-27 13:16:37 +0200 |
commit | 5d258b48efbd0e28d9d0b5dc31de21050608e351 (patch) | |
tree | 3a1db84a2396477b7e07c0c598b0edeafd56e3a4 /drivers/net/ethernet/freescale | |
parent | crypto: stm32_crc32 - Use existing define with polynomial (diff) | |
download | linux-5d258b48efbd0e28d9d0b5dc31de21050608e351.tar.xz linux-5d258b48efbd0e28d9d0b5dc31de21050608e351.zip |
net: ethernet: Use existing define with polynomial
Do not define again the polynomial but use header with existing define.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fs_enet/fec.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c729665107f5..a7cb378ef881 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -48,6 +48,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/clk.h> +#include <linux/crc32poly.h> #include <linux/platform_device.h> #include <linux/mdio.h> #include <linux/phy.h> @@ -2949,7 +2950,6 @@ fec_enet_close(struct net_device *ndev) */ #define FEC_HASH_BITS 6 /* #bits in hash */ -#define CRC32_POLY 0xEDB88320 static void set_multicast_list(struct net_device *ndev) { @@ -2989,7 +2989,7 @@ static void set_multicast_list(struct net_device *ndev) data = ha->addr[i]; for (bit = 0; bit < 8; bit++, data >>= 1) { crc = (crc >> 1) ^ - (((crc ^ data) & 1) ? CRC32_POLY : 0); + (((crc ^ data) & 1) ? CRC32_POLY_LE : 0); } } diff --git a/drivers/net/ethernet/freescale/fs_enet/fec.h b/drivers/net/ethernet/freescale/fs_enet/fec.h index 7832db71dcb9..1dbee5d898b3 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fec.h +++ b/drivers/net/ethernet/freescale/fs_enet/fec.h @@ -2,9 +2,6 @@ #ifndef FS_ENET_FEC_H #define FS_ENET_FEC_H -/* CRC polynomium used by the FEC for the multicast group filtering */ -#define FEC_CRC_POLY 0x04C11DB7 - #define FEC_MAX_MULTICAST_ADDRS 64 /* Interrupt events/masks. diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c index 1fc27c97e3b2..05093e5fc9dd 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c +++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c @@ -18,6 +18,7 @@ #include <linux/string.h> #include <linux/ptrace.h> #include <linux/errno.h> +#include <linux/crc32poly.h> #include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/delay.h> @@ -187,7 +188,7 @@ static void set_multicast_one(struct net_device *dev, const u8 *mac) msb = crc >> 31; crc <<= 1; if (msb ^ (byte & 0x1)) - crc ^= FEC_CRC_POLY; + crc ^= CRC32_POLY_BE; byte >>= 1; } } |