aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-02-04 18:05:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:44:29 -0500
commit5865d015cf85c619a51f8be93d44ec932bc90038 (patch)
tree79a4f4dbc344dee0de2f376ae2ccf40b7872320b /drivers/net/wireless/orinoco
parentcfeb1db6db80435ccf1f9b18ea71bb233f7db20c (diff)
orinoco: Add hardware function to set multicast mode
No functional change. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r--drivers/net/wireless/orinoco/main.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index c5aad88e54d9..3e20df7b6570 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -2347,25 +2347,12 @@ static int __orinoco_program_rids(struct net_device *dev)
2347 return 0; 2347 return 0;
2348} 2348}
2349 2349
2350/* FIXME: return int? */ 2350static int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
2351static void 2351 struct dev_addr_list *mc_list,
2352__orinoco_set_multicast_list(struct net_device *dev) 2352 int mc_count, int promisc)
2353{ 2353{
2354 struct orinoco_private *priv = netdev_priv(dev);
2355 hermes_t *hw = &priv->hw; 2354 hermes_t *hw = &priv->hw;
2356 int err = 0; 2355 int err = 0;
2357 int promisc, mc_count;
2358
2359 /* The Hermes doesn't seem to have an allmulti mode, so we go
2360 * into promiscuous mode and let the upper levels deal. */
2361 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
2362 (dev->mc_count > MAX_MULTICAST(priv))) {
2363 promisc = 1;
2364 mc_count = 0;
2365 } else {
2366 promisc = 0;
2367 mc_count = dev->mc_count;
2368 }
2369 2356
2370 if (promisc != priv->promiscuous) { 2357 if (promisc != priv->promiscuous) {
2371 err = hermes_write_wordrec(hw, USER_BAP, 2358 err = hermes_write_wordrec(hw, USER_BAP,
@@ -2373,7 +2360,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
2373 promisc); 2360 promisc);
2374 if (err) { 2361 if (err) {
2375 printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n", 2362 printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
2376 dev->name, err); 2363 priv->ndev->name, err);
2377 } else 2364 } else
2378 priv->promiscuous = promisc; 2365 priv->promiscuous = promisc;
2379 } 2366 }
@@ -2382,7 +2369,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
2382 * group address if either we want to multicast, or if we were 2369 * group address if either we want to multicast, or if we were
2383 * multicasting and want to stop */ 2370 * multicasting and want to stop */
2384 if (!promisc && (mc_count || priv->mc_count)) { 2371 if (!promisc && (mc_count || priv->mc_count)) {
2385 struct dev_mc_list *p = dev->mc_list; 2372 struct dev_mc_list *p = mc_list;
2386 struct hermes_multicast mclist; 2373 struct hermes_multicast mclist;
2387 int i; 2374 int i;
2388 2375
@@ -2398,7 +2385,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
2398 2385
2399 if (p) 2386 if (p)
2400 printk(KERN_WARNING "%s: Multicast list is " 2387 printk(KERN_WARNING "%s: Multicast list is "
2401 "longer than mc_count\n", dev->name); 2388 "longer than mc_count\n", priv->ndev->name);
2402 2389
2403 err = hermes_write_ltv(hw, USER_BAP, 2390 err = hermes_write_ltv(hw, USER_BAP,
2404 HERMES_RID_CNFGROUPADDRESSES, 2391 HERMES_RID_CNFGROUPADDRESSES,
@@ -2406,10 +2393,34 @@ __orinoco_set_multicast_list(struct net_device *dev)
2406 &mclist); 2393 &mclist);
2407 if (err) 2394 if (err)
2408 printk(KERN_ERR "%s: Error %d setting multicast list.\n", 2395 printk(KERN_ERR "%s: Error %d setting multicast list.\n",
2409 dev->name, err); 2396 priv->ndev->name, err);
2410 else 2397 else
2411 priv->mc_count = mc_count; 2398 priv->mc_count = mc_count;
2412 } 2399 }
2400 return err;
2401}
2402
2403/* FIXME: return int? */
2404static void
2405__orinoco_set_multicast_list(struct net_device *dev)
2406{
2407 struct orinoco_private *priv = netdev_priv(dev);
2408 int err = 0;
2409 int promisc, mc_count;
2410
2411 /* The Hermes doesn't seem to have an allmulti mode, so we go
2412 * into promiscuous mode and let the upper levels deal. */
2413 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
2414 (dev->mc_count > MAX_MULTICAST(priv))) {
2415 promisc = 1;
2416 mc_count = 0;
2417 } else {
2418 promisc = 0;
2419 mc_count = dev->mc_count;
2420 }
2421
2422 err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count,
2423 promisc);
2413} 2424}
2414 2425
2415/* This must be called from user context, without locks held - use 2426/* This must be called from user context, without locks held - use