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
30 struct rgmii_regs {
31 u32 fer;
32 u32 ssr;
33 };
34
35
36 struct 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
55 int rgmii_init(void);
56 void rgmii_exit(void);
57 int rgmii_attach(struct platform_device *ofdev, int input, int mode);
58 void rgmii_detach(struct platform_device *ofdev, int input);
59 void rgmii_get_mdio(struct platform_device *ofdev, int input);
60 void rgmii_put_mdio(struct platform_device *ofdev, int input);
61 void rgmii_set_speed(struct platform_device *ofdev, int input, int speed);
62 int rgmii_get_regs_len(struct platform_device *ofdev);
63 void *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