Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1d44477 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: convert multiple drivers to use netdev_for_each_mc_addr

parent d7b855c2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -320,7 +320,6 @@ static int cpmac_config(struct net_device *dev, struct ifmap *map)
static void cpmac_set_multicast_list(struct net_device *dev)
{
	struct dev_mc_list *iter;
	int i;
	u8 tmp;
	u32 mbp, bit, hash[2] = { 0, };
	struct cpmac_priv *priv = netdev_priv(dev);
@@ -340,8 +339,7 @@ static void cpmac_set_multicast_list(struct net_device *dev)
			 * cpmac uses some strange mac address hashing
			 * (not crc32)
			 */
			for (i = 0, iter = dev->mc_list; i < netdev_mc_count(dev);
			     i++, iter = iter->next) {
			netdev_for_each_mc_addr(iter, dev) {
				bit = 0;
				tmp = iter->dmi_addr[0];
				bit  ^= (tmp >> 2) ^ (tmp << 4);
+2 −4
Original line number Diff line number Diff line
@@ -1596,13 +1596,12 @@ set_multicast_list(struct net_device *dev)
	} else {
		/* MC mode, receive normal and MC packets */
		char hash_ix;
		struct dev_mc_list *dmi = dev->mc_list;
		int i;
		struct dev_mc_list *dmi;
		char *baddr;

		lo_bits = 0x00000000ul;
		hi_bits = 0x00000000ul;
		for (i = 0; i < num_addr; i++) {
		netdev_for_each_mc_addr(dmi, dev) {
			/* Calculate the hash index for the GA registers */

			hash_ix = 0;
@@ -1632,7 +1631,6 @@ set_multicast_list(struct net_device *dev)
			} else {
				lo_bits |= (1 << hash_ix);
			}
			dmi = dmi->next;
		}
		/* Disable individual receive */
		SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, individual, discard);
+1 −1
Original line number Diff line number Diff line
@@ -1785,7 +1785,7 @@ static void set_multicast_list(struct net_device *dev)
	{
		lp->rx_mode = RX_ALL_ACCEPT;
	}
	else if((dev->flags&IFF_ALLMULTI)||dev->mc_list)
	else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev))
	{
		/* The multicast-accept list is initialized to accept-all, and we
		   rely on higher-level filtering for now. */
+2 −4
Original line number Diff line number Diff line
@@ -940,9 +940,8 @@ static void lance_load_multicast(struct net_device *dev)
{
	struct lance_private *lp = netdev_priv(dev);
	volatile u16 *ib = (volatile u16 *)dev->mem_start;
	struct dev_mc_list *dmi = dev->mc_list;
	struct dev_mc_list *dmi;
	char *addrs;
	int i;
	u32 crc;

	/* set all multicast bits */
@@ -960,9 +959,8 @@ static void lance_load_multicast(struct net_device *dev)
	*lib_ptr(ib, filter[3], lp->type) = 0;

	/* Add addresses */
	for (i = 0; i < netdev_mc_count(dev); i++) {
	netdev_for_each_mc_addr(dmi, dev) {
		addrs = dmi->dmi_addr;
		dmi = dmi->next;

		/* multicast address? */
		if (!(*addrs & 1))
+5 −6
Original line number Diff line number Diff line
@@ -2240,12 +2240,11 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)

		/* Copy addresses to multicast address table, then update adapter CAM */

		dmi = dev->mc_list;				/* point to first multicast addr */
		for (i=0; i < bp->mc_count; i++)
			{
			memcpy(&bp->mc_table[i*FDDI_K_ALEN], dmi->dmi_addr, FDDI_K_ALEN);
			dmi = dmi->next;			/* point to next multicast addr */
			}
		i = 0;
		netdev_for_each_mc_addr(dmi, dev)
			memcpy(&bp->mc_table[i++ * FDDI_K_ALEN],
			       dmi->dmi_addr, FDDI_K_ALEN);

		if (dfx_ctl_update_cam(bp) != DFX_K_SUCCESS)
			{
			DBG_printk("%s: Could not update multicast address table!\n", dev->name);
Loading