diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2011-02-28 03:37:20 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-28 13:14:46 -0800 |
commit | faa6fcbbba110c7c4bc299bc90f59d9f7b51ac6e (patch) | |
tree | 7e4b38510a18b12df71e9b35269f4cfc4e7a94bf /drivers/net/bnx2x/bnx2x_cmn.c | |
parent | e3fa3aff0cb198e7c53d894f52146121d9592872 (diff) | |
download | op-kernel-dev-faa6fcbbba110c7c4bc299bc90f59d9f7b51ac6e.zip op-kernel-dev-faa6fcbbba110c7c4bc299bc90f59d9f7b51ac6e.tar.gz |
bnx2x: (NPAR mode) Fix FW initialization
Fix FW initialization according to max BW stored in percents
for NPAR mode. Protect HW from being configured to speed 0.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_cmn.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 710ce5d..a58baf3 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -703,19 +703,20 @@ u16 bnx2x_get_mf_speed(struct bnx2x *bp) { u16 line_speed = bp->link_vars.line_speed; if (IS_MF(bp)) { - u16 maxCfg = (bp->mf_config[BP_VN(bp)] & - FUNC_MF_CFG_MAX_BW_MASK) >> - FUNC_MF_CFG_MAX_BW_SHIFT; - /* Calculate the current MAX line speed limit for the DCC - * capable devices + u16 maxCfg = bnx2x_extract_max_cfg(bp, + bp->mf_config[BP_VN(bp)]); + + /* Calculate the current MAX line speed limit for the MF + * devices */ - if (IS_MF_SD(bp)) { + if (IS_MF_SI(bp)) + line_speed = (line_speed * maxCfg) / 100; + else { /* SD mode */ u16 vn_max_rate = maxCfg * 100; if (vn_max_rate < line_speed) line_speed = vn_max_rate; - } else /* IS_MF_SI(bp)) */ - line_speed = (line_speed * maxCfg) / 100; + } } return line_speed; |