diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-27 02:35:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-28 04:44:01 -0500 |
commit | 655ffee284dfcf9a24ac0343f3e5ee6db85b85c5 (patch) | |
tree | 83ac4727338e0565baae5bbe9ac8dfa57c69c545 /drivers/net/wireless/orinoco | |
parent | 9675478bbafed08848bf8d7e28400d5e46330b23 (diff) |
wireless: convert to use netdev_for_each_mc_addr
also added missed locking in rndis_wlan.c
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/main.c | 3 |
3 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 404830f47ab2..e6369242e49c 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -1028,7 +1028,7 @@ int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx) | |||
1028 | } | 1028 | } |
1029 | 1029 | ||
1030 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, | 1030 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, |
1031 | struct dev_addr_list *mc_list, | 1031 | struct net_device *dev, |
1032 | int mc_count, int promisc) | 1032 | int mc_count, int promisc) |
1033 | { | 1033 | { |
1034 | hermes_t *hw = &priv->hw; | 1034 | hermes_t *hw = &priv->hw; |
@@ -1049,24 +1049,16 @@ int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, | |||
1049 | * group address if either we want to multicast, or if we were | 1049 | * group address if either we want to multicast, or if we were |
1050 | * multicasting and want to stop */ | 1050 | * multicasting and want to stop */ |
1051 | if (!promisc && (mc_count || priv->mc_count)) { | 1051 | if (!promisc && (mc_count || priv->mc_count)) { |
1052 | struct dev_mc_list *p = mc_list; | 1052 | struct dev_mc_list *p; |
1053 | struct hermes_multicast mclist; | 1053 | struct hermes_multicast mclist; |
1054 | int i; | 1054 | int i = 0; |
1055 | 1055 | ||
1056 | for (i = 0; i < mc_count; i++) { | 1056 | netdev_for_each_mc_addr(p, dev) { |
1057 | /* paranoia: is list shorter than mc_count? */ | 1057 | if (i == mc_count) |
1058 | BUG_ON(!p); | 1058 | break; |
1059 | /* paranoia: bad address size in list? */ | 1059 | memcpy(mclist.addr[i++], p->dmi_addr, ETH_ALEN); |
1060 | BUG_ON(p->dmi_addrlen != ETH_ALEN); | ||
1061 | |||
1062 | memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN); | ||
1063 | p = p->next; | ||
1064 | } | 1060 | } |
1065 | 1061 | ||
1066 | if (p) | ||
1067 | printk(KERN_WARNING "%s: Multicast list is " | ||
1068 | "longer than mc_count\n", priv->ndev->name); | ||
1069 | |||
1070 | err = hermes_write_ltv(hw, USER_BAP, | 1062 | err = hermes_write_ltv(hw, USER_BAP, |
1071 | HERMES_RID_CNFGROUPADDRESSES, | 1063 | HERMES_RID_CNFGROUPADDRESSES, |
1072 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), | 1064 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), |
diff --git a/drivers/net/wireless/orinoco/hw.h b/drivers/net/wireless/orinoco/hw.h index e2f7fdc4d45a..9799a1d14a63 100644 --- a/drivers/net/wireless/orinoco/hw.h +++ b/drivers/net/wireless/orinoco/hw.h | |||
@@ -43,7 +43,7 @@ int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx, | |||
43 | u8 *tsc, size_t tsc_len); | 43 | u8 *tsc, size_t tsc_len); |
44 | int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx); | 44 | int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx); |
45 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, | 45 | int __orinoco_hw_set_multicast_list(struct orinoco_private *priv, |
46 | struct dev_addr_list *mc_list, | 46 | struct net_device *dev, |
47 | int mc_count, int promisc); | 47 | int mc_count, int promisc); |
48 | int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, | 48 | int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, |
49 | char buf[IW_ESSID_MAX_SIZE+1]); | 49 | char buf[IW_ESSID_MAX_SIZE+1]); |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index a9e9cea2d767..b42634c614b5 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -1676,8 +1676,7 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1676 | mc_count = netdev_mc_count(dev); | 1676 | mc_count = netdev_mc_count(dev); |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, | 1679 | err = __orinoco_hw_set_multicast_list(priv, dev, mc_count, promisc); |
1680 | promisc); | ||
1681 | 1680 | ||
1682 | return err; | 1681 | return err; |
1683 | } | 1682 | } |