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

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

wireless: convert to use netdev_for_each_mc_addr



also added missed locking in rndis_wlan.c

Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9675478b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -319,15 +319,18 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
{
	int i = nr_addrs;
	struct dev_mc_list *mc_list;
	int cnt;

	if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
		return nr_addrs;

	netif_addr_lock_bh(dev);
	for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) {
	cnt = netdev_mc_count(dev);
	netdev_for_each_mc_addr(mc_list, dev) {
		if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) {
			lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
				    mc_list->dmi_addr);
			cnt--;
			continue;
		}

@@ -337,9 +340,10 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
		lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
			    mc_list->dmi_addr);
		i++;
		cnt--;
	}
	netif_addr_unlock_bh(dev);
	if (mc_list)
	if (cnt)
		return -EOVERFLOW;

	return i;
+7 −15
Original line number Diff line number Diff line
@@ -1028,7 +1028,7 @@ int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx)
}

int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
				    struct dev_addr_list *mc_list,
				    struct net_device *dev,
				    int mc_count, int promisc)
{
	hermes_t *hw = &priv->hw;
@@ -1049,24 +1049,16 @@ int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
	 * group address if either we want to multicast, or if we were
	 * multicasting and want to stop */
	if (!promisc && (mc_count || priv->mc_count)) {
		struct dev_mc_list *p = mc_list;
		struct dev_mc_list *p;
		struct hermes_multicast mclist;
		int i;

		for (i = 0; i < mc_count; i++) {
			/* paranoia: is list shorter than mc_count? */
			BUG_ON(!p);
			/* paranoia: bad address size in list? */
			BUG_ON(p->dmi_addrlen != ETH_ALEN);
		int i = 0;

			memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
			p = p->next;
		netdev_for_each_mc_addr(p, dev) {
			if (i == mc_count)
				break;
			memcpy(mclist.addr[i++], p->dmi_addr, ETH_ALEN);
		}

		if (p)
			printk(KERN_WARNING "%s: Multicast list is "
			       "longer than mc_count\n", priv->ndev->name);

		err = hermes_write_ltv(hw, USER_BAP,
				   HERMES_RID_CNFGROUPADDRESSES,
				   HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN),
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx,
			      u8 *tsc, size_t tsc_len);
int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx);
int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
				    struct dev_addr_list *mc_list,
				    struct net_device *dev,
				    int mc_count, int promisc);
int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
			 char buf[IW_ESSID_MAX_SIZE+1]);
+1 −2
Original line number Diff line number Diff line
@@ -1676,8 +1676,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
		mc_count = netdev_mc_count(dev);
	}

	err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count,
					      promisc);
	err = __orinoco_hw_set_multicast_list(priv, dev, mc_count, promisc);

	return err;
}
+4 −4
Original line number Diff line number Diff line
@@ -1871,10 +1871,8 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,
/*===========================================================================*/
static void ray_update_multi_list(struct net_device *dev, int all)
{
	struct dev_mc_list *dmi, **dmip;
	int ccsindex;
	struct ccs __iomem *pccs;
	int i = 0;
	ray_dev_t *local = netdev_priv(dev);
	struct pcmcia_device *link = local->finder;
	void __iomem *p = local->sram + HOST_TO_ECF_BASE;
@@ -1895,9 +1893,11 @@ static void ray_update_multi_list(struct net_device *dev, int all)
		writeb(0xff, &pccs->var);
		local->num_multi = 0xff;
	} else {
		struct dev_mc_list *dmi;
		int i = 0;

		/* Copy the kernel's list of MC addresses to card */
		for (dmip = &dev->mc_list; (dmi = *dmip) != NULL;
		     dmip = &dmi->next) {
		netdev_for_each_mc_addr(dmi, dev) {
			memcpy_toio(p, dmi->dmi_addr, ETH_ALEN);
			dev_dbg(&link->dev,
			      "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n",
Loading