summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qualcomm/emac/emac-sgmii.h
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2017-01-27 16:43:48 -0600
committerDavid S. Miller <davem@davemloft.net>2017-01-29 19:07:02 -0500
commitfd0e97b806f0331df95f5fc58cdd488d169efb7f (patch)
tree0dc31f4a8d67dbc675a99c5e7def5aa10f058ab2 /drivers/net/ethernet/qualcomm/emac/emac-sgmii.h
parente7e7454b40d290f6efb63c792c56c416922dcef8 (diff)
net: qcom/emac: add an error interrupt handler for the sgmii
The SGMII (internal PHY) can report decode errors via an interrupt. It can also report autonegotiation status changes, but we don't need to track those. The SGMII can recover automatically from most decode errors, so we only reset the interface if we get multiple consecutive errors. It's possible for bogus decode errors to be reported while the link is being brought up. The interrupt is registered when the interface is opened, and it's enabled after the link is up. Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac/emac-sgmii.h')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac-sgmii.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.h b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.h
index 4a8f6b174f4b..e7c0c3b2baa4 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.h
+++ b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.h
@@ -16,17 +16,29 @@
struct emac_adapter;
struct platform_device;
-typedef int (*emac_sgmii_initialize)(struct emac_adapter *adpt);
+typedef int (*emac_sgmii_function)(struct emac_adapter *adpt);
/** emac_sgmii - internal emac phy
* @base base address
* @digital per-lane digital block
+ * @irq the interrupt number
+ * @decode_error_count reference count of consecutive decode errors
* @initialize initialization function
+ * @open called when the driver is opened
+ * @close called when the driver is closed
+ * @link_up called when the link comes up
+ * @link_down called when the link comes down
*/
struct emac_sgmii {
void __iomem *base;
void __iomem *digital;
- emac_sgmii_initialize initialize;
+ unsigned int irq;
+ atomic_t decode_error_count;
+ emac_sgmii_function initialize;
+ emac_sgmii_function open;
+ emac_sgmii_function close;
+ emac_sgmii_function link_up;
+ emac_sgmii_function link_down;
};
int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt);