diff options
author | xiong <xiong@qca.qualcomm.com> | 2013-01-19 13:27:52 +0800 |
---|---|---|
committer | Adrian Chadd <adrian@freebsd.org> | 2013-02-04 12:51:54 -0800 |
commit | 5487a3a114edf483d72ac0430a1d5d24429c1654 (patch) | |
tree | 4d3a5bccc89ae1442b12450fc6c25d06548f6c13 | |
parent | 8f56f403968186dc09ee750e19967b3fd03076e8 (diff) | |
download | alx-5487a3a114edf483d72ac0430a1d5d24429c1654.tar.gz |
alx: fix wrong MDC
the clock for MDIO should be slow if link down, and be fast if link on.
Signed-off-by: xiong <xiong@qca.qualcomm.com>
-rw-r--r-- | src/alx_hw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/alx_hw.c b/src/alx_hw.c index b9a2a3f..cd5aaa7 100644 --- a/src/alx_hw.c +++ b/src/alx_hw.c @@ -855,7 +855,7 @@ int __alx_read_phy_core(struct alx_hw *hw, bool ext, u8 dev, *phy_data = 0; /* use slow clock when it's in hibernation status */ - clk_sel = hw->link_up ? + clk_sel = !hw->link_up ? ALX_MDIO_CLK_SEL_25MD128 : ALX_MDIO_CLK_SEL_25MD4; if (ext) { @@ -905,7 +905,7 @@ int __alx_write_phy_core(struct alx_hw *hw, bool ext, u8 dev, __alx_stop_phy_polling(hw); /* use slow clock when it's in hibernation status */ - clk_sel = hw->link_up ? + clk_sel = !hw->link_up ? ALX_MDIO_CLK_SEL_25MD128 : ALX_MDIO_CLK_SEL_25MD4; if (ext) { |