1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
9 struct platform_device
;
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
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
);
25 /** emac_sgmii - internal emac phy
27 * @digital per-lane digital block
28 * @irq the interrupt number
29 * @decode_error_count reference count of consecutive decode errors
30 * @sgmii_ops sgmii ops
34 void __iomem
*digital
;
36 atomic_t decode_error_count
;
37 struct sgmii_ops
*sgmii_ops
;
40 int emac_sgmii_config(struct platform_device
*pdev
, struct emac_adapter
*adpt
);
42 int emac_sgmii_init_fsm9900(struct emac_adapter
*adpt
);
43 int emac_sgmii_init_qdf2432(struct emac_adapter
*adpt
);
44 int emac_sgmii_init_qdf2400(struct emac_adapter
*adpt
);
46 int emac_sgmii_init(struct emac_adapter
*adpt
);
47 int emac_sgmii_open(struct emac_adapter
*adpt
);
48 void emac_sgmii_close(struct emac_adapter
*adpt
);
49 int emac_sgmii_link_change(struct emac_adapter
*adpt
, bool link_state
);
50 void emac_sgmii_reset(struct emac_adapter
*adpt
);