Commit Graph

37596 Commits

Author SHA1 Message Date
Warner Losh
24ae19c414 Start the retirement process for ufm
This driver hasn't been relevant in almost 15 years. It was for a product on the
shelves for about 6 months in 2003/2004. I've not updated the driver since then,
and have had nobody talk to me about it since maybe 2006 or 2007. It doesn't
implement a standard interface, and can be better done with libusb. All the
action has moved to webcamd for newer, more fully featured hardware. It makes no
appearances in the nycbug dmesg archive.

Relnotes: yes
MFC After: 3 days
2020-04-01 16:22:31 +00:00
Alexander Motin
274328a4ef Add support for AHCI BIOS/OS Handoff.
This allows clean handoff from BIOS implementing some asynchronous I/O to
the OS AHCI driver.  During attach driver declares OS ownership request
and waits from 25ms to 2s for BIOS to complete operation and release the
hardware.

MFC after:	2 weeks
2020-04-01 03:27:47 +00:00
Alexander Motin
16b766eed4 Add ID for JMicron JMB582/JMB585 AHCI controller.
JMB582 has 2 6Gbps SATA ports and PCIe 3.0 x1.
JMB585 has 5 6Gbps SATA ports and PCIe 3.0 x2.

Both chips support AHCI v1.31, Port Multiplier with FBS and 8 MSI vectors.

MFC after:	2 weeks
2020-04-01 03:19:42 +00:00
Takanori Watanabe
c30797873f Add Platform Controller Hub built-in thermal management device driver.
Differential Revision:	https://reviews.freebsd.org/D24077
2020-03-31 06:25:43 +00:00
Hans Petter Selasky
86c9b3f3a6 Add support for multiple playback and recording devices per physical USB audio
device. This requires some structural refactoring inside the driver, mostly
about converting existing audio channel structures into arrays.

The main audio mixer is provided by the first PCM instance.
The non-first audio instances may only have a software mixer for PCM playback.

Tested by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-30 16:50:32 +00:00
Ed Maste
aeb665b538 remove extraneous double ;s in sys/ 2020-03-30 16:04:25 +00:00
Hans Petter Selasky
93e39e2325 Implement new mixer API to return the device pointer based on the mixer pointer.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-30 15:36:38 +00:00
Hans Petter Selasky
8e2e5ae7d1 Evaluate modifier keys before the regular keys, so that if a modifier
key is pressed at the same time as a regular key, that means key with
modifier is output. Some automated USB keyboards like Yubikeys need this.

This fixes a regression issue after r357861.

Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
PR:		224592
PR:		233884
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-30 15:29:39 +00:00
Mark Johnston
9b1d850be8 Remove the "config" taskqgroup and its KPIs.
Equivalent functionality is already provided by taskqueue(9), just use
that instead.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-03-30 14:24:03 +00:00
Mark Johnston
9893ab3f50 Fix accounting of hwpmc's thread descriptor freelist.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-03-30 14:23:08 +00:00
Vladimir Kondratyev
006eb44926 evdev: return error rather than zero-length data on blocked read()
if blocked process has been woken up by evdev device destruction.

MFC after:	2 weeks
2020-03-29 23:01:36 +00:00
Vladimir Kondratyev
80ddbddfd7 evdev: Add COMPAT_FREEBSD32 support for amd64 arch
Incompatibility between i386 and amd64 evdev ABIs was caused by presence of
'struct timeval' in evdev protocol. Replace it with 'struct timeval32' for
32 bit binaries.

Big-endian platforms may require additional work due to bitstr_t (array of
unsigned longs) usage in ioctl interface.

MFC after:	2 weeks
2020-03-29 23:00:33 +00:00
Konstantin Belousov
f30cf5588a hdaa: remove verbosity from the normal driver operations.
If hdaa is used in polling mode, it logs each change to the poll
interval under bootverbose, which makes it unusable (slow).  These
messages are arguably useless or are a debugging leftovers at best.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2020-03-28 16:26:47 +00:00
John Baldwin
c034143269 Refactor driver and consumer interfaces for OCF (in-kernel crypto).
- The linked list of cryptoini structures used in session
  initialization is replaced with a new flat structure: struct
  crypto_session_params.  This session includes a new mode to define
  how the other fields should be interpreted.  Available modes
  include:

  - COMPRESS (for compression/decompression)
  - CIPHER (for simply encryption/decryption)
  - DIGEST (computing and verifying digests)
  - AEAD (combined auth and encryption such as AES-GCM and AES-CCM)
  - ETA (combined auth and encryption using encrypt-then-authenticate)

  Additional modes could be added in the future (e.g. if we wanted to
  support TLS MtE for AES-CBC in the kernel we could add a new mode
  for that.  TLS modes might also affect how AAD is interpreted, etc.)

  The flat structure also includes the key lengths and algorithms as
  before.  However, code doesn't have to walk the linked list and
  switch on the algorithm to determine which key is the auth key vs
  encryption key.  The 'csp_auth_*' fields are always used for auth
  keys and settings and 'csp_cipher_*' for cipher.  (Compression
  algorithms are stored in csp_cipher_alg.)

- Drivers no longer register a list of supported algorithms.  This
  doesn't quite work when you factor in modes (e.g. a driver might
  support both AES-CBC and SHA2-256-HMAC separately but not combined
  for ETA).  Instead, a new 'crypto_probesession' method has been
  added to the kobj interface for symmteric crypto drivers.  This
  method returns a negative value on success (similar to how
  device_probe works) and the crypto framework uses this value to pick
  the "best" driver.  There are three constants for hardware
  (e.g. ccr), accelerated software (e.g. aesni), and plain software
  (cryptosoft) that give preference in that order.  One effect of this
  is that if you request only hardware when creating a new session,
  you will no longer get a session using accelerated software.
  Another effect is that the default setting to disallow software
  crypto via /dev/crypto now disables accelerated software.

  Once a driver is chosen, 'crypto_newsession' is invoked as before.

- Crypto operations are now solely described by the flat 'cryptop'
  structure.  The linked list of descriptors has been removed.

  A separate enum has been added to describe the type of data buffer
  in use instead of using CRYPTO_F_* flags to make it easier to add
  more types in the future if needed (e.g. wired userspace buffers for
  zero-copy).  It will also make it easier to re-introduce separate
  input and output buffers (in-kernel TLS would benefit from this).

  Try to make the flags related to IV handling less insane:

  - CRYPTO_F_IV_SEPARATE means that the IV is stored in the 'crp_iv'
    member of the operation structure.  If this flag is not set, the
    IV is stored in the data buffer at the 'crp_iv_start' offset.

  - CRYPTO_F_IV_GENERATE means that a random IV should be generated
    and stored into the data buffer.  This cannot be used with
    CRYPTO_F_IV_SEPARATE.

  If a consumer wants to deal with explicit vs implicit IVs, etc. it
  can always generate the IV however it needs and store partial IVs in
  the buffer and the full IV/nonce in crp_iv and set
  CRYPTO_F_IV_SEPARATE.

  The layout of the buffer is now described via fields in cryptop.
  crp_aad_start and crp_aad_length define the boundaries of any AAD.
  Previously with GCM and CCM you defined an auth crd with this range,
  but for ETA your auth crd had to span both the AAD and plaintext
  (and they had to be adjacent).

  crp_payload_start and crp_payload_length define the boundaries of
  the plaintext/ciphertext.  Modes that only do a single operation
  (COMPRESS, CIPHER, DIGEST) should only use this region and leave the
  AAD region empty.

  If a digest is present (or should be generated), it's starting
  location is marked by crp_digest_start.

  Instead of using the CRD_F_ENCRYPT flag to determine the direction
  of the operation, cryptop now includes an 'op' field defining the
  operation to perform.  For digests I've added a new VERIFY digest
  mode which assumes a digest is present in the input and fails the
  request with EBADMSG if it doesn't match the internally-computed
  digest.  GCM and CCM already assumed this, and the new AEAD mode
  requires this for decryption.  The new ETA mode now also requires
  this for decryption, so IPsec and GELI no longer do their own
  authentication verification.  Simple DIGEST operations can also do
  this, though there are no in-tree consumers.

  To eventually support some refcounting to close races, the session
  cookie is now passed to crypto_getop() and clients should no longer
  set crp_sesssion directly.

- Assymteric crypto operation structures should be allocated via
  crypto_getkreq() and freed via crypto_freekreq().  This permits the
  crypto layer to track open asym requests and close races with a
  driver trying to unregister while asym requests are in flight.

- crypto_copyback, crypto_copydata, crypto_apply, and
  crypto_contiguous_subsegment now accept the 'crp' object as the
  first parameter instead of individual members.  This makes it easier
  to deal with different buffer types in the future as well as
  separate input and output buffers.  It's also simpler for driver
  writers to use.

- bus_dmamap_load_crp() loads a DMA mapping for a crypto buffer.
  This understands the various types of buffers so that drivers that
  use DMA do not have to be aware of different buffer types.

- Helper routines now exist to build an auth context for HMAC IPAD
  and OPAD.  This reduces some duplicated work among drivers.

- Key buffers are now treated as const throughout the framework and in
  device drivers.  However, session key buffers provided when a session
  is created are expected to remain alive for the duration of the
  session.

- GCM and CCM sessions now only specify a cipher algorithm and a cipher
  key.  The redundant auth information is not needed or used.

- For cryptosoft, split up the code a bit such that the 'process'
  callback now invokes a function pointer in the session.  This
  function pointer is set based on the mode (in effect) though it
  simplifies a few edge cases that would otherwise be in the switch in
  'process'.

  It does split up GCM vs CCM which I think is more readable even if there
  is some duplication.

- I changed /dev/crypto to support GMAC requests using CRYPTO_AES_NIST_GMAC
  as an auth algorithm and updated cryptocheck to work with it.

- Combined cipher and auth sessions via /dev/crypto now always use ETA
  mode.  The COP_F_CIPHER_FIRST flag is now a no-op that is ignored.
  This was actually documented as being true in crypto(4) before, but
  the code had not implemented this before I added the CIPHER_FIRST
  flag.

- I have not yet updated /dev/crypto to be aware of explicit modes for
  sessions.  I will probably do that at some point in the future as well
  as teach it about IV/nonce and tag lengths for AEAD so we can support
  all of the NIST KAT tests for GCM and CCM.

- I've split up the exising crypto.9 manpage into several pages
  of which many are written from scratch.

- I have converted all drivers and consumers in the tree and verified
  that they compile, but I have not tested all of them.  I have tested
  the following drivers:

  - cryptosoft
  - aesni (AES only)
  - blake2
  - ccr

  and the following consumers:

  - cryptodev
  - IPsec
  - ktls_ocf
  - GELI (lightly)

  I have not tested the following:

  - ccp
  - aesni with sha
  - hifn
  - kgssapi_krb5
  - ubsec
  - padlock
  - safe
  - armv8_crypto (aarch64)
  - glxsb (i386)
  - sec (ppc)
  - cesa (armv7)
  - cryptocteon (mips64)
  - nlmsec (mips64)

Discussed with:	cem
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D23677
2020-03-27 18:25:23 +00:00
Hans Petter Selasky
9211468fc2 Change default microphone level from 0 to 25.
Discussed with:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-27 10:28:15 +00:00
Hans Petter Selasky
c2bc9ff72a Improve USB audio mixer support for USB audio class 1 and 2.
- make sure volume controls are correctly mapped to "pcm" and "rec" depending
  on how they deliver audio to the USB host.
- make sure there are no duplicate record selections.
- remove internal only mixer class type.
- don't add software volume controls for recording only.
- some minor mixer code cleanup.

Tested by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-27 10:22:35 +00:00
Leandro Lupori
f6f325c837 [PowerPC64] Fix OPAL IPMI driver
This change fixes a couple of issues with OPAL IPMI driver and
implements a mechanism to detect timeouts and discard old messages left
in receive queue, to avoid old messages from being confused with the
reply of new ones.

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D24185
2020-03-26 12:17:49 +00:00
Hans Petter Selasky
a0be362828 Be more intelligent when classifying USB audio terminal types, so that we
don't end up using SOUND_MIXER_VOLUME for all undefined types.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-26 07:52:04 +00:00
Hans Petter Selasky
91feacd19e Make mute controls available for USB audio mixers.
Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-26 07:46:16 +00:00
Hans Petter Selasky
edabe1ee6d Factor out USB audio mixer value range check.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-26 07:42:36 +00:00
Hans Petter Selasky
7e88777b24 Avoid scaling USB audio mixer values twice.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-26 07:37:00 +00:00
Justin Hibbits
77cb3b49b7 ichwd: Add Atom C3000 watchdog ID.
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc
2020-03-24 21:28:48 +00:00
Justin Hibbits
d681bc9e64 ismt: Fix ISMT_DESC_ADDR_RW macro, slave addresses are already left-shifted
Reverts r293369.  The macro was orginally correct, since our SMBus
framework, unlike i2c, already requires addresses to be 8-bit, LSB-cleared.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc
2020-03-24 18:35:33 +00:00
Baptiste Daroussin
e47b5c3de7 Remove unneeded dependency on libl 2020-03-23 14:33:29 +00:00
Hans Petter Selasky
d0edc32e72 Add new USB ID.
Submitted by:	Konrad Jopek <kjopek@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D24142
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-22 11:44:24 +00:00
Ed Maste
e3e6a34984 Use a separate copy of machdep.h in cp and ce drivers
Previously they included sys/dev/cx/machdep.h, but the cx driver was
retired in r359178.  These drivers haven't had real development for
a decade or more so there's no real benefit in sharing this file; just
copy it to the ce and cp subdirs.
2020-03-20 19:28:55 +00:00
Ed Maste
2733d8c96c retire cx,ctau drivers
The devices supported by these drivers are obsolete ISA cards, and the
sync serial protocols they supported are essentially obsolete too.

Sponsored by:	The FreeBSD Foundation
2020-03-20 16:50:19 +00:00
Navdeep Parhar
aa301e5ffe cxgbe(4): Split sge_nm_rxq into three cachelines.
This reduces the lines bouncing around between the driver rx ithread and
the netmap rxsync thread.  There is no net change in the size of the
struct (it continues to waste a lot of space).

This kind of split was originally proposed in D17869 by Marc De La
Gueronniere @ Verisign, Inc.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-03-20 05:12:16 +00:00
Gavin Atkinson
4b156472c6 Add new USB device ID for Elecom 802.11ac USB device.
MFC after:	2 weeks
2020-03-20 04:13:39 +00:00
Hans Petter Selasky
d76ca5b15c Correctly implement support for remote wakeup for USB 3.0 device.
Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-19 09:15:59 +00:00
Alexander Motin
d26ae2c1ca Add missing STAILQ_INIT() in ciss_disable_adapter().
I think it should fix reported panic after "ADAPTER HEARTBEAT FAILED".

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-03-19 00:19:50 +00:00
Konstantin Belousov
4ad58ea85b mlx5_core: lower the severity of message noting that no SR-IOV cap is present.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:47:14 +00:00
Konstantin Belousov
bbcb656af2 mlx5: Route NIC_VPORT_CHANGE events to eswitch code.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:44:48 +00:00
Konstantin Belousov
90959e7e37 mlx5: Read number of VF ports from the SR-IOV cap.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:43:39 +00:00
Konstantin Belousov
18a70fa574 mlx5: Use eswitch interface to configure VFs steering.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:40:26 +00:00
Konstantin Belousov
8982c8003b mlx5: Add 'follow' vport state, relevant for VFs.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:38:57 +00:00
Konstantin Belousov
f6ca0b216a mlx5: Integrate eswitch and mpfs management code.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:33:39 +00:00
Konstantin Belousov
91ad1bd953 mlx5: Restore eswitch management code from attic.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:30:56 +00:00
Konstantin Belousov
9dfa078252 mlx5: Basic PCIe side of SR-IOV support.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 22:17:01 +00:00
Konstantin Belousov
e19a968f15 mlx5_core: add sysctls to report device capabilities.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
2020-03-18 21:54:32 +00:00
Ed Maste
15f16425e4 if_muge: use C99 bool for boolean vars 2020-03-18 14:16:14 +00:00
Rebecca Cran
7e03a82b63 ath_hal: fix typo in ath_hal_printf 2020-03-18 03:14:17 +00:00
Navdeep Parhar
a8f48cf82f Remove spurious warning about invalid VPD data.
The warning used to be displayed for valid VPDs about 512B or above in
size.  Fix the size check and add a break while here so that the routine
stops if if detects any problem.

Tested with "pciconf -lV"

Reviewed by:	kib@, jhb@
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D23679
2020-03-18 01:09:40 +00:00
Hans Petter Selasky
b527d52357 Add new USB device ID to u3g driver.
Submitted by:	super_gromit@hotmail.com
PR:		244798
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-17 09:12:47 +00:00
Patrick Kelsey
5d1899eedb Restore power-of-2 queue count constraint from r290948
When vmx(4) was converted to an iflib driver in r343291, the
power-of-2 queue count constraint was removed as it appeared that
current implementations of the VMXNET3 virtual device no longer
required that constraint.  It turns out that some of the
implementations still do, and on such systems, the device will fail to
initialize when configured with a non-power-of-2 RX or TX queue count.

PR:		237321
Reported by:	ncrogers@gmail.com
MFC after:	1 week
2020-03-17 03:32:13 +00:00
Alfredo Dal'Ava Junior
5c6ad2e813 atp: fix mouse attachment on PowerBook5,6 (G4)
Skip device mode switch step on Fountain-based devices as they don't
support RAW_SENSOR_MODE command, so failing to attach.

This was reproduced on PowerBook G4 (model PowerBook5,6) equipped with
product ID 0x020e

Reviewed by:	hselasky
Approved by:	jhibbits (mentor)
Differential Revision:	https://reviews.freebsd.org/D24005
2020-03-16 13:53:29 +00:00
Ed Maste
9f6954e505 if_muge: whitespace and style cleanup
Submitted by:	clang-format (in part)
Sponsored by:	The FreeBSD Foundation
2020-03-15 21:47:16 +00:00
Ed Maste
6c0331ea04 muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE
TSO is independent of checksum offload
2020-03-15 03:32:39 +00:00
Ed Maste
0d5e6868c5 muge: enable RXCSUM as it now works
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-03-15 03:03:01 +00:00
Patrick Kelsey
1342c8c622 Adjust if_vmx default receive parameters for better out-of-box performance
These adjustments improve performance with jumbo frames and/or LRO
enabled (i.e., when there may be multiple descriptors per packet) by
increasing the default size of the receive queues and by always using
page-sized buffers for the body type receive ring.

This patch also adjust the initialization of the max frame size to
remove cases where certain configuration sequences would result in 2K
receive buffers being used instead of 4K ones when jumbo frames were
enabled.

Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23950
2020-03-14 20:11:46 +00:00