summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-06-08 09:31:14 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-06-08 09:31:14 +0000
commita879f39e0f5fe80e3e332fecd2fcf5c9c1731cd0 (patch)
tree79e67035fb7636a8054505c33abce108a60da8ad
parented33b8c8a505b702a9183482b1d61c7d0b315944 (diff)
downloadsrc-test-a879f39e0f5fe80e3e332fecd2fcf5c9c1731cd0.tar.gz
src-test-a879f39e0f5fe80e3e332fecd2fcf5c9c1731cd0.zip
MFC r361582:
Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/stable/10/; revision=361916
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index edbd32ccd5a31..bf087ed73fae1 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -540,7 +540,7 @@ ubt_attach(device_t dev)
struct usb_endpoint_descriptor *ed;
struct usb_interface_descriptor *id;
struct usb_interface *iface;
- uint16_t wMaxPacketSize;
+ uint32_t wMaxPacketSize;
uint8_t alt_index, i, j;
uint8_t iface_index[2] = { 0, 1 };
@@ -630,9 +630,10 @@ ubt_attach(device_t dev)
if ((ed->bDescriptorType == UDESC_ENDPOINT) &&
(ed->bLength >= sizeof(*ed)) &&
(i == 1)) {
- uint16_t temp;
+ uint32_t temp;
- temp = UGETW(ed->wMaxPacketSize);
+ temp = usbd_get_max_frame_length(
+ ed, NULL, usbd_get_speed(uaa->device));
if (temp > wMaxPacketSize) {
wMaxPacketSize = temp;
alt_index = j;