diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-07-22 19:26:08 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-31 00:40:53 -0400 |
commit | d8a09943ebbaca9befd995d8fe10dd9885256dbf (patch) | |
tree | b530330e5d8833f86a148c0acb9bf611ff8aeeb4 | |
parent | 2c66851460c9438823e39b76887376d1511fb67c (diff) |
[PATCH] skge: fifo control register access fix
The code to clear fifo errors was incorrect and sending garbage
to the external phy. Removed the no longer used inline's funcs.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r-- | drivers/net/skge.c | 17 | ||||
-rw-r--r-- | drivers/net/skge.h | 11 |
2 files changed, 10 insertions, 18 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 6b04b89cbb4f..f50405b4fba2 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -1818,8 +1818,8 @@ static void yukon_stop(struct skge_port *skge) | |||
1818 | gma_read16(hw, port, GM_GP_CTRL); | 1818 | gma_read16(hw, port, GM_GP_CTRL); |
1819 | 1819 | ||
1820 | /* set GPHY Control reset */ | 1820 | /* set GPHY Control reset */ |
1821 | gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); | 1821 | skge_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); |
1822 | gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); | 1822 | skge_write32(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); |
1823 | } | 1823 | } |
1824 | 1824 | ||
1825 | static void yukon_get_stats(struct skge_port *skge, u64 *data) | 1825 | static void yukon_get_stats(struct skge_port *skge, u64 *data) |
@@ -1850,11 +1850,12 @@ static void yukon_mac_intr(struct skge_hw *hw, int port) | |||
1850 | 1850 | ||
1851 | if (status & GM_IS_RX_FF_OR) { | 1851 | if (status & GM_IS_RX_FF_OR) { |
1852 | ++skge->net_stats.rx_fifo_errors; | 1852 | ++skge->net_stats.rx_fifo_errors; |
1853 | gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); | 1853 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); |
1854 | } | 1854 | } |
1855 | |||
1855 | if (status & GM_IS_TX_FF_UR) { | 1856 | if (status & GM_IS_TX_FF_UR) { |
1856 | ++skge->net_stats.tx_fifo_errors; | 1857 | ++skge->net_stats.tx_fifo_errors; |
1857 | gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); | 1858 | skge_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU); |
1858 | } | 1859 | } |
1859 | 1860 | ||
1860 | } | 1861 | } |
@@ -1898,12 +1899,14 @@ static void yukon_link_down(struct skge_port *skge) | |||
1898 | { | 1899 | { |
1899 | struct skge_hw *hw = skge->hw; | 1900 | struct skge_hw *hw = skge->hw; |
1900 | int port = skge->port; | 1901 | int port = skge->port; |
1902 | u16 ctrl; | ||
1901 | 1903 | ||
1902 | pr_debug("yukon_link_down\n"); | 1904 | pr_debug("yukon_link_down\n"); |
1903 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); | 1905 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); |
1904 | gm_phy_write(hw, port, GM_GP_CTRL, | 1906 | |
1905 | gm_phy_read(hw, port, GM_GP_CTRL) | 1907 | ctrl = gma_read16(hw, port, GM_GP_CTRL); |
1906 | & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); | 1908 | ctrl &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); |
1909 | gma_write16(hw, port, GM_GP_CTRL, ctrl); | ||
1907 | 1910 | ||
1908 | if (skge->flow_control == FLOW_MODE_REM_SEND) { | 1911 | if (skge->flow_control == FLOW_MODE_REM_SEND) { |
1909 | /* restore Asymmetric Pause bit */ | 1912 | /* restore Asymmetric Pause bit */ |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 2086809f4b03..e2546950bf55 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -2606,17 +2606,6 @@ static inline void gma_write16(const struct skge_hw *hw, int port, int r, u16 v) | |||
2606 | skge_write16(hw, SK_GMAC_REG(port,r), v); | 2606 | skge_write16(hw, SK_GMAC_REG(port,r), v); |
2607 | } | 2607 | } |
2608 | 2608 | ||
2609 | static inline void gma_write32(const struct skge_hw *hw, int port, int r, u32 v) | ||
2610 | { | ||
2611 | skge_write16(hw, SK_GMAC_REG(port, r), (u16) v); | ||
2612 | skge_write32(hw, SK_GMAC_REG(port, r+4), (u16)(v >> 16)); | ||
2613 | } | ||
2614 | |||
2615 | static inline void gma_write8(const struct skge_hw *hw, int port, int r, u8 v) | ||
2616 | { | ||
2617 | skge_write8(hw, SK_GMAC_REG(port,r), v); | ||
2618 | } | ||
2619 | |||
2620 | static inline void gma_set_addr(struct skge_hw *hw, int port, int reg, | 2609 | static inline void gma_set_addr(struct skge_hw *hw, int port, int reg, |
2621 | const u8 *addr) | 2610 | const u8 *addr) |
2622 | { | 2611 | { |