@@ -171,7 +171,6 @@ struct port {
171
171
struct npe * npe ;
172
172
struct net_device * netdev ;
173
173
struct napi_struct napi ;
174
- struct phy_device * phydev ;
175
174
struct eth_plat_info * plat ;
176
175
buffer_t * rx_buff_tab [RX_DESCS ], * tx_buff_tab [TX_DESCS ];
177
176
struct desc * desc_tab ; /* coherent */
@@ -562,7 +561,7 @@ static void ixp4xx_mdio_remove(void)
562
561
static void ixp4xx_adjust_link (struct net_device * dev )
563
562
{
564
563
struct port * port = netdev_priv (dev );
565
- struct phy_device * phydev = port -> phydev ;
564
+ struct phy_device * phydev = dev -> phydev ;
566
565
567
566
if (!phydev -> link ) {
568
567
if (port -> speed ) {
@@ -976,8 +975,6 @@ static void eth_set_mcast_list(struct net_device *dev)
976
975
977
976
static int eth_ioctl (struct net_device * dev , struct ifreq * req , int cmd )
978
977
{
979
- struct port * port = netdev_priv (dev );
980
-
981
978
if (!netif_running (dev ))
982
979
return - EINVAL ;
983
980
@@ -988,7 +985,7 @@ static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
988
985
return hwtstamp_get (dev , req );
989
986
}
990
987
991
- return phy_mii_ioctl (port -> phydev , req , cmd );
988
+ return phy_mii_ioctl (dev -> phydev , req , cmd );
992
989
}
993
990
994
991
/* ethtool support */
@@ -1007,20 +1004,17 @@ static void ixp4xx_get_drvinfo(struct net_device *dev,
1007
1004
1008
1005
static int ixp4xx_get_settings (struct net_device * dev , struct ethtool_cmd * cmd )
1009
1006
{
1010
- struct port * port = netdev_priv (dev );
1011
- return phy_ethtool_gset (port -> phydev , cmd );
1007
+ return phy_ethtool_gset (dev -> phydev , cmd );
1012
1008
}
1013
1009
1014
1010
static int ixp4xx_set_settings (struct net_device * dev , struct ethtool_cmd * cmd )
1015
1011
{
1016
- struct port * port = netdev_priv (dev );
1017
- return phy_ethtool_sset (port -> phydev , cmd );
1012
+ return phy_ethtool_sset (dev -> phydev , cmd );
1018
1013
}
1019
1014
1020
1015
static int ixp4xx_nway_reset (struct net_device * dev )
1021
1016
{
1022
- struct port * port = netdev_priv (dev );
1023
- return phy_start_aneg (port -> phydev );
1017
+ return phy_start_aneg (dev -> phydev );
1024
1018
}
1025
1019
1026
1020
int ixp46x_phc_index = -1 ;
@@ -1259,7 +1253,7 @@ static int eth_open(struct net_device *dev)
1259
1253
}
1260
1254
1261
1255
port -> speed = 0 ; /* force "link up" message */
1262
- phy_start (port -> phydev );
1256
+ phy_start (dev -> phydev );
1263
1257
1264
1258
for (i = 0 ; i < ETH_ALEN ; i ++ )
1265
1259
__raw_writel (dev -> dev_addr [i ], & port -> regs -> hw_addr [i ]);
@@ -1380,7 +1374,7 @@ static int eth_close(struct net_device *dev)
1380
1374
printk (KERN_CRIT "%s: unable to disable loopback\n" ,
1381
1375
dev -> name );
1382
1376
1383
- phy_stop (port -> phydev );
1377
+ phy_stop (dev -> phydev );
1384
1378
1385
1379
if (!ports_open )
1386
1380
qmgr_disable_irq (TXDONE_QUEUE );
@@ -1405,6 +1399,7 @@ static int eth_init_one(struct platform_device *pdev)
1405
1399
struct port * port ;
1406
1400
struct net_device * dev ;
1407
1401
struct eth_plat_info * plat = dev_get_platdata (& pdev -> dev );
1402
+ struct phy_device * phydev = NULL ;
1408
1403
u32 regs_phys ;
1409
1404
char phy_id [MII_BUS_ID_SIZE + 3 ];
1410
1405
int err ;
@@ -1466,14 +1461,14 @@ static int eth_init_one(struct platform_device *pdev)
1466
1461
1467
1462
snprintf (phy_id , MII_BUS_ID_SIZE + 3 , PHY_ID_FMT ,
1468
1463
mdio_bus -> id , plat -> phy );
1469
- port -> phydev = phy_connect (dev , phy_id , & ixp4xx_adjust_link ,
1470
- PHY_INTERFACE_MODE_MII );
1471
- if (IS_ERR (port -> phydev )) {
1472
- err = PTR_ERR (port -> phydev );
1464
+ phydev = phy_connect (dev , phy_id , & ixp4xx_adjust_link ,
1465
+ PHY_INTERFACE_MODE_MII );
1466
+ if (IS_ERR (phydev )) {
1467
+ err = PTR_ERR (phydev );
1473
1468
goto err_free_mem ;
1474
1469
}
1475
1470
1476
- port -> phydev -> irq = PHY_POLL ;
1471
+ phydev -> irq = PHY_POLL ;
1477
1472
1478
1473
if ((err = register_netdev (dev )))
1479
1474
goto err_phy_dis ;
@@ -1484,7 +1479,7 @@ static int eth_init_one(struct platform_device *pdev)
1484
1479
return 0 ;
1485
1480
1486
1481
err_phy_dis :
1487
- phy_disconnect (port -> phydev );
1482
+ phy_disconnect (phydev );
1488
1483
err_free_mem :
1489
1484
npe_port_tab [NPE_ID (port -> id )] = NULL ;
1490
1485
release_resource (port -> mem_res );
@@ -1498,10 +1493,11 @@ static int eth_init_one(struct platform_device *pdev)
1498
1493
static int eth_remove_one (struct platform_device * pdev )
1499
1494
{
1500
1495
struct net_device * dev = platform_get_drvdata (pdev );
1496
+ struct phy_device * phydev = dev -> phydev ;
1501
1497
struct port * port = netdev_priv (dev );
1502
1498
1503
1499
unregister_netdev (dev );
1504
- phy_disconnect (port -> phydev );
1500
+ phy_disconnect (phydev );
1505
1501
npe_port_tab [NPE_ID (port -> id )] = NULL ;
1506
1502
npe_release (port -> npe );
1507
1503
release_resource (port -> mem_res );
0 commit comments