|
@@ -84,10 +84,11 @@ static void dwmac1000_get_umac_addr(void __iomem *ioaddr, unsigned char *addr,
|
|
|
GMAC_ADDR_LOW(reg_n));
|
|
|
}
|
|
|
|
|
|
-static void dwmac1000_set_filter(struct net_device *dev)
|
|
|
+static void dwmac1000_set_filter(struct net_device *dev, int id)
|
|
|
{
|
|
|
void __iomem *ioaddr = (void __iomem *) dev->base_addr;
|
|
|
unsigned int value = 0;
|
|
|
+ unsigned int perfect_addr_number;
|
|
|
|
|
|
CHIP_DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n",
|
|
|
__func__, netdev_mc_count(dev), netdev_uc_count(dev));
|
|
@@ -121,8 +122,14 @@ static void dwmac1000_set_filter(struct net_device *dev)
|
|
|
writel(mc_filter[1], ioaddr + GMAC_HASH_HIGH);
|
|
|
}
|
|
|
|
|
|
+ /* Extra 16 regs are available in cores newer than the 3.40. */
|
|
|
+ if (id > DWMAC_CORE_3_40)
|
|
|
+ perfect_addr_number = GMAC_MAX_PERFECT_ADDRESSES;
|
|
|
+ else
|
|
|
+ perfect_addr_number = GMAC_MAX_PERFECT_ADDRESSES / 2;
|
|
|
+
|
|
|
/* Handle multiple unicast addresses (perfect filtering)*/
|
|
|
- if (netdev_uc_count(dev) > GMAC_MAX_UNICAST_ADDRESSES)
|
|
|
+ if (netdev_uc_count(dev) > perfect_addr_number)
|
|
|
/* Switch to promiscuous mode is more than 16 addrs
|
|
|
are required */
|
|
|
value |= GMAC_FRAME_FILTER_PR;
|