aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/genet/bcmgenet.h
diff options
context:
space:
mode:
authorPetri Gynther <pgynther@google.com>2015-04-01 00:40:00 -0700
committerDavid S. Miller <davem@davemloft.net>2015-04-01 13:40:18 -0400
commit8d88c6ebb34c3e54debe81e9b0d81b60411f8179 (patch)
tree5216318b9e39df95a55d86563ce5270c1f203f84 /drivers/net/ethernet/broadcom/genet/bcmgenet.h
parentnet: phy: at803x: simplify using devm_gpiod_get_optional and its 4th argument (diff)
downloadlinux-dev-8d88c6ebb34c3e54debe81e9b0d81b60411f8179.tar.xz
linux-dev-8d88c6ebb34c3e54debe81e9b0d81b60411f8179.zip
net: bcmgenet: enable MoCA link state change detection
Currently, MoCA fixed PHYs are always in link-up state, regardless of whether the link is actually up or not. Add code to properly detect MoCA link state changes and to reflect the new state in MoCA fixed PHY. Only GENET V3 and V4 MACs are capable of detecting MoCA link state changes. The code works as follows: 1. GENET MAC detects MoCA link state change and issues UMAC_IRQ_LINK_UP or UMAC_IRQ_LINK_DOWN interrupt. 2. Link up/down interrupt is processed in bcmgenet_irq_task(), which calls phy_mac_interrupt(). 3. phy_mac_interrupt() updates the fixed PHY phydev->link and kicks the PHY state machine. 4. PHY state machine proceeds to read the fixed PHY link status register. 5. When the fixed PHY link status register is being read, the new function bcmgenet_fixed_phy_link_update() gets called. It copies the fixed PHY phydev->link value to the fixed PHY status->link. 6. PHY state machine receives the new link state of the fixed PHY. 7. MoCA fixed PHY link state now correctly reflects the real MoCA hardware link state. Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/genet/bcmgenet.h')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index ddaa40cb0f21..6f2887a5e0be 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -508,6 +508,7 @@ enum bcmgenet_version {
#define GENET_HAS_40BITS (1 << 0)
#define GENET_HAS_EXT (1 << 1)
#define GENET_HAS_MDIO_INTR (1 << 2)
+#define GENET_HAS_MOCA_LINK_DET (1 << 3)
/* BCMGENET hardware parameters, keep this structure nicely aligned
* since it is going to be used in hot paths