Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298484
b: refs/heads/master
c: 3f8c91a
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Mohr authored and David S. Miller committed Apr 2, 2012
1 parent a829968 commit b046516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 72331bc0cd072c3f4b670cd1256e47681fc53b80
refs/heads/master: 3f8c91a7398b9266fbe7abcbe4bd5dffef907643
12 changes: 7 additions & 5 deletions trunk/drivers/net/ethernet/via/via-rhine.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,30 +503,32 @@ static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid);
static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
static void rhine_restart_tx(struct net_device *dev);

static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool high)
static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low)
{
void __iomem *ioaddr = rp->base;
int i;

for (i = 0; i < 1024; i++) {
if (high ^ !!(ioread8(ioaddr + reg) & mask))
bool has_mask_bits = !!(ioread8(ioaddr + reg) & mask);

if (low ^ has_mask_bits)
break;
udelay(10);
}
if (i > 64) {
netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle "
"count: %04d\n", high ? "high" : "low", reg, mask, i);
"count: %04d\n", low ? "low" : "high", reg, mask, i);
}
}

static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask)
{
rhine_wait_bit(rp, reg, mask, true);
rhine_wait_bit(rp, reg, mask, false);
}

static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask)
{
rhine_wait_bit(rp, reg, mask, false);
rhine_wait_bit(rp, reg, mask, true);
}

static u32 rhine_get_events(struct rhine_private *rp)
Expand Down

0 comments on commit b046516

Please sign in to comment.