From: Stephen Hemminger <shemminger@osdl•org>
To: Jeff Garzik <jgarzik@pobox•com>
Cc: netdev@vger•kernel.org
Subject: [PATCH 2/4] skge: pause mapping for fiber
Date: Thu, 05 Oct 2006 15:49:51 -0700 [thread overview]
Message-ID: <20061005225209.419641008@osdl.org> (raw)
In-Reply-To: 20061005224949.456192755@osdl.org
[-- Attachment #1: skge-fiber-half.patch --]
[-- Type: text/plain, Size: 2511 bytes --]
Do correct mapping of pause and duplex when using 1000BaseX fiber
versions of the board.
Signed-off-by: Stephen Hemminger <shemminger@osdl•org>
---
drivers/net/skge.c | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -197,8 +197,8 @@ static u32 skge_supported_modes(const st
else if (hw->chip_id == CHIP_ID_YUKON)
supported &= ~SUPPORTED_1000baseT_Half;
} else
- supported = SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE
- | SUPPORTED_Autoneg;
+ supported = SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half
+ | SUPPORTED_FIBRE | SUPPORTED_Autoneg;
return supported;
}
@@ -1018,6 +1018,14 @@ static const u16 phy_pause_map[] = {
[FLOW_MODE_REM_SEND] = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM,
};
+/* special defines for FIBER (88E1011S only) */
+static const u16 fiber_pause_map[] = {
+ [FLOW_MODE_NONE] = PHY_X_P_NO_PAUSE,
+ [FLOW_MODE_LOC_SEND] = PHY_X_P_ASYM_MD,
+ [FLOW_MODE_SYMMETRIC] = PHY_X_P_SYM_MD,
+ [FLOW_MODE_REM_SEND] = PHY_X_P_BOTH_MD,
+};
+
/* Check status of Broadcom phy link */
static void bcom_check_link(struct skge_hw *hw, int port)
@@ -1207,17 +1215,7 @@ static void xm_phy_init(struct skge_port
if (skge->advertising & ADVERTISED_1000baseT_Full)
ctrl |= PHY_X_AN_FD;
- switch(skge->flow_control) {
- case FLOW_MODE_NONE:
- ctrl |= PHY_X_P_NO_PAUSE;
- break;
- case FLOW_MODE_LOC_SEND:
- ctrl |= PHY_X_P_ASYM_MD;
- break;
- case FLOW_MODE_SYMMETRIC:
- ctrl |= PHY_X_P_BOTH_MD;
- break;
- }
+ ctrl |= fiber_pause_map[skge->flow_control];
xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl);
@@ -1796,11 +1794,17 @@ static void yukon_init(struct skge_hw *h
adv |= PHY_M_AN_10_FD;
if (skge->advertising & ADVERTISED_10baseT_Half)
adv |= PHY_M_AN_10_HD;
- } else /* special defines for FIBER (88E1011S only) */
- adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD;
- /* Set Flow-control capabilities */
- adv |= phy_pause_map[skge->flow_control];
+ /* Set Flow-control capabilities */
+ adv |= phy_pause_map[skge->flow_control];
+ } else {
+ if (skge->advertising & ADVERTISED_1000baseT_Full)
+ adv |= PHY_M_AN_1000X_AFD;
+ if (skge->advertising & ADVERTISED_1000baseT_Half)
+ adv |= PHY_M_AN_1000X_AHD;
+
+ adv |= fiber_pause_map[skge->flow_control];
+ }
/* Restart Auto-negotiation */
ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG;
--
Stephen Hemminger <shemminger@osdl•org>
next prev parent reply other threads:[~2006-10-05 23:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
2006-10-05 22:49 ` [PATCH 1/4] skge: fix stuck irq when fiber down Stephen Hemminger
2006-10-05 22:49 ` Stephen Hemminger [this message]
2006-10-05 22:49 ` [PATCH 3/4] skge: better flow control negotiation Stephen Hemminger
2006-10-05 22:49 ` [PATCH 4/4] skge: version 1.9 Stephen Hemminger
2006-11-07 13:25 ` Michael Stone
2006-11-07 17:51 ` Stephen Hemminger
2006-11-07 18:58 ` Michael Stone
2006-11-07 19:18 ` Stephen Hemminger
2006-11-07 19:33 ` Michael Stone
2006-11-07 20:28 ` Jay Vosburgh
2006-11-10 0:34 ` Michael Stone
2006-11-10 0:47 ` Jay Vosburgh
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=20061005225209.419641008@osdl.org \
--to=shemminger@osdl$(echo .)org \
--cc=jgarzik@pobox$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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