diff options
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 4 | ||||
| -rw-r--r-- | drivers/net/phy/phy.c | 17 | ||||
| -rw-r--r-- | drivers/net/phy/phy_device.c | 2 | ||||
| -rw-r--r-- | include/linux/phy.h | 7 |
4 files changed, 7 insertions, 23 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 0ca0dfecd153..930694d3a13f 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -379,7 +379,7 @@ static int mdio_bus_resume(struct device *dev) | |||
| 379 | 379 | ||
| 380 | no_resume: | 380 | no_resume: |
| 381 | if (phydev->attached_dev && phydev->adjust_link) | 381 | if (phydev->attached_dev && phydev->adjust_link) |
| 382 | phy_start_machine(phydev, NULL); | 382 | phy_start_machine(phydev); |
| 383 | 383 | ||
| 384 | return 0; | 384 | return 0; |
| 385 | } | 385 | } |
| @@ -401,7 +401,7 @@ static int mdio_bus_restore(struct device *dev) | |||
| 401 | phydev->link = 0; | 401 | phydev->link = 0; |
| 402 | phydev->state = PHY_UP; | 402 | phydev->state = PHY_UP; |
| 403 | 403 | ||
| 404 | phy_start_machine(phydev, NULL); | 404 | phy_start_machine(phydev); |
| 405 | 405 | ||
| 406 | return 0; | 406 | return 0; |
| 407 | } | 407 | } |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 4e6dcc1cc237..19da5ab615bd 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
| @@ -406,21 +406,15 @@ EXPORT_SYMBOL(phy_start_aneg); | |||
| 406 | /** | 406 | /** |
| 407 | * phy_start_machine - start PHY state machine tracking | 407 | * phy_start_machine - start PHY state machine tracking |
| 408 | * @phydev: the phy_device struct | 408 | * @phydev: the phy_device struct |
| 409 | * @handler: callback function for state change notifications | ||
| 410 | * | 409 | * |
| 411 | * Description: The PHY infrastructure can run a state machine | 410 | * Description: The PHY infrastructure can run a state machine |
| 412 | * which tracks whether the PHY is starting up, negotiating, | 411 | * which tracks whether the PHY is starting up, negotiating, |
| 413 | * etc. This function starts the timer which tracks the state | 412 | * etc. This function starts the timer which tracks the state |
| 414 | * of the PHY. If you want to be notified when the state changes, | 413 | * of the PHY. If you want to maintain your own state machine, |
| 415 | * pass in the callback @handler, otherwise, pass NULL. If you | 414 | * do not call this function. |
| 416 | * want to maintain your own state machine, do not call this | ||
| 417 | * function. | ||
| 418 | */ | 415 | */ |
| 419 | void phy_start_machine(struct phy_device *phydev, | 416 | void phy_start_machine(struct phy_device *phydev) |
| 420 | void (*handler)(struct net_device *)) | ||
| 421 | { | 417 | { |
| 422 | phydev->adjust_state = handler; | ||
| 423 | |||
| 424 | queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, HZ); | 418 | queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, HZ); |
| 425 | } | 419 | } |
| 426 | 420 | ||
| @@ -440,8 +434,6 @@ void phy_stop_machine(struct phy_device *phydev) | |||
| 440 | if (phydev->state > PHY_UP) | 434 | if (phydev->state > PHY_UP) |
| 441 | phydev->state = PHY_UP; | 435 | phydev->state = PHY_UP; |
| 442 | mutex_unlock(&phydev->lock); | 436 | mutex_unlock(&phydev->lock); |
| 443 | |||
| 444 | phydev->adjust_state = NULL; | ||
| 445 | } | 437 | } |
| 446 | 438 | ||
| 447 | /** | 439 | /** |
| @@ -706,9 +698,6 @@ void phy_state_machine(struct work_struct *work) | |||
| 706 | 698 | ||
| 707 | mutex_lock(&phydev->lock); | 699 | mutex_lock(&phydev->lock); |
| 708 | 700 | ||
| 709 | if (phydev->adjust_state) | ||
| 710 | phydev->adjust_state(phydev->attached_dev); | ||
| 711 | |||
| 712 | switch (phydev->state) { | 701 | switch (phydev->state) { |
| 713 | case PHY_DOWN: | 702 | case PHY_DOWN: |
| 714 | case PHY_STARTING: | 703 | case PHY_STARTING: |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 1f1f8d77aa6a..09aa9e564296 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -422,7 +422,7 @@ int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | |||
| 422 | return rc; | 422 | return rc; |
| 423 | 423 | ||
| 424 | phy_prepare_link(phydev, handler); | 424 | phy_prepare_link(phydev, handler); |
| 425 | phy_start_machine(phydev, NULL); | 425 | phy_start_machine(phydev); |
| 426 | if (phydev->irq > 0) | 426 | if (phydev->irq > 0) |
| 427 | phy_start_interrupts(phydev); | 427 | phy_start_interrupts(phydev); |
| 428 | 428 | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index d4cb756a41c5..cf1bb480cfb1 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -282,8 +282,6 @@ struct phy_c45_device_ids { | |||
| 282 | * attached_dev: The attached enet driver's device instance ptr | 282 | * attached_dev: The attached enet driver's device instance ptr |
| 283 | * adjust_link: Callback for the enet controller to respond to | 283 | * adjust_link: Callback for the enet controller to respond to |
| 284 | * changes in the link state. | 284 | * changes in the link state. |
| 285 | * adjust_state: Callback for the enet driver to respond to | ||
| 286 | * changes in the state machine. | ||
| 287 | * | 285 | * |
| 288 | * speed, duplex, pause, supported, advertising, lp_advertising, | 286 | * speed, duplex, pause, supported, advertising, lp_advertising, |
| 289 | * and autoneg are used like in mii_if_info | 287 | * and autoneg are used like in mii_if_info |
| @@ -364,8 +362,6 @@ struct phy_device { | |||
| 364 | struct net_device *attached_dev; | 362 | struct net_device *attached_dev; |
| 365 | 363 | ||
| 366 | void (*adjust_link)(struct net_device *dev); | 364 | void (*adjust_link)(struct net_device *dev); |
| 367 | |||
| 368 | void (*adjust_state)(struct net_device *dev); | ||
| 369 | }; | 365 | }; |
| 370 | #define to_phy_device(d) container_of(d, struct phy_device, dev) | 366 | #define to_phy_device(d) container_of(d, struct phy_device, dev) |
| 371 | 367 | ||
| @@ -585,8 +581,7 @@ int phy_drivers_register(struct phy_driver *new_driver, int n); | |||
| 585 | void phy_state_machine(struct work_struct *work); | 581 | void phy_state_machine(struct work_struct *work); |
| 586 | void phy_change(struct work_struct *work); | 582 | void phy_change(struct work_struct *work); |
| 587 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); | 583 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); |
| 588 | void phy_start_machine(struct phy_device *phydev, | 584 | void phy_start_machine(struct phy_device *phydev); |
| 589 | void (*handler)(struct net_device *)); | ||
| 590 | void phy_stop_machine(struct phy_device *phydev); | 585 | void phy_stop_machine(struct phy_device *phydev); |
| 591 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 586 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 592 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 587 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
