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