diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-05-28 08:41:18 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-05-28 08:41:18 +0000 |
commit | 4ac6682cab13502db205c7132fe446c5996de6f3 (patch) | |
tree | 09eeb513328c5e8d6464459c360aa82b98c21e91 /sys/netgraph | |
parent | 506a911bad51b9efde620fccd4448ff7d45146ec (diff) | |
download | src-4ac6682cab13502db205c7132fe446c5996de6f3.tar.gz src-4ac6682cab13502db205c7132fe446c5996de6f3.zip |
Fix check for wMaxPacketSize in USB bluetooth driver,
in case device is not FULL speed.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=361582
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 7 |
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 8573992074e6..bf6d00a59dd8 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -623,7 +623,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 }; @@ -713,9 +713,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; |