Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[linux-2.6-block.git] / drivers / net / ethernet / qualcomm / emac / emac-sgmii.h
CommitLineData
97fb5e8d 1/* SPDX-License-Identifier: GPL-2.0-only */
b9b17deb 2/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
b9b17deb
TT
3 */
4
5#ifndef _EMAC_SGMII_H_
6#define _EMAC_SGMII_H_
7
8struct emac_adapter;
9struct platform_device;
10
9e6881d3
HP
11/** emac_sgmii - internal emac phy
12 * @init initialization function
13 * @open called when the driver is opened
14 * @close called when the driver is closed
15 * @link_change called when the link state changes
16 */
17struct sgmii_ops {
18 int (*init)(struct emac_adapter *adpt);
19 int (*open)(struct emac_adapter *adpt);
20 void (*close)(struct emac_adapter *adpt);
21 int (*link_change)(struct emac_adapter *adpt, bool link_state);
22 void (*reset)(struct emac_adapter *adpt);
23};
41c1093f
TT
24
25/** emac_sgmii - internal emac phy
26 * @base base address
27 * @digital per-lane digital block
fd0e97b8
TT
28 * @irq the interrupt number
29 * @decode_error_count reference count of consecutive decode errors
9e6881d3 30 * @sgmii_ops sgmii ops
41c1093f
TT
31 */
32struct emac_sgmii {
33 void __iomem *base;
34 void __iomem *digital;
fd0e97b8
TT
35 unsigned int irq;
36 atomic_t decode_error_count;
9e6881d3 37 struct sgmii_ops *sgmii_ops;
41c1093f
TT
38};
39
b9b17deb 40int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt);
b9b17deb 41
1e88ab6f
TT
42int emac_sgmii_init_fsm9900(struct emac_adapter *adpt);
43int emac_sgmii_init_qdf2432(struct emac_adapter *adpt);
a51f4047 44int emac_sgmii_init_qdf2400(struct emac_adapter *adpt);
1e88ab6f 45
9e6881d3
HP
46int emac_sgmii_init(struct emac_adapter *adpt);
47int emac_sgmii_open(struct emac_adapter *adpt);
48void emac_sgmii_close(struct emac_adapter *adpt);
49int emac_sgmii_link_change(struct emac_adapter *adpt, bool link_state);
50void emac_sgmii_reset(struct emac_adapter *adpt);
b9b17deb 51#endif