Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74472
b: refs/heads/master
c: 21d7f67
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Dec 1, 2007
1 parent 157e717 commit 2de515e
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 799b21d2bddd43145130e509efb92339eabafef9
refs/heads/master: 21d7f67700ad7a4523d35d43ce95755e40eae5b7
19 changes: 12 additions & 7 deletions trunk/drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,16 +1095,9 @@ static void xm_link_down(struct skge_hw *hw, int port)
{
struct net_device *dev = hw->dev[port];
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);

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))
skge_link_down(skge);
}
Expand Down Expand Up @@ -1194,6 +1187,7 @@ static void genesis_init(struct skge_hw *hw)
static void genesis_reset(struct skge_hw *hw, int port)
{
const u8 zero[8] = { 0 };
u32 reg;

skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);

Expand All @@ -1209,6 +1203,11 @@ static void genesis_reset(struct skge_hw *hw, int port)
xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff);

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);
}


Expand Down Expand Up @@ -1714,6 +1713,12 @@ static void genesis_stop(struct skge_port *skge)
struct skge_hw *hw = skge->hw;
int port = skge->port;
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);

Expand Down

0 comments on commit 2de515e

Please sign in to comment.