ng_ubt(4): Introduce net.bluetooth.usb_isoc_enable loader tunable to disable

isochronous transfers.

If users want to disable isochronous transfers, which cause high
frequency periodic interrupts from the USB host controller, then
net.bluetooth.usb_isoc_enable can be set to zero, either as a
sysctl(8) or as a loader.conf(5) tunable.

Differential Revision:	https://reviews.freebsd.org/D33282
Submitted by:	naito.yuichiro@gmail.com
PR:		238235
MFC after:	1 week
Sponsored by:	NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2021-12-07 11:28:21 +01:00
parent 6f78736cb1
commit 67cbbf1959

View file

@ -152,6 +152,11 @@ static ng_disconnect_t ng_ubt_disconnect;
static ng_rcvmsg_t ng_ubt_rcvmsg;
static ng_rcvdata_t ng_ubt_rcvdata;
static int ng_usb_isoc_enable = 1;
SYSCTL_INT(_net_bluetooth, OID_AUTO, usb_isoc_enable, CTLFLAG_RDTUN | CTLFLAG_MPSAFE,
&ng_usb_isoc_enable, 0, "enable isochronous transfers");
/* Queue length */
static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[] =
{
@ -742,8 +747,9 @@ ubt_attach(device_t dev)
}
/* Setup transfers for both interfaces */
if (usbd_transfer_setup(uaa->device, iface_index, sc->sc_xfer,
ubt_config, UBT_N_TRANSFER, sc, &sc->sc_if_mtx)) {
if (usbd_transfer_setup(uaa->device, iface_index, sc->sc_xfer, ubt_config,
ng_usb_isoc_enable ? UBT_N_TRANSFER : UBT_IF_1_ISOC_DT_RD1,
sc, &sc->sc_if_mtx)) {
UBT_ALERT(sc, "could not allocate transfers\n");
goto detach;
}