mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
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>
This commit is contained in:
parent
cfeb1db6db
commit
5865d015cf
1 changed files with 31 additions and 20 deletions
|
@ -2347,25 +2347,12 @@ static int __orinoco_program_rids(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: return int? */
|
static int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
|
||||||
static void
|
struct dev_addr_list *mc_list,
|
||||||
__orinoco_set_multicast_list(struct net_device *dev)
|
int mc_count, int promisc)
|
||||||
{
|
{
|
||||||
struct orinoco_private *priv = netdev_priv(dev);
|
|
||||||
hermes_t *hw = &priv->hw;
|
hermes_t *hw = &priv->hw;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int promisc, mc_count;
|
|
||||||
|
|
||||||
/* The Hermes doesn't seem to have an allmulti mode, so we go
|
|
||||||
* into promiscuous mode and let the upper levels deal. */
|
|
||||||
if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
|
|
||||||
(dev->mc_count > MAX_MULTICAST(priv))) {
|
|
||||||
promisc = 1;
|
|
||||||
mc_count = 0;
|
|
||||||
} else {
|
|
||||||
promisc = 0;
|
|
||||||
mc_count = dev->mc_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (promisc != priv->promiscuous) {
|
if (promisc != priv->promiscuous) {
|
||||||
err = hermes_write_wordrec(hw, USER_BAP,
|
err = hermes_write_wordrec(hw, USER_BAP,
|
||||||
|
@ -2373,7 +2360,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
|
||||||
promisc);
|
promisc);
|
||||||
if (err) {
|
if (err) {
|
||||||
printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
|
printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
|
||||||
dev->name, err);
|
priv->ndev->name, err);
|
||||||
} else
|
} else
|
||||||
priv->promiscuous = promisc;
|
priv->promiscuous = promisc;
|
||||||
}
|
}
|
||||||
|
@ -2382,7 +2369,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
|
||||||
* group address if either we want to multicast, or if we were
|
* group address if either we want to multicast, or if we were
|
||||||
* multicasting and want to stop */
|
* multicasting and want to stop */
|
||||||
if (!promisc && (mc_count || priv->mc_count)) {
|
if (!promisc && (mc_count || priv->mc_count)) {
|
||||||
struct dev_mc_list *p = dev->mc_list;
|
struct dev_mc_list *p = mc_list;
|
||||||
struct hermes_multicast mclist;
|
struct hermes_multicast mclist;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2398,7 +2385,7 @@ __orinoco_set_multicast_list(struct net_device *dev)
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
printk(KERN_WARNING "%s: Multicast list is "
|
printk(KERN_WARNING "%s: Multicast list is "
|
||||||
"longer than mc_count\n", dev->name);
|
"longer than mc_count\n", priv->ndev->name);
|
||||||
|
|
||||||
err = hermes_write_ltv(hw, USER_BAP,
|
err = hermes_write_ltv(hw, USER_BAP,
|
||||||
HERMES_RID_CNFGROUPADDRESSES,
|
HERMES_RID_CNFGROUPADDRESSES,
|
||||||
|
@ -2406,10 +2393,34 @@ __orinoco_set_multicast_list(struct net_device *dev)
|
||||||
&mclist);
|
&mclist);
|
||||||
if (err)
|
if (err)
|
||||||
printk(KERN_ERR "%s: Error %d setting multicast list.\n",
|
printk(KERN_ERR "%s: Error %d setting multicast list.\n",
|
||||||
dev->name, err);
|
priv->ndev->name, err);
|
||||||
else
|
else
|
||||||
priv->mc_count = mc_count;
|
priv->mc_count = mc_count;
|
||||||
}
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: return int? */
|
||||||
|
static void
|
||||||
|
__orinoco_set_multicast_list(struct net_device *dev)
|
||||||
|
{
|
||||||
|
struct orinoco_private *priv = netdev_priv(dev);
|
||||||
|
int err = 0;
|
||||||
|
int promisc, mc_count;
|
||||||
|
|
||||||
|
/* The Hermes doesn't seem to have an allmulti mode, so we go
|
||||||
|
* into promiscuous mode and let the upper levels deal. */
|
||||||
|
if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
|
||||||
|
(dev->mc_count > MAX_MULTICAST(priv))) {
|
||||||
|
promisc = 1;
|
||||||
|
mc_count = 0;
|
||||||
|
} else {
|
||||||
|
promisc = 0;
|
||||||
|
mc_count = dev->mc_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count,
|
||||||
|
promisc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This must be called from user context, without locks held - use
|
/* This must be called from user context, without locks held - use
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue