diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-07-12 07:59:24 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-07-12 07:59:24 +0000 |
commit | c42990f7fe2d5e525cb71475adda2d077752403c (patch) | |
tree | 422f980b1cbe42a1682bfaaf0f0bc115abc8f7b9 | |
parent | b85e6728e53b3d131aae17def481c2684a281c24 (diff) |
Kill a bunch of DVACT_DEACTIVATE handlers whose only purpose were to
set the 'dying' flag of a device. Such handlers are useless now that
usbd_detach() already set this flag.
Even if the purpose of this flag is questionnable on OpenBSD because
DVACT_DEACTIVATE acts as a pre-detach event, this is just a first small
step towards the simplification of the autoconf(9) device states.
This cleaning is now possible thanks to the work of pirofti@ to convert
all the USB drivers to properly use usbd_is_dying().
Discussed many times with deraadt@
-rw-r--r-- | sys/dev/usb/if_athn_usb.c | 19 | ||||
-rw-r--r-- | sys/dev/usb/if_atu.c | 40 | ||||
-rw-r--r-- | sys/dev/usb/if_aue.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_axe.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_axen.c | 25 | ||||
-rw-r--r-- | sys/dev/usb/if_cdce.c | 40 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_mos.c | 25 | ||||
-rw-r--r-- | sys/dev/usb/if_otus.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_ral.c | 41 | ||||
-rw-r--r-- | sys/dev/usb/if_rsu.c | 22 | ||||
-rw-r--r-- | sys/dev/usb/if_rum.c | 41 | ||||
-rw-r--r-- | sys/dev/usb/if_run.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_smsc.c | 22 | ||||
-rw-r--r-- | sys/dev/usb/if_uath.c | 37 | ||||
-rw-r--r-- | sys/dev/usb/if_udav.c | 40 | ||||
-rw-r--r-- | sys/dev/usb/if_ugl.c | 40 | ||||
-rw-r--r-- | sys/dev/usb/if_upgt.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_upl.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_url.c | 42 | ||||
-rw-r--r-- | sys/dev/usb/if_urndis.c | 26 | ||||
-rw-r--r-- | sys/dev/usb/if_urtw.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_urtwn.c | 22 | ||||
-rw-r--r-- | sys/dev/usb/if_wi_usb.c | 43 | ||||
-rw-r--r-- | sys/dev/usb/if_zyd.c | 40 |
26 files changed, 181 insertions, 680 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 576a73d5323..67f1dd12fe9 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.19 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.20 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr> @@ -98,7 +98,6 @@ static const struct athn_usb_type { int athn_usb_match(struct device *, void *, void *); void athn_usb_attach(struct device *, struct device *, void *); int athn_usb_detach(struct device *, int); -int athn_usb_activate(struct device *, int); void athn_usb_attachhook(void *); int athn_usb_open_pipes(struct athn_usb_softc *); void athn_usb_close_pipes(struct athn_usb_softc *); @@ -214,8 +213,7 @@ const struct cfattach athn_usb_ca = { sizeof(struct athn_usb_softc), athn_usb_match, athn_usb_attach, - athn_usb_detach, - athn_usb_activate + athn_usb_detach }; int @@ -304,19 +302,6 @@ athn_usb_detach(struct device *self, int flags) return (0); } -int -athn_usb_activate(struct device *self, int act) -{ - struct athn_usb_softc *usc = (struct athn_usb_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(usc->sc_udev); - break; - } - return (0); -} - void athn_usb_attachhook(void *xsc) { diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index df8144a52f7..dad17a87a72 100644 --- a/sys/dev/usb/if_atu.c +++ b/sys/dev/usb/if_atu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atu.c,v 1.106 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_atu.c,v 1.107 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2003, 2004 * Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved. @@ -93,21 +93,16 @@ int atudebug = 1; #define DPRINTFN(n,x) #endif -int atu_match(struct device *, void *, void *); -void atu_attach(struct device *, struct device *, void *); -int atu_detach(struct device *, int); -int atu_activate(struct device *, int); - -struct cfdriver atu_cd = { - NULL, "atu", DV_IFNET -}; - -const struct cfattach atu_ca = { - sizeof(struct atu_softc), - atu_match, - atu_attach, - atu_detach, - atu_activate, +int atu_match(struct device *, void *, void *); +void atu_attach(struct device *, struct device *, void *); +int atu_detach(struct device *, int); + +struct cfdriver atu_cd = { + NULL, "atu", DV_IFNET +}; + +const struct cfattach atu_ca = { + sizeof(struct atu_softc), atu_match, atu_attach, atu_detach }; /* @@ -1511,19 +1506,6 @@ atu_detach(struct device *self, int flags) return(0); } -int -atu_activate(struct device *self, int act) -{ - struct atu_softc *sc = (struct atu_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->atu_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 8e8b3bf1702..a4b2c2c149c 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.92 2013/12/13 01:13:56 brad Exp $ */ +/* $OpenBSD: if_aue.c,v 1.93 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -209,21 +209,16 @@ const struct aue_type aue_devs[] = { }; #define aue_lookup(v, p) ((struct aue_type *)usb_lookup(aue_devs, v, p)) -int aue_match(struct device *, void *, void *); -void aue_attach(struct device *, struct device *, void *); -int aue_detach(struct device *, int); -int aue_activate(struct device *, int); - -struct cfdriver aue_cd = { - NULL, "aue", DV_IFNET -}; - -const struct cfattach aue_ca = { - sizeof(struct aue_softc), - aue_match, - aue_attach, - aue_detach, - aue_activate, +int aue_match(struct device *, void *, void *); +void aue_attach(struct device *, struct device *, void *); +int aue_detach(struct device *, int); + +struct cfdriver aue_cd = { + NULL, "aue", DV_IFNET +}; + +const struct cfattach aue_ca = { + sizeof(struct aue_softc), aue_match, aue_attach, aue_detach }; void aue_reset_pegasus_II(struct aue_softc *sc); @@ -882,21 +877,6 @@ aue_detach(struct device *self, int flags) return (0); } -int -aue_activate(struct device *self, int act) -{ - struct aue_softc *sc = (struct aue_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->aue_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->aue_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 45ab35df6e3..94176a61a98 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.124 2014/04/12 14:02:19 jsg Exp $ */ +/* $OpenBSD: if_axe.c,v 1.125 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> @@ -178,21 +178,16 @@ const struct axe_type axe_devs[] = { #define axe_lookup(v, p) ((struct axe_type *)usb_lookup(axe_devs, v, p)) -int axe_match(struct device *, void *, void *); -void axe_attach(struct device *, struct device *, void *); -int axe_detach(struct device *, int); -int axe_activate(struct device *, int); - -struct cfdriver axe_cd = { - NULL, "axe", DV_IFNET -}; - -const struct cfattach axe_ca = { - sizeof(struct axe_softc), - axe_match, - axe_attach, - axe_detach, - axe_activate, +int axe_match(struct device *, void *, void *); +void axe_attach(struct device *, struct device *, void *); +int axe_detach(struct device *, int); + +struct cfdriver axe_cd = { + NULL, "axe", DV_IFNET +}; + +const struct cfattach axe_ca = { + sizeof(struct axe_softc), axe_match, axe_attach, axe_detach }; int axe_tx_list_init(struct axe_softc *); @@ -889,21 +884,6 @@ axe_detach(struct device *self, int flags) return (0); } -int -axe_activate(struct device *self, int act) -{ - struct axe_softc *sc = (struct axe_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->axe_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->axe_udev); - break; - } - return (0); -} - struct mbuf * axe_newbuf(void) { diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c index f2433f3f129..d3770f08e8f 100644 --- a/sys/dev/usb/if_axen.c +++ b/sys/dev/usb/if_axen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axen.c,v 1.6 2014/03/16 02:46:57 jsg Exp $ */ +/* $OpenBSD: if_axen.c,v 1.7 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2013 Yojiro UO <yuo@openbsd.org> @@ -91,18 +91,13 @@ const struct axen_type axen_devs[] = { int axen_match(struct device *, void *, void *); void axen_attach(struct device *, struct device *, void *); int axen_detach(struct device *, int); -int axen_activate(struct device *, int); struct cfdriver axen_cd = { NULL, "axen", DV_IFNET }; const struct cfattach axen_ca = { - sizeof(struct axen_softc), - axen_match, - axen_attach, - axen_detach, - axen_activate, + sizeof(struct axen_softc), axen_match, axen_attach, axen_detach }; int axen_tx_list_init(struct axen_softc *); @@ -863,22 +858,6 @@ axen_detach(struct device *self, int flags) return 0; } -int -axen_activate(struct device *self, int act) -{ - struct axen_softc *sc = (struct axen_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->axen_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->axen_udev); - break; - } - - return 0; -} - struct mbuf * axen_newbuf(void) { diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index 12ec05ec4c4..829a895702e 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdce.c,v 1.59 2013/12/07 20:17:42 brad Exp $ */ +/* $OpenBSD: if_cdce.c,v 1.60 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -111,21 +111,16 @@ const struct cdce_type cdce_devs[] = { #define cdce_lookup(v, p) \ ((const struct cdce_type *)usb_lookup(cdce_devs, v, p)) -int cdce_match(struct device *, void *, void *); -void cdce_attach(struct device *, struct device *, void *); -int cdce_detach(struct device *, int); -int cdce_activate(struct device *, int); - -struct cfdriver cdce_cd = { - NULL, "cdce", DV_IFNET -}; - -const struct cfattach cdce_ca = { - sizeof(struct cdce_softc), - cdce_match, - cdce_attach, - cdce_detach, - cdce_activate, +int cdce_match(struct device *, void *, void *); +void cdce_attach(struct device *, struct device *, void *); +int cdce_detach(struct device *, int); + +struct cfdriver cdce_cd = { + NULL, "cdce", DV_IFNET +}; + +const struct cfattach cdce_ca = { + sizeof(struct cdce_softc), cdce_match, cdce_attach, cdce_detach }; int @@ -855,19 +850,6 @@ cdce_txeof(struct usbd_xfer *xfer, void *priv, usbd_status status) splx(s); } -int -cdce_activate(struct device *self, int act) -{ - struct cdce_softc *sc = (struct cdce_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->cdce_udev); - break; - } - return (0); -} - void cdce_intr(struct usbd_xfer *xfer, void *addr, usbd_status status) { diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 6fcb27fd496..68903da7411 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.64 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: if_cue.c,v 1.65 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -107,21 +107,16 @@ struct usb_devno cue_devs[] = { /* Belkin F5U111 adapter covered by NETMATE entry */ }; -int cue_match(struct device *, void *, void *); -void cue_attach(struct device *, struct device *, void *); -int cue_detach(struct device *, int); -int cue_activate(struct device *, int); - -struct cfdriver cue_cd = { - NULL, "cue", DV_IFNET -}; - -const struct cfattach cue_ca = { - sizeof(struct cue_softc), - cue_match, - cue_attach, - cue_detach, - cue_activate, +int cue_match(struct device *, void *, void *); +void cue_attach(struct device *, struct device *, void *); +int cue_detach(struct device *, int); + +struct cfdriver cue_cd = { + NULL, "cue", DV_IFNET +}; + +const struct cfattach cue_ca = { + sizeof(struct cue_softc), cue_match, cue_attach, cue_detach }; int cue_open_pipes(struct cue_softc *); @@ -581,21 +576,6 @@ cue_detach(struct device *self, int flags) return (0); } -int -cue_activate(struct device *self, int act) -{ - struct cue_softc *sc = (struct cue_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->cue_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->cue_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index fe62c56eeae..635f14959b3 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.71 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: if_kue.c,v 1.72 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -151,21 +151,16 @@ const struct usb_devno kue_devs[] = { { USB_VENDOR_SMC, USB_PRODUCT_SMC_2102USB }, }; -int kue_match(struct device *, void *, void *); -void kue_attach(struct device *, struct device *, void *); -int kue_detach(struct device *, int); -int kue_activate(struct device *, int); - -struct cfdriver kue_cd = { - NULL, "kue", DV_IFNET -}; - -const struct cfattach kue_ca = { - sizeof(struct kue_softc), - kue_match, - kue_attach, - kue_detach, - kue_activate, +int kue_match(struct device *, void *, void *); +void kue_attach(struct device *, struct device *, void *); +int kue_detach(struct device *, int); + +struct cfdriver kue_cd = { + NULL, "kue", DV_IFNET +}; + +const struct cfattach kue_ca = { + sizeof(struct kue_softc), kue_match, kue_attach, kue_detach }; int kue_tx_list_init(struct kue_softc *); @@ -582,21 +577,6 @@ kue_detach(struct device *self, int flags) return (0); } -int -kue_activate(struct device *self, int act) -{ - struct kue_softc *sc = (struct kue_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->kue_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->kue_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c index afc31b84948..e70e5d18b8b 100644 --- a/sys/dev/usb/if_mos.c +++ b/sys/dev/usb/if_mos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mos.c,v 1.24 2014/01/21 09:57:33 brad Exp $ */ +/* $OpenBSD: if_mos.c,v 1.25 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net> @@ -133,18 +133,13 @@ const struct mos_type mos_devs[] = { int mos_match(struct device *, void *, void *); void mos_attach(struct device *, struct device *, void *); int mos_detach(struct device *, int); -int mos_activate(struct device *, int); struct cfdriver mos_cd = { NULL, "mos", DV_IFNET }; const struct cfattach mos_ca = { - sizeof(struct mos_softc), - mos_match, - mos_attach, - mos_detach, - mos_activate, + sizeof(struct mos_softc), mos_match, mos_attach, mos_detach }; int mos_tx_list_init(struct mos_softc *); @@ -815,22 +810,6 @@ mos_detach(struct device *self, int flags) return (0); } - -int -mos_activate(struct device *self, int act) -{ - struct mos_softc *sc = (struct mos_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->mos_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->mos_udev); - break; - } - return (0); -} - struct mbuf * mos_newbuf(void) { diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 707fb808243..44788fe9bf0 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.39 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_otus.c,v 1.40 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -99,7 +99,6 @@ static const struct usb_devno otus_devs[] = { int otus_match(struct device *, void *, void *); void otus_attach(struct device *, struct device *, void *); int otus_detach(struct device *, int); -int otus_activate(struct device *, int); void otus_attachhook(void *); void otus_get_chanlist(struct otus_softc *); int otus_load_firmware(struct otus_softc *, const char *, @@ -174,8 +173,7 @@ struct cfdriver otus_cd = { }; const struct cfattach otus_ca = { - sizeof (struct otus_softc), otus_match, otus_attach, otus_detach, - otus_activate + sizeof (struct otus_softc), otus_match, otus_attach, otus_detach }; int @@ -263,20 +261,6 @@ otus_detach(struct device *self, int flags) return 0; } -int -otus_activate(struct device *self, int act) -{ - struct otus_softc *sc = (struct otus_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return 0; -} - void otus_attachhook(void *xsc) { diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 70b70579268..91cd0b6acf9 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.126 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_ral.c,v 1.127 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -184,21 +184,16 @@ static const uint32_t ural_rf2525e_r2[] = RAL_RF2525E_R2; static const uint32_t ural_rf2526_hi_r2[] = RAL_RF2526_HI_R2; static const uint32_t ural_rf2526_r2[] = RAL_RF2526_R2; -int ural_match(struct device *, void *, void *); -void ural_attach(struct device *, struct device *, void *); -int ural_detach(struct device *, int); -int ural_activate(struct device *, int); - -struct cfdriver ural_cd = { - NULL, "ural", DV_IFNET -}; - -const struct cfattach ural_ca = { - sizeof(struct ural_softc), - ural_match, - ural_attach, - ural_detach, - ural_activate, +int ural_match(struct device *, void *, void *); +void ural_attach(struct device *, struct device *, void *); +int ural_detach(struct device *, int); + +struct cfdriver ural_cd = { + NULL, "ural", DV_IFNET +}; + +const struct cfattach ural_ca = { + sizeof(struct ural_softc), ural_match, ural_attach, ural_detach }; int @@ -2220,17 +2215,3 @@ ural_amrr_update(struct usbd_xfer *xfer, void *priv, if (!usbd_is_dying(sc->sc_udev)) timeout_add_sec(&sc->amrr_to, 1); } - -int -ural_activate(struct device *self, int act) -{ - struct ural_softc *sc = (struct ural_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return 0; -} diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index c5bf2c1d3d8..d5f5c30ea6e 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.19 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.20 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -125,7 +125,6 @@ static const struct usb_devno rsu_devs_noht[] = { int rsu_match(struct device *, void *, void *); void rsu_attach(struct device *, struct device *, void *); int rsu_detach(struct device *, int); -int rsu_activate(struct device *, int); int rsu_open_pipes(struct rsu_softc *); void rsu_close_pipes(struct rsu_softc *); int rsu_alloc_rx_list(struct rsu_softc *); @@ -193,11 +192,7 @@ struct cfdriver rsu_cd = { }; const struct cfattach rsu_ca = { - sizeof(struct rsu_softc), - rsu_match, - rsu_attach, - rsu_detach, - rsu_activate + sizeof(struct rsu_softc), rsu_match, rsu_attach, rsu_detach, }; int @@ -363,19 +358,6 @@ rsu_detach(struct device *self, int flags) } int -rsu_activate(struct device *self, int act) -{ - struct rsu_softc *sc = (struct rsu_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - -int rsu_open_pipes(struct rsu_softc *sc) { usb_interface_descriptor_t *id; diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 8b980c76605..53dfb0bda9c 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.103 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_rum.c,v 1.104 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr> @@ -215,21 +215,16 @@ static const struct rfprog { RT2573_RF5225 }; -int rum_match(struct device *, void *, void *); -void rum_attach(struct device *, struct device *, void *); -int rum_detach(struct device *, int); -int rum_activate(struct device *, int); - -struct cfdriver rum_cd = { - NULL, "rum", DV_IFNET -}; - -const struct cfattach rum_ca = { - sizeof(struct rum_softc), - rum_match, - rum_attach, - rum_detach, - rum_activate, +int rum_match(struct device *, void *, void *); +void rum_attach(struct device *, struct device *, void *); +int rum_detach(struct device *, int); + +struct cfdriver rum_cd = { + NULL, "rum", DV_IFNET +}; + +const struct cfattach rum_ca = { + sizeof(struct rum_softc), rum_match, rum_attach, rum_detach }; int @@ -2298,17 +2293,3 @@ rum_amrr_update(struct usbd_xfer *xfer, void *priv, if (!usbd_is_dying(sc->sc_udev)) timeout_add_sec(&sc->amrr_to, 1); } - -int -rum_activate(struct device *self, int act) -{ - struct rum_softc *sc = (struct rum_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return 0; -} diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 13a4f28c694..7d4f81496f0 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.100 2014/06/13 21:47:02 stsp Exp $ */ +/* $OpenBSD: if_run.c,v 1.101 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -330,7 +330,6 @@ static const struct usb_devno run_devs[] = { int run_match(struct device *, void *, void *); void run_attach(struct device *, struct device *, void *); int run_detach(struct device *, int); -int run_activate(struct device *, int); int run_alloc_rx_ring(struct run_softc *); void run_free_rx_ring(struct run_softc *); int run_alloc_tx_ring(struct run_softc *, int); @@ -429,8 +428,7 @@ struct cfdriver run_cd = { }; const struct cfattach run_ca = { - sizeof (struct run_softc), run_match, run_attach, run_detach, - run_activate + sizeof (struct run_softc), run_match, run_attach, run_detach }; static const struct { @@ -4819,17 +4817,3 @@ run_stop(struct ifnet *ifp, int disable) run_free_tx_ring(sc, qid); run_free_rx_ring(sc); } - -int -run_activate(struct device *self, int act) -{ - struct run_softc *sc = (struct run_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return 0; -} diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c index 2467e3ec6f4..f4956047c1e 100644 --- a/sys/dev/usb/if_smsc.c +++ b/sys/dev/usb/if_smsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_smsc.c,v 1.11 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: if_smsc.c,v 1.12 2014/07/12 07:59:23 mpi Exp $ */ /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */ /*- * Copyright (c) 2012 @@ -148,7 +148,6 @@ int smsc_setmacaddress(struct smsc_softc *, const uint8_t *); int smsc_match(struct device *, void *, void *); void smsc_attach(struct device *, struct device *, void *); int smsc_detach(struct device *, int); -int smsc_activate(struct device *, int); void smsc_init(void *); void smsc_stop(struct smsc_softc *); @@ -182,11 +181,7 @@ struct cfdriver smsc_cd = { }; const struct cfattach smsc_ca = { - sizeof(struct smsc_softc), - smsc_match, - smsc_attach, - smsc_detach, - smsc_activate + sizeof(struct smsc_softc), smsc_match, smsc_attach, smsc_detach, }; int @@ -1137,19 +1132,6 @@ smsc_tick_task(void *xsc) splx(s); } -int -smsc_activate(struct device *self, int act) -{ - struct smsc_softc *sc = (struct smsc_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - void smsc_lock_mii(struct smsc_softc *sc) { diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index 3b7d76f84e2..fd8c22e7925 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.58 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_uath.c,v 1.59 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2006 @@ -177,23 +177,17 @@ int uath_switch_channel(struct uath_softc *, struct ieee80211_channel *); int uath_init(struct ifnet *); void uath_stop(struct ifnet *, int); int uath_loadfirmware(struct uath_softc *, const u_char *, int); -int uath_activate(struct device *, int); -int uath_match(struct device *, void *, void *); -void uath_attach(struct device *, struct device *, void *); -int uath_detach(struct device *, int); -int uath_activate(struct device *, int); +int uath_match(struct device *, void *, void *); +void uath_attach(struct device *, struct device *, void *); +int uath_detach(struct device *, int); -struct cfdriver uath_cd = { +struct cfdriver uath_cd = { NULL, "uath", DV_IFNET -}; - -const struct cfattach uath_ca = { - sizeof(struct uath_softc), - uath_match, - uath_attach, - uath_detach, - uath_activate, +}; + +const struct cfattach uath_ca = { + sizeof(struct uath_softc), uath_match, uath_attach, uath_detach }; int @@ -2115,16 +2109,3 @@ fail3: usbd_free_xfer(txxfer); fail2: usbd_free_xfer(ctlxfer); fail1: return error; } - -int -uath_activate(struct device *self, int act) -{ - struct uath_softc *sc = (struct uath_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return 0; -} diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 34eb8bd3b23..94389dce4db 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.65 2014/01/22 04:13:22 sasano Exp $ */ +/* $OpenBSD: if_udav.c,v 1.66 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -82,23 +82,16 @@ #include <dev/usb/if_udavreg.h> +int udav_match(struct device *, void *, void *); +void udav_attach(struct device *, struct device *, void *); +int udav_detach(struct device *, int); -/* Function declarations */ -int udav_match(struct device *, void *, void *); -void udav_attach(struct device *, struct device *, void *); -int udav_detach(struct device *, int); -int udav_activate(struct device *, int); - -struct cfdriver udav_cd = { - NULL, "udav", DV_IFNET -}; +struct cfdriver udav_cd = { + NULL, "udav", DV_IFNET +}; -const struct cfattach udav_ca = { - sizeof(struct udav_softc), - udav_match, - udav_attach, - udav_detach, - udav_activate, +const struct cfattach udav_ca = { + sizeof(struct udav_softc), udav_match, udav_attach, udav_detach }; int udav_openpipes(struct udav_softc *); @@ -718,21 +711,6 @@ udav_reset(struct udav_softc *sc) delay(10000); /* XXX */ } -int -udav_activate(struct device *self, int act) -{ - struct udav_softc *sc = (struct udav_softc *)self; - - DPRINTF(("%s: %s: enter, act=%d\n", sc->sc_dev.dv_xname, - __func__, act)); - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - #define UDAV_BITS 6 void diff --git a/sys/dev/usb/if_ugl.c b/sys/dev/usb/if_ugl.c index fb929cda59d..87a138be78a 100644 --- a/sys/dev/usb/if_ugl.c +++ b/sys/dev/usb/if_ugl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ugl.c,v 1.5 2014/01/07 09:54:18 mpi Exp $ */ +/* $OpenBSD: if_ugl.c,v 1.6 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2013 SASANO Takayoshi <uaa@uaa.org.uk> @@ -173,21 +173,16 @@ struct usb_devno ugl_devs[] = { { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB_A }, }; -int ugl_match(struct device *, void *, void *); -void ugl_attach(struct device *, struct device *, void *); -int ugl_detach(struct device *, int); -int ugl_activate(struct device *, int); - -struct cfdriver ugl_cd = { - NULL, "ugl", DV_IFNET -}; - -const struct cfattach ugl_ca = { - sizeof(struct ugl_softc), - ugl_match, - ugl_attach, - ugl_detach, - ugl_activate, +int ugl_match(struct device *, void *, void *); +void ugl_attach(struct device *, struct device *, void *); +int ugl_detach(struct device *, int); + +struct cfdriver ugl_cd = { + NULL, "ugl", DV_IFNET +}; + +const struct cfattach ugl_ca = { + sizeof(struct ugl_softc), ugl_match, ugl_attach, ugl_detach }; int ugl_openpipes(struct ugl_softc *); @@ -340,19 +335,6 @@ ugl_detach(struct device *self, int flags) return (0); } -int -ugl_activate(struct device *self, int act) -{ - struct ugl_softc *sc = (struct ugl_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index c81df52588a..e418924b412 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.61 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.62 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -87,7 +87,6 @@ int upgt_match(struct device *, void *, void *); void upgt_attach(struct device *, struct device *, void *); void upgt_attach_hook(void *); int upgt_detach(struct device *, int); -int upgt_activate(struct device *, int); int upgt_device_type(struct upgt_softc *, uint16_t, uint16_t); int upgt_device_init(struct upgt_softc *); @@ -147,11 +146,7 @@ struct cfdriver upgt_cd = { }; const struct cfattach upgt_ca = { - sizeof(struct upgt_softc), - upgt_match, - upgt_attach, - upgt_detach, - upgt_activate, + sizeof(struct upgt_softc), upgt_match, upgt_attach, upgt_detach }; static const struct usb_devno upgt_devs_1[] = { @@ -505,20 +500,6 @@ upgt_detach(struct device *self, int flags) } int -upgt_activate(struct device *self, int act) -{ - struct upgt_softc *sc = (struct upgt_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return (0); -} - -int upgt_device_type(struct upgt_softc *sc, uint16_t vendor, uint16_t product) { if (usb_lookup(upgt_devs_1, vendor, product) != NULL) { diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index 8ecbcd8cedc..791f34a5780 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upl.c,v 1.56 2014/01/07 09:54:18 mpi Exp $ */ +/* $OpenBSD: if_upl.c,v 1.57 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -158,21 +158,16 @@ struct usb_devno upl_devs[] = { { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302 } }; -int upl_match(struct device *, void *, void *); -void upl_attach(struct device *, struct device *, void *); -int upl_detach(struct device *, int); -int upl_activate(struct device *, int); - -struct cfdriver upl_cd = { - NULL, "upl", DV_IFNET -}; - -const struct cfattach upl_ca = { - sizeof(struct upl_softc), - upl_match, - upl_attach, - upl_detach, - upl_activate, +int upl_match(struct device *, void *, void *); +void upl_attach(struct device *, struct device *, void *); +int upl_detach(struct device *, int); + +struct cfdriver upl_cd = { + NULL, "upl", DV_IFNET +}; + +const struct cfattach upl_ca = { + sizeof(struct upl_softc), upl_match, upl_attach, upl_detach }; int upl_openpipes(struct upl_softc *); @@ -324,21 +319,6 @@ upl_detach(struct device *self, int flags) return (0); } -int -upl_activate(struct device *self, int act) -{ - struct upl_softc *sc = (struct upl_softc *)self; - - DPRINTFN(2,("%s: %s: enter\n", sc->sc_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - /* * Initialize an RX descriptor and attach an MBUF cluster. */ diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index f2ba13e006d..623e95491df 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.68 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: if_url.c,v 1.69 2014/07/12 07:59:23 mpi Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -80,23 +80,16 @@ #include <dev/usb/if_urlreg.h> +int url_match(struct device *, void *, void *); +void url_attach(struct device *, struct device *, void *); +int url_detach(struct device *, int); -/* Function declarations */ -int url_match(struct device *, void *, void *); -void url_attach(struct device *, struct device *, void *); -int url_detach(struct device *, int); -int url_activate(struct device *, int); - -struct cfdriver url_cd = { - NULL, "url", DV_IFNET -}; +struct cfdriver url_cd = { + NULL, "url", DV_IFNET +}; -const struct cfattach url_ca = { - sizeof(struct url_softc), - url_match, - url_attach, - url_detach, - url_activate, +const struct cfattach url_ca = { + sizeof(struct url_softc), url_match, url_attach, url_detach }; int url_openpipes(struct url_softc *); @@ -565,23 +558,6 @@ url_reset(struct url_softc *sc) delay(10000); /* XXX */ } -int -url_activate(struct device *self, int act) -{ - struct url_softc *sc = (struct url_softc *)self; - - DPRINTF(("%s: %s: enter, act=%d\n", sc->sc_dev.dv_xname, - __func__, act)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return (0); -} - void url_iff(struct url_softc *sc) { diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 48b4a4bcfe2..9cc6d7e1017 100644 --- a/sys/dev/usb/if_urndis.c +++ b/sys/dev/usb/if_urndis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urndis.c,v 1.46 2013/12/09 15:45:29 pirofti Exp $ */ +/* $OpenBSD: if_urndis.c,v 1.47 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2010 Jonathan Armani <armani@openbsd.org> @@ -115,18 +115,13 @@ const struct urndis_class *urndis_lookup(usb_interface_descriptor_t *); int urndis_match(struct device *, void *, void *); void urndis_attach(struct device *, struct device *, void *); int urndis_detach(struct device *, int); -int urndis_activate(struct device *, int); struct cfdriver urndis_cd = { NULL, "urndis", DV_IFNET }; struct cfattach urndis_ca = { - sizeof(struct urndis_softc), - urndis_match, - urndis_attach, - urndis_detach, - urndis_activate, + sizeof(struct urndis_softc), urndis_match, urndis_attach, urndis_detach }; const struct urndis_class { @@ -1510,20 +1505,3 @@ urndis_detach(struct device *self, int flags) return 0; } - -int -urndis_activate(struct device *self, int devact) -{ - struct urndis_softc *sc; - - sc = (struct urndis_softc *)self; - - switch (devact) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return 0; -} - diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 2cc01166582..98e11e1c696 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtw.c,v 1.45 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_urtw.c,v 1.46 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org> @@ -574,18 +574,13 @@ int urtw_set_macaddr(struct urtw_softc *, const uint8_t *); int urtw_match(struct device *, void *, void *); void urtw_attach(struct device *, struct device *, void *); int urtw_detach(struct device *, int); -int urtw_activate(struct device *, int); struct cfdriver urtw_cd = { NULL, "urtw", DV_IFNET }; const struct cfattach urtw_ca = { - sizeof(struct urtw_softc), - urtw_match, - urtw_attach, - urtw_detach, - urtw_activate, + sizeof(struct urtw_softc), urtw_match, urtw_attach, urtw_detach }; int @@ -791,20 +786,6 @@ urtw_detach(struct device *self, int flags) return (0); } -int -urtw_activate(struct device *self, int act) -{ - struct urtw_softc *sc = (struct urtw_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - - return (0); -} - usbd_status urtw_close_pipes(struct urtw_softc *sc) { diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index ffe880e18d8..a3c4c28ead0 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.35 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.36 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -149,7 +149,6 @@ static const struct usb_devno urtwn_devs[] = { int urtwn_match(struct device *, void *, void *); void urtwn_attach(struct device *, struct device *, void *); int urtwn_detach(struct device *, int); -int urtwn_activate(struct device *, int); int urtwn_open_pipes(struct urtwn_softc *); void urtwn_close_pipes(struct urtwn_softc *); int urtwn_alloc_rx_list(struct urtwn_softc *); @@ -247,11 +246,7 @@ struct cfdriver urtwn_cd = { }; const struct cfattach urtwn_ca = { - sizeof(struct urtwn_softc), - urtwn_match, - urtwn_attach, - urtwn_detach, - urtwn_activate + sizeof(struct urtwn_softc), urtwn_match, urtwn_attach, urtwn_detach }; int @@ -434,19 +429,6 @@ urtwn_detach(struct device *self, int flags) } int -urtwn_activate(struct device *self, int act) -{ - struct urtwn_softc *sc = (struct urtwn_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return (0); -} - -int urtwn_open_pipes(struct urtwn_softc *sc) { /* Bulk-out endpoints addresses (from highest to lowest prio). */ diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c index ef36d18a5f6..e1460c6be16 100644 --- a/sys/dev/usb/if_wi_usb.c +++ b/sys/dev/usb/if_wi_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_usb.c,v 1.60 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: if_wi_usb.c,v 1.61 2014/07/12 07:59:23 mpi Exp $ */ /* * Copyright (c) 2003 Dale Rahn. All rights reserved. @@ -260,21 +260,16 @@ const struct wi_usb_type { }; #define wi_usb_lookup(v, p) ((struct wi_usb_type *)usb_lookup(wi_usb_devs, v, p)) -int wi_usb_match(struct device *, void *, void *); -void wi_usb_attach(struct device *, struct device *, void *); -int wi_usb_detach(struct device *, int); -int wi_usb_activate(struct device *, int); - -struct cfdriver wi_usb_cd = { - NULL, "wi_usb", DV_IFNET -}; - -const struct cfattach wi_usb_ca = { - sizeof(struct wi_usb_softc), - wi_usb_match, - wi_usb_attach, - wi_usb_detach, - wi_usb_activate, +int wi_usb_match(struct device *, void *, void *); +void wi_usb_attach(struct device *, struct device *, void *); +int wi_usb_detach(struct device *, int); + +struct cfdriver wi_usb_cd = { + NULL, "wi_usb", DV_IFNET +}; + +const struct cfattach wi_usb_ca = { + sizeof(struct wi_usb_softc), wi_usb_match, wi_usb_attach, wi_usb_detach }; int @@ -1316,22 +1311,6 @@ wi_get_fid_usb(struct wi_softc *sc, int fid) } -int -wi_usb_activate(struct device *self, int act) -{ - struct wi_usb_softc *sc = (struct wi_usb_softc *)self; - - DPRINTFN(10,("%s: %s: enter\n", sc->wi_usb_dev.dv_xname, __func__)); - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->wi_usb_udev); - sc->wi_thread_info->dying = 1; - break; - } - return (0); -} - #if 0 void wi_dump_data(void *buffer, int len) diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c index d6eaa2f379d..58f2d219047 100644 --- a/sys/dev/usb/if_zyd.c +++ b/sys/dev/usb/if_zyd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_zyd.c,v 1.100 2014/06/03 14:41:56 stsp Exp $ */ +/* $OpenBSD: if_zyd.c,v 1.101 2014/07/12 07:59:23 mpi Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr> @@ -155,21 +155,16 @@ static const struct zyd_type { #define zyd_lookup(v, p) \ ((const struct zyd_type *)usb_lookup(zyd_devs, v, p)) -int zyd_match(struct device *, void *, void *); -void zyd_attach(struct device *, struct device *, void *); -int zyd_detach(struct device *, int); -int zyd_activate(struct device *, int); - -struct cfdriver zyd_cd = { - NULL, "zyd", DV_IFNET -}; - -const struct cfattach zyd_ca = { - sizeof(struct zyd_softc), - zyd_match, - zyd_attach, - zyd_detach, - zyd_activate, +int zyd_match(struct device *, void *, void *); +void zyd_attach(struct device *, struct device *, void *); +int zyd_detach(struct device *, int); + +struct cfdriver zyd_cd = { + NULL, "zyd", DV_IFNET +}; + +const struct cfattach zyd_ca = { + sizeof(struct zyd_softc), zyd_match, zyd_attach, zyd_detach }; void zyd_attachhook(void *); @@ -2573,16 +2568,3 @@ zyd_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew) i--); ni->ni_txrate = i; } - -int -zyd_activate(struct device *self, int act) -{ - struct zyd_softc *sc = (struct zyd_softc *)self; - - switch (act) { - case DVACT_DEACTIVATE: - usbd_deactivate(sc->sc_udev); - break; - } - return 0; -} |