From owner-svn-src-stable-9@freebsd.org Mon Jun 8 09:25:41 2020 Return-Path: Delivered-To: svn-src-stable-9@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F2063288D9; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSXj10G3z41d7; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D72C21CFF; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589PeZI029733; Mon, 8 Jun 2020 09:25:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589PeF2029732; Mon, 8 Jun 2020 09:25:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080925.0589PeF2029732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361909 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:25:41 -0000 Author: hselasky Date: Mon Jun 8 09:25:40 2020 New Revision: 361909 URL: https://svnweb.freebsd.org/changeset/base/361909 Log: MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_device.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Mon Jun 8 09:25:01 2020 (r361908) +++ stable/9/sys/dev/usb/usb_device.c Mon Jun 8 09:25:40 2020 (r361909) @@ -1241,7 +1241,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t { struct usb_interface *iface; - if (udev == NULL) { + if (udev == NULL || iface_index == parent_index) { /* nothing to do */ return; } From owner-svn-src-stable-9@freebsd.org Mon Jun 8 09:29:09 2020 Return-Path: Delivered-To: svn-src-stable-9@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A132B328CEA; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gScj3tGWz42Tb; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 806AA21FE0; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589T9x7030170; Mon, 8 Jun 2020 09:29:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589T9lX030169; Mon, 8 Jun 2020 09:29:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080929.0589T9lX030169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361913 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:29:09 -0000 Author: hselasky Date: Mon Jun 8 09:29:08 2020 New Revision: 361913 URL: https://svnweb.freebsd.org/changeset/base/361913 Log: MFC r361581: Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_transfer.c stable/9/sys/dev/usb/usbdi.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Mon Jun 8 09:28:26 2020 (r361912) +++ stable/9/sys/dev/usb/usb_transfer.c Mon Jun 8 09:29:08 2020 (r361913) @@ -299,6 +299,81 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params #endif /*------------------------------------------------------------------------* + * usbd_get_max_frame_length + * + * This function returns the maximum single frame length as computed by + * usbd_transfer_setup(). It is useful when computing buffer sizes for + * devices having multiple alternate settings. The SuperSpeed endpoint + * companion pointer is allowed to be NULL. + *------------------------------------------------------------------------*/ +uint32_t +usbd_get_max_frame_length(const struct usb_endpoint_descriptor *edesc, + const struct usb_endpoint_ss_comp_descriptor *ecomp, + enum usb_dev_speed speed) +{ + uint32_t max_packet_size; + uint32_t max_packet_count; + uint8_t type; + + max_packet_size = UGETW(edesc->wMaxPacketSize); + max_packet_count = 1; + type = (edesc->bmAttributes & UE_XFERTYPE); + + switch (speed) { + case USB_SPEED_HIGH: + switch (type) { + case UE_ISOCHRONOUS: + case UE_INTERRUPT: + max_packet_count += + (max_packet_size >> 11) & 3; + + /* check for invalid max packet count */ + if (max_packet_count > 3) + max_packet_count = 3; + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + case USB_SPEED_SUPER: + max_packet_count += (max_packet_size >> 11) & 3; + + if (ecomp != NULL) + max_packet_count += ecomp->bMaxBurst; + + if ((max_packet_count == 0) || + (max_packet_count > 16)) + max_packet_count = 16; + + switch (type) { + case UE_CONTROL: + max_packet_count = 1; + break; + case UE_ISOCHRONOUS: + if (ecomp != NULL) { + uint8_t mult; + + mult = UE_GET_SS_ISO_MULT( + ecomp->bmAttributes) + 1; + if (mult > 3) + mult = 3; + + max_packet_count *= mult; + } + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + default: + break; + } + return (max_packet_size * max_packet_count); +} + +/*------------------------------------------------------------------------* * usbd_transfer_setup_sub - transfer setup subroutine * * This function must be called from the "xfer_setup" callback of the Modified: stable/9/sys/dev/usb/usbdi.h ============================================================================== --- stable/9/sys/dev/usb/usbdi.h Mon Jun 8 09:28:26 2020 (r361912) +++ stable/9/sys/dev/usb/usbdi.h Mon Jun 8 09:29:08 2020 (r361913) @@ -496,6 +496,9 @@ uint8_t usbd_get_interface_altindex(struct usb_interfa usb_error_t usbd_set_alt_interface_index(struct usb_device *udev, uint8_t iface_index, uint8_t alt_index); uint32_t usbd_get_isoc_fps(struct usb_device *udev); +uint32_t usbd_get_max_frame_length(const struct usb_endpoint_descriptor *, + const struct usb_endpoint_ss_comp_descriptor *, + enum usb_dev_speed); usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **pxfer, const struct usb_config *setup_start, uint16_t n_setup, From owner-svn-src-stable-9@freebsd.org Mon Jun 8 09:31:52 2020 Return-Path: Delivered-To: svn-src-stable-9@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8EC4329387; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSgr52v6z43JP; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A87FD223F0; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589VqV9035445; Mon, 8 Jun 2020 09:31:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589VqWu035444; Mon, 8 Jun 2020 09:31:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080931.0589VqWu035444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361917 - stable/9/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 361917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:31:52 -0000 Author: hselasky Date: Mon Jun 8 09:31:52 2020 New Revision: 361917 URL: https://svnweb.freebsd.org/changeset/base/361917 Log: MFC r361582: Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Modified: stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:31:14 2020 (r361916) +++ stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:31:52 2020 (r361917) @@ -506,7 +506,7 @@ ubt_attach(device_t dev) struct ubt_softc *sc = device_get_softc(dev); struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; - uint16_t wMaxPacketSize; + uint32_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -596,9 +596,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; From owner-svn-src-stable-9@freebsd.org Mon Jun 8 09:35:33 2020 Return-Path: Delivered-To: svn-src-stable-9@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FDCC3294F1; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSm512gsz449L; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF7F225A9; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589ZXUH036788; Mon, 8 Jun 2020 09:35:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589ZWds036786; Mon, 8 Jun 2020 09:35:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080935.0589ZWds036786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361922 - in stable/9: lib/libusbhid sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/9: lib/libusbhid sys/dev/usb X-SVN-Commit-Revision: 361922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:35:33 -0000 Author: hselasky Date: Mon Jun 8 09:35:32 2020 New Revision: 361922 URL: https://svnweb.freebsd.org/changeset/base/361922 Log: MFC r361827: USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusbhid/parse.c stable/9/sys/dev/usb/usb_hid.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusbhid/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libusbhid/parse.c ============================================================================== --- stable/9/lib/libusbhid/parse.c Mon Jun 8 09:34:16 2020 (r361921) +++ stable/9/lib/libusbhid/parse.c Mon Jun 8 09:35:32 2020 (r361922) @@ -401,26 +401,28 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) s->loc_count = dval & mask; break; case 10: /* Push */ + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) + return (0); s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->report_size = s->loc_size; - c->report_count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->report_size = s->loc_size; + c->report_count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) + return (0); s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->report_size; - s->loc_count = c->report_count; - c->report_size = 0; - c->report_count = 0; - } + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->report_size; + s->loc_count = c->report_count; + c->report_size = 0; + c->report_count = 0; break; default: break; Modified: stable/9/sys/dev/usb/usb_hid.c ============================================================================== --- stable/9/sys/dev/usb/usb_hid.c Mon Jun 8 09:34:16 2020 (r361921) +++ stable/9/sys/dev/usb/usb_hid.c Mon Jun 8 09:35:32 2020 (r361922) @@ -433,36 +433,36 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->loc_count = dval & mask; break; case 10: /* Push */ - s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->loc.size = s->loc_size; - c->loc.count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } else { - DPRINTFN(0, "Cannot push " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) { + DPRINTFN(0, "Cannot push item @ %d\n", s->pushlevel); + return (0); } + s->pushlevel ++; + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->loc.size = s->loc_size; + c->loc.count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ - s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->loc.pos; - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->loc.size; - s->loc_count = c->loc.count; - /* set default item location */ - c->loc.pos = oldpos; - c->loc.size = 0; - c->loc.count = 0; - } else { - DPRINTFN(0, "Cannot pop " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) { + DPRINTFN(0, "Cannot pop item @ 0\n"); + return (0); } + s->pushlevel --; + /* preserve position */ + oldpos = c->loc.pos; + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->loc.size; + s->loc_count = c->loc.count; + /* set default item location */ + c->loc.pos = oldpos; + c->loc.size = 0; + c->loc.count = 0; break; default: DPRINTFN(0, "Global bTag=%d\n", bTag); From owner-svn-src-stable-9@freebsd.org Tue Jun 9 22:15:46 2020 Return-Path: Delivered-To: svn-src-stable-9@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6283C33EEB7; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hPZp0nnBz3bdh; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 167C41CDE4; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 059MFjax014348; Tue, 9 Jun 2020 22:15:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059MFjDK014347; Tue, 9 Jun 2020 22:15:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006092215.059MFjDK014347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 9 Jun 2020 22:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361989 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 22:15:46 -0000 Author: hselasky Date: Tue Jun 9 22:15:45 2020 New Revision: 361989 URL: https://svnweb.freebsd.org/changeset/base/361989 Log: Adapt merge of r361581 to 9-stable to unbreak kernel compilation. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_transfer.c Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Tue Jun 9 21:59:13 2020 (r361988) +++ stable/9/sys/dev/usb/usb_transfer.c Tue Jun 9 22:15:45 2020 (r361989) @@ -354,8 +354,7 @@ usbd_get_max_frame_length(const struct usb_endpoint_de if (ecomp != NULL) { uint8_t mult; - mult = UE_GET_SS_ISO_MULT( - ecomp->bmAttributes) + 1; + mult = (ecomp->bmAttributes & 3) + 1; if (mult > 3) mult = 3;