Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/nlm/dev/net/xlpge.c
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | |||||
static int nlm_xlpge_probe(device_t); | static int nlm_xlpge_probe(device_t); | ||||
static int nlm_xlpge_attach(device_t); | static int nlm_xlpge_attach(device_t); | ||||
static int nlm_xlpge_detach(device_t); | static int nlm_xlpge_detach(device_t); | ||||
static int nlm_xlpge_suspend(device_t); | static int nlm_xlpge_suspend(device_t); | ||||
static int nlm_xlpge_resume(device_t); | static int nlm_xlpge_resume(device_t); | ||||
static int nlm_xlpge_shutdown(device_t); | static int nlm_xlpge_shutdown(device_t); | ||||
/* mii override functions */ | /* mii override functions */ | ||||
static int nlm_xlpge_mii_read(struct device *, int, int); | static int nlm_xlpge_mii_read(device_t, int, int); | ||||
static int nlm_xlpge_mii_write(struct device *, int, int, int); | static int nlm_xlpge_mii_write(device_t, int, int, int); | ||||
static void nlm_xlpge_mii_statchg(device_t); | static void nlm_xlpge_mii_statchg(device_t); | ||||
static device_method_t nlm_xlpge_methods[] = { | static device_method_t nlm_xlpge_methods[] = { | ||||
/* Methods from the device interface */ | /* Methods from the device interface */ | ||||
DEVMETHOD(device_probe, nlm_xlpge_probe), | DEVMETHOD(device_probe, nlm_xlpge_probe), | ||||
DEVMETHOD(device_attach, nlm_xlpge_attach), | DEVMETHOD(device_attach, nlm_xlpge_attach), | ||||
DEVMETHOD(device_detach, nlm_xlpge_detach), | DEVMETHOD(device_detach, nlm_xlpge_detach), | ||||
DEVMETHOD(device_suspend, nlm_xlpge_suspend), | DEVMETHOD(device_suspend, nlm_xlpge_suspend), | ||||
▲ Show 20 Lines • Show All 1,097 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* miibus function with custom implementation | * miibus function with custom implementation | ||||
*/ | */ | ||||
static int | static int | ||||
nlm_xlpge_mii_read(struct device *dev, int phyaddr, int regidx) | nlm_xlpge_mii_read(device_t dev, int phyaddr, int regidx) | ||||
{ | { | ||||
struct nlm_xlpge_softc *sc; | struct nlm_xlpge_softc *sc; | ||||
int val; | int val; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (sc->type == SGMIIC) | if (sc->type == SGMIIC) | ||||
val = nlm_gmac_mdio_read(sc->base_addr, sc->mdio_bus, | val = nlm_gmac_mdio_read(sc->base_addr, sc->mdio_bus, | ||||
BLOCK_7, LANE_CFG, phyaddr, regidx); | BLOCK_7, LANE_CFG, phyaddr, regidx); | ||||
else | else | ||||
val = 0xffff; | val = 0xffff; | ||||
return (val); | return (val); | ||||
} | } | ||||
static int | static int | ||||
nlm_xlpge_mii_write(struct device *dev, int phyaddr, int regidx, int val) | nlm_xlpge_mii_write(device_t dev, int phyaddr, int regidx, int val) | ||||
{ | { | ||||
struct nlm_xlpge_softc *sc; | struct nlm_xlpge_softc *sc; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (sc->type == SGMIIC) | if (sc->type == SGMIIC) | ||||
nlm_gmac_mdio_write(sc->base_addr, sc->mdio_bus, BLOCK_7, | nlm_gmac_mdio_write(sc->base_addr, sc->mdio_bus, BLOCK_7, | ||||
LANE_CFG, phyaddr, regidx, val); | LANE_CFG, phyaddr, regidx, val); | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |