@@ -1294,9 +1294,10 @@ static void happy_meal_init_rings(struct happy_meal *hp)
1294
1294
}
1295
1295
1296
1296
/* hp->happy_lock must be held */
1297
- static void happy_meal_begin_auto_negotiation (struct happy_meal * hp ,
1298
- void __iomem * tregs ,
1299
- struct ethtool_cmd * ep )
1297
+ static void
1298
+ happy_meal_begin_auto_negotiation (struct happy_meal * hp ,
1299
+ void __iomem * tregs ,
1300
+ const struct ethtool_link_ksettings * ep )
1300
1301
{
1301
1302
int timeout ;
1302
1303
@@ -1309,7 +1310,7 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
1309
1310
/* XXX Check BMSR_ANEGCAPABLE, should not be necessary though. */
1310
1311
1311
1312
hp -> sw_advertise = happy_meal_tcvr_read (hp , tregs , MII_ADVERTISE );
1312
- if (ep == NULL || ep -> autoneg == AUTONEG_ENABLE ) {
1313
+ if (! ep || ep -> base . autoneg == AUTONEG_ENABLE ) {
1313
1314
/* Advertise everything we can support. */
1314
1315
if (hp -> sw_bmsr & BMSR_10HALF )
1315
1316
hp -> sw_advertise |= (ADVERTISE_10HALF );
@@ -1384,14 +1385,14 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
1384
1385
/* Disable auto-negotiation in BMCR, enable the duplex and
1385
1386
* speed setting, init the timer state machine, and fire it off.
1386
1387
*/
1387
- if (ep == NULL || ep -> autoneg == AUTONEG_ENABLE ) {
1388
+ if (! ep || ep -> base . autoneg == AUTONEG_ENABLE ) {
1388
1389
hp -> sw_bmcr = BMCR_SPEED100 ;
1389
1390
} else {
1390
- if (ethtool_cmd_speed ( ep ) == SPEED_100 )
1391
+ if (ep -> base . speed == SPEED_100 )
1391
1392
hp -> sw_bmcr = BMCR_SPEED100 ;
1392
1393
else
1393
1394
hp -> sw_bmcr = 0 ;
1394
- if (ep -> duplex == DUPLEX_FULL )
1395
+ if (ep -> base . duplex == DUPLEX_FULL )
1395
1396
hp -> sw_bmcr |= BMCR_FULLDPLX ;
1396
1397
}
1397
1398
happy_meal_tcvr_write (hp , tregs , MII_BMCR , hp -> sw_bmcr );
@@ -2434,20 +2435,21 @@ static void happy_meal_set_multicast(struct net_device *dev)
2434
2435
}
2435
2436
2436
2437
/* Ethtool support... */
2437
- static int hme_get_settings (struct net_device * dev , struct ethtool_cmd * cmd )
2438
+ static int hme_get_link_ksettings (struct net_device * dev ,
2439
+ struct ethtool_link_ksettings * cmd )
2438
2440
{
2439
2441
struct happy_meal * hp = netdev_priv (dev );
2440
2442
u32 speed ;
2443
+ u32 supported ;
2441
2444
2442
- cmd -> supported =
2445
+ supported =
2443
2446
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
2444
2447
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
2445
2448
SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII );
2446
2449
2447
2450
/* XXX hardcoded stuff for now */
2448
- cmd -> port = PORT_TP ; /* XXX no MII support */
2449
- cmd -> transceiver = XCVR_INTERNAL ; /* XXX no external xcvr support */
2450
- cmd -> phy_address = 0 ; /* XXX fixed PHYAD */
2451
+ cmd -> base .port = PORT_TP ; /* XXX no MII support */
2452
+ cmd -> base .phy_address = 0 ; /* XXX fixed PHYAD */
2451
2453
2452
2454
/* Record PHY settings. */
2453
2455
spin_lock_irq (& hp -> happy_lock );
@@ -2456,41 +2458,45 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2456
2458
spin_unlock_irq (& hp -> happy_lock );
2457
2459
2458
2460
if (hp -> sw_bmcr & BMCR_ANENABLE ) {
2459
- cmd -> autoneg = AUTONEG_ENABLE ;
2461
+ cmd -> base . autoneg = AUTONEG_ENABLE ;
2460
2462
speed = ((hp -> sw_lpa & (LPA_100HALF | LPA_100FULL )) ?
2461
2463
SPEED_100 : SPEED_10 );
2462
2464
if (speed == SPEED_100 )
2463
- cmd -> duplex =
2465
+ cmd -> base . duplex =
2464
2466
(hp -> sw_lpa & (LPA_100FULL )) ?
2465
2467
DUPLEX_FULL : DUPLEX_HALF ;
2466
2468
else
2467
- cmd -> duplex =
2469
+ cmd -> base . duplex =
2468
2470
(hp -> sw_lpa & (LPA_10FULL )) ?
2469
2471
DUPLEX_FULL : DUPLEX_HALF ;
2470
2472
} else {
2471
- cmd -> autoneg = AUTONEG_DISABLE ;
2473
+ cmd -> base . autoneg = AUTONEG_DISABLE ;
2472
2474
speed = (hp -> sw_bmcr & BMCR_SPEED100 ) ? SPEED_100 : SPEED_10 ;
2473
- cmd -> duplex =
2475
+ cmd -> base . duplex =
2474
2476
(hp -> sw_bmcr & BMCR_FULLDPLX ) ?
2475
2477
DUPLEX_FULL : DUPLEX_HALF ;
2476
2478
}
2477
- ethtool_cmd_speed_set (cmd , speed );
2479
+ cmd -> base .speed = speed ;
2480
+ ethtool_convert_legacy_u32_to_link_mode (cmd -> link_modes .supported ,
2481
+ supported );
2482
+
2478
2483
return 0 ;
2479
2484
}
2480
2485
2481
- static int hme_set_settings (struct net_device * dev , struct ethtool_cmd * cmd )
2486
+ static int hme_set_link_ksettings (struct net_device * dev ,
2487
+ const struct ethtool_link_ksettings * cmd )
2482
2488
{
2483
2489
struct happy_meal * hp = netdev_priv (dev );
2484
2490
2485
2491
/* Verify the settings we care about. */
2486
- if (cmd -> autoneg != AUTONEG_ENABLE &&
2487
- cmd -> autoneg != AUTONEG_DISABLE )
2492
+ if (cmd -> base . autoneg != AUTONEG_ENABLE &&
2493
+ cmd -> base . autoneg != AUTONEG_DISABLE )
2488
2494
return - EINVAL ;
2489
- if (cmd -> autoneg == AUTONEG_DISABLE &&
2490
- ((ethtool_cmd_speed ( cmd ) != SPEED_100 &&
2491
- ethtool_cmd_speed ( cmd ) != SPEED_10 ) ||
2492
- (cmd -> duplex != DUPLEX_HALF &&
2493
- cmd -> duplex != DUPLEX_FULL )))
2495
+ if (cmd -> base . autoneg == AUTONEG_DISABLE &&
2496
+ ((cmd -> base . speed != SPEED_100 &&
2497
+ cmd -> base . speed != SPEED_10 ) ||
2498
+ (cmd -> base . duplex != DUPLEX_HALF &&
2499
+ cmd -> base . duplex != DUPLEX_FULL )))
2494
2500
return - EINVAL ;
2495
2501
2496
2502
/* Ok, do it to it. */
@@ -2537,10 +2543,10 @@ static u32 hme_get_link(struct net_device *dev)
2537
2543
}
2538
2544
2539
2545
static const struct ethtool_ops hme_ethtool_ops = {
2540
- .get_settings = hme_get_settings ,
2541
- .set_settings = hme_set_settings ,
2542
2546
.get_drvinfo = hme_get_drvinfo ,
2543
2547
.get_link = hme_get_link ,
2548
+ .get_link_ksettings = hme_get_link_ksettings ,
2549
+ .set_link_ksettings = hme_set_link_ksettings ,
2544
2550
};
2545
2551
2546
2552
static int hme_version_printed ;
0 commit comments