Date:2011-05-15 10:21:14 (12 years 10 months ago)
Author:kyak
Commit:82df0af0d91ae893b9b72226022d6491cc67ba02
Message:ks7010: support kernel > 2.6.35

Files: ks7010/src/ks_hostif.c (2 diffs)

Change Details

ks7010/src/ks_hostif.c
21832183
21842184        struct net_device *dev = priv->net_dev;
21852185    int mc_count;
2186#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
2187    struct netdev_hw_addr *ha;
2188#else
21862189    struct dev_mc_list *mclist;
2190#endif
21872191    char set_address[NIC_MAX_MCAST_LIST*ETH_ALEN];
21882192    unsigned long filter_type;
21892193    int i;
...... 
21992203        hostif_mib_set_request(priv, LOCAL_MULTICAST_FILTER, sizeof(filter_type),
22002204                       MIB_VALUE_TYPE_BOOL, &filter_type);
22012205    }
2202    else if ((dev->mc_count > NIC_MAX_MCAST_LIST) || (dev->flags & IFF_ALLMULTI)){
2206    else if ((netdev_mc_count(dev) > NIC_MAX_MCAST_LIST) || (dev->flags & IFF_ALLMULTI)){
22032207        filter_type = cpu_to_le32((uint32_t)MCAST_FILTER_MCASTALL);
22042208        hostif_mib_set_request(priv, LOCAL_MULTICAST_FILTER, sizeof(filter_type),
22052209                       MIB_VALUE_TYPE_BOOL, &filter_type);
22062210    }
22072211    else {
22082212        if (priv->sme_i.sme_flag & SME_MULTICAST){
2209            mc_count = dev->mc_count;
2213            mc_count = netdev_mc_count(dev);
2214#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
2215            netdev_for_each_mc_addr(ha, dev) {
2216                memcpy(&set_address[i*ETH_ALEN], ha->addr, ETH_ALEN);
2217            }
2218#else
22102219            for (i = 0, mclist = dev->mc_list; mclist && i < mc_count; i++, mclist = mclist->next)
22112220                memcpy(&set_address[i*ETH_ALEN], mclist->dmi_addr, ETH_ALEN);
2221#endif
22122222            priv->sme_i.sme_flag &= ~SME_MULTICAST;
22132223            hostif_mib_set_request(priv, LOCAL_MULTICAST_ADDRESS,
22142224                           (ETH_ALEN*mc_count), MIB_VALUE_TYPE_OSTRING, &set_address[0]);

Archive Download the corresponding diff file



interactive