Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74471
b: refs/heads/master
c: 799b21d
h: refs/heads/master
i:
  74469: 78414a8
  74467: d599491
  74463: b56692d
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Dec 1, 2007
1 parent 7285f90 commit 157e717
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: d08b9bdf0264a8134677373f97641712062c603f
refs/heads/master: 799b21d2bddd43145130e509efb92339eabafef9
19 changes: 8 additions & 11 deletions trunk/drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,28 +1713,25 @@ static void genesis_stop(struct skge_port *skge)
{
struct skge_hw *hw = skge->hw;
int port = skge->port;
u32 reg;
unsigned retries = 1000;

genesis_reset(hw, port);

/* Clear Tx packet arbiter timeout IRQ */
skge_write16(hw, B3_PA_CTRL,
port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2);

/*
* If the transfer sticks at the MAC the STOP command will not
* terminate if we don't flush the XMAC's transmit FIFO !
*/
xm_write32(hw, port, XM_MODE,
xm_read32(hw, port, XM_MODE)|XM_MD_FTF);


/* Reset the MAC */
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST);
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST);
do {
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST);
if (!(skge_read16(hw, SK_REG(port, TX_MFF_CTRL1)) & MFF_SET_MAC_RST))
break;
} while (--retries > 0);

/* For external PHYs there must be special handling */
if (hw->phy_type != SK_PHY_XMAC) {
reg = skge_read32(hw, B2_GP_IO);
u32 reg = skge_read32(hw, B2_GP_IO);
if (port == 0) {
reg |= GP_DIR_0;
reg &= ~GP_IO_0;
Expand Down

0 comments on commit 157e717

Please sign in to comment.