Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/puc/puc.c
Show First 20 Lines • Show All 725 Lines • ▼ Show 20 Lines | case PUC_IVAR_TYPE: | ||||
break; | break; | ||||
default: | default: | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
puc_bus_write_ivar(device_t dev, device_t child, int index, uintptr_t val) | |||||
{ | |||||
struct puc_port *port; | |||||
struct puc_softc *sc; | |||||
intptr_t *varr; | |||||
/* Get our immediate child. */ | |||||
while (child != NULL && device_get_parent(child) != dev) | |||||
child = device_get_parent(child); | |||||
if (child == NULL) | |||||
return (EINVAL); | |||||
port = device_get_ivars(child); | |||||
KASSERT(port != NULL, ("%s %d", __func__, __LINE__)); | |||||
switch(index) { | |||||
case PUC_IVAR_TARGETBAUD: | |||||
sc = device_get_softc(dev); | |||||
if (sc && sc->sc_cfg && sc->sc_cfg->config_function) { | |||||
varr = (intptr_t *)val; | |||||
return sc->sc_cfg->config_function(sc, PUC_CFG_TARGETBAUD, port->p_nr - 1, varr); | |||||
} | |||||
return EOPNOTSUPP; | |||||
} | |||||
return ENOENT; | |||||
} | |||||
int | |||||
puc_bus_print_child(device_t dev, device_t child) | puc_bus_print_child(device_t dev, device_t child) | ||||
{ | { | ||||
struct puc_port *port; | struct puc_port *port; | ||||
int retval; | int retval; | ||||
port = device_get_ivars(child); | port = device_get_ivars(child); | ||||
retval = 0; | retval = 0; | ||||
Show All 28 Lines |