diff options
Diffstat (limited to 'drivers/staging/vt6656/tether.c')
-rw-r--r-- | drivers/staging/vt6656/tether.c | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/drivers/staging/vt6656/tether.c b/drivers/staging/vt6656/tether.c index 95286c4d5572..1db1e8419a9a 100644 --- a/drivers/staging/vt6656/tether.c +++ b/drivers/staging/vt6656/tether.c @@ -25,7 +25,6 @@ * Date: May 21, 1996 * * Functions: - * ETHbyGetHashIndexByCrc32 - Calculate multicast hash value by CRC32 * ETHbIsBufferCrc32Ok - Check CRC value of the buffer if Ok or not * * Revision History: @@ -37,52 +36,6 @@ #include "tcrc.h" #include "tether.h" -/*--------------------- Static Definitions -------------------------*/ - -/*--------------------- Static Classes ----------------------------*/ - -/*--------------------- Static Variables --------------------------*/ - -/*--------------------- Static Functions --------------------------*/ - -/*--------------------- Export Variables --------------------------*/ - - - -/* - * Description: Calculate multicast hash value by CRC32 - * - * Parameters: - * In: - * pbyMultiAddr - Multicast Address - * Out: - * none - * - * Return Value: Hash value - * - */ -BYTE ETHbyGetHashIndexByCrc32(PBYTE pbyMultiAddr) -{ - int ii; - BYTE byTmpHash; - BYTE byHash = 0; - - /* get the least 6-bits from CRC generator */ - byTmpHash = (BYTE)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN, - 0xFFFFFFFFL) & 0x3F); - /* reverse most bit to least bit */ - for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) { - byHash <<= 1; - if (byTmpHash & 0x01) - byHash |= 1; - byTmpHash >>= 1; - } - - /* adjust 6-bits to the right most */ - return byHash >> 2; -} - - /* * Description: Check CRC value of the buffer if Ok or not * @@ -96,12 +49,12 @@ BYTE ETHbyGetHashIndexByCrc32(PBYTE pbyMultiAddr) * Return Value: true if ok; false if error. * */ -bool ETHbIsBufferCrc32Ok(PBYTE pbyBuffer, unsigned int cbFrameLength) +bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength) { - DWORD dwCRC; + u32 dwCRC; dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4); - if (cpu_to_le32(*((PDWORD)(pbyBuffer + cbFrameLength - 4))) != dwCRC) + if (cpu_to_le32(*((u32 *)(pbyBuffer + cbFrameLength - 4))) != dwCRC) return false; return true; } |