FreeBSD/sys/dev/bhnd/bhndb/bhndb.c
/**
 * Return the rman instance for a given resource @p type, if any.
 * 
 * @param sc The bhndb device state.
 * @param child The requesting child.
 * @param type The resource type (e.g. SYS_RES_MEMORY, SYS_RES_IRQ, ...)
 */
Return the rman instance for a given resource @p type, if any.

@param sc The bhndb device state.
@param child The requesting child.
@param type The resource type
Return the rman instance for a given resource @p type if any . @param sc The bhndb device state . @param child The requesting child . @param type The resource type
static struct rman *
bhndb_get_rman(struct bhndb_softc *sc, device_t child, int type)
{	
	switch (bhndb_get_addrspace(sc, child)) {
	case BHNDB_ADDRSPACE_NATIVE:
		switch (type) {
		case SYS_RES_MEMORY:
			return (&sc->bus_res->ht_mem_rman);
		case SYS_RES_IRQ:
			return (NULL);
		default:
			return (NULL);
		};
	case BHNDB_ADDRSPACE_BRIDGED:
		switch (type) {
		case SYS_RES_MEMORY:
			return (&sc->bus_res->br_mem_rman);
		case SYS_RES_IRQ:
			return (NULL);
		default:
			return (NULL);
		};
	}
	return (NULL);
}
static struct rman * bhndb_get_rman ( struct bhndb_softc * sc , device_t child , int type ) { switch ( bhndb_get_addrspace ( sc , child ) ) { case BHNDB_ADDRSPACE_NATIVE : switch ( type ) { case SYS_RES_MEMORY : return ( & sc -> bus_res -> ht_mem_rman ) ; case SYS_RES_IRQ : return ( NULL ) ; default : return ( NULL ) ; } ; case BHNDB_ADDRSPACE_BRIDGED : switch ( type ) { case SYS_RES_MEMORY : return ( & sc -> bus_res -> br_mem_rman ) ; case SYS_RES_IRQ : return ( NULL ) ; default : return ( NULL ) ; } ; } return ( NULL ) ; }
Return the rman instance for a given resource @p type, if any.
Return the rman instance for a given resource @p type if any .
// TODO // return &sc->irq_rman; /* Quieten gcc */