15 #include <linux/kernel.h>
16 #include <linux/module.h>
18 #include <linux/list.h>
19 #include <linux/mii.h>
23 #include <linux/slab.h>
25 #define MII_REGS_NUM 29
47 static int fixed_phy_update_regs(
struct fixed_phy *
fp)
57 switch (fp->
status.speed) {
73 pr_warn(
"fixed phy: unknown speed\n");
77 switch (fp->
status.speed) {
93 pr_warn(
"fixed phy: unknown speed\n");
104 if (fp->
status.asym_pause)
127 if (fp->
id == phy_id) {
132 fixed_phy_update_regs(fp);
134 return fp->
regs[reg_num];
141 static int fixed_mdio_write(
struct mii_bus *bus,
int phy_id,
int reg_num,
192 ret = fixed_phy_update_regs(fp);
206 static int __init fixed_mdio_bus_init(
void)
211 pdev = platform_device_register_simple(
"Fixed MDIO bus", 0,
NULL, 0);
217 fmb->
mii_bus = mdiobus_alloc();
220 goto err_mdiobus_reg;
224 fmb->
mii_bus->name =
"Fixed MDIO Bus";
227 fmb->
mii_bus->read = &fixed_mdio_read;
228 fmb->
mii_bus->write = &fixed_mdio_write;
233 goto err_mdiobus_alloc;
246 static void __exit fixed_mdio_bus_exit(
void)