Commit Graph

126 Commits

Author SHA1 Message Date
Warner Losh
b111430e54 mii: Add opt_platform.h to all miibus drivers
miivar.h includes opt_platform.h. Make sure all the drivers that use the
miibus_if.h interface file have opt_platform.h as well. While some of
these may not, strictly speaking, need it, it's easier to include it
universally for miibus.

Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
44796b7e82 mips: remove saf1761
The saf1761 OTG support was only for mips targets (BERI?). Retire it.

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D33706
2022-01-04 16:01:14 -07:00
Konstantin Belousov
5bb3134a8c Fix some modules to export more used symbols
and remove non-present symbols that are now reported by kmod_syms.awk.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32878
2021-11-18 15:56:23 +02:00
Vladimir Kondratyev
8d73071c47 wsp(4): Add evdev support.
Reviewed by:	hselasky
Tested by:	Greg V, Constantin Furst<constantin_AT_fuersten_DOT_info>
MFC after:	2 weeks
PR:		252236
Differential revision:	https://reviews.freebsd.org/D31653
2021-08-25 02:01:42 +03:00
Vladimir Kondratyev
9be6b22da9 hidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel option
which installs /dev/uhid# alias to hidraw character device for
compatibility with some existing uhid(4) users like Firefox.
As side effect it renames traditional uhid(4) driver to hidraw
to make possible using of common unit number allocator.

Requested by:	Greg V <greg_unrelenting.technology>
Reviewed by:	hselasky (as part of D27992)
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
01f2e864f7 hid: Import usbhid - USB transport backend for HID subsystem.
This change implements hid_if.m methods for HID-over-USB protocol [1].

Also, this change adds USBHID_ENABLED kernel option which changes
device_probe() priority and adds/removes PnP records to prefer usbhid
over ums, ukbd, wmt and other USB HID device drivers and vice-versa.

The module is based on uhid(4) driver.  It is disabled by default for
now due to conflicts with existing USB HID drivers.

[1] https://www.usb.org/sites/default/files/hid1_11.pdf

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27893
2021-01-08 02:18:43 +03:00
John-Mark Gurney
7d5522e16a A major update to the ure driver.
This update adds support for:
HW VLAN tagging
HW checksum offload for IPv4 and IPv6
tx and rx aggreegation (for full gige speeds)
multiple transactions

In my testing, I am able to get 900-950Mbps depending upon
TCP or UDP, which is a significant improvement over the previous
91Mbps (~8kint/sec*1500bytes/packet*1packet/int).

Reviewed by:	hselasky
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D25809
2020-09-12 00:33:11 +00:00
Warner Losh
209d3fb41f Remove the long obsolete ufm driver.
It was a driver for a USB FM tuner that was available in the market in 2002. I
wrote the driver in 2003. I've not used it since 2005 or so, so it's time to
retire this driver. No userland code ever interfaced to the special device it
created. There's no user base: the last bug I received on this driver was in
2004.

Relnotes: Yes
2020-08-20 17:35:47 +00:00
Eugene Grosbein
1aca650453 Unbreak building cp2112(8) as a module outside of kernel build environment. 2020-08-16 12:59:43 +00:00
Andriy Gapon
c178a7e73c cp2112: driver for the namesake GPIO and I2C master gadget
Documentation:
- CP2112 Datasheet
  https://www.silabs.com/documents/public/data-sheets/cp2112-datasheet.pdf
- AN495: CP2112 Interface Specification
  https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf
- CP2112 Errata
  https://www.silabs.com/documents/public/errata/cp2112-errata.pdf

The logic is implemented as three sub-drivers.
The parent driver claims the USB device and creates two child devices.
One acts as a GPIO controller and the other is an I2C controller.

Tested with CP2112 revision F02.
Both features seem to work.
HTU21 sensor was used as an I2C slave.

Reviewed by:	adrian, hselasky
MFC after:	2 weeks
Relnotes:	maybe
Differential Revision: https://reviews.freebsd.org/D25359
2020-08-06 13:41:42 +00:00
Hans Petter Selasky
8427dd0899 Fix build of stand/usb .
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-23 10:40:34 +00:00
Edward Tomasz Napierala
63722e5212 Add cdceem(4) driver, for virtual ethernet devices compliant
with Communication Device Class Ethernet Emulation Model (CDC EEM).
The driver supports both the device, and host side operation; there
is a new USB template (#11) for the former.

This enables communication with virtual USB NIC provided by iLO 5,
as found in new HPE Proliant servers.

Reviewed by:	hselasky
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Hewlett Packard Enterprise
2019-08-07 18:14:45 +00:00
Hans Petter Selasky
7fe671dc9b Put USB ACPI code into own module, uacpi.ko.
The code needs more testing before being enabled by default.

Sponsored by:	Mellanox Technologies
2019-07-08 20:53:25 +00:00
Takanori Watanabe
e68fcc8875 Add ACPI support for USB driver.
This adds ACPI device path on devinfo(8) output and
show  value of _UPC(usb port capabilities), _PLD (physical location of device)
when hw.usb.debug >= 1 .

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D20630
2019-06-17 23:03:30 +00:00
Bryan Drewery
f68801df10 Stop using .OODATE for extracting firmware.
This fixes META_MODE rebuilding since it assumes that it this is
a non-consistent build command. These are always unencoded consistently
though and do not need to use the .OODATE/$? mechanism.

MFC after:	2 weeks
Reported by:	npn
Sponsored by:	DellEMC
2019-06-12 00:03:00 +00:00
Ian Lepore
bac5ec96f4 Add common support functions for USB devices configured via FDT data.
FDT data is sometimes used to configure usb devices which are hardwired into
an embedded system. Because the devices are instantiated by the usb
enumeration process rather than by ofwbus iterating through the fdt data, it
is somewhat difficult for a usb driver to locate fdt data that belongs to
it. In the past, various ad-hoc methods have been used, which can lead to
errors such applying configuration that should apply only to a hardwired
device onto a similar device attached by the user at runtime. For example,
if the user adds an ethernet device that uses the same driver as the builtin
ethernet, both devices might end up with the same MAC address.

These changes add a new usb_fdt_get_node() helper function that a driver can
use to locate FDT data that belongs to a single unique instance of the
device. This function locates the proper FDT data using the mechanism
detailed in the standard "usb-device.txt" binding document [1].

There is also a new usb_fdt_get_mac_addr() function, used to retrieve the
mac address for a given device instance from the fdt data. It uses
usb_fdt_get_node() to locate the right node in the FDT data, and attempts to
obtain the mac-address or local-mac-address property (in that order, the
same as linux does it).

The existing if_smsc driver is modified to use the new functions, both as an
example and for testing the new functions. Rpi and rpi2 boards use this
driver and provide the mac address via the fdt data.

[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/usb/usb-device.txt

Differential Revision:	https://reviews.freebsd.org/D20262
2019-05-19 16:56:59 +00:00
Vladimir Kondratyev
26f3e847c3 uep(4): add evdev support
To compile this driver with evdev support enabled, place
following lines into the kernel configuration file:

options EVDEV_SUPPORT
device evdev

Note: Native and evdev modes are mutually exclusive.

Reviewed by:	gonzo, wblock (docs)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11156
2018-08-05 11:14:13 +00:00
Warner Losh
58d5c51106 Remove Atmel AT91RM9200 and AT91SAM9 support.
The last known robust version of this code base was FreeBSD 8.2. There
are no users of this on current, and all users of it have abandoned
this platform or are in legacy mode with a prior version of FreeBSD.

All known users on arm@ approved this removal, and there were no
objections.

Differential Revision: https://reviews.freebsd.org/D16312
2018-07-27 18:28:22 +00:00
Ed Maste
c0134460fc if_muge: connect module to the build
Supported Microchip devices:
- LAN7515 USB 2 hub and gigabit Ethernet controller w/ PHY
- LAN7800 USB 3.0 gigabit Ethernet controller w/ PHY

The LAN7515 is the Ethernet controller on the Raspberry Pi 3 B+.

This driver has some TODO items outstanding, but basic functionality
works.

Sponsored by:	The FreeBSD Foundation
2018-05-25 17:29:29 +00:00
Edward Tomasz Napierala
3dc87e52a9 Add a "multifunction" device side USB template, which provides mass
storage, CDC ACM (serial), and CDC ECM (ethernet) at the same time.
It's quite similar in function to Linux' "g_multi" gadget.

Reviewed by:	hselasky@
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2018-05-17 19:54:11 +00:00
Ed Maste
d30c739c90 Add driver for Microchip LAN78xx USB3-GigE controller
This driver supports two Microchip USB-Ethernet controllers:

LAN7800 USB 3.1 to 10/100/1000 Mbps Ethernet
LAN7515 USB 2 to 10/100/1000 Mbps Ethernet with built-in USB hub

The LAN7515 is the Ethernet controller on the Raspberry Pi 3B+.
At present there is no datasheet for the LAN7515, but it is effectively
a USB 2 hub combined with a LAN7800 controller.  A comprehensive LAN7800
datasheet is at http://www.microchip.com/wwwproducts/en/LAN7800.

This driver is based on the structure of the smsc(4) driver which
supports Microchip/SMSC's LAN95xx family.  (Microchip acquired SMSC
in May 2012.)  The Linux lan78xx driver served as a reference for some
functionality and registers.

The 'muge' driver name comes from "Microchip USB Gigabit Ethernet".
I made some style adjustments and minor edits to Arshan's submission.
It will be connected to the build after additional review and testing.

Thanks to Microchip for providing a number of Evaluation Boards (EVBs)
for development and testing.

Submitted by:	Arshan Khanifar
Reviewed by:	hselasky (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15168
2018-05-17 14:04:59 +00:00
Hans Petter Selasky
e757cb8ecb Add new USB HID driver for Super Nintendo gamepads.
Differential Revision:	https://reviews.freebsd.org/D15385
Submitted by:		johalun@gmail.com (Johannes Lundberg)
Sponsored by:		Mellanox Technologies
2018-05-15 15:36:34 +00:00
Brooks Davis
6469bdcdb6 Move most of the contents of opt_compat.h to opt_global.h.
opt_compat.h is mentioned in nearly 180 files. In-progress network
driver compabibility improvements may add over 100 more so this is
closer to "just about everywhere" than "only some files" per the
guidance in sys/conf/options.

Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of
sys/compat/linux/*.c.  A fake _COMPAT_LINUX option ensure opt_compat.h
is created on all architectures.

Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the
set of compiled files.

Reviewed by:	kib, cem, jhb, jtl
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14941
2018-04-06 17:35:35 +00:00
Andriy Voskoboinyk
63a55eab9b usb/wlan/*: properly include "opt_wlan.h" into all drivers
Without it driver cannot be loaded when wlan(4) module is built with
'options IEEE80211_DEBUG_REFCNT'.
2018-03-10 23:16:24 +00:00
Vladimir Kondratyev
76136d200d Add support for generic MS Windows 7/8/10-compatible USB HID touchscreens
found in many laptops.

Reviewed by:		hps, gonzo, bcr (manpages)
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D12017
2017-08-19 17:00:10 +00:00
Enji Cooper
193d9e768b sys/modules: normalize .CURDIR-relative paths to SRCTOP
This simplifies make output/logic

Tested with:	`cd sys/modules; make ALL_MODULES=` on amd64
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 10:10:17 +00:00
Edward Tomasz Napierala
cc5bbcb275 Add USB Mass Storage CTL frontend. This makes it possible
for USB OTG-capable hardware to implement device side of USB
Mass Storage, ie pretend it's a flash drive.  It's configured
in the same way as other CTL frontends, using ctladm(8)
or ctld(8).  Differently from usfs(4), all the configuration
can be done without rebuilding the kernel.

Testing and review is welcome.  Right now I'm still moving,
and I don't have access to my test environment, so I'm somewhat
reluctant to making larger changes to this code; on the other
hand I don't want to let it sit on Phab until my testing setup
is back, because I want to get it into 11.1-RELEASE.

Reviewed by:	emaste (cursory), wblock (man page)
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8787
2017-02-19 17:47:43 +00:00
Ed Maste
7b523f05a7 mips: exclude modules that fail to build 2017-01-26 18:05:31 +00:00
Oleksandr Tymoshenko
c3af259a20 Add evdev support to ums(4)
event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7863
2016-09-21 18:52:03 +00:00
Oleksandr Tymoshenko
10063b791c Add evdev support to ukbd driver
event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7957
2016-09-21 18:47:21 +00:00
Adrian Chadd
0c91dc1d08 [urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by:	kevlo
2016-03-20 03:54:57 +00:00
Andriy Voskoboinyk
7873b2abd6 urtwn: add an option to compile the driver without firmware specific code
- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4849
2016-02-22 00:48:53 +00:00
Adrian Chadd
6075c2fc6a Disable the firwmare licence check for rsu and urtwn.
The licence grant says something exactly the same as the atheros patent
grant, which is "As long as you use this firmware on our chips, everything
is totally okay."  Now, I'm pretty sure if that we /have/ to have this,
we're going to have to have it for every other firmware for every other
device in the tree.

So, I'll flip this off in -HEAD for now so people stop asking about
why rsu/urtwn don't work out of the box, and I'll kick off a larger
discussion about this in the new year.
2015-12-26 19:14:24 +00:00
Kevin Lo
e1b74f21f5 Add initial support for RTL8152 USB Fast Ethernet. RTL8152 supports
IPv4/IPv6 checksum offloading and VLAN tag insertion/stripping.

Since uether doesn't provide a way to announce driver specific offload
capabilities to upper stack, checksum offloading support needs more work
and will be done in the future.

Special thanks to Hayes Wang from RealTek who gave input.
2015-12-01 05:12:13 +00:00
Bryan Drewery
64bd42622a Build all of sys/modules with SUBDIR_PARALLEL.
Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 weeks
2015-11-10 17:15:36 +00:00
Hans Petter Selasky
8d59ecb214 Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
  its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
  adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
  COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
  LinuxKPI into the kernel. This was done to keep the build rules for
  the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
  Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by:	np @ (cxgb and cxgbe related changes only)
Sponsored by:	Mellanox Technologies
2015-10-29 08:28:39 +00:00
Adrian Chadd
c0658ced70 urtwn(4): split *reg and *var parts (no functional change).
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3775
2015-10-12 05:14:49 +00:00
Adrian Chadd
024223535f Add opt_wlan.h as requirements for the two drivers I'm currently working on. 2015-09-29 04:56:27 +00:00
Hans Petter Selasky
2d45d7935b Add USB gold driver to default kernel build. 2015-06-19 06:48:55 +00:00
Hans Petter Selasky
2ce0e01dba Import ugold driver from OpenBSD supporting digital USB temperature
meters. The driver is currently not part of the default kernel build.

Obtained from:	OpenBSD
MFC after:	2 weeks
2015-06-11 15:23:47 +00:00
Hans Petter Selasky
0a76fe7c24 Add USB MIDI template for USB device side mode. 2015-06-01 11:24:34 +00:00
Hans Petter Selasky
faaf95e8c2 Build the USB DisplayLink driver by default. 2015-04-17 07:11:10 +00:00
Hans Petter Selasky
75d07abd2d Allow USB modules to be built in parallel. 2015-03-04 09:17:03 +00:00
Hans Petter Selasky
0867995ca0 Import USB display link driver from OpenBSD. Support for compression
has been removed and the driver has been greatly simplified and
optimised for FreeBSD. The driver is currently not built by default.

Requested by:	Bruce Simpson <bms@fastmail.net>
2015-02-15 12:02:17 +00:00
Hans Petter Selasky
27f9c0b3d9 Add new USB template to the USB template module. 2015-01-13 14:26:05 +00:00
Kevin Lo
6bd03b20fd The USB LED driver for the Dream Cheeky WebMail Notifier.
Reviewed by:	hselasky
2014-09-05 11:25:58 +00:00
Warner Losh
df3394b3de Remove dependence on source tree options. Move all kernel module
options into kern.opts.mk and change all the places where we use
src.opts.mk to pull in the options. Conditionally define SYSDIR and
use SYSDIR/conf/kern.opts.mk instead of a CURDIR path. Replace all
instances of CURDIR/../../etc with STSDIR, but only in the affected
files.

As a special compatibility hack, include bsd.owm.mk at the top of
kern.opts.mk to allow the bare build of sys/modules to work on older
systems. If the defaults ever change between 9.x, 10.x and current for
these options, however, you'll wind up with the host OS' defaults
rather than the -current defaults. This hack will be removed when
we no longer need to support this build scenario.

Reviewed by: jhb
Differential Revision: https://phabric.freebsd.org/D529
2014-08-11 14:50:49 +00:00
Hans Petter Selasky
f9478f91fb Add new USB phone descriptor template for USB device side mode.
MFC after:	3 days
2014-08-05 07:03:16 +00:00
Hans Petter Selasky
0b4dc07df8 Hook the ISP/SAF1761 driver into MIPS kernel builds.
- Update FDT file for BERI DE4 boards.
- Add needed kernel configuration keywords.
- Rename module to saf1761otg so that the device unit number does not
interfere with the hardware ID in dmesg.

Sponsored by:	DARPA, AFRL
2014-05-29 10:46:09 +00:00
Hans Petter Selasky
e85f0d3141 - Remove no longer used file. FDT is used to attach device drivers. 2014-05-18 09:19:13 +00:00