freebsd-nq/sys/dev/usb
Gleb Smirnoff 79d2c5e857 Change KPI of how device drivers that provide wireless connectivity interact
with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@,
op@ and lev@, who also participated in testing. Details here:

https://wiki.freebsd.org/projects/ifnet/net80211

Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not
tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances
of problems are low. The wtap wasn't compilable even before this change.
But the ndis driver is complex, and it is likely to be broken with this
commit. Help with testing and debugging it is appreciated.

Differential Revision:	D2655, D2740
Sponsored by:	Nginx, Inc.
Sponsored by:	Netflix
2015-08-07 11:43:14 +00:00
..
controller Limit the number of times we loop inside the DWC OTG poll handler to 2015-07-31 09:12:31 +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 Lock softc before clearing bits. 2015-03-10 16:06:07 +00:00
misc Import ugold driver from OpenBSD supporting digital USB temperature 2015-06-11 15:23:47 +00:00
net - Fix compilation after r285909 with USB_DEBUG defined. 2015-07-27 14:43:14 +00:00
quirk Add new USB quirk. 2015-06-07 15:47:58 +00:00
serial Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl. 2015-08-06 19:47:04 +00:00
storage Use define instead of constant. 2015-03-17 08:42:09 +00:00
template Fix spelling. 2015-06-03 15:43:55 +00:00
video Put recycle pointer in own memory area which is not mmap'able. 2015-05-10 12:45:21 +00:00
wlan Change KPI of how device drivers that provide wireless connectivity interact 2015-08-07 11:43:14 +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
usb_bus.h Resolve a special case deadlock: When two or more threads are 2015-01-13 16:37:43 +00:00
usb_busdma.c
usb_busdma.h
usb_cdc.h
usb_compat_linux.c
usb_compat_linux.h
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
usb_debug.h
usb_dev.c Don't wait forever for USB data to be flushed. 2015-06-05 06:06:07 +00:00
usb_dev.h
usb_device.c Add support for DYMO LabelWriter PnP. 2015-05-07 12:54:27 +00:00
usb_device.h Resolve a special case deadlock: When two or more threads are 2015-01-13 16:37:43 +00:00
usb_dynamic.c
usb_dynamic.h
usb_endian.h
usb_error.c
usb_freebsd_loader.h Increase the maximum number of dynamic USB quirks. USB memory stick 2015-01-12 06:34:23 +00:00
usb_freebsd.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
usb_hid.c
usb_hub.c Add ugen keyword to USB pnpinfo. Remove extra space from existing pnpinfo. 2015-02-25 08:35:00 +00:00
usb_hub.h
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
usb_mbuf.c
usb_mbuf.h
usb_msctest.c Add support for DYMO LabelWriter PnP. 2015-05-07 12:54:27 +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
usb_pf.h
usb_process.c
usb_process.h
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 Optimise allocation of USB DMA structures. By default don't double map 2015-02-02 11:32:15 +00:00
usb_transfer.h
usb_util.c
usb_util.h
usb.h Add definition of the ISOCHRONOUS endpoint usage bits. 2015-03-25 13:32:27 +00:00
usbdevs Import ugold driver from OpenBSD supporting digital USB temperature 2015-06-11 15:23:47 +00:00
usbdi_util.h
usbdi.h
usbhid.h