Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242606
b: refs/heads/master
c: 3c0f3c6
h: refs/heads/master
v: v3
  • Loading branch information
Marc Zyngier authored and David S. Miller committed Mar 22, 2011
1 parent cba9bb2 commit 44d31d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27660515a21bf913e3208ded3f27abd0529fae0e
refs/heads/master: 3c0f3c605b2572c740f66ea39fe2d125399b20aa
17 changes: 10 additions & 7 deletions trunk/drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

struct smsc95xx_priv {
u32 mac_cr;
u32 hash_hi;
u32 hash_lo;
spinlock_t mac_cr_lock;
bool use_tx_csum;
bool use_rx_csum;
Expand Down Expand Up @@ -370,10 +372,11 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
{
struct usbnet *dev = netdev_priv(netdev);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
u32 hash_hi = 0;
u32 hash_lo = 0;
unsigned long flags;

pdata->hash_hi = 0;
pdata->hash_lo = 0;

spin_lock_irqsave(&pdata->mac_cr_lock, flags);

if (dev->net->flags & IFF_PROMISC) {
Expand All @@ -394,13 +397,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
u32 bitnum = smsc95xx_hash(ha->addr);
u32 mask = 0x01 << (bitnum & 0x1F);
if (bitnum & 0x20)
hash_hi |= mask;
pdata->hash_hi |= mask;
else
hash_lo |= mask;
pdata->hash_lo |= mask;
}

netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
hash_hi, hash_lo);
pdata->hash_hi, pdata->hash_lo);
} else {
netif_dbg(dev, drv, dev->net, "receive own packets only\n");
pdata->mac_cr &=
Expand All @@ -410,8 +413,8 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);

/* Initiate async writes, as we can't wait for completion here */
smsc95xx_write_reg_async(dev, HASHH, &hash_hi);
smsc95xx_write_reg_async(dev, HASHL, &hash_lo);
smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi);
smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo);
smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr);
}

Expand Down

0 comments on commit 44d31d3

Please sign in to comment.