kernels/linux-2.4.0/drivers/net/tokenring/tms380tr.c
/*
 * Set or clear the multicast filter for this adapter.
 */
Set or clear the multicast filter for this adapter.
Set or clear the multicast filter for this adapter .
static void tms380tr_set_multicast_list(struct net_device *dev)
{
	struct net_local *tp = (struct net_local *)dev->priv;
	unsigned int OpenOptions;
	OpenOptions = tp->ocpl.OPENOptions &
		~(PASS_ADAPTER_MAC_FRAMES
		  | PASS_ATTENTION_FRAMES
		  | PASS_BEACON_MAC_FRAMES
		  | COPY_ALL_MAC_FRAMES
		  | COPY_ALL_NON_MAC_FRAMES);
	tp->ocpl.FunctAddr = 0;
	if(dev->flags & IFF_PROMISC)
		OpenOptions |= COPY_ALL_NON_MAC_FRAMES |
			COPY_ALL_MAC_FRAMES;
	else
	{
		if(dev->flags & IFF_ALLMULTI)
		{
			tp->ocpl.FunctAddr = 0xFFFFFFFF;
		}
		else
		{
			int i;
			struct dev_mc_list *mclist = dev->mc_list;
			for (i=0; i< dev->mc_count; i++)
			{
				((char *)(&tp->ocpl.FunctAddr))[0] |=
					mclist->dmi_addr[2];
				((char *)(&tp->ocpl.FunctAddr))[1] |=
					mclist->dmi_addr[3];
				((char *)(&tp->ocpl.FunctAddr))[2] |=
					mclist->dmi_addr[4];
				((char *)(&tp->ocpl.FunctAddr))[3] |=
					mclist->dmi_addr[5];
				mclist = mclist->next;
			}
		}
		tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR);
	}
	tp->ocpl.OPENOptions = OpenOptions;
	tms380tr_exec_cmd(dev, OC_MODIFY_OPEN_PARMS);
	return;
}
static void tms380tr_set_multicast_list ( struct net_device * dev ) { struct net_local * tp = ( struct net_local * ) dev -> priv ; unsigned int OpenOptions ; OpenOptions = tp -> ocpl . OPENOptions & ~ ( PASS_ADAPTER_MAC_FRAMES | PASS_ATTENTION_FRAMES | PASS_BEACON_MAC_FRAMES | COPY_ALL_MAC_FRAMES | COPY_ALL_NON_MAC_FRAMES ) ; tp -> ocpl . FunctAddr = 0 ; if ( dev -> flags & IFF_PROMISC ) OpenOptions |= COPY_ALL_NON_MAC_FRAMES | COPY_ALL_MAC_FRAMES ; else { if ( dev -> flags & IFF_ALLMULTI ) { tp -> ocpl . FunctAddr = 0xFFFFFFFF ; } else { int i ; struct dev_mc_list * mclist = dev -> mc_list ; for ( i = 0 ; i < dev -> mc_count ; i ++ ) { ( ( char * ) ( & tp -> ocpl . FunctAddr ) ) [ 0 ] |= mclist -> dmi_addr [ 2 ] ; ( ( char * ) ( & tp -> ocpl . FunctAddr ) ) [ 1 ] |= mclist -> dmi_addr [ 3 ] ; ( ( char * ) ( & tp -> ocpl . FunctAddr ) ) [ 2 ] |= mclist -> dmi_addr [ 4 ] ; ( ( char * ) ( & tp -> ocpl . FunctAddr ) ) [ 3 ] |= mclist -> dmi_addr [ 5 ] ; mclist = mclist -> next ; } } tms380tr_exec_cmd ( dev , OC_SET_FUNCT_ADDR ) ; } tp -> ocpl . OPENOptions = OpenOptions ; tms380tr_exec_cmd ( dev , OC_MODIFY_OPEN_PARMS ) ; return ; }
Set or clear the multicast filter for this adapter.
Set or clear the multicast filter for this adapter .
/* Enable promiscuous mode */ /* Disable promiscuous mode, use normal mode. */