summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-05-05 15:39:29 +0000
committerthompsa <thompsa@FreeBSD.org>2009-05-05 15:39:29 +0000
commit1dad28b11e3e46254de8aac8eb786a6627348e42 (patch)
treec81a83c35fcae7c3e83bf9803f42242f38014c81 /sys
parent9a5ee5e7f1215ee4dc0f22592f0b6c02700d0f35 (diff)
downloadFreeBSD-src-1dad28b11e3e46254de8aac8eb786a6627348e42.zip
FreeBSD-src-1dad28b11e3e46254de8aac8eb786a6627348e42.tar.gz
Remove USB shutdown methods from device drivers as its the host controllers
responsibility to detach the bus. PR: usb/133896 Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/net/if_aue.c16
-rw-r--r--sys/dev/usb/net/if_axe.c16
-rw-r--r--sys/dev/usb/net/if_cdce.c12
-rw-r--r--sys/dev/usb/net/if_cue.c16
-rw-r--r--sys/dev/usb/net/if_kue.c16
-rw-r--r--sys/dev/usb/net/if_rue.c16
-rw-r--r--sys/dev/usb/net/if_udav.c16
-rw-r--r--sys/dev/usb/net/usb_ethernet.c13
-rw-r--r--sys/dev/usb/net/usb_ethernet.h1
-rw-r--r--sys/dev/usb/storage/ustorage_fs.c8
-rw-r--r--sys/dev/usb/usb_compat_linux.c19
-rw-r--r--sys/dev/usb/usb_hub.c1
12 files changed, 0 insertions, 150 deletions
diff --git a/sys/dev/usb/net/if_aue.c b/sys/dev/usb/net/if_aue.c
index ca72948..e1cd066 100644
--- a/sys/dev/usb/net/if_aue.c
+++ b/sys/dev/usb/net/if_aue.c
@@ -173,7 +173,6 @@ static const struct usb2_device_id aue_devs[] = {
static device_probe_t aue_probe;
static device_attach_t aue_attach;
static device_detach_t aue_detach;
-static device_shutdown_t aue_shutdown;
static miibus_readreg_t aue_miibus_readreg;
static miibus_writereg_t aue_miibus_writereg;
static miibus_statchg_t aue_miibus_statchg;
@@ -239,7 +238,6 @@ static device_method_t aue_methods[] = {
DEVMETHOD(device_probe, aue_probe),
DEVMETHOD(device_attach, aue_attach),
DEVMETHOD(device_detach, aue_detach),
- DEVMETHOD(device_shutdown, aue_shutdown),
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
@@ -1038,17 +1036,3 @@ aue_stop(struct usb2_ether *ue)
aue_csr_write_1(sc, AUE_CTL1, 0);
aue_reset(sc);
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-aue_shutdown(device_t dev)
-{
- struct aue_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c
index c0db84b..6240e77 100644
--- a/sys/dev/usb/net/if_axe.c
+++ b/sys/dev/usb/net/if_axe.c
@@ -151,7 +151,6 @@ static const struct usb2_device_id axe_devs[] = {
static device_probe_t axe_probe;
static device_attach_t axe_attach;
static device_detach_t axe_detach;
-static device_shutdown_t axe_shutdown;
static usb2_callback_t axe_intr_callback;
static usb2_callback_t axe_bulk_read_callback;
@@ -216,7 +215,6 @@ static device_method_t axe_methods[] = {
DEVMETHOD(device_probe, axe_probe),
DEVMETHOD(device_attach, axe_attach),
DEVMETHOD(device_detach, axe_detach),
- DEVMETHOD(device_shutdown, axe_shutdown),
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
@@ -1060,17 +1058,3 @@ axe_stop(struct usb2_ether *ue)
axe_reset(sc);
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-axe_shutdown(device_t dev)
-{
- struct axe_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c
index 9a9cb37..eec58fc 100644
--- a/sys/dev/usb/net/if_cdce.c
+++ b/sys/dev/usb/net/if_cdce.c
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
static device_probe_t cdce_probe;
static device_attach_t cdce_attach;
static device_detach_t cdce_detach;
-static device_shutdown_t cdce_shutdown;
static device_suspend_t cdce_suspend;
static device_resume_t cdce_resume;
static usb_handle_request_t cdce_handle_request;
@@ -157,7 +156,6 @@ static device_method_t cdce_methods[] = {
DEVMETHOD(device_detach, cdce_detach),
DEVMETHOD(device_suspend, cdce_suspend),
DEVMETHOD(device_resume, cdce_resume),
- DEVMETHOD(device_shutdown, cdce_shutdown),
{0, 0}
};
@@ -596,16 +594,6 @@ cdce_setpromisc(struct usb2_ether *ue)
}
static int
-cdce_shutdown(device_t dev)
-{
- struct cdce_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
-
-static int
cdce_suspend(device_t dev)
{
device_printf(dev, "Suspending\n");
diff --git a/sys/dev/usb/net/if_cue.c b/sys/dev/usb/net/if_cue.c
index 10fd038..e487280 100644
--- a/sys/dev/usb/net/if_cue.c
+++ b/sys/dev/usb/net/if_cue.c
@@ -86,7 +86,6 @@ static const struct usb2_device_id cue_devs[] = {
static device_probe_t cue_probe;
static device_attach_t cue_attach;
static device_detach_t cue_detach;
-static device_shutdown_t cue_shutdown;
static usb2_callback_t cue_bulk_read_callback;
static usb2_callback_t cue_bulk_write_callback;
@@ -142,7 +141,6 @@ static device_method_t cue_methods[] = {
DEVMETHOD(device_probe, cue_probe),
DEVMETHOD(device_attach, cue_attach),
DEVMETHOD(device_detach, cue_detach),
- DEVMETHOD(device_shutdown, cue_shutdown),
{0, 0}
};
@@ -629,17 +627,3 @@ cue_stop(struct usb2_ether *ue)
cue_csr_write_1(sc, CUE_ETHCTL, 0);
cue_reset(sc);
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-cue_shutdown(device_t dev)
-{
- struct cue_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/if_kue.c b/sys/dev/usb/net/if_kue.c
index 3056692..c72210c 100644
--- a/sys/dev/usb/net/if_kue.c
+++ b/sys/dev/usb/net/if_kue.c
@@ -129,7 +129,6 @@ static const struct usb2_device_id kue_devs[] = {
static device_probe_t kue_probe;
static device_attach_t kue_attach;
static device_detach_t kue_detach;
-static device_shutdown_t kue_shutdown;
static usb2_callback_t kue_bulk_read_callback;
static usb2_callback_t kue_bulk_write_callback;
@@ -185,7 +184,6 @@ static device_method_t kue_methods[] = {
DEVMETHOD(device_probe, kue_probe),
DEVMETHOD(device_attach, kue_attach),
DEVMETHOD(device_detach, kue_detach),
- DEVMETHOD(device_shutdown, kue_shutdown),
{0, 0}
};
@@ -688,17 +686,3 @@ kue_stop(struct usb2_ether *ue)
usb2_transfer_stop(sc->sc_xfer[KUE_BULK_DT_WR]);
usb2_transfer_stop(sc->sc_xfer[KUE_BULK_DT_RD]);
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-kue_shutdown(device_t dev)
-{
- struct kue_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/if_rue.c b/sys/dev/usb/net/if_rue.c
index dc7a31f..5783943 100644
--- a/sys/dev/usb/net/if_rue.c
+++ b/sys/dev/usb/net/if_rue.c
@@ -105,7 +105,6 @@ static const struct usb2_device_id rue_devs[] = {
static device_probe_t rue_probe;
static device_attach_t rue_attach;
static device_detach_t rue_detach;
-static device_shutdown_t rue_shutdown;
static miibus_readreg_t rue_miibus_readreg;
static miibus_writereg_t rue_miibus_writereg;
@@ -172,7 +171,6 @@ static device_method_t rue_methods[] = {
DEVMETHOD(device_probe, rue_probe),
DEVMETHOD(device_attach, rue_attach),
DEVMETHOD(device_detach, rue_detach),
- DEVMETHOD(device_shutdown, rue_shutdown),
/* Bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
@@ -897,17 +895,3 @@ rue_stop(struct usb2_ether *ue)
rue_reset(sc);
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-rue_shutdown(device_t dev)
-{
- struct rue_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c
index 5962d19..8515516 100644
--- a/sys/dev/usb/net/if_udav.c
+++ b/sys/dev/usb/net/if_udav.c
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
static device_probe_t udav_probe;
static device_attach_t udav_attach;
static device_detach_t udav_detach;
-static device_shutdown_t udav_shutdown;
static usb2_callback_t udav_bulk_write_callback;
static usb2_callback_t udav_bulk_read_callback;
@@ -132,7 +131,6 @@ static device_method_t udav_methods[] = {
DEVMETHOD(device_probe, udav_probe),
DEVMETHOD(device_attach, udav_attach),
DEVMETHOD(device_detach, udav_detach),
- DEVMETHOD(device_shutdown, udav_shutdown),
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
@@ -840,17 +838,3 @@ udav_miibus_statchg(device_t dev)
{
/* nothing to do */
}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static int
-udav_shutdown(device_t dev)
-{
- struct udav_softc *sc = device_get_softc(dev);
-
- usb2_ether_ifshutdown(&sc->sc_ue);
-
- return (0);
-}
diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c
index 80b8852..6bd5320 100644
--- a/sys/dev/usb/net/usb_ethernet.c
+++ b/sys/dev/usb/net/usb_ethernet.c
@@ -288,19 +288,6 @@ usb2_ether_ifdetach(struct usb2_ether *ue)
usb2_proc_free(&ue->ue_tq);
}
-void
-usb2_ether_ifshutdown(struct usb2_ether *ue)
-{
- struct ifnet *ifp = ue->ue_ifp;
-
- UE_LOCK(ue);
- if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- ue_queue_command(ue, ue_stop_task,
- &ue->ue_sync_task[0].hdr,
- &ue->ue_sync_task[1].hdr);
- UE_UNLOCK(ue);
-}
-
uint8_t
usb2_ether_is_gone(struct usb2_ether *ue)
{
diff --git a/sys/dev/usb/net/usb_ethernet.h b/sys/dev/usb/net/usb_ethernet.h
index 3f45e6f..3eaafed 100644
--- a/sys/dev/usb/net/usb_ethernet.h
+++ b/sys/dev/usb/net/usb_ethernet.h
@@ -118,6 +118,5 @@ int usb2_ether_rxbuf(struct usb2_ether *,
struct usb2_page_cache *,
unsigned int, unsigned int);
void usb2_ether_rxflush(struct usb2_ether *);
-void usb2_ether_ifshutdown(struct usb2_ether *);
uint8_t usb2_ether_is_gone(struct usb2_ether *);
#endif /* _USB2_ETHERNET_H_ */
diff --git a/sys/dev/usb/storage/ustorage_fs.c b/sys/dev/usb/storage/ustorage_fs.c
index efea84c..c810c2e 100644
--- a/sys/dev/usb/storage/ustorage_fs.c
+++ b/sys/dev/usb/storage/ustorage_fs.c
@@ -202,7 +202,6 @@ static device_attach_t ustorage_fs_attach;
static device_detach_t ustorage_fs_detach;
static device_suspend_t ustorage_fs_suspend;
static device_resume_t ustorage_fs_resume;
-static device_shutdown_t ustorage_fs_shutdown;
static usb_handle_request_t ustorage_fs_handle_request;
static usb2_callback_t ustorage_fs_t_bbb_command_callback;
@@ -239,7 +238,6 @@ static device_method_t ustorage_fs_methods[] = {
DEVMETHOD(device_detach, ustorage_fs_detach),
DEVMETHOD(device_suspend, ustorage_fs_suspend),
DEVMETHOD(device_resume, ustorage_fs_resume),
- DEVMETHOD(device_shutdown, ustorage_fs_shutdown),
{0, 0}
};
@@ -437,12 +435,6 @@ ustorage_fs_resume(device_t dev)
return (0); /* success */
}
-static int
-ustorage_fs_shutdown(device_t dev)
-{
- return (0); /* success */
-}
-
/*
* Generic functions to handle transfers
*/
diff --git a/sys/dev/usb/usb_compat_linux.c b/sys/dev/usb/usb_compat_linux.c
index eed72ce..85dba84 100644
--- a/sys/dev/usb/usb_compat_linux.c
+++ b/sys/dev/usb/usb_compat_linux.c
@@ -59,7 +59,6 @@ static device_attach_t usb_linux_attach;
static device_detach_t usb_linux_detach;
static device_suspend_t usb_linux_suspend;
static device_resume_t usb_linux_resume;
-static device_shutdown_t usb_linux_shutdown;
static usb2_callback_t usb_linux_isoc_callback;
static usb2_callback_t usb_linux_non_isoc_callback;
@@ -92,7 +91,6 @@ static device_method_t usb_linux_methods[] = {
DEVMETHOD(device_detach, usb_linux_detach),
DEVMETHOD(device_suspend, usb_linux_suspend),
DEVMETHOD(device_resume, usb_linux_resume),
- DEVMETHOD(device_shutdown, usb_linux_shutdown),
{0, 0}
};
@@ -360,23 +358,6 @@ usb_linux_resume(device_t dev)
}
/*------------------------------------------------------------------------*
- * usb_linux_shutdown
- *
- * This function is the FreeBSD shutdown callback. Usually it does nothing.
- *------------------------------------------------------------------------*/
-static int
-usb_linux_shutdown(device_t dev)
-{
- struct usb_linux_softc *sc = device_get_softc(dev);
- struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
-
- if (udrv && udrv->shutdown) {
- (udrv->shutdown) (sc->sc_ui);
- }
- return (0);
-}
-
-/*------------------------------------------------------------------------*
* Linux emulation layer
*------------------------------------------------------------------------*/
diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c
index 6961ff4..f92072b 100644
--- a/sys/dev/usb/usb_hub.c
+++ b/sys/dev/usb/usb_hub.c
@@ -132,7 +132,6 @@ static device_method_t uhub_methods[] = {
DEVMETHOD(device_suspend, uhub_suspend),
DEVMETHOD(device_resume, uhub_resume),
- DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(bus_child_location_str, uhub_child_location_string),
DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_string),
OpenPOWER on IntegriCloud