Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134537
b: refs/heads/master
c: 46c6a67
h: refs/heads/master
i:
  134535: c77ec13
v: v3
  • Loading branch information
Eilon Greenstein authored and David S. Miller committed Feb 16, 2009
1 parent e8e296b commit d770c60
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 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: 589abe3a0f594a7707a15674ca9e80370c972832
refs/heads/master: 46c6a67495b3ec76204db800fc8d60a260f91cfe
1 change: 1 addition & 0 deletions trunk/drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ struct bnx2x_port {

/* used to synchronize phy accesses */
struct mutex phy_mutex;
int need_hw_lock;

u32 port_stx;

Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,22 +1816,16 @@ static int bnx2x_release_hw_lock(struct bnx2x *bp, u32 resource)
/* HW Lock for shared dual port PHYs */
static void bnx2x_acquire_phy_lock(struct bnx2x *bp)
{
u32 ext_phy_type = XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config);

mutex_lock(&bp->port.phy_mutex);

if ((ext_phy_type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072) ||
(ext_phy_type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073))
bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_8072_MDIO);
if (bp->port.need_hw_lock)
bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
}

static void bnx2x_release_phy_lock(struct bnx2x *bp)
{
u32 ext_phy_type = XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config);

if ((ext_phy_type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072) ||
(ext_phy_type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073))
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_8072_MDIO);
if (bp->port.need_hw_lock)
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);

mutex_unlock(&bp->port.phy_mutex);
}
Expand Down Expand Up @@ -5705,6 +5699,12 @@ static int bnx2x_init_common(struct bnx2x *bp)
}

switch (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config)) {
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072:
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073:
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726:
bp->port.need_hw_lock = 1;
break;

case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101:
/* Fan failure is indicated by SPIO 5 */
bnx2x_set_spio(bp, MISC_REGISTERS_SPIO_5,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bnx2x_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -5228,8 +5228,8 @@
#define MISC_REGISTERS_SPIO_OUTPUT_LOW 0
#define MISC_REGISTERS_SPIO_SET_POS 8
#define HW_LOCK_MAX_RESOURCE_VALUE 31
#define HW_LOCK_RESOURCE_8072_MDIO 0
#define HW_LOCK_RESOURCE_GPIO 1
#define HW_LOCK_RESOURCE_MDIO 0
#define HW_LOCK_RESOURCE_PORT0_ATT_MASK 3
#define HW_LOCK_RESOURCE_SPIO 2
#define HW_LOCK_RESOURCE_UNDI 5
Expand Down

0 comments on commit d770c60

Please sign in to comment.