Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/e1000/e1000_phy.c
Show First 20 Lines • Show All 4,140 Lines • ▼ Show 20 Lines | s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data) | ||||
/* Read data from the address */ | /* Read data from the address */ | ||||
ready = e1000_is_mphy_ready(hw); | ready = e1000_is_mphy_ready(hw); | ||||
if (!ready) | if (!ready) | ||||
return -E1000_ERR_PHY; | return -E1000_ERR_PHY; | ||||
*data = E1000_READ_REG(hw, E1000_MPHY_DATA); | *data = E1000_READ_REG(hw, E1000_MPHY_DATA); | ||||
/* Disable access to mPHY if it was originally disabled */ | /* Disable access to mPHY if it was originally disabled */ | ||||
if (locked) { | if (locked) | ||||
ready = e1000_is_mphy_ready(hw); | ready = e1000_is_mphy_ready(hw); | ||||
if (!ready) | if (!ready) | ||||
return -E1000_ERR_PHY; | return -E1000_ERR_PHY; | ||||
} | E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, | ||||
E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); | E1000_MPHY_DIS_ACCESS); | ||||
return E1000_SUCCESS; | return E1000_SUCCESS; | ||||
} | } | ||||
/** | /** | ||||
* e1000_write_phy_reg_mphy - Write mPHY control register | * e1000_write_phy_reg_mphy - Write mPHY control register | ||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
* @address: address to write to | * @address: address to write to | ||||
* @data: data to write to register at offset | * @data: data to write to register at offset | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, | ||||
/* Read data from the address */ | /* Read data from the address */ | ||||
ready = e1000_is_mphy_ready(hw); | ready = e1000_is_mphy_ready(hw); | ||||
if (!ready) | if (!ready) | ||||
return -E1000_ERR_PHY; | return -E1000_ERR_PHY; | ||||
E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); | E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); | ||||
/* Disable access to mPHY if it was originally disabled */ | /* Disable access to mPHY if it was originally disabled */ | ||||
if (locked) { | if (locked) | ||||
ready = e1000_is_mphy_ready(hw); | ready = e1000_is_mphy_ready(hw); | ||||
if (!ready) | if (!ready) | ||||
return -E1000_ERR_PHY; | return -E1000_ERR_PHY; | ||||
} | E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, | ||||
E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); | E1000_MPHY_DIS_ACCESS); | ||||
return E1000_SUCCESS; | return E1000_SUCCESS; | ||||
} | } | ||||
/** | /** | ||||
* e1000_is_mphy_ready - Check if mPHY control register is not busy | * e1000_is_mphy_ready - Check if mPHY control register is not busy | ||||
* @hw: pointer to the HW structure | * @hw: pointer to the HW structure | ||||
* | * | ||||
* Returns mPHY control register status. | * Returns mPHY control register status. | ||||
Show All 23 Lines |