FreeBSD/sys/arm/at91/if_macb.c
/*
 * We have to know if we're using MII or RMII attachment
 * for the MACB to talk to the PHY correctly. With FDT,
 * we must use rmii if there's a proprety phy-mode
 * equal to "rmii". Otherwise we MII mode is used.
 */
We have to know if we're using MII or RMII attachment
for the MACB to talk to the PHY correctly. With FDT,
we must use rmii if there's a proprety phy-mode
equal to "rmii". Otherwise we MII mode is used.
We have to know if we ' re using MII or RMII attachment for the MACB to talk to the PHY correctly . With FDT we must use rmii if there ' s a proprety phy - mode equal to " rmii " . Otherwise we MII mode is used .
static void
macb_set_rmii(struct macb_softc *sc)
{
	phandle_t node;
	char prop[10];
	ssize_t len;
	node = ofw_bus_get_node(sc->dev);
	memset(prop, 0 ,sizeof(prop));
	len = OF_getproplen(node, "phy-mode");
	if (len != 4)
		return;
	if (OF_getprop(node, "phy-mode", prop, len) != len)
		return;
	if (strncmp(prop, "rmii", 4) == 0)
		sc->use_rmii = USRIO_RMII;
}
static void macb_set_rmii ( struct macb_softc * sc ) { phandle_t node ; char prop [ 10 ] ; ssize_t len ; node = ofw_bus_get_node ( sc -> dev ) ; memset ( prop , 0 , sizeof ( prop ) ) ; len = OF_getproplen ( node , " " ) ; if ( len != 4 ) return ; if ( OF_getprop ( node , " " , prop , len ) != len ) return ; if ( strncmp ( prop , " " , 4 ) == 0 ) sc -> use_rmii = USRIO_RMII ; }
We have to know if we're using MII or RMII attachment
 for the MACB to talk to the PHY correctly.
We have to know if we ' re using MII or RMII attachment for the MACB to talk to the PHY correctly .