Commit Graph

3979 Commits

Author SHA1 Message Date
Vladimir Kondratyev
3a3dc5b5b4 wmt(4): Use internal function to calculate input report size
Usbhid's hid_report_size() calculates integral size of all reports of given
kind found in the HID descriptor rather then exact size of report with given
ID as its userland counterpart does. As all input data processed by the
driver is located within the same report, calculate required driver's buffer
size with userland version, imported in one of the previous commits.
This allows us to skip zeroing of buffer on processing of each report.

While here do some minor refactoring.

MFC after:	2 weeks
2018-08-04 12:31:19 +00:00
Vladimir Kondratyev
8107f311f4 wmt(4): Read Microsoft's "Touch Hardware Quality Assurance" certificate blob
if present to enable some devices like WaveShare touchscreens. Unlike
Windows we discard content of the blob. We try mimic Windows driver
behaviour from the USB device point of view.

Submitted by:	glebius (initial version)
2018-08-04 12:29:08 +00:00
Vladimir Kondratyev
36584a62c7 wmt(4): Read 'Contact count maximum' usage value from feature report
rather than from HID descriptor to match Microsoft documentation.
Fall back to HID descriptor provided value if 'Get Report' request failed.

MFC after:	2 weeks
2018-08-04 12:24:37 +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
Gavin Atkinson
76cffa7a7e run(4): Support the D-Link DWA-125 rev A3
Submitted by:	Ali Mashtizadeh
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D16029
2018-07-21 14:56:15 +00:00
Vladimir Kondratyev
99a4d2ce08 Raise "Report Count" value limit in HID descriptor parser.
This fixes usage/report size calculation of Microsoft`s "Touch Hardware
Quality Assurance" certificate blob found in many touchscreens.

While here, join several "c->flags = dval" lines in to single line.

Reviewed by:	hselasky
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16357
2018-07-21 14:20:17 +00:00
Warner Losh
ff9452772d Remove kernel support for armeb
Remove all the big-endian arm architectures (ixp425 and ixp435)
support in the kernel and associated drivers.

Differential Revision:  https://reviews.freebsd.org/D16257
2018-07-17 23:23:45 +00:00
Mark Johnston
ca0a66ba34 Add PCI IDs for AMD X370 AHCI and XHCI.
Submitted by:	Greg V <greg@unrelenting.technology>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15398
2018-07-12 18:44:00 +00:00
Ben Widawsky
2c6d9edb2c run(4): Add a new USB device ID.
Summary:
Add the device id of the Panda Wireless PAU06 which seems to be
the already-supported combination of RT5392 MAC and RF RT5372
radio.

Reviewed By: allanjude, eadler, jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D16211
2018-07-11 02:32:06 +00:00
Ian Lepore
a6dae5627a Detach all children before beginning to tear down the hardware, instead of
doing it last.  Also, remove the local tracking of whether usb's busdma
memory allocation got done, because it's safe to call the free_all
function even if it wasn't.
2018-07-05 16:00:58 +00:00
Ed Maste
515a5d0239 muge(4): remove DTB MAC addr from TODO list after r335925
Also replace numbered list with - bulleted so the list entries do not
need to be renumbered as tasks are completed.

Sponsored by:	The FreeBSD Foundation
2018-07-04 13:38:02 +00:00
Oleksandr Tymoshenko
b4872d675e muge(4): add DTB blob as one more possible source of MAC address
On FDT-enabled platforms check if DTB blob has MAC address configured by
a boot loader. This information passed as a "local-mac-address" or
"mac-address" property of the device node. For USB NICs node
can be found by looking for compatibility string "usbVVV,PPP" where
VVV - vendor id (hex) and PPP - product id (hex)

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D16117
2018-07-04 03:02:53 +00:00
Hans Petter Selasky
b774480cd6 Improve the kernel's USB descriptor reading function.
Some USB devices does not allow a partial descriptor readout.

Found by:	bz@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-06-27 12:08:12 +00:00
Ed Maste
2c8cf0c505 if_muge: retire lan78xx_eeprom_read
lan78xx_eeprom_read just checked for EEPROM presence then called
lan78xx_eeprom_read_raw if present, and had only one caller.  Introduce
lan78xx_eeprom_present to check for EEPROM presence, and use it in the
one place it is needed.

This is used by r334964, which was accidentally committed out-of-order
from my work tree.

Reported by:	markj
Sponsored by:	The FreeBSD Foundation
2018-06-11 19:34:47 +00:00
Ed Maste
2d14fb8bec if_muge: add LAN7850 support
Differences between LAN7800 and LAN7850 from the driver's perspective:

* The LAN7800 muxes EEPROM signals with LEDs, so LED mode needs to be
  disabled when reading/writing EEPROM.  The EEPROM is not muxed on the
  LAN7850.

* The Linux driver enables automatic duplex and speed detection when
  there is no EEPROM, for the LAN7800 only.  With this FreeBSD driver
  LAN7850-based adapters without a configuration EEPROM fail to link
  (with or without the automatic duplex and speed detection code), so
  I have just followed the example of the Linux driver for now.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	Microchip (hardware)
2018-06-11 18:44:56 +00:00
Eitan Adler
0642b65f38 usbdevs: sort my prior commit 2018-06-11 05:28:00 +00:00
Eitan Adler
876713d563 usbdevs: adding vendor
PR:		228856
Reported by:	hrs, ys-h@imail.earth
2018-06-11 05:27:07 +00:00
Eitan Adler
10c66ed32e usbdevs: sync from NetBSD
This adds several vendors from NetBSD's copy of the same file (r1.749).
Prefer longer more "canonical" names where the names differed.

Sort while here.
2018-06-05 09:52:38 +00:00
Kevin Lo
ce24b3e7d8 Add support for SIMCom SIM7600E.
Sponsored by:	MSI/FUNTORO
2018-06-05 05:19:04 +00:00
Edward Tomasz Napierala
e8a5d07df5 Set bDeviceClass properly for composite device (template 8). There should
be no functional change.

PR:		203289
Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-06-01 09:17:20 +00:00
Eitan Adler
b1c8e1b1e7 [usbdevs] add several GENESYS product ids
Add USB product ID for two GENESYS LOGIC ICs, found in DELOCK
In-Desk-Hub 61991

PR:		228489
Submitted by:	"Harald Schmalzbauer" <bugzilla.freebsd@omnilan.de>
MFC After:	3 weeks
2018-05-29 14:40:50 +00:00
Eitan Adler
beb535e618 [usbdevs] add AMD vendor ids
- also more fully spell the name of ATI for ATI2
2018-05-29 14:37:48 +00:00
Eitan Adler
077da86688 [usbdevs] add misig letters 2018-05-29 14:08:06 +00:00
Eitan Adler
3ad02c2069 [usbdevs] add several intel product identifiers 2018-05-29 14:04:58 +00:00
Eitan Adler
9c7c97c0ff [usbdevs] Add USB product ID for Philips SPC N900 CCD Webcam
PR:		228488
Submitted by:	"Harald Schmalzbauer" <bugzilla.freebsd@omnilan.de>
2018-05-29 14:04:50 +00:00
Ed Maste
cfa989aa34 if_muge: Add GMII enable (vs RGMII) bit
The GMII control bit ETH_MAC_CR_GMII_EN_ is not documented in
LAN78xx datasheets, but from the permissively licensed header provided
by Microchip it is:

 #define ETH_MAC_CR_GMII_EN (0x00080000UL ) // GMII/RGMII Selection
2018-05-28 20:06:40 +00:00
Marius Strobl
f0db235b7d Describe Fresco Logic FL1100 USB 3.0 controllers. 2018-05-28 19:55:51 +00:00
Edward Tomasz Napierala
c140287a5b Change the default USB template from the current 0 to -1. The reason
is that current one (mass storage device) doesn't work as it is - it
needs to be set to 0 after the LUN is configured, which is what the
cfumass rc script does.  In other words: the current default does not
work, and to actually make it work it had to be set to -1 in
/boot/loader.conf.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-28 18:34:16 +00:00
Ed Maste
097f721b80 if_muge: Use lock assertion instead of broken locking in lan78xx_chip_init
Previously lan78xx_chip_init locked the driver's mutex if not already
locked, but unlocked it only in the case of error.  This provided a
fairly clear indication that the function is already called with the
lock held, so just replace it with a lock assertion.

Sponsored by:	The FreeBSD Foundation
2018-05-25 17:31:43 +00:00
Edward Tomasz Napierala
6ad033c2f1 Clarify that USB bus power consumption is measured in mA at 5V.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-24 18:02:02 +00:00
Ed Maste
49b2a5fede if_muge: Add LAN78xx family USB ids but attach only to LAN7800
This driver was developed for the LAN7800 and the register-compatible
LAN7515 and has only been tested on those devices.  Adding support for
other members of the family should be straightforward, once we have
devices to test.

With this change the driver will probe but fail to attach due to the
Chip ID check, but will leave a hint leading to the driver that needs
work.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15537
2018-05-24 16:34:06 +00:00
Bjoern A. Zeeb
3210d76631 Add Peraso Technologies, Inc. to the list.
Sponsored by:	Turing Robotic Industries
2018-05-24 15:47:15 +00:00
Hans Petter Selasky
0c89167c76 Add function to wait for USB ethernet attach to complete.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-05-24 15:24:42 +00:00
Edward Tomasz Napierala
d008c0d75f Centralize USB device mode bus power reporting, and add
hw.usb.template_power sysctl to control it.

Reviewed by:	hselasky@ (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-23 20:06:04 +00:00
Ed Maste
03ba5353ce if_muge: only attach to LAN7800 Chip ID
This driver was developed for the LAN7800 and the register-compatible
LAN7515 (found on Raspberry Pi 3B+) and has only been tested on those
devices.

Sponsored by:	The FreeBSD Foundation
2018-05-22 20:00:56 +00:00
Edward Tomasz Napierala
defd918d79 Add new PIDs for Audio, CDCE, MTP, and Mass Storage, from
https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt.

Big thanks to Christian Starkjohann for allocating those.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-22 19:11:06 +00:00
Andriy Gapon
a23a4e68fa uchcom: extend hardware support to version 0x30
This change adds support for a UBS<->RS232 adapter based on CH340 (or an
analogue) that I own.  The device seems to have a newer internal version
(0x30) and the existing code incorrectly configures line control for it
resulting in garbled transmission.  The changes are based on what I
learned in Linux drivers for the same hardware.

Additional changes:
- use UCHCOM_REG_LCR1 / UCHCOM_REG_LCR2 instead of explicit 0x18 and
  0x25
- use NULL instead of 0 where a pointer is expected

Reviewed by:	hselasky
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D15498
2018-05-21 21:04:31 +00:00
Andriy Gapon
dad3e656eb uchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1
Also, add definitions for more bits of UCHCOM_REG_LCR1 as seen in the
Linux driver.  UCHCOM_LCR1_PARENB definition was different from that in
the Linux driver and clashed with newly added UCHCOM_LCR1_RX.  I took a
liberty to change UCHCOM_LCR1_PARENB to the Linux definition as it was
unused in the driver anyway.  This change should make
uchcom_cfg_set_break() easier to understand.

Approved by:	hselasky
MFC after:	2 weeks
2018-05-21 21:02:10 +00:00
Andriy Gapon
40e7b06492 uchcom: reject parity and double stop bits as unsupported
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 21:00:13 +00:00
Andriy Gapon
7acd73fd1e uchcom: add a hardware configuration tweak seen in Linux code
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:59:15 +00:00
Andriy Gapon
1d33c9a55f uchcom: add DPRINTF-s to aid debugging of the driver
Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:58:06 +00:00
Andriy Gapon
d759c295c1 uchcom: report detected product based on USB product ID
Product IDs are specified in vendor documents.  The previously used
device ID is not.  This is a cosmetic change.  No functionality depends
on those IDs.

Reviewed by:	hselasky
MFC after:	2 weeks
2018-05-21 20:57:14 +00:00
Edward Tomasz Napierala
733efc21c4 Add a somewhat ugly hack that makes OSX serial device node names
human-readable.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 17:33:52 +00:00
Edward Tomasz Napierala
ac4a7f30d2 Improve description strings for USB device-mode serial ports.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 16:33:13 +00:00
Edward Tomasz Napierala
d01c1c8bfe Use USB Vendor Identifiers and Product Identifiers provided by V-USB
(https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt).
Previously we were using an invalid (not assigned to us) VID.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-21 15:06:19 +00:00
Ed Maste
0842ea9bb9 muge(4): chase r333813 if_addr_lock rwlock to epoch + mutex
muge was committed to the tree in r333713 but not yet connected to the
tree, and it crossed paths with the migration to using ck.

Sponsored by:	The FreeBSD Foundation
2018-05-19 18:44:29 +00:00
Edward Tomasz Napierala
86c61317fd Fix whitespace; no functional changes.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 15:18:15 +00:00
Edward Tomasz Napierala
1558eec6db Add #defines for vendor/product USB IDs. No functional changes.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 15:11:24 +00:00
Edward Tomasz Napierala
6073714909 Permit "(", ")", ":", and "/" in USB string descriptors.
This way we can properly show descriptors with URLs in them.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 10:49:51 +00:00
Edward Tomasz Napierala
6b7e508c4a Stop claiming the device-side USB serial interfaces talk Hayes AT.
There should be no functional difference.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-18 20:24:19 +00:00