FreeBSD/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Search @p windows for the first matching core window.
 * 
 * @param table The table to search.
 * @param class The required core class.
 * @param unit The required core unit, or -1.
 * @param port_type The required port type.
 * @param port The required port.
 * @param region The required region.
 *
 * @retval bhndb_regwin The first matching window.
 * @retval NULL If no matching window was found. 
 */
Search @p windows for the first matching core window.

@param table The table to search.
@param class The required core class.
@param unit The required core unit, or -1.
@param port_type The required port type.
@param port The required port.
@param region The required region.

@retval bhndb_regwin The first matching window.
@retval NULL If no matching window was found.
Search @p windows for the first matching core window . @param table The table to search . @param class The required core class . @param unit The required core unit or - 1 . @param port_type The required port type . @param port The required port . @param region The required region . @retval bhndb_regwin The first matching window . @retval NULL If no matching window was found .
const struct bhndb_regwin *
bhndb_regwin_find_core(const struct bhndb_regwin *table, bhnd_devclass_t class,
    int unit, bhnd_port_type port_type, u_int port, u_int region)
{
	const struct bhndb_regwin *rw;
	for (rw = table; rw->win_type != BHNDB_REGWIN_T_INVALID; rw++)
	{
		if (rw->win_type != BHNDB_REGWIN_T_CORE)
			continue;
		if (rw->d.core.class != class)
			continue;
		if (unit != -1 && rw->d.core.unit != unit)
			continue;
		if (rw->d.core.port_type != port_type)
			continue;
		if (rw->d.core.port != port)
			continue;
		if (rw->d.core.region != region)
			continue;
		return (rw);
	}
	return (NULL);
}
const struct bhndb_regwin * bhndb_regwin_find_core ( const struct bhndb_regwin * table , bhnd_devclass_t class , int unit , bhnd_port_type port_type , u_int port , u_int region ) { const struct bhndb_regwin * rw ; for ( rw = table ; rw -> win_type != BHNDB_REGWIN_T_INVALID ; rw ++ ) { if ( rw -> win_type != BHNDB_REGWIN_T_CORE ) continue ; if ( rw -> d . core . class != class ) continue ; if ( unit != -1 && rw -> d . core . unit != unit ) continue ; if ( rw -> d . core . port_type != port_type ) continue ; if ( rw -> d . core . port != port ) continue ; if ( rw -> d . core . region != region ) continue ; return ( rw ) ; } return ( NULL ) ; }
Search @p windows for the first matching core window.
Search @p windows for the first matching core window .