CRC endianess problem on DGE-510T
Subsystems (2)
Hello,
I'm having problems with the PCI network board D-LINK DGE-510T on SPARC32/LEON. The CRC calculated by ether_crc_le() does not match the CRC, however after swapping the result it matches. This is the same behaviour with the 3 boards I have. After applying the patch below everything works.
Does anyone know if this is a correct patch or has had similar problems on big endian machines?
Daniel
From: Daniel Hellstrom <[email protected]>
Date: Wed, 6 Apr 2011 15:01:44 +0200
[PATCH] dl2k: EEPROM CRC calculation wrong endianess on bigendian machine
---drivers/net/dl2k.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/dl2k.c +1 -1
@@ -346,7 +346,7 @@ parse_eeprom (struct net_device *dev)if (np->pdev->vendor ==PCI_VENDOR_ID_DLINK ) {/* D-Link Only */ /* Check CRC */ crc = ~ether_crc_le (256 -4 , sromdata); -if (psrom->crc != crc) { + if (psrom->crc != cpu_to_le32(crc)) {q printk (KERN_ERR "%s: EEPROM data CRC error.\n", dev->name);return -1 ;
--
1.5.4
Quoted 10 lines · Daniel Hellstrom
Hello,
I'm having problems with the PCI network board D-LINK DGE-510T on SPARC32/LEON. The CRC calculated by
ether_crc_le()does not match the CRC, however after swapping the result it matches. This is the same behaviour with the 3 boards I have. After applying the patch below everything works.Does anyone know if this is a correct patch or has had similar problems on big endian machines?
No idea about this hardware, but it looks reasonable - the contents of the EEPROM are treated as being in little-endian order, except when reading the CRC for comparison.
Quoted 19 lines
Daniel
From: Daniel Hellstrom <[email protected]>
Date: Wed, 6 Apr 2011 15:01:44 +0200
[PATCH] dl2k: EEPROM CRC calculation wrong endianess on bigendian machineSigned-off-by Daniel Hellstrom <[email protected]>--- drivers/net/dl2k.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/dl2k.c +0
-0
drivers/net/dl2k.c parse_eeprom (struct net_device *dev) · line 349
Quoted 5 lines
drivers/net/dl2k.c +1
-1@@ -346,7 +346,7 @@ parse_eeprom (struct net_device *dev)if (np->pdev->vendor ==PCI_VENDOR_ID_DLINK ) {/* D-Link Only */ /* Check CRC */ crc = ~ether_crc_le (256 -4 , sromdata); -if (psrom->crc != crc) { +if (psrom->crc !=cpu_to_le32 (crc)) {q
q?
Ben.
Quoted 9 lines
drivers/net/dl2k.c +0
-1printk (KERN_ERR "%s: EEPROM data CRC error.\n" , dev->name);return -1 ; --1.5.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Quoted 7 lines · Ben Hutchings
Quoted 4 lines · Daniel Hellstrom
Hello,
I'm having problems with the PCI network board D-LINK DGE-510T on SPARC32/LEON. The CRC calculated by
ether_crc_le()does not match the CRC, however after swapping the result it matches. This is the same behaviour with the 3 boards I have. After applying the patch below everything works.
Quoted 9 lines
Quoted 3 lines
Does anyone know if this is a correct patch or has had similar problems on big endian machines?
No idea about this hardware, but it looks reasonable - the contents of the EEPROM are treated as being in little-endian order, except when reading the CRC for comparison.
Ok, then I will submit my patch to the list.
The funny thing is that other vendors than DLINK doesn't check the CRC, they might have tested it on a big endian machine... but it might just be a coincidence.
Thanks,
Daniel
Quoted 49 lines
Quoted 21 lines
Daniel
From: Daniel Hellstrom <[email protected]>
Date: Wed, 6 Apr 2011 15:01:44 +0200
[PATCH] dl2k: EEPROM CRC calculation wrong endianess on bigendian machineSigned-off-by Daniel Hellstrom <[email protected]>---
drivers/net/dl2k.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/dl2k.c +0
-0drivers/net/dl2k.c parse_eeprom (struct net_device *dev) · line 351
Quoted 7 lines
drivers/net/dl2k.c +1
-1@@ -346,7 +346,7 @@ parse_eeprom (struct net_device *dev)if (np->pdev->vendor ==PCI_VENDOR_ID_DLINK ) {/* D-Link Only */ /* Check CRC */ crc = ~ether_crc_le (256 -4 , sromdata); -if (psrom->crc != crc) { +if (psrom->crc !=cpu_to_le32 (crc)) {qq?
Ben.
Quoted 11 lines
drivers/net/dl2k.c +0
-0printk (KERN_ERR "%s: EEPROM data CRC error.\n",dev->name); return -1;--
1.5.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html