Commit Graph

3998 Commits

Author SHA1 Message Date
Andriy Voskoboinyk
98d2a76e37 rtwn, rsu: add more USB ids.
PR:		233638
Submitted by:	cezary.sliwa@gmail.com
MFC after:	3 days
2018-12-10 09:45:57 +00:00
Vladimir Kondratyev
236e308af1 wmt(4): Add PNP record so it could be picked by devd/devmatch.
Fix uhid(4) conflict with blacklisting of multitouch HID-usages
in uhid(4) probe handler.

Reviewed by:		imp
No objections from:	hps
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D17689
2018-11-10 22:14:09 +00:00
Hans Petter Selasky
36d2d637dd Sometimes the complete split packet may be queued too early and the
transaction translator will return a NAK. Ignore this message and
retry the complete split instead.

MFC after:		3 days
Sponsored by:		Mellanox Technologies
2018-11-07 08:25:44 +00:00
Hans Petter Selasky
46b05e1923 Add new USB v2.0 PCI ID.
Submitted by:		Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by:		Mellanox Technologies
2018-11-02 15:03:52 +00:00
Vladimir Kondratyev
f86e7267f5 evdev: Use console lock as evdev lock for all supported keyboard drivers.
Now evdev part of keyboard drivers does not take any locks if corresponding
input/eventN device node is not opened by userland consumers.

Do not assert console lock inside evdev to handle the cases when keyboard
driver is called from some special single-threaded context like shutdown
thread.
2018-10-27 20:22:41 +00:00
Hans Petter Selasky
27e4bd81f7 Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by:		Gabor Simon <gabor.simon75@gmail.com>
PR:			225932
Differential revision:	https://reviews.freebsd.org/D16639
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-10-22 11:58:30 +00:00
Poul-Henning Kamp
146ebc766c Recognize LAN in Lenovo USB-C and TB3 docks 2018-10-21 09:36:12 +00:00
Poul-Henning Kamp
7595f142f1 Add Lenovo USB-C and TB3 docks 2018-10-21 07:32:35 +00:00
Hans Petter Selasky
a38abbfb00 Fix for reception of large full speed isochronous frames via the transaction
translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR:			230434
MFC after:		3 days
Approved by:		re (gjb)
Sponsored by:		Mellanox Technologies
2018-10-16 18:47:13 +00:00
Allan Jude
72851e8598 Use PNP metadata to allow devmatch to autoload ure(4)
Reviewed by:	manu imp
Approved by:	re (kib)
X-MFC-with:	devmatch
Sponsored by:	Klara Systems
2018-09-30 21:23:31 +00:00
Warner Losh
329e817fcc Reapply, with minor tweaks, r338025, from the original commit:
Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely.  The 'table' parameter is now required to
have correct pointer (or array) type.  Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

  $ cat modpnpsize0.cocci
    @normaltables@
    identifier b,c;
    expression a,d,e;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,d,
    -sizeof(d[0]),
     e);

    @singletons@
    identifier b,c,d;
    expression a;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,&d,
    -sizeof(d),
     1);

  $ rg -l MODULE_PNP_INFO -- sys | \
    xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not.  So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)
2018-09-26 17:12:14 +00:00
Vladimir Kondratyev
316086bd6c wmt(4): Fix regression introduced in r337289
r337289 has a side effect of reducing usb frame 0 buffer size down to
touch report size. That broke some devices e.g. "Raydium Touch System"
which are capable of generating non-touch frames of bigger length.
Fix it with enlarging frame 0 buffer up to internal wmt(4) buffer size.

Reported by:	Roberto Fernandez Cueto <roberfern@gmail.com>
Tested by:	Roberto Fernandez Cueto <roberfern@gmail.com>
Approved by:	re (gjb)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16772
2018-09-04 19:22:31 +00:00
Conrad Meyer
b8e771e97a Back out r338035 until Warner is finished churning GSoC PNP patches
I was not aware Warner was making or planning to make forward progress in
this area and have since been informed of that.

It's easy to apply/reapply when churn dies down.
2018-08-19 00:46:22 +00:00
Conrad Meyer
faa319436f Remove unused and easy to misuse PNP macro parameter
Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely.  The 'table' parameter is now required to
have correct pointer (or array) type.  Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

  $ cat modpnpsize0.cocci
    @normaltables@
    identifier b,c;
    expression a,d,e;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,d,
    -sizeof(d[0]),
     e);

    @singletons@
    identifier b,c,d;
    expression a;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,&d,
    -sizeof(d),
     1);

  $ rg -l MODULE_PNP_INFO -- sys | \
    xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not.  So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
2018-08-19 00:22:21 +00:00
Vladimir Kondratyev
48f2b00648 evdev: Remove evdev.ko linkage dependency on kbd driver
Move evdev_ev_kbd_event() helper from evdev to kbd.c as otherwise evdev
unconditionally requires all keyboard and console stuff to be compiled
into the kernel. This dependency happens as evdev_ev_kbd_event() helper
references kbdsw global variable defined in kbd.c through use of
kbdd_ioctl() macro.

While here make all keyboard drivers respect evdev_rcpt_mask while setting
typematic rate and LEDs with evdev interface.

Requested by:	Milan Obuch <bsd@dino.sk>
Reviewed by:	hselasky, gonzo
Differential Revision:	https://reviews.freebsd.org/D16614
2018-08-13 19:05:53 +00:00
Vladimir Kondratyev
911aed94fa evdev: remove soft context from evdev methods parameter list.
Now softc should be retrieved from struct edvev * pointer
with evdev_get_softc() helper.

wmt(4) is a sample of driver that support both KPI.

Reviewed by:	hselasky, gonzo
Differential Revision:	https://reviews.freebsd.org/D16614
2018-08-13 19:00:42 +00:00
Michal Meloun
23242e7a9c Add USB ID for rebranded RTL8153 found on NVIDIA Jetson TX1 board.
MFC after:	3 days
2018-08-13 07:28:25 +00:00
Kevin Lo
a99020fbf3 - Fix hash calculation by MAC address
- Since rx_cmd_c is an uint16_t, use le16toh() instead of le32toh()

Reviewed by:	emaste
2018-08-08 01:20:02 +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
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