writeq(RMAC_ADDR_DATA1_MEM_MASK(0x0), &bar0->rmac_addr_data1_mem); 
static void s2io_set_multicast(struct net_device *dev){	int i, j, prev_cnt;	struct dev_mc_list *mclist;	nic_t *sp = dev->priv;	XENA_dev_config_t __iomem *bar0 = sp->bar0;	u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =	    0xfeffffffffffULL;	u64 dis_addr = 0xffffffffffffULL, mac_addr = 0;	void __iomem *add;	if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {		/*  Enable all Multicast addresses */		writeq(RMAC_ADDR_DATA0_MEM_ADDR(multi_mac),		       &bar0->rmac_addr_data0_mem);		writeq(RMAC_ADDR_DATA1_MEM_MASK(mask),		       &bar0->rmac_addr_data1_mem);		val64 = RMAC_ADDR_CMD_MEM_WE |		    RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |		    RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);		writeq(val64, &bar0->rmac_addr_cmd_mem);		/* Wait till command completes */		wait_for_cmd_complete(sp);		sp->m_cast_flg = 1;		sp->all_multi_pos = MAC_MC_ALL_MC_ADDR_OFFSET;	} else if ((dev->flags & IFF_ALLMULTI) && (sp->m_cast_flg)) {		/*  Disable all Multicast addresses */		writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),		       &bar0->rmac_addr_data0_mem);		val64 = RMAC_ADDR_CMD_MEM_WE |		    RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |		    RMAC_ADDR_CMD_MEM_OFFSET(sp->all_multi_pos);		writeq(val64, &bar0->rmac_addr_cmd_mem);		/* Wait till command completes */		wait_for_cmd_complete(sp);		sp->m_cast_flg = 0;		sp->all_multi_pos = 0;	}	if ((dev->flags & IFF_PROMISC) && (!sp->promisc_flg)) {		/*  Put the NIC into promiscuous mode */		add = &bar0->mac_cfg;		val64 = readq(&bar0->mac_cfg);		val64 |= MAC_CFG_RMAC_PROM_ENABLE;		writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key);		writel((u32) val64, add);		writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key);		writel((u32) (val64 >> 32), (add + 4));		val64 = readq(&bar0->mac_cfg);		sp->promisc_flg = 1;		DBG_PRINT(ERR_DBG, "%s: entered promiscuous mode\n",			  dev->name);	} else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) {		/*  Remove the NIC from promiscuous mode */		add = &bar0->mac_cfg;		val64 = readq(&bar0->mac_cfg);		val64 &= ~MAC_CFG_RMAC_PROM_ENABLE;		writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key);		writel((u32) val64, add);		writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key);		writel((u32) (val64 >> 32), (add + 4));		val64 = readq(&bar0->mac_cfg);		sp->promisc_flg = 0;		DBG_PRINT(ERR_DBG, "%s: left promiscuous mode\n",			  dev->name);	}	/*  Update individual M_CAST address list */	if ((!sp->m_cast_flg) && dev->mc_count) {		if (dev->mc_count >		    (MAX_ADDRS_SUPPORTED - MAC_MC_ADDR_START_OFFSET - 1)) {			DBG_PRINT(ERR_DBG, "%s: No more Rx filters ",				  dev->name);			DBG_PRINT(ERR_DBG, "can be added, please enable ");			DBG_PRINT(ERR_DBG, "ALL_MULTI instead\n");			return;		}		prev_cnt = sp->mc_addr_count;		sp->mc_addr_count = dev->mc_count;		/* Clear out the previous list of Mc in the H/W. */		for (i = 0; i < prev_cnt; i++) {			writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),			       &bar0->rmac_addr_data0_mem);			writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),				&bar0->rmac_addr_data1_mem);			val64 = RMAC_ADDR_CMD_MEM_WE |			    RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |			    RMAC_ADDR_CMD_MEM_OFFSET			    (MAC_MC_ADDR_START_OFFSET + i);			writeq(val64, &bar0->rmac_addr_cmd_mem);			/* Wait for command completes */			if (wait_for_cmd_complete(sp)) {				DBG_PRINT(ERR_DBG, "%s: Adding ",					  dev->name);				DBG_PRINT(ERR_DBG, "Multicasts failed\n");				return;			}		}		/* Create the new Rx filter list and update the same in H/W. */		for (i = 0, mclist = dev->mc_list; i < dev->mc_count;		     i++, mclist = mclist->next) {			memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,			       ETH_ALEN);			for (j = 0; j < ETH_ALEN; j++) {				mac_addr |= mclist->dmi_addr[j];				mac_addr <<= 8;			}			mac_addr >>= 8;			writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),			       &bar0->rmac_addr_data0_mem);			writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),				&bar0->rmac_addr_data1_mem);			val64 = RMAC_ADDR_CMD_MEM_WE |			    RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |			    RMAC_ADDR_CMD_MEM_OFFSET			    (i + MAC_MC_ADDR_START_OFFSET);			writeq(val64, &bar0->rmac_addr_cmd_mem);			/* Wait for command completes */			if (wait_for_cmd_complete(sp)) {				DBG_PRINT(ERR_DBG, "%s: Adding ",					  dev->name);				DBG_PRINT(ERR_DBG, "Multicasts failed\n");				return;			}		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5e25b9ddb6683fe225a2266b53d73c57381a0c18/s2io.c/clean/drivers/net/s2io.c