Lines Matching refs:dev
27 * $FreeBSD: releng/11.0/sys/dev/etherswitch/arswitch/arswitch_phy.c 292738 2015-12-26 02:31:39Z adrian $
46 #include <dev/iicbus/iic.h>
47 #include <dev/iicbus/iiconf.h>
48 #include <dev/iicbus/iicbus.h>
49 #include <dev/mii/mii.h>
50 #include <dev/mii/miivar.h>
51 #include <dev/mdio/mdio.h>
53 #include <dev/etherswitch/etherswitch.h>
55 #include <dev/etherswitch/arswitch/arswitchreg.h>
56 #include <dev/etherswitch/arswitch/arswitchvar.h>
58 #include <dev/etherswitch/arswitch/arswitch_reg.h>
59 #include <dev/etherswitch/arswitch/arswitch_phy.h>
75 arswitch_readphy_external(device_t dev, int phy, int reg)
80 sc = device_get_softc(dev);
83 ret = (MDIO_READREG(device_get_parent(dev), phy, reg));
90 arswitch_writephy_external(device_t dev, int phy, int reg, int data)
94 sc = device_get_softc(dev);
97 (void) MDIO_WRITEREG(device_get_parent(dev), phy,
109 arswitch_readphy_internal(device_t dev, int phy, int reg)
116 sc = device_get_softc(dev);
130 err = arswitch_writereg_msb(dev, a,
135 DEVERR(dev, err, "arswitch_readphy()=%d: phy=%d.%02x\n", phy, reg);
139 ctrl = arswitch_readreg_msb(dev, a);
144 DPRINTF(dev, "arswitch_readphy(): phy=%d.%02x; timeout=%d\n", phy, reg, timeout);
147 data = arswitch_readreg_lsb(dev, a) &
158 arswitch_writephy_internal(device_t dev, int phy, int reg, int data)
165 sc = device_get_softc(dev);
177 err = arswitch_writereg(dev, a,
187 ctrl = arswitch_readreg(dev, a);
194 DEVERR(dev, err, "arswitch_writephy()=%d: phy=%d.%02x\n", phy, reg);