/* spider_net_get_multicast_hash calculates a hash value for a given multicast address, that is used to set the multicast filter tables  */
static u8 spider_net_get_multicast_hash(struct net_device *netdev, __u8 *addr)
/* spider_net_get_multicast_hash calculates a hash value for a given multicast address, that is used to set the multicast filter tables  */
static u8 spider_net_get_multicast_hash(struct net_device *netdev, __u8 *addr)
{
	u32 crc;
	u8 hash;
	char addr_for_crc[ETH_ALEN] = { 0, };
	int i, bit;
	for (i = 0; i < ETH_ALEN * 8; i++) {
		bit = (addr[i / 8] >> (i % 8)) & 1;
		addr_for_crc[ETH_ALEN - 1 - i / 8] += bit << (7 - (i % 8));
	}
	crc = crc32_be(~0, addr_for_crc, netdev->addr_len);
	hash = (crc >> 27);
	hash <<= 3;
	hash |= crc & 7;
	hash &= 0xff;
	return hash;
}