Skip to content

Commit 4e2bba3

Browse files
committed
Merge branch 'fix-qca808x-wol-issue'
Luo Jie says: ==================== Fix QCA808X WoL Issue Restore WoL (Wake-on-LAN) enablement via MMD3 register 0x8012 BIT5 for the QCA808X PHY. This change resolves the issue where WoL functionality was not working due to its unintended removal in a previous commit. Refactor at8031_set_wol() into a shared library to enable reuse of the Wake-on-LAN (WoL) functionality by the AT8031, QCA807X and QCA808X PHY drivers. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents b9fd988 + 4ab9ada commit 4e2bba3

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

drivers/net/phy/qcom/at803x.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
#define AT803X_LED_CONTROL 0x18
2828

29-
#define AT803X_PHY_MMD3_WOL_CTRL 0x8012
30-
#define AT803X_WOL_EN BIT(5)
31-
3229
#define AT803X_REG_CHIP_CONFIG 0x1f
3330
#define AT803X_BT_BX_REG_SEL 0x8000
3431

@@ -866,30 +863,6 @@ static int at8031_config_init(struct phy_device *phydev)
866863
return at803x_config_init(phydev);
867864
}
868865

869-
static int at8031_set_wol(struct phy_device *phydev,
870-
struct ethtool_wolinfo *wol)
871-
{
872-
int ret;
873-
874-
/* First setup MAC address and enable WOL interrupt */
875-
ret = at803x_set_wol(phydev, wol);
876-
if (ret)
877-
return ret;
878-
879-
if (wol->wolopts & WAKE_MAGIC)
880-
/* Enable WOL function for 1588 */
881-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
882-
AT803X_PHY_MMD3_WOL_CTRL,
883-
0, AT803X_WOL_EN);
884-
else
885-
/* Disable WoL function for 1588 */
886-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
887-
AT803X_PHY_MMD3_WOL_CTRL,
888-
AT803X_WOL_EN, 0);
889-
890-
return ret;
891-
}
892-
893866
static int at8031_config_intr(struct phy_device *phydev)
894867
{
895868
struct at803x_priv *priv = phydev->priv;

drivers/net/phy/qcom/qca808x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ static struct phy_driver qca808x_driver[] = {
633633
.handle_interrupt = at803x_handle_interrupt,
634634
.get_tunable = at803x_get_tunable,
635635
.set_tunable = at803x_set_tunable,
636-
.set_wol = at803x_set_wol,
636+
.set_wol = at8031_set_wol,
637637
.get_wol = at803x_get_wol,
638638
.get_features = qca808x_get_features,
639639
.config_aneg = qca808x_config_aneg,

drivers/net/phy/qcom/qcom-phy-lib.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ int at803x_set_wol(struct phy_device *phydev,
115115
}
116116
EXPORT_SYMBOL_GPL(at803x_set_wol);
117117

118+
int at8031_set_wol(struct phy_device *phydev,
119+
struct ethtool_wolinfo *wol)
120+
{
121+
int ret;
122+
123+
/* First setup MAC address and enable WOL interrupt */
124+
ret = at803x_set_wol(phydev, wol);
125+
if (ret)
126+
return ret;
127+
128+
if (wol->wolopts & WAKE_MAGIC)
129+
/* Enable WOL function for 1588 */
130+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
131+
AT803X_PHY_MMD3_WOL_CTRL,
132+
0, AT803X_WOL_EN);
133+
else
134+
/* Disable WoL function for 1588 */
135+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
136+
AT803X_PHY_MMD3_WOL_CTRL,
137+
AT803X_WOL_EN, 0);
138+
139+
return ret;
140+
}
141+
EXPORT_SYMBOL_GPL(at8031_set_wol);
142+
118143
void at803x_get_wol(struct phy_device *phydev,
119144
struct ethtool_wolinfo *wol)
120145
{

drivers/net/phy/qcom/qcom.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@
172172
#define AT803X_LOC_MAC_ADDR_16_31_OFFSET 0x804B
173173
#define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A
174174

175+
#define AT803X_PHY_MMD3_WOL_CTRL 0x8012
176+
#define AT803X_WOL_EN BIT(5)
177+
175178
#define AT803X_DEBUG_ADDR 0x1D
176179
#define AT803X_DEBUG_DATA 0x1E
177180

@@ -215,6 +218,8 @@ int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
215218
int at803x_debug_reg_write(struct phy_device *phydev, u16 reg, u16 data);
216219
int at803x_set_wol(struct phy_device *phydev,
217220
struct ethtool_wolinfo *wol);
221+
int at8031_set_wol(struct phy_device *phydev,
222+
struct ethtool_wolinfo *wol);
218223
void at803x_get_wol(struct phy_device *phydev,
219224
struct ethtool_wolinfo *wol);
220225
int at803x_ack_interrupt(struct phy_device *phydev);

0 commit comments

Comments
 (0)