static void armadillo9_device_register(device_t dev, void *aux) { /* MAC address for the built-in Ethernet. */ if (device_is_a(dev, "epe")) { prop_data_t pd = prop_data_create_data_nocopy( armadillo9_ethaddr, ETHER_ADDR_LEN); KASSERT(pd != NULL); if (prop_dictionary_set(device_properties(dev), "mac-address", pd) == false) { printf("WARNING: unable to set mac-addr property " "for %s\n", device_xname(dev)); } prop_object_release(pd); } }
void device_register(struct device *dev, void *aux) { struct device *pdev; /* * We don't ever know the boot device. But that's because the * firmware only loads from the network or the parallel port. */ /* * Fetch the MAC address for the built-in Ethernet (we grab it * from PMON earlier in the boot process). */ if ((pdev = device_parent(dev)) != NULL && device_is_a(pdev, "pci")) { struct pci_attach_args *pa = aux; if (BUILTIN_ETHERNET_P(pa)) { prop_data_t pd = prop_data_create_data_nocopy( algor_ethaddr, ETHER_ADDR_LEN); KASSERT(pd != NULL); if (prop_dictionary_set(device_properties(dev), "mac-addr", pd) == false) { printf("WARNING: unable to set mac-addr " "property for %s\n", dev->dv_xname); } prop_object_release(pd); #if defined(ALGOR_P4032) /* * XXX This is gross, disgusting, and otherwise vile, * XXX but V962 rev. < B2 have broken DMA FIFOs. Give * XXX the on-board Ethernet a different DMA window * XXX that has pre-fetching disabled so that Ethernet * XXX performance doesn't completely suck. */ pa->pa_dmat = &p4032_configuration.ac_pci_pf_dmat; pa->pa_dmat64 = NULL; #endif /* ALGOR_P4032 */ } } }