0001
0002 #ifndef __LINUX_MDIO_BITBANG_H
0003 #define __LINUX_MDIO_BITBANG_H
0004
0005 #include <linux/phy.h>
0006
0007 struct module;
0008
0009 struct mdiobb_ctrl;
0010
0011 struct mdiobb_ops {
0012 struct module *owner;
0013
0014
0015
0016
0017 void (*set_mdc)(struct mdiobb_ctrl *ctrl, int level);
0018
0019
0020
0021
0022 void (*set_mdio_dir)(struct mdiobb_ctrl *ctrl, int output);
0023
0024
0025
0026
0027
0028 void (*set_mdio_data)(struct mdiobb_ctrl *ctrl, int value);
0029
0030
0031 int (*get_mdio_data)(struct mdiobb_ctrl *ctrl);
0032 };
0033
0034 struct mdiobb_ctrl {
0035 const struct mdiobb_ops *ops;
0036 unsigned int override_op_c22;
0037 u8 op_c22_read;
0038 u8 op_c22_write;
0039 };
0040
0041 int mdiobb_read(struct mii_bus *bus, int phy, int reg);
0042 int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val);
0043
0044
0045 struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl);
0046
0047
0048 void free_mdio_bitbang(struct mii_bus *bus);
0049
0050 #endif