Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53486
b: refs/heads/master
c: 1b8227c
h: refs/heads/master
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed May 3, 2007
1 parent a853cd7 commit 2c9307c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 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: 27a005b883984ef3a3cf24e7ddd78eb78902f494
refs/heads/master: 1b8227c48e164655f02aa0eff55862af2d05da51
12 changes: 11 additions & 1 deletion trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,29 @@ static inline u32 bnx2_tx_avail(struct bnx2 *bp)
static u32
bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset)
{
u32 val;

spin_lock_bh(&bp->indirect_lock);
REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
return (REG_RD(bp, BNX2_PCICFG_REG_WINDOW));
val = REG_RD(bp, BNX2_PCICFG_REG_WINDOW);
spin_unlock_bh(&bp->indirect_lock);
return val;
}

static void
bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)
{
spin_lock_bh(&bp->indirect_lock);
REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
REG_WR(bp, BNX2_PCICFG_REG_WINDOW, val);
spin_unlock_bh(&bp->indirect_lock);
}

static void
bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val)
{
offset += cid_addr;
spin_lock_bh(&bp->indirect_lock);
if (CHIP_NUM(bp) == CHIP_NUM_5709) {
int i;

Expand All @@ -266,6 +274,7 @@ bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val)
REG_WR(bp, BNX2_CTX_DATA_ADR, offset);
REG_WR(bp, BNX2_CTX_DATA, val);
}
spin_unlock_bh(&bp->indirect_lock);
}

static int
Expand Down Expand Up @@ -6039,6 +6048,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->pdev = pdev;

spin_lock_init(&bp->phy_lock);
spin_lock_init(&bp->indirect_lock);
INIT_WORK(&bp->reset_task, bnx2_reset_task);

dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -6522,6 +6522,7 @@ struct bnx2 {

/* Used to synchronize phy accesses. */
spinlock_t phy_lock;
spinlock_t indirect_lock;

u32 phy_flags;
#define PHY_SERDES_FLAG 1
Expand Down

0 comments on commit 2c9307c

Please sign in to comment.