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

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

net: use netdev_mc_count and netdev_mc_empty when appropriate



This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
anything). Used spatch and did small tweaks and conding style changes when
it was suitable.

Jirka

Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8e557421
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ static void iss_net_set_multicast_list(struct net_device *dev)
#if 0
	if (dev->flags & IFF_PROMISC)
		return;
	else if (dev->mc_count)
	else if (!netdev_mc_empty(dev))
		dev->flags |= IFF_ALLMULTI;
	else
		dev->flags &= ~IFF_ALLMULTI;
+1 −1
Original line number Diff line number Diff line
@@ -862,7 +862,7 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
	}

	nes_debug(NES_DBG_NIC_RX, "Number of MC entries = %d, Promiscous = %d, All Multicast = %d.\n",
		  netdev->mc_count, !!(netdev->flags & IFF_PROMISC),
		  netdev_mc_count(netdev), !!(netdev->flags & IFF_PROMISC),
		  !!(netdev->flags & IFF_ALLMULTI));
	if (!mc_all_on) {
		multicast_addr = netdev->mc_list;
+3 −4
Original line number Diff line number Diff line
@@ -1138,18 +1138,18 @@ static void wq_set_multicast_list (struct work_struct *work)
	} else if ((dev->flags & IFF_ALLMULTI)) {
		dprintk("%s: allmulti mode\n", dev->name);
		priv->rx_mode = RX_MODE_ALL_MULTI;
	} else if (dev->mc_count) {
	} else if (!netdev_mc_empty(dev)) {
		int mci;
		struct dev_mc_list *mc;

		dprintk("%s: set_mc_list, %d entries\n",
			dev->name, dev->mc_count);
			dev->name, netdev_mc_count(dev));

		priv->rx_mode = RX_MODE_MULTI;
		priv->multi_num = 0;

		for (mci = 0, mc=dev->mc_list;
		     mci < dev->mc_count;
		     mci < netdev_mc_count(dev);
		     mc = mc->next, mci++) {
			dvb_set_mc_filter(dev, mc);
		}
@@ -1236,7 +1236,6 @@ static void dvb_net_setup(struct net_device *dev)
	dev->header_ops		= &dvb_header_ops;
	dev->netdev_ops		= &dvb_netdev_ops;
	dev->mtu		= 4096;
	dev->mc_count           = 0;

	dev->flags |= IFF_NOARP;
}
+3 −3
Original line number Diff line number Diff line
@@ -1229,8 +1229,8 @@ static void elp_set_mc_list(struct net_device *dev)
		/* send a "load multicast list" command to the board, max 10 addrs/cmd */
		/* if num_addrs==0 the list will be cleared */
		adapter->tx_pcb.command = CMD_LOAD_MULTICAST_LIST;
		adapter->tx_pcb.length = 6 * dev->mc_count;
		for (i = 0; i < dev->mc_count; i++) {
		adapter->tx_pcb.length = 6 * netdev_mc_count(dev);
		for (i = 0; i < netdev_mc_count(dev); i++) {
			memcpy(adapter->tx_pcb.data.multicast[i], dmi->dmi_addr, 6);
			dmi = dmi->next;
		}
@@ -1244,7 +1244,7 @@ static void elp_set_mc_list(struct net_device *dev)
				TIMEOUT_MSG(__LINE__);
			}
		}
		if (dev->mc_count)
		if (!netdev_mc_empty(dev))
			adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD | RECV_MULTI;
		else		/* num_addrs == 0 */
			adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD;
+6 −4
Original line number Diff line number Diff line
@@ -1111,12 +1111,14 @@ set_multicast_list(struct net_device *dev)
	unsigned long flags;
	struct el3_private *lp = netdev_priv(dev);
	int ioaddr = dev->base_addr;
	int mc_count = netdev_mc_count(dev);

	if (el3_debug > 1) {
		static int old;
		if (old != dev->mc_count) {
			old = dev->mc_count;
			pr_debug("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count);
		if (old != mc_count) {
			old = mc_count;
			pr_debug("%s: Setting Rx mode to %d addresses.\n",
				 dev->name, mc_count);
		}
	}
	spin_lock_irqsave(&lp->lock, flags);
@@ -1124,7 +1126,7 @@ set_multicast_list(struct net_device *dev)
		outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
			 ioaddr + EL3_CMD);
	}
	else if (dev->mc_count || (dev->flags&IFF_ALLMULTI)) {
	else if (mc_count || (dev->flags&IFF_ALLMULTI)) {
		outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast, ioaddr + EL3_CMD);
	}
	else
Loading