DRIVER_MODULE(rlphy, miibus, rlphy_driver, rlphy_devclass, 0, 0); static int rlphy_service(struct mii_softc *, struct mii_data *, int); static void rlphy_status(struct mii_softc *); /* * RealTek internal PHYs don't have vendor/device ID registers; * re(4) and rl(4) fake up a return value of all zeros. */ static const struct mii_phydesc rlintphys[] = { { 0, 0, "RealTek internal media interface" }, MII_PHY_END }; static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(REALTEK, RTL8201L), MII_PHY_DESC(ICPLUS, IP101), MII_PHY_END }; static int rlphy_probe(device_t dev) { const char *nic; int rv; rv = mii_phy_dev_probe(dev, rlphys, BUS_PROBE_DEFAULT); if (rv <= 0) return (rv); nic = device_get_name(device_get_parent(device_get_parent(dev)));
static void brgphy_reset(struct mii_softc *); static void brgphy_enable_loopback(struct mii_softc *); static void bcm5401_load_dspcode(struct mii_softc *); static void bcm5411_load_dspcode(struct mii_softc *); static void bcm54k2_load_dspcode(struct mii_softc *); static void brgphy_fixup_5704_a0_bug(struct mii_softc *); static void brgphy_fixup_adc_bug(struct mii_softc *); static void brgphy_fixup_adjust_trim(struct mii_softc *); static void brgphy_fixup_ber_bug(struct mii_softc *); static void brgphy_fixup_crc_bug(struct mii_softc *); static void brgphy_fixup_jitter_bug(struct mii_softc *); static void brgphy_ethernet_wirespeed(struct mii_softc *); static void brgphy_jumbo_settings(struct mii_softc *, u_long); static const struct mii_phydesc brgphys[] = { MII_PHY_DESC(BROADCOM, BCM5400), MII_PHY_DESC(BROADCOM, BCM5401), MII_PHY_DESC(BROADCOM, BCM5411), MII_PHY_DESC(BROADCOM, BCM54K2), MII_PHY_DESC(BROADCOM, BCM5701), MII_PHY_DESC(BROADCOM, BCM5703), MII_PHY_DESC(BROADCOM, BCM5704), MII_PHY_DESC(BROADCOM, BCM5705), MII_PHY_DESC(BROADCOM, BCM5706), MII_PHY_DESC(BROADCOM, BCM5714), MII_PHY_DESC(BROADCOM, BCM5421), MII_PHY_DESC(BROADCOM, BCM5750), MII_PHY_DESC(BROADCOM, BCM5752), MII_PHY_DESC(BROADCOM, BCM5780), MII_PHY_DESC(BROADCOM, BCM5708C), MII_PHY_DESC(BROADCOM2, BCM5482),
static devclass_t ip1000phy_devclass; static driver_t ip1000phy_driver = { "ip1000phy", ip1000phy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(ip1000phy, miibus, ip1000phy_driver, ip1000phy_devclass, 0, 0); static int ip1000phy_service(struct mii_softc *, struct mii_data *, int); static void ip1000phy_status(struct mii_softc *); static void ip1000phy_reset(struct mii_softc *); static int ip1000phy_mii_phy_auto(struct mii_softc *, int); static const struct mii_phydesc ip1000phys[] = { MII_PHY_DESC(xxICPLUS, IP1000A), MII_PHY_DESC(xxICPLUS, IP1001), MII_PHY_END }; static const struct mii_phy_funcs ip1000phy_funcs = { ip1000phy_service, ip1000phy_status, ip1000phy_reset }; static int ip1000phy_probe(device_t dev) { return (mii_phy_dev_probe(dev, ip1000phys, BUS_PROBE_DEFAULT));
static int truephy_attach(device_t); static int truephy_probe(device_t); static void truephy_reset(struct mii_softc *); static void truephy_status(struct mii_softc *); static device_method_t truephy_methods[] = { /* device interface */ DEVMETHOD(device_probe, truephy_probe), DEVMETHOD(device_attach, truephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), { 0, 0 } }; static const struct mii_phydesc truephys[] = { MII_PHY_DESC(AGERE, ET1011C), MII_PHY_END }; static devclass_t truephy_devclass; static driver_t truephy_driver = { "truephy", truephy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(truephy, miibus, truephy_driver, truephy_devclass, 0, 0); static const struct truephy_dsp { uint16_t index;
static devclass_t nsphyter_devclass; static driver_t nsphyter_driver = { "nsphyter", nsphyter_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(nsphyter, miibus, nsphyter_driver, nsphyter_devclass, 0, 0); static int nsphyter_service(struct mii_softc *, struct mii_data *, int); static void nsphyter_status(struct mii_softc *); static void nsphyter_reset(struct mii_softc *); static const struct mii_phydesc nsphyters[] = { MII_PHY_DESC(xxNATSEMI, DP83815), MII_PHY_DESC(xxNATSEMI, DP83843), MII_PHY_DESC(xxNATSEMI, DP83847), MII_PHY_DESC(xxNATSEMI, DP83849), MII_PHY_END }; static const struct mii_phy_funcs nsphyter_funcs = { nsphyter_service, nsphyter_status, nsphyter_reset }; static int nsphyter_probe(device_t dev) {
}; static devclass_t pnaphy_devclass; static driver_t pnaphy_driver = { "pnaphy", pnaphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(pnaphy, miibus, pnaphy_driver, pnaphy_devclass, 0, 0); static int pnaphy_service(struct mii_softc *, struct mii_data *,int); static const struct mii_phydesc pnaphys[] = { MII_PHY_DESC(yyAMD, 79c901home), MII_PHY_END }; static const struct mii_phy_funcs pnaphy_funcs = { pnaphy_service, ukphy_status, mii_phy_reset }; static int pnaphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, pnaphys, BUS_PROBE_DEFAULT)); }
}; static devclass_t jmphy_devclass; static driver_t jmphy_driver = { "jmphy", jmphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(jmphy, miibus, jmphy_driver, jmphy_devclass, 0, 0); static int jmphy_service(struct mii_softc *, struct mii_data *, int); static void jmphy_status(struct mii_softc *); static const struct mii_phydesc jmphys[] = { MII_PHY_DESC(JMICRON, JMP202), MII_PHY_DESC(JMICRON, JMP211), MII_PHY_END }; static const struct mii_phy_funcs jmphy_funcs = { jmphy_service, jmphy_status, jmphy_reset }; static int jmphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, jmphys, BUS_PROBE_DEFAULT));
static driver_t atphy_driver = { "atphy", atphy_methods, sizeof(struct atphy_softc) }; DRIVER_MODULE(atphy, miibus, atphy_driver, atphy_devclass, 0, 0); static int atphy_service(struct mii_softc *, struct mii_data *, int); static void atphy_status(struct mii_softc *); static void atphy_reset(struct mii_softc *); static uint16_t atphy_anar(struct ifmedia_entry *); static int atphy_auto(struct mii_softc *); static const struct mii_phydesc atphys[] = { MII_PHY_DESC(ATHEROS, F1), MII_PHY_END }; static int atphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, atphys, BUS_PROBE_DEFAULT)); } static int atphy_attach(device_t dev) { struct atphy_softc *asc; struct mii_softc *sc;
static devclass_t xmphy_devclass; static driver_t xmphy_driver = { "xmphy", xmphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(xmphy, miibus, xmphy_driver, xmphy_devclass, 0, 0); static int xmphy_service(struct mii_softc *, struct mii_data *, int); static void xmphy_status(struct mii_softc *); static int xmphy_mii_phy_auto(struct mii_softc *); static const struct mii_phydesc xmphys[] = { MII_PHY_DESC(xxJATO, BASEX), MII_PHY_DESC(xxXAQTI, XMACII), MII_PHY_END }; static const struct mii_phy_funcs xmphy_funcs = { xmphy_service, xmphy_status, mii_phy_reset }; static int xmphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, xmphys, BUS_PROBE_DEFAULT));
static devclass_t qsphy_devclass; static driver_t qsphy_driver = { "qsphy", qsphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(qsphy, miibus, qsphy_driver, qsphy_devclass, 0, 0); static int qsphy_service(struct mii_softc *, struct mii_data *, int); static void qsphy_reset(struct mii_softc *); static void qsphy_status(struct mii_softc *); static const struct mii_phydesc qsphys[] = { MII_PHY_DESC(xxQUALSEMI, QS6612), MII_PHY_END }; static const struct mii_phy_funcs qsphy_funcs = { qsphy_service, qsphy_status, qsphy_reset }; static int qsphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, qsphys, BUS_PROBE_DEFAULT)); }
}; static devclass_t pnaphy_devclass; static driver_t pnaphy_driver = { "pnaphy", pnaphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(pnaphy, miibus, pnaphy_driver, pnaphy_devclass, 0, 0); static int pnaphy_service(struct mii_softc *, struct mii_data *,int); static const struct mii_phydesc pnaphys[] = { MII_PHY_DESC(AMD, 79c978), MII_PHY_END }; static int pnaphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, pnaphys, BUS_PROBE_DEFAULT)); } static int pnaphy_attach(device_t dev) { struct mii_softc *sc; struct mii_attach_args *ma;
static devclass_t amphy_devclass; static driver_t amphy_driver = { "amphy", amphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(amphy, miibus, amphy_driver, amphy_devclass, 0, 0); static int amphy_service(struct mii_softc *, struct mii_data *, int); static void amphy_status(struct mii_softc *); static const struct mii_phydesc amphys[] = { MII_PHY_DESC(DAVICOM, DM9102), MII_PHY_DESC(xxAMD, 79C873), MII_PHY_DESC(xxDAVICOM, DM9101), MII_PHY_END }; static int amphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, amphys, BUS_PROBE_DEFAULT)); } static int amphy_attach(device_t dev) {
static devclass_t bmtphy_devclass; static driver_t bmtphy_driver = { "bmtphy", bmtphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(bmtphy, miibus, bmtphy_driver, bmtphy_devclass, 0, 0); static int bmtphy_service(struct mii_softc *, struct mii_data *, int); static void bmtphy_status(struct mii_softc *); static const struct mii_phydesc bmtphys_dp[] = { MII_PHY_DESC(BROADCOM, BCM4401), MII_PHY_DESC(BROADCOM, BCM5201), MII_PHY_DESC(BROADCOM, BCM5221), MII_PHY_END }; static const struct mii_phydesc bmtphys_lp[] = { MII_PHY_DESC(BROADCOM, 3C905B), MII_PHY_DESC(BROADCOM, 3C905C), MII_PHY_END }; static int bmtphy_probe(device_t dev) { int rval;
DRIVER_MODULE(xlphy, miibus, xlphy_driver, xlphy_devclass, 0, 0); static int xlphy_service(struct mii_softc *, struct mii_data *, int); static void xlphy_reset(struct mii_softc *); /* * Some 3Com internal PHYs report zero for OUI and model, others use * actual values. * Note that the 3Com internal PHYs having OUI 0x105a and model 0 are * handled fine by ukphy(4); they can be isolated and don't require * special treatment after reset. */ static const struct mii_phydesc xlphys[] = { { 0, 0, "3Com internal media interface" }, MII_PHY_DESC(xxBROADCOM, 3C905C), MII_PHY_END }; static const struct mii_phy_funcs xlphy_funcs = { xlphy_service, ukphy_status, xlphy_reset }; static int xlphy_probe(device_t dev) { if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), "xl") == 0)
"rgephy", rgephy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(rgephy, miibus, rgephy_driver, rgephy_devclass, 0, 0); static int rgephy_service(struct mii_softc *, struct mii_data *, int); static void rgephy_status(struct mii_softc *); static int rgephy_mii_phy_auto(struct mii_softc *, int); static void rgephy_reset(struct mii_softc *); static void rgephy_loop(struct mii_softc *); static void rgephy_load_dspcode(struct mii_softc *); static const struct mii_phydesc rgephys[] = { MII_PHY_DESC(REALTEK, RTL8169S), MII_PHY_DESC(REALTEK, RTL8251), MII_PHY_END }; static const struct mii_phy_funcs rgephy_funcs = { rgephy_service, rgephy_status, rgephy_reset }; static int rgephy_probe(device_t dev) { return (mii_phy_dev_probe(dev, rgephys, BUS_PROBE_DEFAULT));
static driver_t tlphy_driver = { "tlphy", tlphy_methods, sizeof(struct tlphy_softc) }; DRIVER_MODULE(tlphy, miibus, tlphy_driver, tlphy_devclass, 0, 0); static int tlphy_service(struct mii_softc *, struct mii_data *, int); static int tlphy_auto(struct tlphy_softc *); static void tlphy_acomp(struct tlphy_softc *); static void tlphy_status(struct mii_softc *); static const struct mii_phydesc tlphys[] = { MII_PHY_DESC(TI, TLAN10T), MII_PHY_END }; static const struct mii_phy_funcs tlphy_funcs = { tlphy_service, tlphy_status, mii_phy_reset }; static int tlphy_probe(device_t dev) { if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), "tl") != 0)
DRIVER_MODULE(rlphy, miibus, rlphy_driver, rlphy_devclass, 0, 0); static int rlphy_service(struct mii_softc *, struct mii_data *, int); static void rlphy_status(struct mii_softc *); /* * RealTek internal PHYs don't have vendor/device ID registers; * re(4) and rl(4) fake up a return value of all zeros. */ static const struct mii_phydesc rlintphys[] = { { 0, 0, "RealTek internal media interface" }, MII_PHY_END }; static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(yyREALTEK, RTL8201L), MII_PHY_DESC(REALTEK, RTL8201E), MII_PHY_DESC(xxICPLUS, IP101), MII_PHY_END }; static const struct mii_phy_funcs rlphy_funcs = { rlphy_service, rlphy_status, mii_phy_reset }; static int rlphy_probe(device_t dev) { const char *nic;
static devclass_t amphy_devclass; static driver_t amphy_driver = { "amphy", amphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(amphy, miibus, amphy_driver, amphy_devclass, 0, 0); static int amphy_service(struct mii_softc *, struct mii_data *, int); static void amphy_status(struct mii_softc *); static const struct mii_phydesc amphys[] = { MII_PHY_DESC(xxDAVICOM, DM9102), MII_PHY_DESC(xxDAVICOM, DM9101), MII_PHY_DESC(yyDAVICOM, DM9101), MII_PHY_END }; static const struct mii_phy_funcs amphy_funcs = { amphy_service, amphy_status, mii_phy_reset }; static int amphy_probe(device_t dev) {
static driver_t ciphy_driver = { "ciphy", ciphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(ciphy, miibus, ciphy_driver, ciphy_devclass, 0, 0); static int ciphy_service(struct mii_softc *, struct mii_data *, int); static void ciphy_status(struct mii_softc *); static void ciphy_reset(struct mii_softc *); static void ciphy_fixup(struct mii_softc *); static const struct mii_phydesc ciphys[] = { MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; static int ciphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, ciphys, BUS_PROBE_DEFAULT)); } static int
static driver_t atphy_driver = { "atphy", atphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(atphy, miibus, atphy_driver, atphy_devclass, 0, 0); static int atphy_service(struct mii_softc *, struct mii_data *, int); static void atphy_status(struct mii_softc *); static void atphy_reset(struct mii_softc *); static uint16_t atphy_anar(struct ifmedia_entry *); static int atphy_setmedia(struct mii_softc *, int); static const struct mii_phydesc atphys[] = { MII_PHY_DESC(xxATHEROS, F1), MII_PHY_DESC(xxATHEROS, F1_7), MII_PHY_DESC(xxATHEROS, F2), MII_PHY_END }; static const struct mii_phy_funcs atphy_funcs = { atphy_service, atphy_status, atphy_reset }; static int atphy_probe(device_t dev) {
static devclass_t nsphy_devclass; static driver_t nsphy_driver = { "nsphy", nsphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(nsphy, miibus, nsphy_driver, nsphy_devclass, 0, 0); static int nsphy_service(struct mii_softc *, struct mii_data *, int); static void nsphy_status(struct mii_softc *); static void nsphy_reset(struct mii_softc *); static const struct mii_phydesc nsphys[] = { MII_PHY_DESC(xxNATSEMI, DP83840), MII_PHY_END }; static const struct mii_phy_funcs nsphy_funcs = { nsphy_service, nsphy_status, nsphy_reset }; static int nsphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, nsphys, BUS_PROBE_DEFAULT)); }
static driver_t tlphy_driver = { "tlphy", tlphy_methods, sizeof(struct tlphy_softc) }; DRIVER_MODULE(tlphy, miibus, tlphy_driver, tlphy_devclass, 0, 0); static int tlphy_service(struct mii_softc *, struct mii_data *, int); static int tlphy_auto(struct tlphy_softc *); static void tlphy_acomp(struct tlphy_softc *); static void tlphy_status(struct tlphy_softc *); static const struct mii_phydesc tlphys[] = { MII_PHY_DESC(xxTI, TLAN10T), MII_PHY_END }; static int tlphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, tlphys, BUS_PROBE_DEFAULT)); } static int tlphy_attach(device_t dev) { device_t *devlist; struct tlphy_softc *sc;
static driver_t ciphy_driver = { "ciphy", ciphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(ciphy, miibus, ciphy_driver, ciphy_devclass, 0, 0); static int ciphy_service(struct mii_softc *, struct mii_data *, int); static void ciphy_status(struct mii_softc *); static void ciphy_reset(struct mii_softc *); static void ciphy_fixup(struct mii_softc *); static const struct mii_phydesc ciphys[] = { MII_PHY_DESC(xxCICADA, CS8201), MII_PHY_DESC(xxCICADA, CS8201A), MII_PHY_DESC(xxCICADA, CS8201B), MII_PHY_DESC(xxCICADA, CS8204), MII_PHY_DESC(xxCICADA, VSC8211), MII_PHY_DESC(xxCICADA, VSC8221), MII_PHY_DESC(xxCICADA, CS8244), MII_PHY_DESC(xxVITESSE, VSC8601), MII_PHY_DESC(xxVITESSE, VSC8641), MII_PHY_END }; static const struct mii_phy_funcs ciphy_funcs = { ciphy_service, ciphy_status, ciphy_reset
static devclass_t acphy_devclass; static driver_t acphy_driver = { "acphy", acphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(acphy, miibus, acphy_driver, acphy_devclass, 0, 0); static int acphy_service(struct mii_softc *, struct mii_data *, int); static void acphy_reset(struct mii_softc *); static void acphy_status(struct mii_softc *); static const struct mii_phydesc acphys[] = { MII_PHY_DESC(xxALTIMA, AC101), MII_PHY_DESC(xxALTIMA, AC101L), /* XXX This is reported to work, but it's not from any data sheet. */ MII_PHY_DESC(xxALTIMA, ACXXX), MII_PHY_END }; static int acphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, acphys, BUS_PROBE_DEFAULT)); } static int acphy_attach(device_t dev)
DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD_END }; static devclass_t smcphy_devclass; static driver_t smcphy_driver = { "smcphy", smcphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(smcphy, miibus, smcphy_driver, smcphy_devclass, 0, 0); static const struct mii_phydesc smcphys[] = { MII_PHY_DESC(SEEQ, 80220), MII_PHY_DESC(SEEQ, 84220), MII_PHY_END }; static const struct mii_phy_funcs smcphy80220_funcs = { smcphy_service, smcphy_status, mii_phy_reset }; static const struct mii_phy_funcs smcphy_funcs = { smcphy_service, smcphy_status, smcphy_reset };
DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD_END }; static devclass_t micphy_devclass; static driver_t micphy_driver = { "micphy", micphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(micphy, miibus, micphy_driver, micphy_devclass, 0, 0); static const struct mii_phydesc micphys[] = { MII_PHY_DESC(MICREL, KSZ8081), MII_PHY_DESC(MICREL, KSZ9021), MII_PHY_DESC(MICREL, KSZ9031), MII_PHY_END }; static const struct mii_phy_funcs micphy_funcs = { micphy_service, ukphy_status, micphy_reset }; static uint32_t ksz9031_read(struct mii_softc *sc, uint32_t devaddr, uint32_t reg) { /* Set up device address and register. */
static devclass_t e1000phy_devclass; static driver_t e1000phy_driver = { "e1000phy", e1000phy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(e1000phy, miibus, e1000phy_driver, e1000phy_devclass, 0, 0); static int e1000phy_service(struct mii_softc *, struct mii_data *, int); static void e1000phy_status(struct mii_softc *); static void e1000phy_reset(struct mii_softc *); static int e1000phy_mii_phy_auto(struct mii_softc *, int); static const struct mii_phydesc e1000phys[] = { MII_PHY_DESC(MARVELL, E1000), MII_PHY_DESC(MARVELL, E1011), MII_PHY_DESC(MARVELL, E1000_3), MII_PHY_DESC(MARVELL, E1000_5), MII_PHY_DESC(MARVELL, E1111), MII_PHY_DESC(xxMARVELL, E1000), MII_PHY_DESC(xxMARVELL, E1011), MII_PHY_DESC(xxMARVELL, E1000_3), MII_PHY_DESC(xxMARVELL, E1000S), MII_PHY_DESC(xxMARVELL, E1000_5), MII_PHY_DESC(xxMARVELL, E1101), MII_PHY_DESC(xxMARVELL, E3082), MII_PHY_DESC(xxMARVELL, E1112), MII_PHY_DESC(xxMARVELL, E1149), MII_PHY_DESC(xxMARVELL, E1111), MII_PHY_DESC(xxMARVELL, E1116),
static devclass_t rdcphy_devclass; static driver_t rdcphy_driver = { "rdcphy", rdcphy_methods, sizeof(struct rdcphy_softc) }; DRIVER_MODULE(rdcphy, miibus, rdcphy_driver, rdcphy_devclass, 0, 0); static int rdcphy_service(struct mii_softc *, struct mii_data *, int); static void rdcphy_status(struct mii_softc *); static const struct mii_phydesc rdcphys[] = { MII_PHY_DESC(RDC, R6040), MII_PHY_END }; static const struct mii_phy_funcs rdcphy_funcs = { rdcphy_service, rdcphy_status, mii_phy_reset }; static int rdcphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, rdcphys, BUS_PROBE_DEFAULT)); }
DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD_END }; static devclass_t micphy_devclass; static driver_t micphy_driver = { "micphy", micphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(micphy, miibus, micphy_driver, micphy_devclass, 0, 0); static const struct mii_phydesc micphys[] = { MII_PHY_DESC(MICREL, KSZ9021), MII_PHY_END }; static const struct mii_phy_funcs micphy_funcs = { micphy_service, ukphy_status, mii_phy_reset }; static void micphy_write(struct mii_softc *sc, uint32_t reg, uint32_t val) { PHY_WRITE(sc, MII_KSZPHY_EXTREG, KSZPHY_EXTREG_WRITE | reg); PHY_WRITE(sc, MII_KSZPHY_EXTREG_WRITE, val); }
static devclass_t tdkphy_devclass; static driver_t tdkphy_driver = { "tdkphy", tdkphy_methods, sizeof(struct mii_softc) }; DRIVER_MODULE(tdkphy, miibus, tdkphy_driver, tdkphy_devclass, 0, 0); static int tdkphy_service(struct mii_softc *, struct mii_data *, int); static void tdkphy_status(struct mii_softc *); static const struct mii_phydesc tdkphys[] = { MII_PHY_DESC(xxTSC, 78Q2120), MII_PHY_END }; static const struct mii_phy_funcs tdkphy_funcs = { tdkphy_service, tdkphy_status, mii_phy_reset }; static int tdkphy_probe(device_t dev) { return (mii_phy_dev_probe(dev, tdkphys, BUS_PROBE_DEFAULT)); }