forked from Poco-Ye/rk-ethernet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
force_100MSpeedFullDuplex.patch
42 lines (35 loc) · 1.08 KB
/
force_100MSpeedFullDuplex.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8179727..1d54120 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -161,14 +161,14 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
dev->dev.release = phy_device_release;
- dev->speed = 0;
- dev->duplex = -1;
+ dev->speed = SPEED_100;
+ dev->duplex = DUPLEX_FULL;
dev->pause = 0;
dev->asym_pause = 0;
dev->link = 1;
dev->interface = PHY_INTERFACE_MODE_GMII;
- dev->autoneg = AUTONEG_ENABLE;
+ dev->autoneg = AUTONEG_DISABLE;
dev->is_c45 = is_c45;
dev->addr = addr;
@@ -1108,6 +1108,9 @@ int genphy_read_status(struct phy_device *phydev)
else
phydev->speed = SPEED_10;
+
+ phydev->duplex = DUPLEX_FULL;
+ phydev->speed = SPEED_100;
phydev->pause = 0;
phydev->asym_pause = 0;
}
@@ -1251,7 +1254,8 @@ int genphy_resume(struct phy_device *phydev)
value = phy_read(phydev, MII_BMCR);
phy_write(phydev, MII_BMCR, value & ~BMCR_PDOWN);
-
+ phy_write(phydev, MII_BMCR, 0x2100);
+
mutex_unlock(&phydev->lock);
return 0;