From: Yaniv Rosner <yanivr@broadcom.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Yaniv Rosner <yanivr@broadcom.com>,
Ariel Elior <ariele@broadcom.com>
Subject: [PATCH net 2/5] bnx2x: Fix passive DAC cable detection
Date: Wed, 1 Jan 2014 11:06:42 +0200 [thread overview]
Message-ID: <1388567205-20210-3-git-send-email-yanivr@broadcom.com> (raw)
In-Reply-To: <1388567205-20210-1-git-send-email-yanivr@broadcom.com>
Fix Passive DAC detection for specific cables, such that even in case
SFP_CABLE_TECHNOLOGY option is not set in the EEPROM (offset 8), treat it as a
passive DAC cable, since some cables don't have this indication.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index efbf729..000b6ee 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -8133,17 +8133,20 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy,
*edc_mode = EDC_MODE_ACTIVE_DAC;
else
check_limiting_mode = 1;
- } else if (copper_module_type &
- SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
+ } else {
+ *edc_mode = EDC_MODE_PASSIVE_DAC;
+ /* Even in case PASSIVE_DAC indication is not set,
+ * treat it as a passive DAC cable, since some cables
+ * don't have this indication.
+ */
+ if (copper_module_type &
+ SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
DP(NETIF_MSG_LINK,
"Passive Copper cable detected\n");
- *edc_mode =
- EDC_MODE_PASSIVE_DAC;
- } else {
- DP(NETIF_MSG_LINK,
- "Unknown copper-cable-type 0x%x !!!\n",
- copper_module_type);
- return -EINVAL;
+ } else {
+ DP(NETIF_MSG_LINK,
+ "Unknown copper-cable-type\n");
+ }
}
break;
}
--
1.7.1
next prev parent reply other threads:[~2014-01-01 9:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-01 9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
2014-01-01 9:06 ` [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link Yaniv Rosner
2014-01-01 9:06 ` Yaniv Rosner [this message]
2014-01-01 9:06 ` [PATCH net 3/5] bnx2x: Fix Duplex setting for 54618se Yaniv Rosner
2014-01-01 9:06 ` [PATCH net 4/5] bnx2x: Fix incorrect link-up report Yaniv Rosner
2014-01-01 9:06 ` [PATCH net 5/5] bnx2x: Fix KR2 work-around detection of BCM8073 Yaniv Rosner
2014-01-02 3:10 ` [PATCH net 0/5] bnx2x: Link fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388567205-20210-3-git-send-email-yanivr@broadcom.com \
--to=yanivr@broadcom.com \
--cc=ariele@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).