diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2013-05-19 22:53:43 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-20 14:13:08 -0700 |
commit | 5ea94e7686a3aa04cc0d01a2d8bd3d0292b3f592 (patch) | |
tree | c698dd2f66fc211a06deab14696ed7d998616b0f /drivers/net/phy/phy_device.c | |
parent | 2c7b49212a86f13697281a4dace2cb96aec71d6b (diff) | |
download | blackbird-op-linux-5ea94e7686a3aa04cc0d01a2d8bd3d0292b3f592.tar.gz blackbird-op-linux-5ea94e7686a3aa04cc0d01a2d8bd3d0292b3f592.zip |
phy: add phy_mac_interrupt() to use with PHY_IGNORE_INTERRUPT
There is currently no way for an Ethernet MAC driver servicing PHY link
interrupts to notify this to the PHY state machine without defining its
own state machine. Since most drivers are not so special, introduce a
helper: phy_mac_interrupt() which can be called from a link up/down
interrupt routine to update the PHY state machine. To avoid code
duplication some refactoring has been done to expose the workqueue and
its corresponding callback internally.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 8e29d22ba113..b55aa33a5b8b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -189,6 +189,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, mutex_init(&dev->lock); INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); + INIT_WORK(&dev->phy_queue, phy_change); /* Request the appropriate module unconditionally; don't bother trying to do so only if it isn't already loaded, |