<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/usb, branch releng/14.3</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>hidraw(4): Add additional hidraw input/output report ioctls</title>
<updated>2025-04-30T07:32:22+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2025-04-27T09:07:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7545c8c116b111e418f31eadfe6fba775a9e3dea'/>
<id>7545c8c116b111e418f31eadfe6fba775a9e3dea</id>
<content type='text'>
to Linux hidraw compatibility API.

Respective Linux commit f43d3870cafa made by Dean Camera message is:

Currently the hidraw module can only read and write feature HID reports on
demand, via dedicated ioctls. Input reports are read from the device through
the read() interface, while output reports are written through the write
interface().

This is insufficient; it is desirable in many situations to be able to read and
write input and output reports through the control interface to cover
additional scenarios:

  - Reading an input report by its report ID, to get initial state
  - Writing an input report, to set initial input state in the device
  - Reading an output report by its report ID, to obtain current state
  - Writing an output report by its report ID, out of band

This patch adds these missing ioctl requests to read and write the remaining
HID report types. Note that not all HID backends will neccesarily support this
(e.g. while the USB link layer supports setting Input reports, others may not).

FreeBSD native uhid(4) compatible API already has similar ioctls.

MFC after:	3 days

(cherry picked from commit fd6690e2d5cd5b15fce2c74ab0cac77a83514f6a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to Linux hidraw compatibility API.

Respective Linux commit f43d3870cafa made by Dean Camera message is:

Currently the hidraw module can only read and write feature HID reports on
demand, via dedicated ioctls. Input reports are read from the device through
the read() interface, while output reports are written through the write
interface().

This is insufficient; it is desirable in many situations to be able to read and
write input and output reports through the control interface to cover
additional scenarios:

  - Reading an input report by its report ID, to get initial state
  - Writing an input report, to set initial input state in the device
  - Reading an output report by its report ID, to obtain current state
  - Writing an output report by its report ID, out of band

This patch adds these missing ioctl requests to read and write the remaining
HID report types. Note that not all HID backends will neccesarily support this
(e.g. while the USB link layer supports setting Input reports, others may not).

FreeBSD native uhid(4) compatible API already has similar ioctls.

MFC after:	3 days

(cherry picked from commit fd6690e2d5cd5b15fce2c74ab0cac77a83514f6a)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: increase USB_PORT_RESET_RECOVERY</title>
<updated>2025-03-26T01:28:38+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>ahmadkhalifa570@gmail.com</email>
</author>
<published>2024-07-16T17:38:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=513d89fef90a64330580e9c5db4fd67d8198d7de'/>
<id>513d89fef90a64330580e9c5db4fd67d8198d7de</id>
<content type='text'>
10ms seems to be too strict for some configurations, so increase to
20ms.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1327

(cherry picked from commit e152944f1a16a4ff33b4e20b813ce4a54b884b90)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
10ms seems to be too strict for some configurations, so increase to
20ms.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1327

(cherry picked from commit e152944f1a16a4ff33b4e20b813ce4a54b884b90)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb-msctest: Be more conservative setting GETMAXLUN quirk</title>
<updated>2025-03-25T03:01:56+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-03-16T19:20:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d3a659a338cbad72bd205e6fc8787a9fb3fb485b'/>
<id>d3a659a338cbad72bd205e6fc8787a9fb3fb485b</id>
<content type='text'>
Only set the GETMAXLUN quirk when it causes an error, but don't set it
when it returns 0. Since we reset the device when we set any quirk, only
set this quirk when it generates an error so umass will avoid it. When
the command works, there's no reason for umass to avoid it at all.

MFC After: 1 week
Sponsored by: Netflix

(cherry picked from commit b0375f78e32acd7947d28126a5e165f8139a5a23)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only set the GETMAXLUN quirk when it causes an error, but don't set it
when it returns 0. Since we reset the device when we set any quirk, only
set this quirk when it generates an error so umass will avoid it. When
the command works, there's no reason for umass to avoid it at all.

MFC After: 1 week
Sponsored by: Netflix

(cherry picked from commit b0375f78e32acd7947d28126a5e165f8139a5a23)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: Kill left-over cdefs.h includes</title>
<updated>2025-03-11T15:41:19+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-03-04T21:42:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=642fc04eda48d6b8b0091d968cb5fbca0cb577ba'/>
<id>642fc04eda48d6b8b0091d968cb5fbca0cb577ba</id>
<content type='text'>
These includes were for __FBSD_RCSID() macro. They weren't formatted
like the rest of the tree so weren't trimmed automatically when that
script was run. Trim them now.

MFC After: 1 week
Sponsored by:		Netflix

(cherry picked from commit ca48e43ba9ee73a07cdbad8365117793b01273bb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These includes were for __FBSD_RCSID() macro. They weren't formatted
like the rest of the tree so weren't trimmed automatically when that
script was run. Trim them now.

MFC After: 1 week
Sponsored by:		Netflix

(cherry picked from commit ca48e43ba9ee73a07cdbad8365117793b01273bb)
</pre>
</div>
</content>
</entry>
<entry>
<title>uath: Avoid a NULL dereference</title>
<updated>2025-02-19T16:24:39+00:00</updated>
<author>
<name>Jose Luis Duran</name>
<email>jlduran@FreeBSD.org</email>
</author>
<published>2025-02-12T15:31:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9fcb7c640e27088b2b6673f5cc26cbf230d0a28f'/>
<id>9fcb7c640e27088b2b6673f5cc26cbf230d0a28f</id>
<content type='text'>
PR:		284643
Reviewed by:	adrian
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48948

(cherry picked from commit 4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:		284643
Reviewed by:	adrian
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48948

(cherry picked from commit 4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4)
</pre>
</div>
</content>
</entry>
<entry>
<title>ure(4): Add support for ELECOM EDC-QUA3C</title>
<updated>2025-02-07T14:46:53+00:00</updated>
<author>
<name>FUKAUMI Naoki</name>
<email>naoki@radxa.com</email>
</author>
<published>2025-01-23T01:43:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=703c6df05260880280c5d41aa8742afa86cbff55'/>
<id>703c6df05260880280c5d41aa8742afa86cbff55</id>
<content type='text'>
ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter.
This also works as a cdce(4) device by:

usbconfig -d X.Y set_config 1
  or
usbconfig -d X.Y set_config 2

Signed-off-by: FUKAUMI Naoki &lt;naoki@radxa.com&gt;

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1578

(cherry picked from commit dc273058cb0b6bef075e77272afc66f1a1fd3889)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter.
This also works as a cdce(4) device by:

usbconfig -d X.Y set_config 1
  or
usbconfig -d X.Y set_config 2

Signed-off-by: FUKAUMI Naoki &lt;naoki@radxa.com&gt;

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1578

(cherry picked from commit dc273058cb0b6bef075e77272afc66f1a1fd3889)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: serial: make more commands execute synchronously</title>
<updated>2025-01-01T05:45:26+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2024-12-11T01:23:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4c20884b3735a17b668bca49a50b8ace4d7fa4ba'/>
<id>4c20884b3735a17b668bca49a50b8ace4d7fa4ba</id>
<content type='text'>
The termios layer wants some level of guarantee that we've actually
submitted param changes to the hardware when our functions return, so we
need to do a little more waiting to avoid violating those guarantees.

This is especially important as some hardware has some minimum timing
specifications around this stuff, and without being less asynchronous
the software dealing with these devices can't reasonably operate the
hardware without more excessive delays than they should need.

More specifically, we make sure that:
 - The command to start transfers is finished before we toggle DTR/RTS
 - The status_change command finishes before we return, which may change
    some fields in the softc that we need for a subsequent call into
    usb_serial
 - cfg_param finishes before we re-enable transfers, and we ensure that
    RTS is appropriately toggled before we return to userland

This has been observed to fix some flakiness in connecting to some
ESP32 devices.

Tested by:	kenrap from Libera
Reviewed by:	imp, kib

(cherry picked from commit 36a80f4264350a2f4f0686eb91ae7f5943d40327)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The termios layer wants some level of guarantee that we've actually
submitted param changes to the hardware when our functions return, so we
need to do a little more waiting to avoid violating those guarantees.

This is especially important as some hardware has some minimum timing
specifications around this stuff, and without being less asynchronous
the software dealing with these devices can't reasonably operate the
hardware without more excessive delays than they should need.

More specifically, we make sure that:
 - The command to start transfers is finished before we toggle DTR/RTS
 - The status_change command finishes before we return, which may change
    some fields in the softc that we need for a subsequent call into
    usb_serial
 - cfg_param finishes before we re-enable transfers, and we ensure that
    RTS is appropriately toggled before we return to userland

This has been observed to fix some flakiness in connecting to some
ESP32 devices.

Tested by:	kenrap from Libera
Reviewed by:	imp, kib

(cherry picked from commit 36a80f4264350a2f4f0686eb91ae7f5943d40327)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: serial: allow the open/close sleep to be interruptible</title>
<updated>2025-01-01T05:45:24+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2024-12-11T01:23:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2ba5217057bdf94a4929dc7644f4e39be06fdef3'/>
<id>2ba5217057bdf94a4929dc7644f4e39be06fdef3</id>
<content type='text'>
ucom_queue_command will issue commands for open/close, then wait on them
to be finished.  In the spirit of playing it safe, allow
ucom_queue_command's wait to be interrupted in case the usb process gets
jammed up waiting on the hardware -- we can at least recover the user
thread that initiated it, even if we can't recover the usb process.

Reviewed by:	imp, kib

(cherry picked from commit 729eb176a465cedc55c5980f116d87be592421f1)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ucom_queue_command will issue commands for open/close, then wait on them
to be finished.  In the spirit of playing it safe, allow
ucom_queue_command's wait to be interrupted in case the usb process gets
jammed up waiting on the hardware -- we can at least recover the user
thread that initiated it, even if we can't recover the usb process.

Reviewed by:	imp, kib

(cherry picked from commit 729eb176a465cedc55c5980f116d87be592421f1)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: serial: propagate errors from ucom_queue_command()</title>
<updated>2025-01-01T05:45:20+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2024-12-11T01:23:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2882d0c61aebab77e8f2cc5b7cace6186bb8cb01'/>
<id>2882d0c61aebab77e8f2cc5b7cace6186bb8cb01</id>
<content type='text'>
There's only one error that we can get back right now, but future
changes will add some more cases that we need to watch out for.  Start
by returning errors and propagating them back.

Reviewed by:	kib

(cherry picked from commit 51f3d0874f6216907c8971c4af9d6be6c93edf7b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's only one error that we can get back right now, but future
changes will add some more cases that we need to watch out for.  Start
by returning errors and propagating them back.

Reviewed by:	kib

(cherry picked from commit 51f3d0874f6216907c8971c4af9d6be6c93edf7b)
</pre>
</div>
</content>
</entry>
<entry>
<title>uhid(4): update ugd_actlen in USB_GET_REPORT ioctl</title>
<updated>2024-12-22T03:33:16+00:00</updated>
<author>
<name>Matthew Nygard Dodd</name>
<email>Matthew.Nygard.Dodd@gmail.com</email>
</author>
<published>2024-11-18T04:15:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4bbc69192e4feea57198b5d00ec2b7e2f1b0579d'/>
<id>4bbc69192e4feea57198b5d00ec2b7e2f1b0579d</id>
<content type='text'>
USB_GET_REPORT ioctl is documented to update ugd_actlen on return with
the number of bytes copied.  It does not do this.

Reviewed by:	wulf
PR:		282790
MFC after:	1 week

(cherry picked from commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
USB_GET_REPORT ioctl is documented to update ugd_actlen on return with
the number of bytes copied.  It does not do this.

Reviewed by:	wulf
PR:		282790
MFC after:	1 week

(cherry picked from commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234)
</pre>
</div>
</content>
</entry>
</feed>
