Deleted Added
full compact
e1000_phy.c (287990) e1000_phy.c (295323)
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
1/******************************************************************************
2
3 Copyright (c) 2001-2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/e1000/e1000_phy.c 287990 2015-09-19 18:22:59Z sbruno $*/
33/*$FreeBSD: head/sys/dev/e1000/e1000_phy.c 295323 2016-02-05 17:14:37Z erj $*/
34
35#include "e1000_api.h"
36
37static s32 e1000_wait_autoneg(struct e1000_hw *hw);
38static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
39 u16 *data, bool read, bool page_set);
40static u32 e1000_get_phy_addr_for_hv_page(u32 page);
41static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,

--- 1780 unchanged lines hidden (view full) ---

1822 if (ret_val)
1823 return ret_val;
1824
1825 phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
1826 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL,
1827 phy_data);
1828 if (ret_val)
1829 return ret_val;
34
35#include "e1000_api.h"
36
37static s32 e1000_wait_autoneg(struct e1000_hw *hw);
38static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
39 u16 *data, bool read, bool page_set);
40static u32 e1000_get_phy_addr_for_hv_page(u32 page);
41static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,

--- 1780 unchanged lines hidden (view full) ---

1822 if (ret_val)
1823 return ret_val;
1824
1825 phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
1826 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL,
1827 phy_data);
1828 if (ret_val)
1829 return ret_val;
1830
1831 DEBUGOUT1("M88E1000 PSCR: %X\n", phy_data);
1830 }
1831
1832 }
1833
1832 DEBUGOUT1("M88E1000 PSCR: %X\n", phy_data);
1833
1834 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
1835 if (ret_val)
1836 return ret_val;
1837
1838 e1000_phy_force_speed_duplex_setup(hw, &phy_data);
1839
1840 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
1841 if (ret_val)

--- 1582 unchanged lines hidden (view full) ---

3424 * Assumes semaphore is already acquired. When page_set==TRUE, assumes
3425 * the PHY page is set to BM_WUC_PAGE (i.e. a function in the call stack
3426 * is responsible for calls to e1000_[enable|disable]_phy_wakeup_reg_bm()).
3427 **/
3428static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
3429 u16 *data, bool read, bool page_set)
3430{
3431 s32 ret_val;
1834 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
1835 if (ret_val)
1836 return ret_val;
1837
1838 e1000_phy_force_speed_duplex_setup(hw, &phy_data);
1839
1840 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
1841 if (ret_val)

--- 1582 unchanged lines hidden (view full) ---

3424 * Assumes semaphore is already acquired. When page_set==TRUE, assumes
3425 * the PHY page is set to BM_WUC_PAGE (i.e. a function in the call stack
3426 * is responsible for calls to e1000_[enable|disable]_phy_wakeup_reg_bm()).
3427 **/
3428static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
3429 u16 *data, bool read, bool page_set)
3430{
3431 s32 ret_val;
3432 u16 reg, page;
3432 u16 reg = BM_PHY_REG_NUM(offset);
3433 u16 page = BM_PHY_REG_PAGE(offset);
3433 u16 phy_reg = 0;
3434
3435 DEBUGFUNC("e1000_access_phy_wakeup_reg_bm");
3436
3434 u16 phy_reg = 0;
3435
3436 DEBUGFUNC("e1000_access_phy_wakeup_reg_bm");
3437
3437 reg = BM_PHY_REG_NUM(offset);
3438 page = BM_PHY_REG_PAGE(offset);
3439
3440 /* Gig must be disabled for MDIO accesses to Host Wakeup reg page */
3441 if ((hw->mac.type == e1000_pchlan) &&
3442 (!(E1000_READ_REG(hw, E1000_PHY_CTRL) & E1000_PHY_CTRL_GBE_DISABLE)))
3443 DEBUGOUT1("Attempting to access page %d while gig enabled.\n",
3444 page);
3445
3446 if (!page_set) {
3447 /* Enable access to PHY wakeup registers */

--- 806 unchanged lines hidden ---
3438 /* Gig must be disabled for MDIO accesses to Host Wakeup reg page */
3439 if ((hw->mac.type == e1000_pchlan) &&
3440 (!(E1000_READ_REG(hw, E1000_PHY_CTRL) & E1000_PHY_CTRL_GBE_DISABLE)))
3441 DEBUGOUT1("Attempting to access page %d while gig enabled.\n",
3442 page);
3443
3444 if (!page_set) {
3445 /* Enable access to PHY wakeup registers */

--- 806 unchanged lines hidden ---