1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef __IBM_NEWEMAC_ZMII_H
20 #define __IBM_NEWEMAC_ZMII_H
21
22
23 struct zmii_regs {
24 u32 fer;
25 u32 ssr;
26 u32 smiirs;
27 };
28
29
30 struct zmii_instance {
31 struct zmii_regs __iomem *base;
32
33
34 struct mutex lock;
35
36
37 int mode;
38
39
40 int users;
41
42
43 u32 fer_save;
44
45
46 struct platform_device *ofdev;
47 };
48
49 #ifdef CONFIG_IBM_EMAC_ZMII
50
51 int zmii_init(void);
52 void zmii_exit(void);
53 int zmii_attach(struct platform_device *ofdev, int input, int *mode);
54 void zmii_detach(struct platform_device *ofdev, int input);
55 void zmii_get_mdio(struct platform_device *ofdev, int input);
56 void zmii_put_mdio(struct platform_device *ofdev, int input);
57 void zmii_set_speed(struct platform_device *ofdev, int input, int speed);
58 int zmii_get_regs_len(struct platform_device *ocpdev);
59 void *zmii_dump_regs(struct platform_device *ofdev, void *buf);
60
61 #else
62 # define zmii_init() 0
63 # define zmii_exit() do { } while(0)
64 # define zmii_attach(x,y,z) (-ENXIO)
65 # define zmii_detach(x,y) do { } while(0)
66 # define zmii_get_mdio(x,y) do { } while(0)
67 # define zmii_put_mdio(x,y) do { } while(0)
68 # define zmii_set_speed(x,y,z) do { } while(0)
69 # define zmii_get_regs_len(x) 0
70 # define zmii_dump_regs(x,buf) (buf)
71 #endif
72
73 #endif