|
发表于 2014-1-20 16:08:06
|
显示全部楼层
本帖最后由 ywzjackal 于 2014-1-22 09:50 编辑
可以确定是驱动问题,allwiner只移植了最简单的驱动程序。不能组播是因为他屏蔽了设置rx模式的代码,详细的如下:
不知道如果移出了#IF 0后重新编译内核是否会解决问题。
static const struct net_device_ops sunxi_emac_netdev_ops = {
.ndo_open = sunxi_emac_open,
.ndo_stop = sunxi_emac_stop,
.ndo_start_xmit = sunxi_emac_start_xmit,
.ndo_tx_timeout = sunxi_emac_timeout,
.ndo_set_rx_mode = sunxi_emac_hash_table,
.ndo_do_ioctl = sunxi_emac_ioctl,
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = sunxi_emac_set_mac_address,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = sunxi_emac_poll_controller,
#endif
};
/////
/*
* Set SUNXI_EMAC multicast address
*/
static void
sunxi_emac_hash_table(struct net_device *dev)
{
#if 0
sunxi_emac_board_info_t *db = netdev_priv(dev);
struct dev_mc_list *mcptr = dev->mc_list;
int mc_cnt = dev->mc_count;
int i, oft;
u32 hash_val;
u16 hash_table[4];
u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
unsigned long flags;
sunxi_emac_dbg(db, 1, "entering %s\n", __func__);
spin_lock_irqsave(&db->lock, flags);
for (i = 0, oft = SUNXI_EMAC_PAR; i < 6; i++, oft++)
iow(db, oft, dev->dev_addr);
/* Clear Hash Table */
for (i = 0; i < 4; i++)
hash_table = 0x0;
/* broadcast address */
hash_table[3] = 0x8000;
if (dev->flags & IFF_PROMISC)
rcr |= RCR_PRMSC;
if (dev->flags & IFF_ALLMULTI)
rcr |= RCR_ALL;
/* the multicast address in Hash Table : 64 bits */
for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) {
hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f;
hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
}
/* Write the hash table to MAC MD table */
for (i = 0, oft = SUNXI_EMAC_MAR; i < 4; i++) {
iow(db, oft++, hash_table);
iow(db, oft++, hash_table >> 8);
}
iow(db, SUNXI_EMAC_RCR, rcr);
spin_unlock_irqrestore(&db->lock, flags);
#endif
}
|
|