korina.c (7a1a0cbfeb31f20acc10722642198e76bbc30cb9) | korina.c (e998fd413e5e7dac750dfe79c79cbf8f417d41b7) |
---|---|
1/* 2 * Driver for the IDT RC32434 (Korina) on-chip ethernet controller. 3 * 4 * Copyright 2004 IDT Inc. (rischelp@idt.com) 5 * Copyright 2006 Felix Fietkau <nbd@openwrt.org> 6 * Copyright 2008 Florian Fainelli <florian@openwrt.org> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 481 unchanged lines hidden (view full) --- 490 recognise |= ETH_ARC_PRO; 491 492 else if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 4)) 493 /* All multicast and broadcast */ 494 recognise |= ETH_ARC_AM; 495 496 /* Build the hash table */ 497 if (netdev_mc_count(dev) > 4) { | 1/* 2 * Driver for the IDT RC32434 (Korina) on-chip ethernet controller. 3 * 4 * Copyright 2004 IDT Inc. (rischelp@idt.com) 5 * Copyright 2006 Felix Fietkau <nbd@openwrt.org> 6 * Copyright 2008 Florian Fainelli <florian@openwrt.org> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 481 unchanged lines hidden (view full) --- 490 recognise |= ETH_ARC_PRO; 491 492 else if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 4)) 493 /* All multicast and broadcast */ 494 recognise |= ETH_ARC_AM; 495 496 /* Build the hash table */ 497 if (netdev_mc_count(dev) > 4) { |
498 u16 hash_table[4]; | 498 u16 hash_table[4] = { 0 }; |
499 u32 crc; 500 | 499 u32 crc; 500 |
501 for (i = 0; i < 4; i++) 502 hash_table[i] = 0; 503 | |
504 netdev_for_each_mc_addr(ha, dev) { 505 crc = ether_crc_le(6, ha->addr); 506 crc >>= 26; 507 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf)); 508 } 509 /* Accept filtered multicast */ 510 recognise |= ETH_ARC_AFM; 511 --- 725 unchanged lines hidden --- | 501 netdev_for_each_mc_addr(ha, dev) { 502 crc = ether_crc_le(6, ha->addr); 503 crc >>= 26; 504 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf)); 505 } 506 /* Accept filtered multicast */ 507 recognise |= ETH_ARC_AFM; 508 --- 725 unchanged lines hidden --- |