0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef __IBM_NEWEMAC_ZMII_H
0020 #define __IBM_NEWEMAC_ZMII_H
0021
0022
0023 struct zmii_regs {
0024 u32 fer;
0025 u32 ssr;
0026 u32 smiirs;
0027 };
0028
0029
0030 struct zmii_instance {
0031 struct zmii_regs __iomem *base;
0032
0033
0034 struct mutex lock;
0035
0036
0037 int mode;
0038
0039
0040 int users;
0041
0042
0043 u32 fer_save;
0044
0045
0046 struct platform_device *ofdev;
0047 };
0048
0049 #ifdef CONFIG_IBM_EMAC_ZMII
0050
0051 int zmii_init(void);
0052 void zmii_exit(void);
0053 int zmii_attach(struct platform_device *ofdev, int input,
0054 phy_interface_t *mode);
0055 void zmii_detach(struct platform_device *ofdev, int input);
0056 void zmii_get_mdio(struct platform_device *ofdev, int input);
0057 void zmii_put_mdio(struct platform_device *ofdev, int input);
0058 void zmii_set_speed(struct platform_device *ofdev, int input, int speed);
0059 int zmii_get_regs_len(struct platform_device *ocpdev);
0060 void *zmii_dump_regs(struct platform_device *ofdev, void *buf);
0061
0062 #else
0063 # define zmii_init() 0
0064 # define zmii_exit() do { } while(0)
0065 # define zmii_attach(x,y,z) (-ENXIO)
0066 # define zmii_detach(x,y) do { } while(0)
0067 # define zmii_get_mdio(x,y) do { } while(0)
0068 # define zmii_put_mdio(x,y) do { } while(0)
0069 # define zmii_set_speed(x,y,z) do { } while(0)
0070 # define zmii_get_regs_len(x) 0
0071 # define zmii_dump_regs(x,buf) (buf)
0072 #endif
0073
0074 #endif