1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __IBM_NEWEMAC_RGMII_H
23#define __IBM_NEWEMAC_RGMII_H
24
25
26#define RGMII_STANDARD 0
27#define RGMII_AXON 1
28
29
30struct rgmii_regs {
31 u32 fer;
32 u32 ssr;
33};
34
35
36struct rgmii_instance {
37 struct rgmii_regs __iomem *base;
38
39
40 int flags;
41#define EMAC_RGMII_FLAG_HAS_MDIO 0x00000001
42
43
44 struct mutex lock;
45
46
47 int users;
48
49
50 struct platform_device *ofdev;
51};
52
53#ifdef CONFIG_IBM_EMAC_RGMII
54
55int rgmii_init(void);
56void rgmii_exit(void);
57int rgmii_attach(struct platform_device *ofdev, int input, int mode);
58void rgmii_detach(struct platform_device *ofdev, int input);
59void rgmii_get_mdio(struct platform_device *ofdev, int input);
60void rgmii_put_mdio(struct platform_device *ofdev, int input);
61void rgmii_set_speed(struct platform_device *ofdev, int input, int speed);
62int rgmii_get_regs_len(struct platform_device *ofdev);
63void *rgmii_dump_regs(struct platform_device *ofdev, void *buf);
64
65#else
66
67# define rgmii_init() 0
68# define rgmii_exit() do { } while(0)
69# define rgmii_attach(x,y,z) (-ENXIO)
70# define rgmii_detach(x,y) do { } while(0)
71# define rgmii_get_mdio(o,i) do { } while (0)
72# define rgmii_put_mdio(o,i) do { } while (0)
73# define rgmii_set_speed(x,y,z) do { } while(0)
74# define rgmii_get_regs_len(x) 0
75# define rgmii_dump_regs(x,buf) (buf)
76#endif
77
78#endif
79