Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327844
b: refs/heads/master
c: 08e9acc
h: refs/heads/master
v: v3
  • Loading branch information
Yuval Mintz authored and David S. Miller committed Sep 10, 2012
1 parent f15968d commit aec0dce
Show file tree
Hide file tree
Showing 4 changed files with 37 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: fdd6681d92a70b3db73cdb61c6b4053f2f8003b3
refs/heads/master: 08e9acc25a60e845101840ce6db368dc6d77c3c1
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ static int bnx2x_get_eee(struct net_device *dev, struct ethtool_eee *edata)
return -EOPNOTSUPP;
}

eee_cfg = SHMEM2_RD(bp, eee_status[BP_PORT(bp)]);
eee_cfg = bp->link_vars.eee_status;

edata->supported =
bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_SUPPORTED_MASK) >>
Expand Down Expand Up @@ -1684,7 +1684,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)
return -EOPNOTSUPP;
}

eee_cfg = SHMEM2_RD(bp, eee_status[BP_PORT(bp)]);
eee_cfg = bp->link_vars.eee_status;

if (!(eee_cfg & SHMEM_EEE_SUPPORTED_MASK)) {
DP(BNX2X_MSG_ETHTOOL, "Board does not support EEE!\n");
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -4716,6 +4716,10 @@ void bnx2x_link_status_update(struct link_params *params,
vars->link_status = REG_RD(bp, params->shmem_base +
offsetof(struct shmem_region,
port_mb[port].link_status));
if (bnx2x_eee_has_cap(params))
vars->eee_status = REG_RD(bp, params->shmem2_base +
offsetof(struct shmem2_region,
eee_status[params->port]));

vars->phy_flags = PHY_XGXS_FLAG;
bnx2x_sync_link(params, vars);
Expand Down
35 changes: 30 additions & 5 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,39 @@ static inline long bnx2x_hilo(u32 *hiref)
#endif
}

static u16 bnx2x_get_port_stats_dma_len(struct bnx2x *bp)
static inline u16 bnx2x_get_port_stats_dma_len(struct bnx2x *bp)
{
u16 res = sizeof(struct host_port_stats) >> 2;
u16 res = 0;

/* if PFC stats are not supported by the MFW, don't DMA them */
if (!(bp->flags & BC_SUPPORTS_PFC_STATS))
res -= (sizeof(u32)*4) >> 2;
/* 'newest' convention - shmem2 cotains the size of the port stats */
if (SHMEM2_HAS(bp, sizeof_port_stats)) {
u32 size = SHMEM2_RD(bp, sizeof_port_stats);
if (size)
res = size;

/* prevent newer BC from causing buffer overflow */
if (res > sizeof(struct host_port_stats))
res = sizeof(struct host_port_stats);
}

/* Older convention - all BCs support the port stats' fields up until
* the 'not_used' field
*/
if (!res) {
res = offsetof(struct host_port_stats, not_used) + 4;

/* if PFC stats are supported by the MFW, DMA them as well */
if (bp->flags & BC_SUPPORTS_PFC_STATS) {
res += offsetof(struct host_port_stats,
pfc_frames_rx_lo) -
offsetof(struct host_port_stats,
pfc_frames_tx_hi) + 4 ;
}
}

res >>= 2;

WARN_ON(res > 2 * DMAE_LEN32_RD_MAX);
return res;
}

Expand Down

0 comments on commit aec0dce

Please sign in to comment.