14
14
#define MDIO_MMD_AN_MV_STAT_MS_CONF_FAULT 0x8000
15
15
16
16
#define MDIO_MMD_PCS_MV_100BT1_STAT1 33032
17
- #define MDIO_MMD_PCS_MV_100BT1_STAT1_IDLE_ERROR 0x00FF
17
+ #define MDIO_MMD_PCS_MV_100BT1_STAT1_IDLE_ERROR 0x00ff
18
18
#define MDIO_MMD_PCS_MV_100BT1_STAT1_JABBER 0x0100
19
19
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LINK 0x0200
20
20
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LOCAL_RX 0x1000
27
27
#define MDIO_MMD_PCS_MV_100BT1_STAT2_LINK 0x0004
28
28
#define MDIO_MMD_PCS_MV_100BT1_STAT2_ANGE 0x0008
29
29
30
+ #define MDIO_MMD_PCS_MV_RX_STAT 33328
31
+
30
32
static int mv88q2xxx_soft_reset (struct phy_device * phydev )
31
33
{
32
34
int ret ;
@@ -63,15 +65,17 @@ static int mv88q2xxx_read_link_gbit(struct phy_device *phydev)
63
65
* the link was already down.
64
66
*/
65
67
if (!phy_polling_mode (phydev ) || !phydev -> link ) {
66
- ret = phy_read_mmd (phydev , MDIO_MMD_PCS , MDIO_PCS_1000BT1_STAT );
68
+ ret = phy_read_mmd (phydev , MDIO_MMD_PCS ,
69
+ MDIO_PCS_1000BT1_STAT );
67
70
if (ret < 0 )
68
71
return ret ;
69
72
else if (ret & MDIO_PCS_1000BT1_STAT_LINK )
70
73
link = true;
71
74
}
72
75
73
76
if (!link ) {
74
- ret = phy_read_mmd (phydev , MDIO_MMD_PCS , MDIO_PCS_1000BT1_STAT );
77
+ ret = phy_read_mmd (phydev , MDIO_MMD_PCS ,
78
+ MDIO_PCS_1000BT1_STAT );
75
79
if (ret < 0 )
76
80
return ret ;
77
81
else if (ret & MDIO_PCS_1000BT1_STAT_LINK )
@@ -95,7 +99,8 @@ static int mv88q2xxx_read_link_100m(struct phy_device *phydev)
95
99
* we always read the realtime status.
96
100
*/
97
101
if (!phy_polling_mode (phydev ) || !phydev -> link ) {
98
- ret = phy_read_mmd (phydev , MDIO_MMD_PCS , MDIO_MMD_PCS_MV_100BT1_STAT1 );
102
+ ret = phy_read_mmd (phydev , MDIO_MMD_PCS ,
103
+ MDIO_MMD_PCS_MV_100BT1_STAT1 );
99
104
if (ret < 0 )
100
105
return ret ;
101
106
else if (ret & MDIO_MMD_PCS_MV_100BT1_STAT1_LINK )
@@ -200,15 +205,16 @@ static int mv88q2xxx_config_init(struct phy_device *phydev)
200
205
return mv88q2xxx_config_aneg (phydev );
201
206
}
202
207
203
- static int mv88q2xxxx_get_sqi (struct phy_device * phydev )
208
+ static int mv88q2xxx_get_sqi (struct phy_device * phydev )
204
209
{
205
210
int ret ;
206
211
207
212
if (phydev -> speed == SPEED_100 ) {
208
213
/* Read the SQI from the vendor specific receiver status
209
214
* register
210
215
*/
211
- ret = phy_read_mmd (phydev , MDIO_MMD_PCS , 0x8230 );
216
+ ret = phy_read_mmd (phydev , MDIO_MMD_PCS ,
217
+ MDIO_MMD_PCS_MV_RX_STAT );
212
218
if (ret < 0 )
213
219
return ret ;
214
220
@@ -218,7 +224,7 @@ static int mv88q2xxxx_get_sqi(struct phy_device *phydev)
218
224
* but can be found in the Software Initialization Guide. Only
219
225
* revisions >= A0 are supported.
220
226
*/
221
- ret = phy_modify_mmd (phydev , MDIO_MMD_PCS , 0xFC5D , 0x00FF , 0x00AC );
227
+ ret = phy_modify_mmd (phydev , MDIO_MMD_PCS , 0xfc5d , 0xff , 0xac );
222
228
if (ret < 0 )
223
229
return ret ;
224
230
@@ -227,10 +233,10 @@ static int mv88q2xxxx_get_sqi(struct phy_device *phydev)
227
233
return ret ;
228
234
}
229
235
230
- return ret & 0x0F ;
236
+ return ret & 0x0f ;
231
237
}
232
238
233
- static int mv88q2xxxx_get_sqi_max (struct phy_device * phydev )
239
+ static int mv88q2xxx_get_sqi_max (struct phy_device * phydev )
234
240
{
235
241
return 15 ;
236
242
}
@@ -246,8 +252,8 @@ static struct phy_driver mv88q2xxx_driver[] = {
246
252
.read_status = mv88q2xxx_read_status ,
247
253
.soft_reset = mv88q2xxx_soft_reset ,
248
254
.set_loopback = genphy_c45_loopback ,
249
- .get_sqi = mv88q2xxxx_get_sqi ,
250
- .get_sqi_max = mv88q2xxxx_get_sqi_max ,
255
+ .get_sqi = mv88q2xxx_get_sqi ,
256
+ .get_sqi_max = mv88q2xxx_get_sqi_max ,
251
257
},
252
258
};
253
259
0 commit comments