FreeBSD/sys/dev/bhnd/bhndb/bhndb.c
/**
 * Find a hardware specification for @p dev.
 * 
 * @param sc The bhndb device state.
 * @param devs All devices enumerated on the bridged bhnd bus.
 * @param ndevs The length of @p devs.
 * @param[out] hw On success, the matched hardware specification.
 * with @p dev.
 * 
 * @retval 0 success
 * @retval non-zero if an error occurs fetching device info for comparison.
 */
Find a hardware specification for @p dev.

@param sc The bhndb device state.
@param devs All devices enumerated on the bridged bhnd bus.
@param ndevs The length of @p devs.
@param[out] hw On success, the matched hardware specification.
with @p dev.

@retval 0 success
@retval non-zero if an error occurs fetching device info for comparison.
Find a hardware specification for @p dev . @param sc The bhndb device state . @param devs All devices enumerated on the bridged bhnd bus . @param ndevs The length of @p devs . @param [ out ] hw On success the matched hardware specification . with @p dev . @retval 0 success @retval non - zero if an error occurs fetching device info for comparison .
static int
bhndb_find_hwspec(struct bhndb_softc *sc, device_t *devs, int ndevs,
    const struct bhndb_hw **hw)
{
	const struct bhndb_hw	*next, *hw_table;
	hw_table = BHNDB_BUS_GET_HARDWARE_TABLE(sc->parent_dev, sc->dev);
	for (next = hw_table; next->hw_reqs != NULL; next++) {
		if (!bhndb_hw_matches(devs, ndevs, next))
			continue;
		*hw = next;
		return (0);
	}
	return (ENOENT);
}
static int bhndb_find_hwspec ( struct bhndb_softc * sc , device_t * devs , int ndevs , const struct bhndb_hw * * hw ) { const struct bhndb_hw * next , * hw_table ; hw_table = BHNDB_BUS_GET_HARDWARE_TABLE ( sc -> parent_dev , sc -> dev ) ; for ( next = hw_table ; next -> hw_reqs != NULL ; next ++ ) { if ( ! bhndb_hw_matches ( devs , ndevs , next ) ) continue ; * hw = next ; return ( 0 ) ; } return ( ENOENT ) ; }
Find a hardware specification for @p dev.
Find a hardware specification for @p dev .
/* Search for the first matching hardware config. */ /* Found */