I figured out that it can be fixed by flushing receive in probe()
function in adapter.c right before set mac address:
if (XEmacLite_Initialize(&lp->EmacLite, cfg->DeviceId) !=
XST_SUCCESS) {
printk(KERN_ERR "%s: Could not initialize device.\n",
dev->name);
remove_head_dev();
return -ENODEV;
}
-> /* Flush Recieve */
-> XEmacLite_FlushReceive(&lp->EmacLite);
-> /* Copy MAC address in from descriptor table */
-> memcpy(dev->dev_addr, ether_table[index].macaddr,6);
->
/* Copy MAC address in from descriptor table */
XEmacLite_SetMacAddress(&lp->EmacLite,
ether_table[index].macaddr);
Memcopy I have also added fixes wrong ifconfig output which otherwise
shows interface HW address to be all zeroes.