opnsense-src/sys/dev/usb
Bjoern A. Zeeb 89856f7e2d Get closer to a VIMAGE network stack teardown from top to bottom rather
than removing the network interfaces first. This change is rather larger
and convoluted as the ordering requirements cannot be separated.

Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and
related modules to their own SI_SUB_PROTO_FIREWALL.
Move initialization of "physical" interfaces to SI_SUB_DRIVERS,
move virtual (cloned) interfaces to SI_SUB_PSEUDO.
Move Multicast to SI_SUB_PROTO_MC.

Re-work parts of multicast initialisation and teardown, not taking the
huge amount of memory into account if used as a module yet.

For interface teardown we try to do as many of them as we can on
SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling
over a higher layer protocol such as IP. In that case the interface
has to go along (or before) the higher layer protocol is shutdown.

Kernel hhooks need to go last on teardown as they may be used at various
higher layers and we cannot remove them before we cleaned up the higher
layers.

For interface teardown there are multiple paths:
(a) a cloned interface is destroyed (inside a VIMAGE or in the base system),
(b) any interface is moved from a virtual network stack to a different
network stack ("vmove"), or (c) a virtual network stack is being shut down.
All code paths go through if_detach_internal() where we, depending on the
vmove flag or the vnet state, make a decision on how much to shut down;
in case we are destroying a VNET the individual protocol layers will
cleanup their own parts thus we cannot do so again for each interface as
we end up with, e.g., double-frees, destroying locks twice or acquiring
already destroyed locks.
When calling into protocol cleanups we equally have to tell them
whether they need to detach upper layer protocols ("ulp") or not
(e.g., in6_ifdetach()).

Provide or enahnce helper functions to do proper cleanup at a protocol
rather than at an interface level.

Approved by:		re (hrs)
Obtained from:		projects/vnet
Reviewed by:		gnn, jhb
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D6747
2016-06-21 13:48:49 +00:00
..
controller Enable USB PHY regulators when requested by the host controller driver. 2016-05-26 10:50:39 +00:00
gadget Make a bunch of USB debug SYSCTLs tunable, so that their value(s) can 2015-01-05 15:04:17 +00:00
input dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
misc dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
net Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
quirk Add new USB quirk. 2016-04-21 17:45:37 +00:00
serial dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
storage dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
template dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
video Add new USB ID to UDL driver. 2016-03-30 10:05:52 +00:00
wlan [run] fix TSF locking in RX radiotap. 2016-06-04 07:18:39 +00:00
ufm_ioctl.h
uftdiio.h Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl. 2015-08-06 19:47:04 +00:00
uled_ioctl.h The USB LED driver for the Dream Cheeky WebMail Notifier. 2014-09-05 11:25:58 +00:00
usb.h Add definition of the ISOCHRONOUS endpoint usage bits. 2015-03-25 13:32:27 +00:00
usb_bus.h Improve the realtime properties of USB transfers for embedded systems 2015-08-14 12:57:53 +00:00
usb_busdma.c sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
usb_busdma.h Add helper function to check if a USB page cache buffer is properly 2015-11-07 11:40:35 +00:00
usb_cdc.h dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usb_controller.h
usb_core.c Remove no longer used allocation type. 2015-03-17 11:07:59 +00:00
usb_core.h Section 3.2.9 in the XHCI specification about control transfers says 2015-02-02 11:06:41 +00:00
usb_debug.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
usb_debug.h
usb_dev.c Check for signals when locking the USB enumeration thread from 2016-05-25 07:48:36 +00:00
usb_dev.h
usb_device.c Check for signals when locking the USB enumeration thread from 2016-05-25 07:48:36 +00:00
usb_device.h Check for signals when locking the USB enumeration thread from 2016-05-25 07:48:36 +00:00
usb_dynamic.c Finish process of moving the LinuxKPI module into the default kernel build. 2015-10-29 08:28:39 +00:00
usb_dynamic.h Finish process of moving the LinuxKPI module into the default kernel build. 2015-10-29 08:28:39 +00:00
usb_endian.h
usb_error.c
usb_freebsd.h Increase the maximum number of dynamic USB quirks. USB memory stick 2015-01-12 06:34:23 +00:00
usb_freebsd_loader.h Increase the maximum number of dynamic USB quirks. USB memory stick 2015-01-12 06:34:23 +00:00
usb_generic.c Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular 2015-01-20 11:43:16 +00:00
usb_generic.h
usb_handle_request.c dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usb_hid.c dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usb_hub.c dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usb_hub.h Resolve a deadlock setting the USB configuration index from userspace 2014-06-08 20:10:29 +00:00
usb_if.m
usb_ioctl.h Add USB MIDI template for USB device side mode. 2015-06-01 11:24:34 +00:00
usb_lookup.c Update metadata for "tools/tools/bus_autoconf" after r292080. Use 2015-12-29 11:53:13 +00:00
usb_mbuf.c
usb_mbuf.h
usb_msctest.c Revert r290327. The compiler warnings seems to be specific to clang v3.5 only. 2015-11-03 09:38:39 +00:00
usb_msctest.h Add support for DYMO LabelWriter PnP. 2015-05-07 12:54:27 +00:00
usb_parse.c
usb_pci.h
usb_pf.c Fix race in USB PF which can happen if we stop tracing exactly when 2015-08-15 09:00:36 +00:00
usb_pf.h
usb_process.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
usb_process.h Improve the realtime properties of USB transfers for embedded systems 2015-08-14 12:57:53 +00:00
usb_request.c Make a bunch of USB debug SYSCTLs tunable, so that their value(s) can 2015-01-05 15:04:17 +00:00
usb_request.h
usb_transfer.c dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usb_transfer.h
usb_util.c
usb_util.h
usbdevs dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usbdi.h dev/usb: minor spelling fixes in comments. 2016-05-02 17:44:03 +00:00
usbdi_util.h
usbhid.h