Index: dev/pci/files.pci =================================================================== RCS file: /cvs/src/sys/dev/pci/files.pci,v retrieving revision 1.312 diff -u -p -r1.312 files.pci --- dev/pci/files.pci 6 Feb 2015 19:49:29 -0000 1.312 +++ dev/pci/files.pci 10 Feb 2015 01:26:46 -0000 @@ -805,7 +805,7 @@ file dev/pci/km.c km # Intel SOC GCU device gcu attach gcu at pci -file dev/pci/gcu.c gcu +file dev/pci/gcu.c gcu needs-flag # AMD Geode CS5536 Audio device auglx: audio, ac97 Index: dev/pci/gcu.h =================================================================== RCS file: dev/pci/gcu.h diff -N dev/pci/gcu.h --- dev/pci/gcu.h 25 Nov 2009 13:28:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -/* $OpenBSD: gcu.h,v 1.1 2009/11/25 13:28:13 dms Exp $ */ - -/* - * Copyright (c) 2009 Dariusz Swiderski - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -struct gcu_softc { - struct device sc_dev; - - bus_addr_t addr; - bus_size_t size; - bus_space_tag_t tag; - bus_space_handle_t handle; - struct mutex mdio_mtx; -}; Index: dev/pci/gcu_var.h =================================================================== RCS file: dev/pci/gcu_var.h diff -N dev/pci/gcu_var.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dev/pci/gcu_var.h 10 Feb 2015 01:26:46 -0000 @@ -0,0 +1,27 @@ +/* $OpenBSD: gcu.h,v 1.1 2009/11/25 13:28:13 dms Exp $ */ + +/* + * Copyright (c) 2009 Dariusz Swiderski + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +struct gcu_softc { + struct device sc_dev; + + bus_addr_t addr; + bus_size_t size; + bus_space_tag_t tag; + bus_space_handle_t handle; + struct mutex mdio_mtx; +}; Index: dev/pci/if_em_soc.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em_soc.c,v retrieving revision 1.2 diff -u -p -r1.2 if_em_soc.c --- dev/pci/if_em_soc.c 7 Apr 2011 15:30:16 -0000 1.2 +++ dev/pci/if_em_soc.c 10 Feb 2015 01:26:46 -0000 @@ -19,24 +19,24 @@ #include #include #include -#include +#include #include +#include "gcu.h" + void em_media_status(struct ifnet *, struct ifmediareq *); int em_media_change(struct ifnet *); void * em_lookup_gcu(struct device *self) { - struct device *dev; +#if NGCU > 0 + extern struct cfdriver gcu_cd; - INIT_DEBUGOUT("em_lookup_gcu"); - TAILQ_FOREACH(dev, &alldevs, dv_list) { - if (strcmp(dev->dv_xname, "gcu0") == 0) { - return dev; - } - } - return 0; + return (device_lookup(&gcu_cd, 0)); +#else + return (NULL); +#endif } int