diff options
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/auixp.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/cs4280.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_bnx.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_iwm.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_myx.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_nxe.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_oce.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_pgt_pci.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_tht.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_txp.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/yds.c | 12 |
12 files changed, 59 insertions, 75 deletions
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 299d260e4c8..4207cac6cef 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.35 2015/05/11 06:46:21 ratchov Exp $ */ +/* $OpenBSD: auixp.c,v 1.36 2015/12/11 16:07:01 mpi Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -139,7 +139,7 @@ void auixp_get_default_params(void *, int, struct audio_params *); /* Supporting subroutines */ int auixp_init(struct auixp_softc *); void auixp_autodetect_codecs(struct auixp_softc *); -void auixp_post_config(void *); +void auixp_post_config(struct device *); void auixp_reset_aclink(struct auixp_softc *); int auixp_attach_codec(void *, struct ac97_codec_if *); @@ -1114,16 +1114,15 @@ auixp_attach(struct device *parent, struct device *self, void *aux) * delay further configuration of codecs and audio after interrupts * are enabled. */ - mountroothook_establish(auixp_post_config, self); + config_mountroot(self, auixp_post_config); } /* called from autoconfigure system when interrupts are enabled */ void -auixp_post_config(void *self) +auixp_post_config(struct device *self) { - struct auixp_softc *sc; + struct auixp_softc *sc = (struct auixp_softc *)self; - sc = (struct auixp_softc *)self; /* detect the AC97 codecs */ auixp_autodetect_codecs(sc); diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 8a4cf871614..8f6e6cf688b 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.47 2015/05/11 06:46:22 ratchov Exp $ */ +/* $OpenBSD: cs4280.c,v 1.48 2015/12/11 16:07:01 mpi Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -165,7 +165,7 @@ struct cs4280_softc { int cs4280_match(struct device *, void *, void *); void cs4280_attach(struct device *, struct device *, void *); int cs4280_activate(struct device *, int); -void cs4280_attachhook(void *xsc); +void cs4280_attachhook(struct device *); int cs4280_intr(void *); void cs4280_reset(void *); int cs4280_download_image(struct cs4280_softc *); @@ -539,9 +539,9 @@ cs4280_set_dac_rate(struct cs4280_softc *sc, int rate) } void -cs4280_attachhook(void *xsc) +cs4280_attachhook(struct device *self) { - struct cs4280_softc *sc = xsc; + struct cs4280_softc *sc = (struct cs4280_softc *)self; mixer_ctrl_t ctl; /* Initialization */ @@ -565,7 +565,7 @@ cs4280_attachhook(void *xsc) ctl.dev = cs4280_get_portnum_by_name(sc, AudioCinputs, AudioNcd, AudioNmute); cs4280_mixer_set_port(sc, &ctl); - + audio_attach_mi(&cs4280_hw_if, sc, &sc->sc_dev); #if NMIDI > 0 @@ -632,7 +632,7 @@ cs4280_attach(struct device *parent, struct device *self, void *aux) if (cs4280_init(sc, 1) != 0) return; - mountroothook_establish(cs4280_attachhook, sc); + config_mountroot(self, cs4280_attachhook); /* AC 97 attachement */ sc->host_if.arg = sc; diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 4737c19754a..890e75956fa 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_kms.c,v 1.44 2015/11/22 15:35:49 kettenis Exp $ */ +/* $OpenBSD: radeon_kms.c,v 1.45 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -106,7 +106,7 @@ int radeondrm_probe(struct device *, void *, void *); void radeondrm_attach_kms(struct device *, struct device *, void *); int radeondrm_detach_kms(struct device *, int); int radeondrm_activate_kms(struct device *, int); -void radeondrm_attachhook(void *); +void radeondrm_attachhook(struct device *); int radeondrm_forcedetach(struct radeon_device *); extern struct drm_ioctl_desc radeon_ioctls_kms[]; @@ -646,10 +646,7 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux) #endif rdev->shutdown = true; - if (rootvp == NULL) - mountroothook_establish(radeondrm_attachhook, rdev); - else - radeondrm_attachhook(rdev); + config_mountroot(self, radeondrm_attachhook); } int @@ -668,9 +665,9 @@ radeondrm_forcedetach(struct radeon_device *rdev) } void -radeondrm_attachhook(void *xsc) +radeondrm_attachhook(struct device *self) { - struct radeon_device *rdev = xsc; + struct radeon_device *rdev = (struct radeon_device *)self; int r, acpi_status; /* radeon_device_init should report only fatal error diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 8250c9b10b5..52e2efe2473 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.119 2015/12/10 12:24:27 dlg Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.120 2015/12/11 16:07:01 mpi Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -274,7 +274,7 @@ static struct flash_spec flash_5709 = { /****************************************************************************/ int bnx_probe(struct device *, void *, void *); void bnx_attach(struct device *, struct device *, void *); -void bnx_attachhook(void *); +void bnx_attachhook(struct device *); int bnx_read_firmware(struct bnx_softc *sc, int); int bnx_read_rv2p(struct bnx_softc *sc, int); #if 0 @@ -753,7 +753,7 @@ bnx_attach(struct device *parent, struct device *self, void *aux) printf(": %s\n", intrstr); - mountroothook_establish(bnx_attachhook, sc); + config_mountroot(self, bnx_attachhook); return; bnx_attach_fail: @@ -762,9 +762,9 @@ bnx_attach_fail: } void -bnx_attachhook(void *xsc) +bnx_attachhook(struct device *self) { - struct bnx_softc *sc = xsc; + struct bnx_softc *sc = (struct bnx_softc *)self; struct pci_attach_args *pa = &sc->bnx_pa; struct ifnet *ifp; int error, mii_flags = 0; diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index fcfc69a13ec..0511da53828 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.69 2015/12/08 17:10:02 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.70 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2014 genua mbh <info@genua.de> @@ -410,7 +410,7 @@ void iwm_notif_intr(struct iwm_softc *); int iwm_intr(void *); int iwm_match(struct device *, void *, void *); int iwm_preinit(struct iwm_softc *); -void iwm_attach_hook(void *); +void iwm_attach_hook(struct device *); void iwm_attach(struct device *, struct device *, void *); void iwm_init_task(void *); int iwm_activate(struct device *, int); @@ -6340,9 +6340,9 @@ iwm_preinit(struct iwm_softc *sc) } void -iwm_attach_hook(void *arg) +iwm_attach_hook(struct device *self) { - struct iwm_softc *sc = arg; + struct iwm_softc *sc = (void *)self; KASSERT(!cold); @@ -6560,10 +6560,7 @@ iwm_attach(struct device *parent, struct device *self, void *aux) * We cannot read the MAC address without loading the * firmware from disk. Postpone until mountroot is done. */ - if (rootvp == NULL) - mountroothook_establish(iwm_attach_hook, sc); - else - iwm_attach_hook(sc); + config_mountroot(self, iwm_attach_hook); return; diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 56239c5c30f..d88dbfb47ba 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.91 2015/12/09 03:22:39 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.92 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -166,7 +166,7 @@ void myx_attach(struct device *, struct device *, void *); int myx_pcie_dc(struct myx_softc *, struct pci_attach_args *); int myx_query(struct myx_softc *sc, char *, size_t); u_int myx_ether_aton(char *, u_int8_t *, u_int); -void myx_attachhook(void *); +void myx_attachhook(struct device *); int myx_loadfirmware(struct myx_softc *, const char *); int myx_probe_firmware(struct myx_softc *); @@ -311,10 +311,7 @@ myx_attach(struct device *parent, struct device *self, void *aux) if (myx_pcie_dc(sc, pa) != 0) printf("%s: unable to configure PCI Express\n", DEVNAME(sc)); - if (mountroothook_establish(myx_attachhook, sc) == NULL) { - printf("%s: unable to establish mountroot hook\n", DEVNAME(sc)); - goto unmap; - } + config_mountroot(self, myx_attachhook); return; @@ -468,9 +465,9 @@ err: } void -myx_attachhook(void *arg) +myx_attachhook(struct device *self) { - struct myx_softc *sc = (struct myx_softc *)arg; + struct myx_softc *sc = (struct myx_softc *)self; struct ifnet *ifp = &sc->sc_ac.ac_if; struct myx_cmd mc; diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index 63c4b3ea385..cf7c7c5bcf6 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.71 2015/11/25 03:09:59 dlg Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.72 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -750,7 +750,7 @@ int nxe_board_info(struct nxe_softc *); int nxe_user_info(struct nxe_softc *); int nxe_init(struct nxe_softc *); void nxe_uninit(struct nxe_softc *); -void nxe_mountroot(void *); +void nxe_mountroot(struct device *); /* chip state */ void nxe_tick(void *); @@ -972,7 +972,7 @@ nxe_pci_map(struct nxe_softc *sc, struct pci_attach_args *pa) goto unmap_mem; } - mountroothook_establish(nxe_mountroot, sc); + config_mountroot(&sc->sc_dev, nxe_mountroot); return (0); unmap_mem: @@ -1765,9 +1765,9 @@ nxe_uninit(struct nxe_softc *sc) } void -nxe_mountroot(void *arg) +nxe_mountroot(struct device *self) { - struct nxe_softc *sc = arg; + struct nxe_softc *sc = (struct nxe_softc *)self; DASSERT(sc->sc_window == 1); diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index bff7f2b6d33..edaca26e61d 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.90 2015/11/25 03:09:59 dlg Exp $ */ +/* $OpenBSD: if_oce.c,v 1.91 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -365,7 +365,7 @@ struct oce_softc { int oce_match(struct device *, void *, void *); void oce_attach(struct device *, struct device *, void *); int oce_pci_alloc(struct oce_softc *, struct pci_attach_args *); -void oce_attachhook(void *); +void oce_attachhook(struct device *); void oce_attach_ifp(struct oce_softc *); int oce_ioctl(struct ifnet *, u_long, caddr_t); int oce_rxrinfo(struct oce_softc *, struct if_rxrinfo *); @@ -621,7 +621,7 @@ oce_attach(struct device *parent, struct device *self, void *aux) timeout_set(&sc->sc_tick, oce_tick, sc); timeout_set(&sc->sc_rxrefill, oce_refill_rx, sc); - mountroothook_establish(oce_attachhook, sc); + config_mountroot(self, oce_attachhook); printf(", address %s\n", ether_sprintf(sc->sc_ac.ac_enaddr)); @@ -779,9 +779,9 @@ oce_intr_disable(struct oce_softc *sc) } void -oce_attachhook(void *arg) +oce_attachhook(struct device *self) { - struct oce_softc *sc = arg; + struct oce_softc *sc = (struct oce_softc *)self; oce_get_link_status(sc); diff --git a/sys/dev/pci/if_pgt_pci.c b/sys/dev/pci/if_pgt_pci.c index 8c6f71f2f1c..de05789deae 100644 --- a/sys/dev/pci/if_pgt_pci.c +++ b/sys/dev/pci/if_pgt_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pgt_pci.c,v 1.17 2015/11/24 17:11:39 mpi Exp $ */ +/* $OpenBSD: if_pgt_pci.c,v 1.18 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2006 Marcus Glocker <mglocker@openbsd.org> @@ -133,10 +133,7 @@ pgt_pci_attach(struct device *parent, struct device *self, void *aux) } printf(": %s\n", intrstr); - if (rootvp == NULL) - mountroothook_establish(pgt_attach, sc); - else - pgt_attach(sc); + config_mountroot(self, pgt_attach); } int diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index e2473a2735e..6f42954cd01 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.137 2015/11/25 03:09:59 dlg Exp $ */ +/* $OpenBSD: if_tht.c,v 1.138 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -498,7 +498,7 @@ struct tht_softc { int tht_match(struct device *, void *, void *); void tht_attach(struct device *, struct device *, void *); -void tht_mountroot(void *); +void tht_mountroot(struct device *); int tht_intr(void *); struct cfattach tht_ca = { @@ -794,13 +794,13 @@ tht_attach(struct device *parent, struct device *self, void *aux) printf(": address %s\n", ether_sprintf(sc->sc_ac.ac_enaddr)); - mountroothook_establish(tht_mountroot, sc); + config_mountroot(self, tht_mountroot); } void -tht_mountroot(void *arg) +tht_mountroot(struct device *self) { - struct tht_softc *sc = arg; + struct tht_softc *sc = (struct tht_softc *)self; if (tht_fifo_alloc(sc, &sc->sc_txt, &tht_txt_desc) != 0) return; diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index 6f9584b5726..bfd1d6e5a36 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.122 2015/11/25 03:09:59 dlg Exp $ */ +/* $OpenBSD: if_txp.c,v 1.123 2015/12/11 16:07:02 mpi Exp $ */ /* * Copyright (c) 2001 @@ -73,7 +73,7 @@ int txp_probe(struct device *, void *, void *); void txp_attach(struct device *, struct device *, void *); -void txp_attachhook(void *vsc); +void txp_attachhook(struct device *); int txp_intr(void *); void txp_tick(void *); int txp_ioctl(struct ifnet *, u_long, caddr_t); @@ -142,9 +142,9 @@ txp_probe(struct device *parent, void *match, void *aux) } void -txp_attachhook(void *vsc) +txp_attachhook(struct device *self) { - struct txp_softc *sc = vsc; + struct txp_softc *sc = (struct txp_softc *)self; struct ifnet *ifp = &sc->sc_arpcom.ac_if; u_int16_t p1; u_int32_t p2; @@ -270,10 +270,7 @@ txp_attach(struct device *parent, struct device *self, void *aux) } printf(": %s\n", intrstr); - if (rootvp == NULL) - mountroothook_establish(txp_attachhook, sc); - else - txp_attachhook(sc); + config_mountroot(self, txp_attachhook); } diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index 212d917bb8b..04f763beb3f 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.51 2015/09/10 18:10:34 deraadt Exp $ */ +/* $OpenBSD: yds.c,v 1.52 2015/12/11 16:07:02 mpi Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -193,7 +193,7 @@ static u_int32_t yds_get_lpfk(u_int); static struct yds_dma *yds_find_dma(struct yds_softc *, void *); int yds_init(struct yds_softc *, int); -void yds_attachhook(void *); +void yds_attachhook(struct device *); #ifdef AUDIO_DEBUG static void yds_dump_play_slot(struct yds_softc *, int); @@ -720,17 +720,17 @@ yds_attach(struct device *parent, struct device *self, void *aux) YWRITE2(sc, i, 0); sc->sc_legacy_iot = pa->pa_iot; - mountroothook_establish(yds_attachhook, sc); + config_mountroot(self, yds_attachhook); } void -yds_attachhook(void *xsc) +yds_attachhook(struct device *self) { - struct yds_softc *sc = xsc; + struct yds_softc *sc = (struct yds_softc *)self; struct yds_codec_softc *codec; mixer_ctrl_t ctl; int r, i; - + /* Initialize the device */ if (yds_init(sc, 0) == -1) return; |