diff options
author | imp <imp@FreeBSD.org> | 2005-02-16 01:08:43 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-02-16 01:08:43 +0000 |
commit | a4a07104a28b5d47bd62767056ad01aebce80188 (patch) | |
tree | 75eefd8ad9d03ebe4a3d5698a8935489b9841797 /sys/dev/mii | |
parent | 0d2242ab8432965adb45b4c4c17865c5cae088ea (diff) | |
download | FreeBSD-src-a4a07104a28b5d47bd62767056ad01aebce80188.zip FreeBSD-src-a4a07104a28b5d47bd62767056ad01aebce80188.tar.gz |
Add location and PNP info to the mii bus
Diffstat (limited to 'sys/dev/mii')
-rw-r--r-- | sys/dev/mii/mii.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 4ff8485..02f56b4 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -64,6 +64,10 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" +static int miibus_child_location_str(device_t bus, device_t child, char *buf, + size_t buflen); +static int miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, + size_t buflen); static int miibus_readreg(device_t, int, int); static int miibus_writereg(device_t, int, int, int); static void miibus_statchg(device_t); @@ -80,6 +84,8 @@ static device_method_t miibus_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), + DEVMETHOD(bus_child_location_str, miibus_child_location_str), /* MII interface */ DEVMETHOD(miibus_readreg, miibus_readreg), @@ -192,6 +198,24 @@ miibus_detach(device_t dev) } static int +miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, + size_t buflen) +{ + struct mii_attach_args *maa = device_get_ivars(child); + snprintf(buf, buflen, "id1=0x%x id2=0x%x", maa->mii_id1, maa->mii_id2); + return (0); +} + +static int +miibus_child_location_str(device_t bus, device_t child, char *buf, + size_t buflen) +{ + struct mii_attach_args *maa = device_get_ivars(child); + snprintf(buf, buflen, "phyno=%d", maa->mii_phyno); + return (0); +} + +static int miibus_readreg(device_t dev, int phy, int reg) { device_t parent; |