Commit 21d7f677 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

skge: fiber link up/down fix

The driver would not work over fibre if other end when down then
came back up (would require reloading driver). The correct way
to manage the link the same way for both TP and fibre.

Resloves problem described in: 	 http://lkml.org/lkml/2007/11/6/395Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 799b21d2
...@@ -1095,16 +1095,9 @@ static void xm_link_down(struct skge_hw *hw, int port) ...@@ -1095,16 +1095,9 @@ static void xm_link_down(struct skge_hw *hw, int port)
{ {
struct net_device *dev = hw->dev[port]; struct net_device *dev = hw->dev[port];
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
u16 cmd = xm_read16(hw, port, XM_MMU_CMD);
xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE); xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE);
cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
xm_write16(hw, port, XM_MMU_CMD, cmd);
/* dummy read to ensure writing */
xm_read16(hw, port, XM_MMU_CMD);
if (netif_carrier_ok(dev)) if (netif_carrier_ok(dev))
skge_link_down(skge); skge_link_down(skge);
} }
...@@ -1194,6 +1187,7 @@ static void genesis_init(struct skge_hw *hw) ...@@ -1194,6 +1187,7 @@ static void genesis_init(struct skge_hw *hw)
static void genesis_reset(struct skge_hw *hw, int port) static void genesis_reset(struct skge_hw *hw, int port)
{ {
const u8 zero[8] = { 0 }; const u8 zero[8] = { 0 };
u32 reg;
skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
...@@ -1209,6 +1203,11 @@ static void genesis_reset(struct skge_hw *hw, int port) ...@@ -1209,6 +1203,11 @@ static void genesis_reset(struct skge_hw *hw, int port)
xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff);
xm_outhash(hw, port, XM_HSM, zero); xm_outhash(hw, port, XM_HSM, zero);
/* Flush TX and RX fifo */
reg = xm_read32(hw, port, XM_MODE);
xm_write32(hw, port, XM_MODE, reg | XM_MD_FTF);
xm_write32(hw, port, XM_MODE, reg | XM_MD_FRF);
} }
...@@ -1714,6 +1713,12 @@ static void genesis_stop(struct skge_port *skge) ...@@ -1714,6 +1713,12 @@ static void genesis_stop(struct skge_port *skge)
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
unsigned retries = 1000; unsigned retries = 1000;
u16 cmd;
/* Disable Tx and Rx */
cmd = xm_read16(hw, port, XM_MMU_CMD);
cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
xm_write16(hw, port, XM_MMU_CMD, cmd);
genesis_reset(hw, port); genesis_reset(hw, port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment