ll_temac: Add support for V2 LLTEMAC core
[pandora-kernel.git] / drivers / net / ll_temac_main.c
index a8522bd..d7eb24c 100644 (file)
@@ -232,7 +232,7 @@ static void temac_set_multicast_list(struct net_device *ndev)
 
        mutex_lock(&lp->indirect_mutex);
        if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) ||
-           ndev->mc_count > MULTICAST_CAM_TABLE_NUM) {
+           netdev_mc_count(ndev) > MULTICAST_CAM_TABLE_NUM) {
                /*
                 *      We must make the kernel realise we had to move
                 *      into promisc mode or we start all out war on
@@ -242,9 +242,9 @@ static void temac_set_multicast_list(struct net_device *ndev)
                ndev->flags |= IFF_PROMISC;
                temac_indirect_out32(lp, XTE_AFM_OFFSET, XTE_AFM_EPPRM_MASK);
                dev_info(&ndev->dev, "Promiscuous mode enabled.\n");
-       } else if (ndev->mc_count) {
+       } else if (!netdev_mc_empty(ndev)) {
                struct dev_mc_list *mclist = ndev->mc_list;
-               for (i = 0; mclist && i < ndev->mc_count; i++) {
+               for (i = 0; mclist && i < netdev_mc_count(ndev); i++) {
 
                        if (i >= MULTICAST_CAM_TABLE_NUM)
                                break;
@@ -615,7 +615,7 @@ static void ll_temac_recv(struct net_device *ndev)
        while ((bdstat & STS_CTRL_APP0_CMPLT)) {
 
                skb = lp->rx_skb[lp->rx_bd_ci];
-               length = cur_p->app4;
+               length = cur_p->app4 & 0x3FFF;
 
                skb_vaddr = virt_to_bus(skb->data);
                dma_unmap_single(ndev->dev.parent, skb_vaddr, length,
@@ -938,6 +938,9 @@ static int __devexit temac_of_remove(struct of_device *op)
 
 static struct of_device_id temac_of_match[] __devinitdata = {
        { .compatible = "xlnx,xps-ll-temac-1.01.b", },
+       { .compatible = "xlnx,xps-ll-temac-2.00.a", },
+       { .compatible = "xlnx,xps-ll-temac-2.02.a", },
+       { .compatible = "xlnx,xps-ll-temac-2.03.a", },
        {},
 };
 MODULE_DEVICE_TABLE(of, temac_of_match);