Lines 950-969
static void set_multicast_list(struct nd
Link Here
|
950 |
packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS | |
950 |
packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS | |
951 |
NDIS_PACKET_TYPE_ALL_LOCAL; |
951 |
NDIS_PACKET_TYPE_ALL_LOCAL; |
952 |
} else if (net_dev->flags & IFF_ALLMULTI || |
952 |
} else if (net_dev->flags & IFF_ALLMULTI || |
953 |
net_dev->mc_count > wnd->multicast_size) { |
953 |
netdev_mc_count(net_dev) > wnd->multicast_size) { |
954 |
packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; |
954 |
packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; |
955 |
TRACE2("0x%08x", packet_filter); |
955 |
TRACE2("0x%08x", packet_filter); |
956 |
} else if (net_dev->mc_count > 0) { |
956 |
} else if (netdev_mc_count(net_dev) > 0) { |
957 |
int i, size; |
957 |
int i, size; |
958 |
char *buf; |
958 |
char *buf; |
|
|
959 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) |
960 |
struct netdev_hw_addr *ha; |
961 |
#else |
959 |
struct dev_mc_list *mclist; |
962 |
struct dev_mc_list *mclist; |
960 |
size = min(wnd->multicast_size, net_dev->mc_count); |
963 |
#endif |
961 |
TRACE2("%d, %d", wnd->multicast_size, net_dev->mc_count); |
964 |
size = min(wnd->multicast_size, netdev_mc_count(net_dev)); |
|
|
965 |
TRACE2("%d, %d", wnd->multicast_size, netdev_mc_count(net_dev)); |
962 |
buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); |
966 |
buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); |
963 |
if (!buf) { |
967 |
if (!buf) { |
964 |
WARNING("couldn't allocate memory"); |
968 |
WARNING("couldn't allocate memory"); |
965 |
EXIT2(return); |
969 |
EXIT2(return); |
966 |
} |
970 |
} |
|
|
971 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) |
972 |
i = 0; |
973 |
netdev_for_each_mc_addr(ha, net_dev) { |
974 |
if (i >= size) |
975 |
break; |
976 |
memcpy(buf + i * ETH_ALEN, ha->addr, ETH_ALEN); |
977 |
TRACE2(MACSTRSEP, MAC2STR(ha->addr)); |
978 |
i++; |
979 |
} |
980 |
#else |
967 |
mclist = net_dev->mc_list; |
981 |
mclist = net_dev->mc_list; |
968 |
for (i = 0; i < size && mclist; mclist = mclist->next) { |
982 |
for (i = 0; i < size && mclist; mclist = mclist->next) { |
969 |
if (mclist->dmi_addrlen != ETH_ALEN) |
983 |
if (mclist->dmi_addrlen != ETH_ALEN) |
Lines 972-977
static void set_multicast_list(struct nd
Link Here
|
972 |
TRACE2(MACSTRSEP, MAC2STR(mclist->dmi_addr)); |
986 |
TRACE2(MACSTRSEP, MAC2STR(mclist->dmi_addr)); |
973 |
i++; |
987 |
i++; |
974 |
} |
988 |
} |
|
|
989 |
#endif |
975 |
res = mp_set(wnd, OID_802_3_MULTICAST_LIST, buf, i * ETH_ALEN); |
990 |
res = mp_set(wnd, OID_802_3_MULTICAST_LIST, buf, i * ETH_ALEN); |
976 |
if (res == NDIS_STATUS_SUCCESS && i > 0) |
991 |
if (res == NDIS_STATUS_SUCCESS && i > 0) |
977 |
packet_filter |= NDIS_PACKET_TYPE_MULTICAST; |
992 |
packet_filter |= NDIS_PACKET_TYPE_MULTICAST; |